Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » [Resolved] Sirius Open Dialog
[Resolved] Sirius Open Dialog [message #1768980] Tue, 25 July 2017 11:57 Go to next message
Ran Wei is currently offline Ran WeiFriend
Messages: 119
Registered: September 2012
Location: York, UK
Senior Member
Hi there,

I am currently trying to implement an Open Dialogue in container creation.

I first create an Instance (for the container) that I need, then I add an Open Dialogue.

I can manage the Cancel button (to simply remove the instance created) and the OK button (currently it does nothing).

I then add some "text" widget to the dialogue.

My question is, how you do extract the input in the text widget to set the properties of the instance with the inputs?

Cheers,
Will


Research Associate
Department of Computer Science
University of York

[Updated on: Mon, 31 July 2017 12:39]

Report message to a moderator

Re: Sirius Open Dialog [message #1768985 is a reply to message #1768980] Tue, 25 July 2017 12:52 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 488
Registered: May 2011
Senior Member
Hello,

The Open Dialog operation is used to edit a model and it is not expected (yet at least) to access its values/result afterward. Therefore, you should set the properties with a set operation in the OK button.

Regards,
Steve


Steve Monnier - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Sirius Open Dialog [message #1768986 is a reply to message #1768985] Tue, 25 July 2017 12:53 Go to previous messageGo to next message
Ran Wei is currently offline Ran WeiFriend
Messages: 119
Registered: September 2012
Location: York, UK
Senior Member
Hi Steve,

Thanks, so if I create the instance in the first place, how do you edit the properties using text widgets?

Cheers,
Will


Research Associate
Department of Computer Science
University of York
Re: Sirius Open Dialog [message #1768991 is a reply to message #1768986] Tue, 25 July 2017 13:49 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 488
Registered: May 2011
Senior Member
Hi,

In the "Create Instance" operation, there is a "variable name" field. If you add your Open Dialog operation under it, this variable will be accessible.

Regards,
Steve


Steve Monnier - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Sirius Open Dialog [message #1768992 is a reply to message #1768991] Tue, 25 July 2017 13:51 Go to previous messageGo to next message
Ran Wei is currently offline Ran WeiFriend
Messages: 119
Registered: September 2012
Location: York, UK
Senior Member
Hi Steve,

I am wonder how you'd access the input in the dialog, suppose i have a text field which asks the user for the "name" property of the instance. How do I access the input that the user enters?

Cheers,
Will


Research Associate
Department of Computer Science
University of York
Re: Sirius Open Dialog [message #1769163 is a reply to message #1768992] Thu, 27 July 2017 08:33 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 488
Registered: May 2011
Senior Member
Hello,

You can access it with the variable created by the previous "create instance" operation declared by the field "variable name".

Regards,
Steve


Steve Monnier - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Sirius Open Dialog [message #1769179 is a reply to message #1769163] Thu, 27 July 2017 09:54 Go to previous messageGo to next message
Ran Wei is currently offline Ran WeiFriend
Messages: 119
Registered: September 2012
Location: York, UK
Senior Member
Hi Steve,

I am afraid you are not answering my question.

So I create an instance and then I open a dialog. With the dialog I create a text widget: name. This text widget should get the user input and set the name of the instance to the user input.

I know how to access the instance created. My question is, how do you access the user input?

Hope this is clear to you.

Cheers,
Will


Research Associate
Department of Computer Science
University of York
Re: Sirius Open Dialog [message #1769248 is a reply to message #1769179] Fri, 28 July 2017 08:52 Go to previous messageGo to next message
Stephane Begaudeau is currently offline Stephane BegaudeauFriend
Messages: 454
Registered: April 2010
Location: Nantes (France)
Senior Member

Hi William,

In a Sirius tool, we are always working with the variables accessible starting with self, the current semantic element. In your situation, you just need to create a new instance and then open a dialog containing a page and a group. Once you are on the group, you can use a text widget to edit the value of the property name of the newly created instance.

For a more detailed version, have a look at those screenshots and the final result in video

Regards,

Stephane Begaudeau, Obeo
Re: Sirius Open Dialog [message #1769397 is a reply to message #1769248] Mon, 31 July 2017 10:27 Go to previous message
Ran Wei is currently offline Ran WeiFriend
Messages: 119
Registered: September 2012
Location: York, UK
Senior Member
Hi Stephane,

Thanks very much for your help! I have managed to get the open dialog up and running.

Many thanks again.

Cheers,
Will


Research Associate
Department of Computer Science
University of York
Previous Topic:Variable label icons
Next Topic:Computed color expression to return R,G,B in one service call
Goto Forum:
  


Current Time: Thu Sep 24 14:58:45 GMT 2020

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

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

Back to the top