Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » hide specific model elements
hide specific model elements [message #107645] Wed, 28 February 2007 12:14 Go to next message
Eclipse UserFriend
Originally posted by: pramsohl.in.tum.de

This is a multi-part message in MIME format.
--------------070401090204060107000508
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

I've got two editors running on the same model file.
In the second editor i show elements that have been created by first
editor as childs of their containers.

How can i manage to show only a group of this elements based on model
attributes? I tried to override the container editparts
refreshChildren() method. This works sometimes but normally i get a
"semantic refresh failed" error.

Example:
In my attached screenshot i want to show only that figures which have a
connection to other figures.
I don't know where i have to put code for that.
Perhaps there is some possibilitiy to define that in the mapping model.

thank you
Thomas

--------------070401090204060107000508
Content-Type: image/png;
name="screenshot.PNG"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
filename="screenshot.PNG"

iVBORw0KGgoAAAANSUhEUgAAAUEAAAFUCAIAAAA1dxlOAAAABGdBTUEAALGP C/xhBQAAEcFJ
REFUeF7t3c9qHNfahXGd+/EtmHMJuZ4zSi4gt5B7SMCG2KPg2J4YPMjAEIJn STwxGA/OxGD0
1YdyhKK0+t21uvbu2vJPhHD+1KouPbUere6WZP/r8vLywsfFxQ8//PDVV18h sQkBMDfB2HqS
xWEfC4Hvv/8eh60IgLkVyZbzXLQc9CUco3Yb3mUwN4RZnorDfyFSu7Ir7QeA 2c7q9CM5zOHT
W3T7DBzenundZ+Qwh7fvG4e3Z8rhkqnalYjaDwCzndXpR9phO3x6izyX3p5h +xk5zOH2trQe
aYdbSW1xHIc5vEWP/n4ODm/P1OvhkqnalYjaDwCzndXpR9phO3x6i7we3p5h +xk5zOH2trQe
aYdbSW1xHIc5vEWPvB7enmLrGTnM4dautB9nh9tZnX4khzl8eou8Ht6eYfsZ Oczh9ra0HmmH
W0ltcRyHObxFj7we3p5i6xk5zOHWrrQfZ4fbWZ1+JIc5fHqLvB7enm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gMPKgMDcBDg89/1z9QhwWAcQmJsAh+e+f64eAQ7rAAJzE+Dw3PfP1SPA YR1AYG4CHJ77
/rl6BDisAwjMTYDDc98/V48Ah3UAgbkJcHju++fqEeCwDiAwNwEOz33/XD0C HNYBBOYmwOG5
75+rR4DDOoDA3AQ4PPf9c/UIcFgHEJibAIfnvn+uHgEO6wACcxPg8Nz3z9Uj wGEdQGBuAhye
+/65egQ4rAMIzE2Aw3PfP1ePAId1AIG5CXB47vvn6hHgsA4gMDcBDs99/1w9 AhzWAQTmJsDh
ue+fq0fg/wCpQD6x+hgnVwAAAABJRU5ErkJggg==
--------------070401090204060107000508--
Re: hide specific model elements [message #107828 is a reply to message #107645] Wed, 28 February 2007 15:07 Go to previous messageGo to next message
Mohammed Mostafa is currently offline Mohammed MostafaFriend
Messages: 143
Registered: July 2009
Senior Member
Hi Thomas ;

Filtering can be accomplished in many ways, one way of them is to
override the method getModelChildren in your edit part and do the
filtering there for example if you look at the default implementation of
this method in the graphical edit part you will find it doing something
like that

protected List getModelChildren() {
Object model = getModel();
if(model!=null && model instanceof View){
return new ArrayList(((View)model).getVisibleChildren());
}
return Collections.EMPTY_LIST;
}

you will notice it is returning only views with Visibility = true and
skip the rest.
Here is an example where I do not display any book with a title that
contains "filter"

protected List getModelChildren() {
List views = super.getModelChildren();
Iterator iterator = views.iterator();
while (iterator.hasNext()) {
Book book = (Book)((View)iterator.next()).getElement();
if (book.getTitle().contains("filter")) {
iterator.remove();
}
}
return views;
}

i hope this will help

Thomas Pramsohler wrote:
> Hi,
>
> I've got two editors running on the same model file.
> In the second editor i show elements that have been created by first
> editor as childs of their containers.
>
> How can i manage to show only a group of this elements based on model
> attributes? I tried to override the container editparts
> refreshChildren() method. This works sometimes but normally i get a
> "semantic refresh failed" error.
>
> Example:
> In my attached screenshot i want to show only that figures which have a
> connection to other figures.
> I don't know where i have to put code for that.
> Perhaps there is some possibilitiy to define that in the mapping model.
>
> thank you
> Thomas
>
> ------------------------------------------------------------ ------------
>
Re: hide specific model elements [message #108094 is a reply to message #107828] Thu, 01 March 2007 10:11 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: pramsohl.in.tum.de

Hi Mohammed,

thank you for your reply. That was exactly what i searched for.

greets
Thomas
Re: hide specific model elements [message #871821 is a reply to message #107828] Mon, 14 May 2012 23:55 Go to previous messageGo to next message
mohamed ahmed is currently offline mohamed ahmedFriend
Messages: 4
Registered: May 2012
Junior Member
Hi Mohammed,

I have the same problem as Thomas and i don't know where shoud i override getModelChildren(). And im my generated code i don't have any default implementation
of this method.

Best regards,
Re: hide specific model elements [message #880255 is a reply to message #871821] Fri, 01 June 2012 17:58 Go to previous message
Aurélien Pupier is currently offline Aurélien PupierFriend
Messages: 637
Registered: July 2009
Location: Grenoble, FRANCE
Senior Member

Hi,

as mentioned in previous post, getModelChildren() is a method available in Graphical Edit Part class. You can find them generated in your project, they are called XXXEditPart

regards,


Aurélien Pupier - Red Hat
Senior Software Engineer in Fuse Tooling team

[Updated on: Fri, 01 June 2012 17:59]

Report message to a moderator

Previous Topic:Multiline direct label editing not working in Mac Cocoa
Next Topic:Adding new context menu option to a palette entry
Goto Forum:
  


Current Time: Sun Oct 25 18:11:58 GMT 2020

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

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

Back to the top