Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » EclipseCon 2007 GMF Best Practices
EclipseCon 2007 GMF Best Practices [message #191441] Fri, 06 June 2008 15:40 Go to next message
Eclipse UserFriend
Originally posted by: zippo29.hotmail.fr

Hi !

The use cas i am trying to implement is the loading of an image into a
node. An employee has an image and i want to allow the user to change the
image of the employee.

I read a solution proposed in the newsgroup but i am searching for another
way to do it. I found a similar comportmentin the prensentation at
EclipseCon 07 by Alex Shatalin and Artem Tikhomirov adapting. According
to the presentation we can create an editpolicy to display an InputDialog
to enter the attribute text when clicking on an attribute.

I am trying hard with the source code available in the slides (i know it
is incomplete) but i am missing something.

If someone can help me with this i will be thankfull.
Re: EclipseCon 2007 GMF Best Practices [message #191655 is a reply to message #191441] Mon, 09 June 2008 10:51 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Mous,

> I am trying hard with the source code available in the slides (i know
> it is incomplete) but i am missing something.
Which particular problems do you have? Was you able to create corresponding
subclass of OpenEditPolicy openning dialog while executing the command? Was
you able to install this EditPolicy onto the corresponding EditParts?

-----------------
Alex Shatalin
Re: EclipseCon 2007 GMF Best Practices [message #191718 is a reply to message #191655] Mon, 09 June 2008 13:05 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: zippo29.hotmail.fr

hi Alex!

I think my problem is that I do not understand the command mechanism well
enough. but, in this case precisely I wrote the doExecuteWithResult()
method but i am bugging when writing the constructor of my xxxCommand
class.

In your example (EclipseCon) you don't precise the EditingDomain as a
parameter of the class constructor. I suppose you get it from some object.
For me, when invoking the super constructor, from where can I get it ?

There is also an interogation about the label ? Is it some kind of message
the user can read ? Do I have to define it in the Messages class ?

Thanks for your interest and hope this is clearer.
Re: EclipseCon 2007 GMF Best Practices [message #191744 is a reply to message #191718] Mon, 09 June 2008 14:23 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Mous,

> In your example (EclipseCon) you don't precise the EditingDomain as a
> parameter of the class constructor. I suppose you get it from some
I do not remember exact contents of this constructor, but you can use org.eclipse.emf.transaction.util.TransactionUtil.getEditingD omain(Object)
to acess proper instance of TransactionalEditingDomain associated with context
object.

> There is also an interogation about the label ? Is it some kind of
> message the user can read ? Do I have to define it in the Messages
> class ?
Do you mean labels specified while creating InputDialog? Yes, you can store
these strings in Messages class (use Eclipse Source/Externalize Strings...
functionality for it).

-----------------
Alex Shatalin
Re: EclipseCon 2007 GMF Best Practices [message #192017 is a reply to message #191744] Wed, 11 June 2008 07:32 Go to previous message
Eclipse UserFriend
Originally posted by: zippo29.hotmail.fr

Thx Alex,

I managed to write and add the EditPolicy. The problem is that I can not
double-clik on an item in the diagram if it does not have a semantic
meaning.

In my example, my employee does not have any attribute representing his
photo. I only add it as a figure. So it doe not appear in the genmodel and
then I can not add the custom behavior to the specific zone where the
photo appears.

I think I have to use the way described by Thomas Beyer in the newsgroup.
Previous Topic:OCL expression problem extending UML2 editor
Next Topic:position and size values in model
Goto Forum:
  


Current Time: Fri Apr 26 08:50:48 GMT 2024

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

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

Back to the top