最近越來越懶了,自我批評一下: 平時不練功,關鍵的時候就只能靠Google這根救命草了。
http://www.richclient2.eu/2006_03_20/getting-rid-of-convert-line-delimiters-to/
Getting rid of “Convert Line Delimiters to”
20. March 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
-
ActionSetRegistry reg = WorkbenchPlugin.getDefault().getActionSetRegistry();
-
IActionSetDescriptor[] actionSets = reg.getActionSets();
-
// removing annoying gotoLastPosition Message.
-
for (int i = 0; i <actionSets.length; i++)
-
{
-
if (!actionSets[i].getId().equals(actionSetId))
-
continue;
-
IExtension ext = actionSets[i].getConfigurationElement()
-
.getDeclaringExtension();
-
}
-
// Removing convert line delimiters menu.
-
actionSetId = "org.eclipse.ui.edit.text.actionSet.convertLineDelimitersTo"; //$NON-NLS-1$
-
for (int i = 0; i <actionSets.length; i++)
-
{
-
if (!actionSets[i].getId().equals(actionSetId))
-
continue;
-
IExtension ext = actionSets[i].getConfigurationElement()
-
.getDeclaringExtension();
-
}
thanks Tom Seidel
we tried it and , its working fine..great job
thanks again
Comment by biju — 29. September 2006 @ 09:09
Hi,
thanks for this one - worked great. I enhanced it to get rid of “open file” as well and changed it so that walked only once through the loop. Takes about 15 millisec for three ids - so I think its quite fast
And it seems to work in Eclipse 3.2 as well.
Cheers,
Christoph
Comment by Christoph — 29. September 2006 @ 15:38
thanks.
your tips really help me!
finally I could remove “org.eclipse.ui.WorkingSetActionSet”
Comment by aki — 9. April 2007 @ 16:12
This was very helpful thanks.
I refactored it to avoid the duplication (DRY) as follows:
private void removeExtraneousActions() {
ActionSetRegistry reg = WorkbenchPlugin.getDefault().getActionSetRegistry();
// removing gotoLastPosition message
removeStandardAction(reg, “org.eclipse.ui.edit.text.actionSet.navigation”);
// Removing “Convert Line Delimiters To” menu
removeStandardAction(reg, “org.eclipse.ui.edit.text.actionSet.convertLineDelimitersTo”);
}
private void removeStandardAction(ActionSetRegistry reg, String actionSetId) {
IActionSetDescriptor[] actionSets = reg.getActionSets();
for (int i = 0; i
Comment by Edward Garson — 23. April 2007 @ 15:37
Ah, there is some filtering going on.
The implementationof “removeStandardAction” is like the original for loop.
Have fun
Comment by Edward Garson — 23. April 2007 @ 15:38
Great Job Thanks!!!
Comment by GC — 9. July 2007 @ 17:18
Thanks a lot.
Comment by Thanker — 28. December 2007 @ 21:08
Hi, i try to get rid of the”Open File” menu in the menubar which appeared with the “Convert Line Delimiters to”, how can i do this??
I can’t fing the “actionSetId”
Comment by cansen — 5. March 2008 @ 08:49
cool site man
The actionsetid can be found in the plugin “org.eclipse.ui.ide” as extension at the “org.eclipse.ui.actionSets” extensionpoint. Its id is “org.eclipse.ui.actionSet.openFiles”
Greets, Mike