Skip to main content



      Home
Home » Eclipse Projects » GEF » Filtering models
Filtering models [message #169348] Tue, 22 February 2005 18:27 Go to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

I have a question regarding the best approach for filtering model
objects using GEF.

Here's the scenario:
- MPE that shares the same model across GEF editors
- Each editor provides a different view of the model
- Filters via the getModelChildren() / addChild()
- I have to intercept addChild because I don't
want editparts to be created and then
removed via the getChildren call...
seems like a waste of resources.

Is there a better way instead of wrapping the calls to getModelChildren
and addChild to filter what objects I want to display?

Is there a better approach?

Cheers,

~ Chris
Re: Filtering models [message #169458 is a reply to message #169348] Wed, 23 February 2005 10:26 Go to previous message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

>I have a question regarding the best approach for filtering model objects
>using GEF.
>
> Here's the scenario:
> - MPE that shares the same model across GEF editors
> - Each editor provides a different view of the model
> - Filters via the getModelChildren() / addChild()
> - I have to intercept addChild because I don't
> want editparts to be created and then
> removed via the getChildren call...
> seems like a waste of resources.

Are you calling addChild directly? addChild wouldn't get called if the
model was filtered from the list of model children. If you are responding
to model updates incrementally, you might call addChild directly, but then
you'd have to fix the index, and apply the filter as you suggest.

>
> Is there a better way instead of wrapping the calls to getModelChildren
> and addChild to filter what objects I want to display?
>
> Is there a better approach?

You could try using figure visibility, but you would have to make sure the
editparts don't stay selected once they are hidden.

>
> Cheers,
>
> ~ Chris
Previous Topic:CompoundDirectedGraphLayout question
Next Topic:FanRouter
Goto Forum:
  


Current Time: Sun May 11 19:12:52 EDT 2025

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

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

Back to the top