Getting rid of “Convert Line Delimiters to”

March 20th, 2006

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.  

Entry Filed under: Uncategorized, RCP

2 Comments Add your own

  • 1. dillboy  |  July 13th, 2006 at 8:14 pm

    Thanks!

  • 2. brownmik  |  July 17th, 2006 at 9:43 pm

    New to Eclipse PDE - can’t believe it’s this hard to turn off menu items!

    Thanks!

Leave a Comment

Required

Required, hidden

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>

Trackback this post  |  Subscribe to the comments via RSS Feed


Calendar

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

Most Recent Posts