Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Preventing Node being added to Diagram
Preventing Node being added to Diagram [message #183797] Tue, 22 April 2008 09:31 Go to next message
Eclipse UserFriend
Originally posted by: yagayoga.hotmail.com

Hi there,

When I create a new diagram file from my model, it adds nodes that I don't
want to be represented on the diagram.

There are two nodes in my model; parent and child, with a relation between
them. Ideally I would like the child to appear on my diagram, but not the
parent, or the relation.

At the moment the parent has setEnabled(false) and setVisible(false) on
both figures in the EditPart, but I'd like to prevent it being added to
the diagram altogether, while ensuring I don't get errors about ghost
nodes etc. when building the source from the GMF console.

I'm thinking I have to look at the createCommands, or edit policies to
achieve this? Anyone know where?

Jen
Re: Preventing Node being added to Diagram [message #183807 is a reply to message #183797] Tue, 22 April 2008 09:45 Go to previous message
Eclipse UserFriend
Originally posted by: nico.lammers.gmail.com

Hi,

So, you only want to omit the graphical representation? As in, the views
need to be there but not represented?

I believe a Creation Role EditPolicy might be what you need here. But
that would mean an EditPart would be created anyway. If you don't
want this, I could suggest implementing your own editPartProvider to
check for certain conditions and not create a new EditPart at all. At
least, I would try it this way. I'm not 100% sure if GMF will like this :)

~ Nico

Jennifer LLewelyn wrote:
> Hi there,
>
> When I create a new diagram file from my model, it adds nodes that I
> don't want to be represented on the diagram.
>
> There are two nodes in my model; parent and child, with a relation
> between them. Ideally I would like the child to appear on my diagram,
> but not the parent, or the relation.
>
> At the moment the parent has setEnabled(false) and setVisible(false) on
> both figures in the EditPart, but I'd like to prevent it being added to
> the diagram altogether, while ensuring I don't get errors about ghost
> nodes etc. when building the source from the GMF console.
>
> I'm thinking I have to look at the createCommands, or edit policies to
> achieve this? Anyone know where?
>
> Jen
>
>
>
Previous Topic:How to use OCL to constraint links between nodes?
Next Topic:drag-in menu contribution
Goto Forum:
  


Current Time: Fri Apr 26 18:34:10 GMT 2024

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

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

Back to the top