Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » selection of invisible model objects
selection of invisible model objects [message #224628] Tue, 17 October 2006 17:12 Go to next message
Eclipse UserFriend
Originally posted by: kvdijken.tiscali.nl

Dear GEF-ers,

Short:

What's the best way to programmatically select model objects
without editparts in a GraphicalViewer?


Long:

My model is a tree. At one level in the tree I do not use
editparts, because they do not have any visual counterparts.
I call objects at this level 'Feature'. Features do not
necessarily have any children. If they do have children,
these children have their own editparts and are displayed.
The reason I did not introduce editparts for these Features
is the possibly very high number of them (may be more than
one million). Together with the IFigures created by these
feature-EditParts, this would hamper the system too much.

But now I need to be able to programmatically select these
Features, even if they do not have any children. I need to
select them, so their properties become visible in the
properties view.

Q1: I suspect (am nearly sure) that it is simply not
possible to select model elements without associated
editpart in a GraphicalViewer. Is this true?

Q2: If I need to introduce EditParts for these Features, can
I do without having to create IFigures for them, is
returning null from getFigure() allowed? These Features
really have no visual representation whatsoever, their
children *do* have a visual counterpart.

Q3: If returning null from getFigure() is not allowed, can I
return a singleton fake, invisible figure from getFigure(),
or does their need to be a one-to-one relationship between
editparts and figures?


Koen
Re: selection of invisible model objects [message #224779 is a reply to message #224628] Wed, 18 October 2006 20:55 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.unknown.com

You're approaching this the wrong way. If all you want to do is show the
properties of the parent, there are other ways to do so. The selected
editpart(s) will be asked for the property source, and it can return its
parent's properties or the merged properties of the two or whatever.

"Koen van Dijken" <kvdijken@tiscali.nl> wrote in message
news:eh32uc$84j$1@utils.eclipse.org...
> Dear GEF-ers,
>
> Short:
>
> What's the best way to programmatically select model objects without
> editparts in a GraphicalViewer?
>
>
> Long:
>
> My model is a tree. At one level in the tree I do not use editparts,
> because they do not have any visual counterparts. I call objects at this
> level 'Feature'. Features do not necessarily have any children. If they do
> have children, these children have their own editparts and are displayed.
> The reason I did not introduce editparts for these Features is the
> possibly very high number of them (may be more than one million). Together
> with the IFigures created by these feature-EditParts, this would hamper
> the system too much.
>
> But now I need to be able to programmatically select these Features, even
> if they do not have any children. I need to select them, so their
> properties become visible in the properties view.
>
> Q1: I suspect (am nearly sure) that it is simply not possible to select
> model elements without associated editpart in a GraphicalViewer. Is this
> true?
>
> Q2: If I need to introduce EditParts for these Features, can I do without
> having to create IFigures for them, is returning null from getFigure()
> allowed? These Features really have no visual representation whatsoever,
> their children *do* have a visual counterpart.
>
> Q3: If returning null from getFigure() is not allowed, can I return a
> singleton fake, invisible figure from getFigure(), or does their need to
> be a one-to-one relationship between editparts and figures?
>
>
> Koen
>
Re: selection of invisible model objects [message #224802 is a reply to message #224779] Thu, 19 October 2006 07:13 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: kvdijken.tiscali.nl

Pratik,

You're right. That's how I have been doing it until now. But now (times
change) I need to be able to display properties of Features who do not have
any children, so no child editparts, no child figures...

Koen



"Pratik Shah" <none@unknown.com> wrote in message
news:eh64bc$pb1$1@utils.eclipse.org...
> You're approaching this the wrong way. If all you want to do is show the
> properties of the parent, there are other ways to do so. The selected
> editpart(s) will be asked for the property source, and it can return its
> parent's properties or the merged properties of the two or whatever.
>
> "Koen van Dijken" <kvdijken@tiscali.nl> wrote in message
> news:eh32uc$84j$1@utils.eclipse.org...
>> Dear GEF-ers,
>>
>> Short:
>>
>> What's the best way to programmatically select model objects without
>> editparts in a GraphicalViewer?
>>
>>
>> Long:
>>
>> My model is a tree. At one level in the tree I do not use editparts,
>> because they do not have any visual counterparts. I call objects at this
>> level 'Feature'. Features do not necessarily have any children. If they
>> do have children, these children have their own editparts and are
>> displayed. The reason I did not introduce editparts for these Features is
>> the possibly very high number of them (may be more than one million).
>> Together with the IFigures created by these feature-EditParts, this would
>> hamper the system too much.
>>
>> But now I need to be able to programmatically select these Features, even
>> if they do not have any children. I need to select them, so their
>> properties become visible in the properties view.
>>
>> Q1: I suspect (am nearly sure) that it is simply not possible to select
>> model elements without associated editpart in a GraphicalViewer. Is this
>> true?
>>
>> Q2: If I need to introduce EditParts for these Features, can I do without
>> having to create IFigures for them, is returning null from getFigure()
>> allowed? These Features really have no visual representation whatsoever,
>> their children *do* have a visual counterpart.
>>
>> Q3: If returning null from getFigure() is not allowed, can I return a
>> singleton fake, invisible figure from getFigure(), or does their need to
>> be a one-to-one relationship between editparts and figures?
>>
>>
>> Koen
>>
>
>
Re: selection of invisible model objects [message #224810 is a reply to message #224802] Thu, 19 October 2006 12:21 Go to previous message
Eclipse UserFriend
Originally posted by: kvdijken.tiscali.nl

After all the answer is quite simple:

Let the editor be the selectionprovider instead of its
graphical viewer. In the editor I can put logic to decide
whether to delegate to the graphicalViewer (which lets only
be editparts selected) or handle non-editparts selections
itself.

Koen




koen wrote:
> Pratik,
>
> You're right. That's how I have been doing it until now. But now (times
> change) I need to be able to display properties of Features who do not have
> any children, so no child editparts, no child figures...
>
> Koen
>
>
>
> "Pratik Shah" <none@unknown.com> wrote in message
> news:eh64bc$pb1$1@utils.eclipse.org...
>> You're approaching this the wrong way. If all you want to do is show the
>> properties of the parent, there are other ways to do so. The selected
>> editpart(s) will be asked for the property source, and it can return its
>> parent's properties or the merged properties of the two or whatever.
>>
>> "Koen van Dijken" <kvdijken@tiscali.nl> wrote in message
>> news:eh32uc$84j$1@utils.eclipse.org...
>>> Dear GEF-ers,
>>>
>>> Short:
>>>
>>> What's the best way to programmatically select model objects without
>>> editparts in a GraphicalViewer?
>>>
>>>
>>> Long:
>>>
>>> My model is a tree. At one level in the tree I do not use editparts,
>>> because they do not have any visual counterparts. I call objects at this
>>> level 'Feature'. Features do not necessarily have any children. If they
>>> do have children, these children have their own editparts and are
>>> displayed. The reason I did not introduce editparts for these Features is
>>> the possibly very high number of them (may be more than one million).
>>> Together with the IFigures created by these feature-EditParts, this would
>>> hamper the system too much.
>>>
>>> But now I need to be able to programmatically select these Features, even
>>> if they do not have any children. I need to select them, so their
>>> properties become visible in the properties view.
>>>
>>> Q1: I suspect (am nearly sure) that it is simply not possible to select
>>> model elements without associated editpart in a GraphicalViewer. Is this
>>> true?
>>>
>>> Q2: If I need to introduce EditParts for these Features, can I do without
>>> having to create IFigures for them, is returning null from getFigure()
>>> allowed? These Features really have no visual representation whatsoever,
>>> their children *do* have a visual counterpart.
>>>
>>> Q3: If returning null from getFigure() is not allowed, can I return a
>>> singleton fake, invisible figure from getFigure(), or does their need to
>>> be a one-to-one relationship between editparts and figures?
>>>
>>>
>>> Koen
>>>
>>
>
>
Previous Topic:RCP and GEF examples
Next Topic:eclipse RCP and draw2d
Goto Forum:
  


Current Time: Fri Apr 26 22:55:26 GMT 2024

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

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

Back to the top