Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » How to set Name (or other properties) automatically for a node with empty Name
How to set Name (or other properties) automatically for a node with empty Name [message #185004] Fri, 02 May 2008 05:40 Go to next message
Eclipse UserFriend
Originally posted by: mehrdad.saadatmand.gmail.com

Hi,
While a user just puts a new node on the diagram, how is it possible to
detect whether they have set a field; for example Name; and if it is emtpy
and not set, assign something (like random) to it? In which editpart and
methods should we watch for it to check if it is empty or not?

Thanks,
Mehrdad
Re: How to set Name (or other properties) automatically for a node with empty Name [message #185036 is a reply to message #185004] Fri, 02 May 2008 11:06 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: 5d5.mail.ru

You may modify your model so the Name property has a default value or
add feature sequence initializer to the node in gmfmap file.

Mehrdad Saadatmand wrote:
> Hi,
> While a user just puts a new node on the diagram, how is it possible to
> detect whether they have set a field; for example Name; and if it is emtpy
> and not set, assign something (like random) to it? In which editpart and
> methods should we watch for it to check if it is empty or not?
>
> Thanks,
> Mehrdad
>
>
Re: How to set Name (or other properties) automatically for a node with empty Name [message #185131 is a reply to message #185036] Sat, 03 May 2008 19:24 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mehrdad.saadatmand.gmail.com

Well, I tested using feature sequence initializer, however there are two
problems, first is that the node is not shown on the diagram now that I've
added the feature seg init. it's xml code however is added.
Also the main problem is using that all nodes of that type get same name, I
want to initialize names as node1,node2,.... and so on. In what file and
class should I look to add code for this?



"Dmitry Stadnik" <5d5@mail.ru> wrote in message
news:fvesjr$skm$1@build.eclipse.org...
> You may modify your model so the Name property has a default value or add
> feature sequence initializer to the node in gmfmap file.
>
> Mehrdad Saadatmand wrote:
>> Hi,
>> While a user just puts a new node on the diagram, how is it possible to
>> detect whether they have set a field; for example Name; and if it is
>> emtpy and not set, assign something (like random) to it? In which
>> editpart and methods should we watch for it to check if it is empty or
>> not?
>>
>> Thanks,
>> Mehrdad
>>
Re: How to set Name (or other properties) automatically for a node with empty Name [message #185295 is a reply to message #185131] Mon, 05 May 2008 09:15 Go to previous message
Eclipse UserFriend
Originally posted by: 5d5.mail.ru

If your node is named Tingamajig for example then have a look at
generated TingamajigCreateCommand.

Mehrdad Saadatmand wrote:
> Well, I tested using feature sequence initializer, however there are two
> problems, first is that the node is not shown on the diagram now that I've
> added the feature seg init. it's xml code however is added.
> Also the main problem is using that all nodes of that type get same name, I
> want to initialize names as node1,node2,.... and so on. In what file and
> class should I look to add code for this?
>
>
>
> "Dmitry Stadnik" <5d5@mail.ru> wrote in message
> news:fvesjr$skm$1@build.eclipse.org...
>> You may modify your model so the Name property has a default value or add
>> feature sequence initializer to the node in gmfmap file.
>>
>> Mehrdad Saadatmand wrote:
>>> Hi,
>>> While a user just puts a new node on the diagram, how is it possible to
>>> detect whether they have set a field; for example Name; and if it is
>>> emtpy and not set, assign something (like random) to it? In which
>>> editpart and methods should we watch for it to check if it is empty or
>>> not?
>>>
>>> Thanks,
>>> Mehrdad
>>>
>
Previous Topic:Copy/Paste implementation issue
Next Topic:exclude note from auto arrange function
Goto Forum:
  


Current Time: Sat Apr 20 03:18:22 GMT 2024

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

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

Back to the top