How to override Eclipse "File > Save" Action [message #668445] |
Thu, 05 May 2011 16:55 |
Abhishek Rakshit Messages: 8 Registered: April 2011 |
Junior Member |
|
|
I am trying to override the Eclipse File > Save menu action to add some functionality. I have tried the following things
a) Create a new action and add it to the global action handler
actionBars.setGlobalActionHandler(ActionFactory.SAVE.getId(), mySaveAction);
actionRegistry.registerAction(action);
b) Create a new handler and override the save command
<extension point="org.eclipse.ui.handlers">
<handler commandId="org.eclipse.ui.file.save"
class="com.diagrams.ui.SaveFileHandler">
<enabledWhen>
<with variable="activePartId">
<equals
value="com.diagrams.editors.MultiPageEditor" />
</with>
</enabledWhen>
<activeWhen>
<with variable="activePartId">
<equals
value="com.diagrams.editors.MultiPageEditor" />
</with>
</activeWhen>
</handler>
</extension>
With both these approaches I have been able to override the Keyboard Ctrl+S functionality but the "File > Save" menu seem to work differently.
Would really appreciate any help, Thanks
[Updated on: Thu, 05 May 2011 16:55] Report message to a moderator
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03284 seconds