Archive for March 20th, 2006

Getting rid of “Convert Line Delimiters to”

If you're having dependencies to org.eclipse.ui.ide and you launch your RCP you'll automatically get an entry in the menu-bar that is called "Convert Line Delimiters to" and also "Last Edit Location", although you don't need it. To remove this entries place the following lines in your ApplicationActionBarAdvisor

JAVA:
  1.  
  2. ActionSetRegistry reg = WorkbenchPlugin.getDefault().getActionSetRegistry();
  3. IActionSetDescriptor[] actionSets = reg.getActionSets();
  4. // removing annoying gotoLastPosition Message.
  5. String actionSetId = "org.eclipse.ui.edit.text.actionSet.navigation"; //$NON-NLS-1$
  6. for (int i = 0; i <actionSets.length; i++)
  7. {
  8.     if (!actionSets[i].getId().equals(actionSetId))
  9.         continue;
  10.     IExtension ext = actionSets[i].getConfigurationElement()
  11.         .getDeclaringExtension();
  12.     reg.removeExtension(ext, new Object[] { actionSets[i] });
  13. }
  14. // Removing convert line delimiters menu.
  15. actionSetId = "org.eclipse.ui.edit.text.actionSet.convertLineDelimitersTo"; //$NON-NLS-1$
  16. for (int i = 0; i <actionSets.length; i++)
  17. {
  18.     if (!actionSets[i].getId().equals(actionSetId))
  19.         continue;
  20.     IExtension ext = actionSets[i].getConfigurationElement()
  21.         .getDeclaringExtension();
  22.     reg.removeExtension(ext, new Object[] { actionSets[i] });
  23. }
  24.  
  25.  

2 comments March 20th, 2006


Calendar

March 2006
M T W T F S S
« Jan   Apr »
 12345
6789101112
13141516171819
20212223242526
2728293031  

Posts by Month

Posts by Category