[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools.gef] Editparts, Figures and children

Hi all,

I've designed a GEF editor to edit bean properties. I have a BeanEditPart and a PropertyEditPart. The BeanEditPart will have a child PropertyEditPart for every property (as defined via commons Attributes xdoclet markup).

I have all this working, but would like a sanity check on my use of Figures and EditParts.

My BeanEditPart has a EditPolicy.COMPONENT_ROLE as it is not strictly a container in the GEF sense of the word. I.e. It has children but this is a fixed number of PropertyEditParts. You cannot add/delete or move these children so it is not a GEF container.

The PropertyEditPart is a container which allows a single child - the value that will set the property of the bean. When a value is set, this in turn will cause a BeanEditPart to be created etc, etc.

Now, when I created my figures, the PropertyEditPart simply returns a Figure with a FlowLayout; no problem there. I want the BeanEditPart to construct a Figure containing both labels and PropertyEditPart figures. Ultimately I want to achieve something like this:

------------                 ------------
| property | is greater than | property |
------------                 ------------

I.e. Parts of the figure are just non-editable layout and information to describe the interrelation of the properties.

And finally the question:
Is it safe to override addChildVisual and removeChildVisual to do nothing. I can then take the responsibility for adding child PropertyEditPart figures in the createFigure() method. I have so far added placeholders for the child figures and replaced them by overridden add/removeChildVisual() methods.


Thanks for your help. Looking forward to a response.

Pat

p.s. Appreciated all of the mails in the newsgroup. This is certainly a valuable resource to understanding GEF.