Delete Action [message #184071] |
Fri, 10 June 2005 08:23 |
Eclipse User |
|
|
|
Originally posted by: q5280338.mailstore.fernuni-hagen.de
I write a editor using a MultiPageEditorPart with different pages, which
are containing editors subclassing the GraphicalEditorWithPalette. I
register some global Actions in the MultiPageEditorContributor like this:
public void setActivePage(IEditorPart part) {
if (activeEditorPart == part)
return;
activeEditorPart = part;
IActionBars bars = this.getActionBars();
if (bars != null && part instanceof MyGraphicalEditorWithPalette) {
bars.setGlobalActionHandler(ActionFactory.UNDO.getId(),
((MyGraphicalEditorWithPalette) part)
.getAction(ActionFactory.UNDO.getId()));
bars.setGlobalActionHandler(ActionFactory.REDO.getId(),
((MyGraphicalEditorWithPalette) part)
.getAction(ActionFactory.REDO.getId()));
bars.setGlobalActionHandler(ActionFactory.DELETE.getId(),
((MyGraphicalEditorWithPalette) part)
.getAction(ActionFactory.DELETE.getId()));
bars.updateActionBars();
}
}
MyGraphicalEditorWithPalette contains a method getAction() which returns
"getActionRegistry().getAction(key)"
It works fine with UNDO and REDO. But I can't select and execute a
DELETE-Action e.g. for a children EditPart of the contents EditPart.
Thanks
Klaus
|
|
|
Delete Action supplement [message #184367 is a reply to message #184071] |
Mon, 13 June 2005 10:14 |
Eclipse User |
|
|
|
Originally posted by: q5280338.mailstore.fernuni-hagen.de
Maybe the problem is to find the right EditPolicy? I've studied the flow
example and I think the EditPoliy responsible for enabling a Delete
Action must subclass the ComponentEditPolicy? I've done all this but it
don't works?
regards
Klaus
|
|
|
|
Re: Delete Action supplement [message #184591 is a reply to message #184511] |
Tue, 14 June 2005 18:33 |
Eclipse User |
|
|
|
Originally posted by: q5280338.mailstore.fernuni-hagen.de
Alex wrote:
> give a look here I solved this way:
>
> http://dev.eclipse.org/newslists/news.eclipse.platform/msg29 053.html
>
> bye
> Alex
>
Thanks for the hint. I made it that way and it works fine with EVRYTHING
like UNDO, REDO, PRINT... but doesn't with DELETE?
I found that the List returning by "getSelectionActions()" contains
"delete" (so in principle DELETE must be possible) but the DELETE-Action
isn't enabled...
I think there must be some trouble with my EditPolicies...
Klaus
|
|
|
|
Powered by
FUDForum. Page generated in 0.03592 seconds