"Delete" & "Zoom" in MultiPageEditor [message #205734] |
Wed, 21 December 2005 09:51  |
Eclipse User |
|
|
|
Originally posted by: hplaas.gmx.de
Hello.
IŽm working on a graphical GEF editor based on the Eclipse
"ShapeEditor"-example.(extends "GraphicalEditorWithFlyoutPalette",
contributor class extends "ActionBarContributor" )
IŽve extended this editor with the zoom-, redo-, undo- and delete-
functions (with contextmenu and editmenu support). The stand-alone version
runs properly.
To manage multiple instances of this editor, I tried to implement the
editor as a page in a "MultiPageEditorPart". Even this is nearly working.
The only problem is, that now the zoom- and delete-functions in the
context- and editmenu are disabled. Undo- and redo- functions work fine.
IŽve replaced the ActionBarContributor with a
MultiPageEditorActionBarContributor which looks like this:
------------------------------------------------------------ --------------------------------------------------
public class MultiPageEditorContributor extends
MultiPageEditorActionBarContributor {
private IEditorPart activeEditorPart;
public MultiPageEditorContributor() {
super();
}
protected IAction getAction(DynamicDnDEditor editor, String actionID) {
return (editor == null ? null : editor.getAction(actionID));
}
public void setActivePage(IEditorPart part) {
if (activeEditorPart == part) return;
activeEditorPart = part;
IActionBars actionBars = getActionBars();
if (actionBars != null) {
DynamicDnDEditor editor = (part instanceof DynamicDnDEditor) ?
(DynamicDnDEditor) part : null;
actionBars.setGlobalActionHandler(
ActionFactory.DELETE.getId(),
getAction(editor, ActionFactory.DELETE.getId()));
actionBars.setGlobalActionHandler(
ActionFactory.UNDO.getId(),
getAction(editor, ActionFactory.UNDO.getId()));
actionBars.setGlobalActionHandler(
ActionFactory.REDO.getId(),
getAction(editor, ActionFactory.REDO.getId()));
actionBars.updateActionBars();
}
}
public void contributeToToolBar(IToolBarManager manager) {
String[] zoomStrings = new String[] {
ZoomManager.FIT_ALL,
ZoomManager.FIT_HEIGHT,
ZoomManager.FIT_WIDTH };
manager.add(new ZoomComboContributionItem(getPage(), zoomStrings));
}
}
------------------------------------------------------------ ------------------------------------------------------------ -
Maybe the deleteaction is not registered properly...
thanks for any hints.
Heiko
|
|
|
|
|
|
|
Re: "Delete" & "Zoom" in MultiPageEditor [message #207033 is a reply to message #205734] |
Tue, 10 January 2006 04:06  |
Eclipse User |
|
|
|
Originally posted by: hplaas.gmx.de
now IŽm so far that when I click on a GEF-shapeobject, the
"createDeleteCommand(GroupRequest deleteRequest)"-method of my
"ShapeComponentEditPolicy" is called by GEF, but the deletebutton is still
disabled.
....anybody knows the missing part of the puzzle ?
Heiko
|
|
|
Powered by
FUDForum. Page generated in 0.04419 seconds