Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » setting property when diagram loads
setting property when diagram loads [message #189552] Tue, 27 May 2008 15:14 Go to next message
Eclipse UserFriend
Originally posted by: nico.lammers.gmail.com

My datafile comes from a different source than EMF/GMF/ECore/Whatever,
and I use a custom DocumentProvider (created by someone else than me).

When I open the diagram it is possible that some attributes of some
elements are not set. For visualisation purposes I'd like to give them a
default value.

What is a good way to do this?

~ Nico
Re: setting property when diagram loads [message #189675 is a reply to message #189552] Wed, 28 May 2008 09:44 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Nico,

You can use "View Pattern"+"View Method" of label mapping to make diagram
labels displaying default values if corresponding reference is null in the
domain model.

-----------------
Alex Shatalin
Re: setting property when diagram loads [message #189723 is a reply to message #189675] Wed, 28 May 2008 11:35 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: nico.lammers.gmail.com

Actually I just investigated that possibility, but I haven't found out
how exactly. Actually the value in the domain model isn't null, but an
empty string.

Can you give me an example? I'm either just lost or missing something..
Thanks.

~ Nico

Alex Shatalin wrote:
> Hello Nico,
>
> You can use "View Pattern"+"View Method" of label mapping to make
> diagram labels displaying default values if corresponding reference is
> null in the domain model.
>
> -----------------
> Alex Shatalin
>
>
Re: setting property when diagram loads [message #189794 is a reply to message #189552] Wed, 28 May 2008 14:58 Go to previous messageGo to next message
Francisco Javier Cano is currently offline Francisco Javier CanoFriend
Messages: 21
Registered: July 2009
Junior Member
If it's a document provider for a GMF diagram then it must implement the
org.eclipse.gmf.runtime.diagram.ui.resources.editor.document .IDocumentProvider
interface, right?
If so, take a look at the connect(Object) method of the document
provider. Maybe you can do something there.

Cheers,
Javi
--

Nico Lammers escribió:
> My datafile comes from a different source than EMF/GMF/ECore/Whatever,
> and I use a custom DocumentProvider (created by someone else than me).
>
> When I open the diagram it is possible that some attributes of some
> elements are not set. For visualisation purposes I'd like to give them a
> default value.
>
> What is a good way to do this?
>
> ~ Nico
Re: setting property when diagram loads [message #189826 is a reply to message #189723] Wed, 28 May 2008 16:10 Go to previous message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Nico,

> Actually I just investigated that possibility, but I haven't found out
> how exactly. Actually the value in the domain model isn't null, but an
> empty string.
Well, you are right - it looks not possible to write such a parser using
MassageFormat or other formatting options. You can try using LabelMapping
instead of FeatureLabelMapping and plug in your own parser via extension
point.

-----------------
Alex Shatalin
Previous Topic:to extend the copy/paste function
Next Topic:[Announce] GMF 2.1.0RC2 is available
Goto Forum:
  


Current Time: Fri Apr 26 13:06:04 GMT 2024

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

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

Back to the top