"Delete" & "Zoom" in MultiPageEditor [message #205734] |
Wed, 21 December 2005 14: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 #206478 is a reply to message #205734] |
Mon, 02 January 2006 11:13 |
Eclipse User |
|
|
|
Originally posted by: hplaas.gmx.de
Hello.
Meanwhile the problem with the zoom-function is solved. I had fogotten to
set the zoommanager of the zoombox with the correct zoommanager of the
active editor.
The delete-function is still not working. The icon is added to the toolbar
and contextmenu, but is greyed out. It seems that Eclipse doesnŽt
recognize that the mousepointer is above a deletable object.
any hints are welcome.
Heiko
|
|
|
|
|
Re: "Delete" & "Zoom" in MultiPageEditor [message #206932 is a reply to message #206916] |
Mon, 09 January 2006 10:57 |
Eclipse User |
|
|
|
Originally posted by: hplaas.gmx.de
Hi
In my implementation of the editor, each page is a nested version of my
extended shapeeditor. For the multipageeditor i created a "MainModel"
class, which contains a list of models for each page (one model per page).
When a new page is created (createPages() in MultiPageEditor), i add a new
model to the list. Then i add a page with an instance of the shapeeditor.
In its constructor the shapeditor gets the model from the list of the
"MainModel" class.
Heiko
|
|
|
Re: "Delete" & "Zoom" in MultiPageEditor [message #207033 is a reply to message #205734] |
Tue, 10 January 2006 09: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.02819 seconds