Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » "Delete" & "Zoom" in MultiPageEditor
"Delete" & "Zoom" in MultiPageEditor [message #205734] Wed, 21 December 2005 14:51 Go to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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 #206591 is a reply to message #206478] Wed, 04 January 2006 08:55 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: hplaas.gmx.de

Has nobody here experience in using the MultipageEditor or does anybody
know where I can get more information about it ?

thanks
Heiko
Re: "Delete" & "Zoom" in MultiPageEditor [message #206916 is a reply to message #205734] Mon, 09 January 2006 09:04 Go to previous messageGo to next message
Ravikanth Somayaji is currently offline Ravikanth SomayajiFriend
Messages: 49
Registered: July 2009
Location: Oxford
Member
Hi, I'm sorry I've no solution for the problem you're facing, but then, I
trying to do the same thing, as in extending the ShapeEditor Example and
associating it wiht the multi page editor, the problem I'm facing is I'm
unable to set the model element of the ShapesEditor, for which I have a
null pointer exception. Can you please tell me where I should set the
model element for the shapes editor.
Thanks
Re: "Delete" & "Zoom" in MultiPageEditor [message #206932 is a reply to message #206916] Mon, 09 January 2006 10:57 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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
Previous Topic:Animation...
Next Topic:Small palette problem
Goto Forum:
  


Current Time: Fri Apr 26 21:47:14 GMT 2024

Powered by FUDForum. Page generated in 0.04626 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top