Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » how to create edit part from code editor
how to create edit part from code editor [message #237641] Mon, 06 August 2007 14:33 Go to next message
Eclipse UserFriend
Originally posted by: alexjaquet.gmail.com

Hi,

I've the following case to solve :

I want to create edit part and associate figures when a event occur :
Once a user select a figure and edit it's associated code then the
figure have to be transformed

I need to know how to dynamically change / create edit part of the
figure (a figure could contain other figures) and create figures.

thx for any hints
Re: how to create edit part from code editor [message #237676 is a reply to message #237641] Tue, 07 August 2007 07:05 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: alexjaquet.gmail.com

I'm not sure if this is the rigth way to do the following

1 ) create a new edit part and associate it with the rooteditpart of my
editor :

FigureFactory ff = new FigureFactory();
IFigure figure = ff.create(widget);
WidgetEditPart editPart = new WidgetEditPart();
editPart.getContentPane().add(figure);
designer.addEditPart(editPart);


public void addEditPart(EditPart editPart) {
EditPart root = (EditPart) getGraphicalViewer().getRootEditPart();
root.getChildren().add(editPart);
}

what do you think
Re: how to create edit part from code editor [message #237692 is a reply to message #237676] Tue, 07 August 2007 11:05 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: alexjaquet.gmail.com

I finaly change my way using a commands to update my model
Re: how to create edit part from code editor [message #508384 is a reply to message #237692] Mon, 18 January 2010 15:55 Go to previous message
Deepak Singla is currently offline Deepak SinglaFriend
Messages: 27
Registered: December 2009
Junior Member
I also want to do same from shape to code editor and code editor to shape changes.

I am deleting all the shapes from diagram container(editor) and adding the again by using the new() of their model.

Is this is the right way to day or should I have to create new instance of editPart.???

One more question.. while removing, it removes from the editor, but object doesnt delete from the outline view (object remains in memory).

Please suggest.

Any Help would be appriciated.
Previous Topic:Drag and Drop Objects from Navigator to other Editor
Next Topic:Issue in CompoundDIrectedGraphLayout
Goto Forum:
  


Current Time: Wed Apr 24 23:40:00 GMT 2024

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

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

Back to the top