Posted on: July 22, 2010
When JDeveloper first starts up, you are prompted to select a Role that you would like to have JDev run in. If you don't see this dialog at startup, look in the Tools -> Preferences -> Roles menu. ; For most of us, one of these roles will work just fine. ; But what if you wanted to create your own Role? ; What does it really mean to create your own Role? To see what each of these roles does behind the scenes, you can take a look at it's source XML file. ; All of the role xml files are located at: /middleware/jdeveloper/jdev/roles For the most part, the different roles remove the unneeded extensions, so that JDeveloper only loads what you need for that specific role. ; You can also modify what menus are loaded when the IDE starts. ; This is sometimes referred to as Menu Shaping. To create your own Role file, it's best to start with one of the existing roles and modify it to meet your needs. Taking a look at the Java or J2EE Role files will show that they only disable certain extensions. ; No menu modification are made. To get the best example of what can be done, take a look at the Customization Role (oracle.fusion.cust.role.xml) In this file you will see two tags that do the work of disabling extensions and hiding the menus and Here is an example of a very basic Roles file. ; It only has one disabled extension and one hidden menu. ********************************************************************************************************* http://xmlns.oracle.com/ide/roles" ; ; ; id="unique_id_of_your_role" ; ; ; ; ; ; ; ; ; rsbundle="name_of_resource_file" ; ; ; version="1.0"> ; My Developer Role ; A Customized role just for me ; ; ; ; ; ; ; ; ; ; ; ; http://jcp.org/jsr/198/extension-manifest" ; ; ; ; ; ; ; ; xmlns:c="http://xmlns.oracle.com/ide/customization"> ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; true ; ; ; ; ; ; ; ; ; ; ;
********************************************************************************************************* After you have created your file, name it something like my_role.xml and save it to the /middleware/jdeveloper/jdev/roles directory. ; The next time you start JDeveloper, your role will show up in the list with the name that you set in the Role file as one of the selections . I'm pretty much always using the Java role myself, and I use the context menus for most of the actions on the code in the editor. ; ; Here is a complete Role file that I use most of the time. ; It is based on the Java Role file and it also removes a few of the menus that I never use from the main menu bar. my_role.xml A list of all the extensions currently running in your version of JDeveloper, can be found in the Help -> About menu under the Extensions tab. To find Menu IdRef's take a look at my earlier post on How to find the IdRef for most menu commands Those are the basics of Roles files. ; In a future post, I'll cover how you can use a resource file to help localize the properties used in the role file, and how to package and distribute your role file so others on your team can use the same role if they like. ; TROUBLESHOOTING Just in case you run into problems, here are some tips.... -- Make sure that you have the "Always prompt for role selection on startup" checked so that if something goes wrong, you can just select one of the default roles and be back to normal. ; If you need to, you can set this under Tools -> Preferences -> Roles as well. -- If you don't see your role in the list, it's usually because there is an error in the structure of the xml file. Make sure to validate your xml file after you save it. -- If JDeveloper fails to load at all, after you select your Role, you are probably trying to disable an extension that is needed by something else that you aren't disabling. ; This is a trial error process unfortunately. Good luck with creating your own Roles. ; Feel free to leave any ideas or suggestions in the comments. http://blogs.oracle.com/jdevextensions/2010/07/jdeveloper_role_files_what_are_they.html
Home
|