Undo for Eclipse RCP Editor by Using ActionFactory.UNDO.create(window) [message #465491] |
Fri, 30 March 2007 07:37 |
Eclipse User |
|
|
|
Originally posted by: tapamayghosh.gmail.com
PROBLEM :
1) I Have created an editor by extending EditorPart.
2) Now I want to implement undo action exactly similar to the Eclipse.
3) In ApplicationActionBarAdvisor,
I have I have created an action by writing following codes,
// Inside makeActions() method.
IWorkbechAction undoAction=ActionFactory.UNDO.create(window) ;
register(undoAction);
// in fillcoolbar() method I have added this action.
toolBar.add(undoAction);
Above written code is providing an icon in the toolbar but this
is always disabled.
But same steps did work for implementing "Save Action"
I know there something different which I dont know. because
"Undo" is gonna be a retargetable action. will anyone help me urgently to
solv this problem.I'm really in a critical situation.
Thanks in Advance
|
|
|
Re: Undo for Eclipse RCP Editor by Using ActionFactory.UNDO.create(window) [message #465499 is a reply to message #465491] |
Fri, 30 March 2007 10:52 |
Eclipse User |
|
|
|
Originally posted by: peter_ossipov.mail.ru
Hello Tapamay
when initializing your editor do this:
IEditorSite editorSite = getEditorSite();
IActionBars actionBars = editorSite.getActionBars();
actionBars.setGlobalActionHandler(ActionFactory.UNDO.getId() ,
getUndoAction());
where getUndoAction() is your action that should have the following id:
ActionFactory.UNDO.getId()
This is how re-targeting mechanism works actually.
Tapamay wrote:
>
> PROBLEM :
>
> 1) I Have created an editor by extending EditorPart.
>
> 2) Now I want to implement undo action exactly similar to the Eclipse.
>
> 3) In ApplicationActionBarAdvisor,
>
> I have I have created an action by writing following codes,
> // Inside makeActions() method.
>
> IWorkbechAction undoAction=ActionFactory.UNDO.create(window) ;
>
> register(undoAction);
>
>
> // in fillcoolbar() method I have added this action.
>
> toolBar.add(undoAction);
>
>
> Above written code is providing an icon in the toolbar but
> this is always disabled.
>
> But same steps did work for implementing "Save Action"
>
> I know there something different which I dont know. because
> "Undo" is gonna be a retargetable action. will anyone help me urgently
> to solv this problem.I'm really in a critical situation.
>
> Thanks in Advance
>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03453 seconds