Naive question: can I have both a GEF editor and a property editor on the same model? [message #47523] |
Thu, 05 December 2002 08:39 |
Alexandre Vermeerbergen Messages: 110 Registered: July 2009 |
Senior Member |
|
|
Hello,
Reading Eclipse UI guideline article, I face the following dilemna: I what
to use GEF to show on a graph-manner (Randy calls that an UML diagram editor
manner) a list of nodes, each node having a list of items, each item having
plenty of editable properties.
So I principe, my UI would be based on *two* editor, both being active at
the same time:
- a GEF editor to graphically inspect the nodes & their relations, each node
being displayed as an emulated draw2d List showing its items as labels.
- a property editor, that would allow to edit the properties of the
currently selected items.
My dilmena is that Eclipse UI guideline article tends to say that there is
at most one editor per file in Eclipse UI conventions, so I am confused on:
- whether what I would like to do could work at all (is it possible to have
two editors on one model, so that undo/redo, isDirty state will work without
hacking Eclipse / GEF default implemenation)
- what would be the alternative that would meet Eclipse UI guideline.
Any wize advice ?
Alex.
|
|
|
Re: Naive question: can I have both a GEF editor and a property editor on the same model? [message #47553 is a reply to message #47523] |
Thu, 05 December 2002 10:53 |
Eclipse User |
|
|
|
Originally posted by: bramez.users.sourceforge.net
I think you have several options
- use modal popup windows (like in rat. rose)
- make a "property view" and e.g. stack it on the Outline view. (it is
possible to manipulate a perspective programmatically)
- split the editor in a GEF and a property pane, with possibility to
"collapse/expand" the property pane.
Bram
Alexandre Vermeerbergen wrote:
> - a GEF editor to graphically inspect the nodes & their relations, each node
> being displayed as an emulated draw2d List showing its items as labels.
> - a property editor, that would allow to edit the properties of the
> currently selected items.
> My dilmena is that Eclipse UI guideline article tends to say that there is
> at most one editor per file in Eclipse UI conventions, so I am confused on:
> - whether what I would like to do could work at all (is it possible to have
> two editors on one model, so that undo/redo, isDirty state will work without
> hacking Eclipse / GEF default implemenation)
> - what would be the alternative that would meet Eclipse UI guideline.
> Any wize advice ?
> Alex.
|
|
|
Re: Naive question: can I have both a GEF editor and a property editor on the same model? [message #47609 is a reply to message #47553] |
Thu, 05 December 2002 11:48 |
Alexandre Vermeerbergen Messages: 110 Registered: July 2009 |
Senior Member |
|
|
Bram:
Thanks you for your reply
"Bram Stieperaere" <bramez@users.sourceforge.net> wrote in message
news:asnb6i$h2d$1@rogue.oti.com...
> I think you have several options
> - use modal popup windows (like in rat. rose)
I don't quite understand how I could how editing of my item's name, alias,
etc. through a pop-up... sounds like a strange place to allow editing, isn't
it?
> - make a "property view" and e.g. stack it on the Outline view. (it is
> possible to manipulate a perspective programmatically)
I do not quite need to have a default stacking over the Outline view :
Eclipse perspective & workbench standards should let the user choose its
prefered layout..
But again are we allowed to permit editing in a property view in Eclipse?
> - split the editor in a GEF and a property pane, with possibility to
> "collapse/expand" the property pane.
That's the only solution I could imagine due the "one editor per file" of
Eclipse UI article, but I find that a little bit constraining: why the
shouldn't the property editor for my items be a windows that can be docked /
stacked at any place of the current perspective ??
I still have this dilmena with Eclipse UI guidelines... To give a
comparison, I would like to have editor workbench similar to XmlSpy, where
you can graphically browse an XML Schema, direct edit some nodes properties
such as the node name and its comment, but for the rest of properties
(datatype, nullable, etc.) you use a property sheet docked were you wanted
to see it.
Is that feasible with Eclipse / GEF ? how ?
Alex.
|
|
|
|
|
|
|
|
Re: Naive question: can I have both a GEF editor and a property editor on the same model? [message #48369 is a reply to message #48339] |
Fri, 06 December 2002 15:57 |
Eclipse User |
|
|
|
Originally posted by: hudsonr.us.eye-bee-em.com
"Alexandre Vermeerbergen" <ave@ds-fr.com> wrote in message
news:asqatd$7f0$1@rogue.oti.com...
>
> "Alex Selkov" <as@empproject.com> wrote in message
> news:asps1k$udf$1@rogue.oti.com...
> > Actually, they are. But everything already impelmented in
> > org.eclipse.gef.editpart.AbstractEditPart - look at source. So if your
> model
> > implements IPropertySource you don't need to do anything else (or, maybe
> > IAdaptable). Actually I think that you rare need to catch
> > getAdapter(IPropertySource.class) in your EditParts because if you do
that
> > then model is a better place then EditPart. IMHO.
>
> Alright, I think you mean that it works me for even if I do not override
> getAdapter() because
> I do it in my EditPart that implement IPropertySource and because they
> derive from AbstractEditPart.
>
> I got it.
>
> Now my next question is: how can I allow editing of some "common"
properties
> in Eclipse's PropertySheet when I have more than one object selected, and
> only for some properties for which I consider that setting a common value
to
> a given property is a good thing?
Fortunately, the people who brought you GEF are the same people who brought
you the PropertySheet :-)
The PropertySheet already performs an intersection of the property
descriptors returned by the multiple PropertySources. If that intersection
still contains properties that you don't want to be edited among multiple
items, such as a "name" property that must be unique within your Editor, you
can do this using PropertyDescriptor.isCompatibleWith(PropertyDescriptor).
You can make this method return true by overriding it, or by calling
PropertyDescriptor.setAlwaysIncompatible(true).
> Alex.
>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.04604 seconds