Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Label Edit mode once a node has been created on diagram!
Label Edit mode once a node has been created on diagram! [message #1713272] Mon, 02 November 2015 22:15 Go to next message
Parsa Pourali is currently offline Parsa PouraliFriend
Messages: 210
Registered: February 2014
Senior Member
Hi,

Let's assume I have a node (e.g. state in an statemachine) and each node has a label. I have created a DirectLabelEdit tool so that the user can click on the node/state and edit/change its label.

I was wondering if it is possible to automatically go to the label edit mode and user just write the label , i.e. without needing to click on the label and then edit the text! I feel this is an extra step for the user to first put the node and then click on its label and THEN goes to label edit mode! So, I want to omit the "click" part!

Thanks,
Parsa

[Updated on: Mon, 02 November 2015 22:17]

Report message to a moderator

Re: Label Edit mode once a node has been created on diagram! [message #1713443 is a reply to message #1713272] Wed, 04 November 2015 08:51 Go to previous messageGo to next message
Esteban Dugueperoux is currently offline Esteban DugueperouxFriend
Messages: 472
Registered: July 2009
Senior Member
Hi,

Note it exists the F2 shortcut to enable direct edit without doing a
click on the label.
Otherwise if you want enable direct edit on selection change, you can
try by registering a selection listener and send a DirectEditRequest to
the selected EditPart by calling EditPart.performRequest(directEditRequest).

Best Regards.

Le 02/11/2015 23:15, Parsa Pourali a écrit :
> Hi,
>
> Let's assume I have a node (e.g. state in an statemachine) and each node
> has a label. I have created a DirectLabelEdit tool so that the user can
> click on the node/state and edit/change its label.
>
> I was wondering if it is possible to automatically go to the label edit
> mode and user just write the label , i.e. without needing to click on
> the label and then edit the text! I feel this is an extra step for the
> user to first put the node and then click on its label and THEN goes to
> label edit mode! So, I want to omit the "click" part!
>
> Thanks,
> Parsa



--
Esteban Dugueperoux - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Label Edit mode once a node has been created on diagram! [message #1713514 is a reply to message #1713443] Wed, 04 November 2015 17:26 Go to previous messageGo to next message
Parsa Pourali is currently offline Parsa PouraliFriend
Messages: 210
Registered: February 2014
Senior Member
Hi,

Thanks for the reply,

I don't actually want it when the selection changes. If you remember, when you use GMF diagram editor, when you add a transition between two nodes in the diagram, it automatically waits for the user to input the transition name and then hit enter. I mean, wehn you insert a transition on the diagram, the default behaviour should be going to the label editing mode and waiting for the user to enter the transition label (e.g. event) .

However, in Sirius, when you create a transition, it places the transition on the diagram with a default label on it and then the user must press F2 or click on it to be able to edit it.

All I want to do is to going with the editing mode immediately after adding a transition and wait for the user to enter his/her text as a label (that was also in GMF previously).

I hope it is clear now Smile

Thanks,
Bests,
Parsa
Re: Label Edit mode once a node has been created on diagram! [message #1713566 is a reply to message #1713514] Thu, 05 November 2015 08:44 Go to previous messageGo to next message
Esteban Dugueperoux is currently offline Esteban DugueperouxFriend
Messages: 472
Registered: July 2009
Senior Member
Hi Parsa,

Ok I understand better, we could imagine several possibilities :

- At creation when the created view is selected, you can direct edit the
label by typing label directly and the old label will be replaced by
what user typed. At creation time this can be sufficient for you as
there is no old label.
- Before the node creation, have a dialog to input the label of the
future created node. You can do that by defining an 'Expression
Variable' in your node creation tool, see [1].

Is it answer to your need?

Best Regards.

[1]
https://www.eclipse.org/sirius/doc/specifier/general/ToolsSpecification.html

Le 04/11/2015 18:27, Parsa Pourali a écrit :
> Hi,
>
> Thanks for the reply,
>
> I don't actually want it when the selection changes. If you remember,
> when you use GMF diagram editor, when you add a transition between two
> nodes in the diagram, it automatically waits for the user to input the
> transition name and then hit enter. I mean, wehn you insert a transition
> on the diagram, the default behaviour should be going to the label
> editing mode and waiting for the user to enter the transition label
> (e.g. event) .
>
> However, in Sirius, when you create a transition, it places the
> transition on the diagram with a default label on it and then the user
> must press F2 or click on it to be able to edit it.
>
> All I want to do is to going with the editing mode immediately after
> adding a transition and wait for the user to enter his/her text as a
> label (that was also in GMF previously).
> I hope it is clear now :)
>
> Thanks,
> Bests,
> Parsa
>



--
Esteban Dugueperoux - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Label Edit mode once a node has been created on diagram! [message #1713643 is a reply to message #1713566] Thu, 05 November 2015 16:35 Go to previous message
Parsa Pourali is currently offline Parsa PouraliFriend
Messages: 210
Registered: February 2014
Senior Member
Hi Esteban,

Thanks again for your reply.

I don't think what you suggested is what is suitable for me. Consider the two attached images.

1:
index.php/fa/23837/0/

2:
index.php/fa/23838/0/

Image 1, shows what Sirius currently does when I create a new transition, for example t5. I have managed to preset the transition label and it automatically places a transition with the name pattern I suggested.

Image 2, is what I need immediately after placing a transition (e.g. for t5), which is bring the transition label to edit mode, and then select all the text. This is the default behavior of GMF.

What I think is that I can write a java service to be run immediately and invoke edit command of the transition (or something like that)!

Or, I write a java service which shows a jForm/jDialogue to the user and the user can set the label in a text box.

Or, I can manage to show a JDialog box in the semantic code (EMF part) that when a label is being created, the dialog box appear ?!

Which one do you advise ?

BTW, your following suggestion doesn't work for me.

"- At creation when the created view is selected, you can direct edit the
label by typing label directly and the old label will be replaced by
what user typed. At creation time this can be sufficient for you as
there is no old label."

It is because if the start to type, then all the label pattern that I have provided as a transition label will be deleted.

Thanks,
Bests,
Parsa
  • Attachment: 1.jpg
    (Size: 151.80KB, Downloaded 598 times)
  • Attachment: 2.jpg
    (Size: 173.99KB, Downloaded 582 times)

[Updated on: Thu, 05 November 2015 17:58]

Report message to a moderator

Previous Topic:[ANN] Sirius 3.1
Next Topic:Feature Column style does not override the line style
Goto Forum:
  


Current Time: Wed Mar 03 00:27:57 GMT 2021

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

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

Back to the top