Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Naive question: can I have both a GEF editor and a property editor on the same model?
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 Go to next message
Alexandre Vermeerbergen is currently offline Alexandre VermeerbergenFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Alexandre Vermeerbergen is currently offline Alexandre VermeerbergenFriend
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 #47731 is a reply to message #47609] Thu, 05 December 2002 14:16 Go to previous messageGo to next message
Alexandre Vermeerbergen is currently offline Alexandre VermeerbergenFriend
Messages: 110
Registered: July 2009
Senior Member
Oh I think I can answer to myself now:

if you run "Logical Diagram Editor" and open the standard Eclipse Property
Sheet view, and then select a node, say a AND gate, then you can edit its X
and Y position in the property sheet !

Exactly what I need... so we can have more than one editor per file, even if
a PropertySheet is not called an editor in Eclipse terminology, it allows to
edit (understands who can...)

Alex.
Re: Naive question: can I have both a GEF editor and a property editor on the same model? [message #48099 is a reply to message #47731] Fri, 06 December 2002 01:20 Go to previous messageGo to next message
Erik Johnson is currently offline Erik JohnsonFriend
Messages: 36
Registered: July 2009
Member
You pretty much want to override getAdapter(IPropertySource.class) (in your
EditPart) and return an IPropertySource implementation to edit your item's
properties.


"Alexandre Vermeerbergen" <ave@ds-fr.com> wrote in message
news:asnmts$ogk$1@rogue.oti.com...
> Oh I think I can answer to myself now:
>
> if you run "Logical Diagram Editor" and open the standard Eclipse Property
> Sheet view, and then select a node, say a AND gate, then you can edit its
X
> and Y position in the property sheet !
>
> Exactly what I need... so we can have more than one editor per file, even
if
> a PropertySheet is not called an editor in Eclipse terminology, it allows
to
> edit (understands who can...)
>
> Alex.
>
>
Re: Naive question: can I have both a GEF editor and a property editor on the same model? [message #48129 is a reply to message #48099] Fri, 06 December 2002 08:23 Go to previous messageGo to next message
Alexandre Vermeerbergen is currently offline Alexandre VermeerbergenFriend
Messages: 110
Registered: July 2009
Senior Member
Hi Erik:

"Erik Johnson" <ejohnson@avaya.com> wrote in message
news:asotnq$hcj$1@rogue.oti.com...
> You pretty much want to override getAdapter(IPropertySource.class) (in
your
> EditPart) and return an IPropertySource implementation to edit your item's
> properties.

Well, I must confess that I resorted to imitate the "Logical Diagram Editor"
source code. LogicEditPart/LogicElement, and for example Led are not using
getAdapter() at all. Is that bad pratice ?

Alex.
Re: Naive question: can I have both a GEF editor and a property editor on the same model? [message #48188 is a reply to message #48129] Fri, 06 December 2002 09:26 Go to previous messageGo to next message
Alex Selkov is currently offline Alex SelkovFriend
Messages: 73
Registered: July 2009
Member
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.

"Alexandre Vermeerbergen" <ave@ds-fr.com> wrote in message
news:aspmit$qrm$1@rogue.oti.com...
> Hi Erik:
>
> "Erik Johnson" <ejohnson@avaya.com> wrote in message
> news:asotnq$hcj$1@rogue.oti.com...
> > You pretty much want to override getAdapter(IPropertySource.class) (in
> your
> > EditPart) and return an IPropertySource implementation to edit your
item's
> > properties.
>
> Well, I must confess that I resorted to imitate the "Logical Diagram
Editor"
> source code. LogicEditPart/LogicElement, and for example Led are not using
> getAdapter() at all. Is that bad pratice ?
>
> Alex.
>
>
Re: Naive question: can I have both a GEF editor and a property editor on the same model? [message #48339 is a reply to message #48188] Fri, 06 December 2002 14:10 Go to previous messageGo to next message
Alexandre Vermeerbergen is currently offline Alexandre VermeerbergenFriend
Messages: 110
Registered: July 2009
Senior Member
"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?

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 Go to previous message
Eclipse UserFriend
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.
>
>
>
Previous Topic:quick start on implementing own layout
Next Topic:line on figure and more
Goto Forum:
  


Current Time: Sat Jul 27 16:57:37 GMT 2024

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

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

Back to the top