how to create edit part from code editor [message #237641] |
Mon, 06 August 2007 14:33 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03440 seconds