[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Newsgroup Home]
|
[news.eclipse.platform.rcp] removing unused ActionSets
|
- From: Francis Upton <francisu@xxxxxxxx>
- Date: Wed, 16 Nov 2005 12:14:56 -0800
- Newsgroups: eclipse.platform.rcp
- Organization: EclipseCorner
- User-agent: Mozilla Thunderbird 1.0 (X11/20041206)
I get this annoying message in the log of my RCP application:
!ENTRY org.eclipse.ui 4 4 2005-11-14 14:04:42.171
!MESSAGE Invalid Menu Extension (Path is invalid):
org.eclipse.ui.edit.text.gotoLastEditPosition
The only way I found to remove this undesired action set is the
following code, which works fine, but seems rather heinous (using all
kinds of nasty internal classes):
ActionSetRegistry reg = WorkbenchPlugin.getDefault()
.getActionSetRegistry();
IActionSetDescriptor[] actionSets = reg.getActionSets();
String actionSetId =
"org.eclipse.ui.edit.text.actionSet.navigation";
for (int i = 0; i < actionSets.length; i++)
{
if (!actionSets[i].getId().equals(actionSetId))
continue;
IExtension ext = actionSets[i].getConfigurationElement()
.getDeclaringExtension();
reg.removeExtension(ext, new Object[] { actionSets[i] });
}
Is there a better way?
Francis