How do I remove Open External File action for RCP editor? [message #542094] |
Wed, 23 June 2010 20:32 |
Jeff Johnston Messages: 215 Registered: July 2009 |
Senior Member |
|
|
I originally was looking to do an override, but let's simplify. I justI want to remove the external Open file action from my RCP editor.
I saw a number of entries on the web regarding this.
I tried doing IWorkbenchPage.hideActionSet("org.eclipse.ui.edit.text.actionSet.openExternalFile ");
in varous places, including postWindowOpen() in my WorkbenchAdvisor. I actually see the call go through without any exception, but no dice, the menu item remains.
I tried using an activities extension and specifying a number of patterns including the obvious org.eclipse.ui.edit.text.actionSet.openExternalFile. I also tried org.eclipse.ui.edit.*.openExternalFile..
None of these patterns seem to do anything
I saw another post where someone used a startup extension and specified an earlyStartup method, but the extension is marked as deprecated so I would rather find something else.
Any suggestions that someone has gotten to work?
I have included by WorkbenchAdvisor code in case there is something I screwed up.
public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer) {
return new WorkbenchWindowAdvisor(configurer) {
public void preWindowOpen() {
super.preWindowOpen();
getWindowConfigurer().setInitialSize(new Point(600, 450));
getWindowConfigurer().setShowCoolBar(true);
getWindowConfigurer().setShowStatusLine(true);
getWindowConfigurer().setTitle(RPMMessages.EditorTitle);
IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows();
for (int i = 0; i < windows.length; ++i) {
IWorkbenchPage page = windows[i].getActivePage();
if (page != null)
page.hideActionSet("org.eclipse.ui.edit.text.actionSet.openExternalFile");
}
}
public void postWindowOpen() {
super.postWindowOpen();
IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows();
for (int i = 0; i < windows.length; ++i) {
IWorkbenchPage page = windows[i].getActivePage();
if (page != null)
page.hideActionSet("org.eclipse.ui.edit.text.actionSet.openExternalFile");
}
}
public ActionBarAdvisor createActionBarAdvisor(IActionBarConfigurer abConfigurer) {
return new RPMEditorActionBarAdvisor(abConfigurer);
}
};
}
[Updated on: Thu, 24 June 2010 21:42] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.02707 seconds