Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Set programatically a feature value
Set programatically a feature value [message #482748] Thu, 27 August 2009 18:48 Go to next message
Eclipse UserFriend
Originally posted by: oldstate.gmail.com

Hi, I have a node with two feature: name and module. The name feature is
hidden in the properties view, so I want to set this value through the
value of module. Basicly, I want to take the value of module (introduced
by user) and set programatically the name.

Any solution?...

Thanks...
Re: Set programatically a feature value [message #482751 is a reply to message #482748] Thu, 27 August 2009 19:16 Go to previous messageGo to next message
Artur Kronenberg is currently offline Artur KronenbergFriend
Messages: 159
Registered: August 2009
Senior Member
Hi,

I hope this will help you, I am not an expert myself but I think I had a
similar problem.

Setting the name or any atribute programmatically is possible on the
editpart.

You get the Impl class and there should be a setName() method. You have to
use the setName method in an AbstractEMFOperation.

I hope that helps.

Best,
Artur
Re: Set programatically a feature value [message #482838 is a reply to message #482751] Fri, 28 August 2009 09:56 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: oldstate.gmail.com

Hi Artur,

Thank you very much for your response.

The question is where I have to capture the call of setModule and set the
name value. The setModule of NodeImpl is never called and I have seen that
when the user set de value of module the method called
notifyChanged(Notification notification) is triggered, I think this method
is the site where I have to catch the value of module and set the name,
but I don't know how to do.

Any help?

Regards,

Edu.

Artur Kronenberg wrote:

> Hi,

> I hope this will help you, I am not an expert myself but I think I had a
> similar problem.

> Setting the name or any atribute programmatically is possible on the
> editpart.

> You get the Impl class and there should be a setName() method. You have to
> use the setName method in an AbstractEMFOperation.

> I hope that helps.

> Best,
> Artur
Re: Set programatically a feature value [message #482921 is a reply to message #482838] Fri, 28 August 2009 14:39 Go to previous message
Artur Kronenberg is currently offline Artur KronenbergFriend
Messages: 159
Registered: August 2009
Senior Member
Hi Eduardo,

I guess you can do that in notifyChanged method.

Though, if I remember correctly, in the XXXNameEditPart there should be
methods for that. I know that the performDirectEditRequest handles that
for example.

Also, you can install a DirectEditPolicy, I did that for taking car of
unique names once. There is a getDirectEditCommand() that handles the
editing of labels on nodes. So if your user modifies the Module you will
get his text in that Command and since this one is installed on your node,
you can get the parent of the edit policy and set the name of your name
atribute in there.

This may not be the smoothest way of handeling this, but I think this
might work for you.

Hope that helps,
best regards,
Artur

Eduardo Fernández wrote:

> Hi Artur,

> Thank you very much for your response.

> The question is where I have to capture the call of setModule and set the
> name value. The setModule of NodeImpl is never called and I have seen that
> when the user set de value of module the method called
> notifyChanged(Notification notification) is triggered, I think this method
> is the site where I have to catch the value of module and set the name,
> but I don't know how to do.

> Any help?

> Regards,

> Edu.

> Artur Kronenberg wrote:

>> Hi,

>> I hope this will help you, I am not an expert myself but I think I had a
>> similar problem.

>> Setting the name or any atribute programmatically is possible on the
>> editpart.

>> You get the Impl class and there should be a setName() method. You have to
>> use the setName method in an AbstractEMFOperation.

>> I hope that helps.

>> Best,
>> Artur
Previous Topic:Disable note attachment mechanism
Next Topic:How to sort properties and property categories in Properties View
Goto Forum:
  


Current Time: Thu Mar 28 14:35:18 GMT 2024

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

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

Back to the top