Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Custom Dialog for a certain type of Node
Custom Dialog for a certain type of Node [message #130149] Fri, 25 May 2007 06:38 Go to next message
Eclipse UserFriend
Originally posted by: evaandoli.dodo.com.au

Hi,
I'd like to create a custom dialog when a user adds a certains type of node
to the diagram.
I thought this had been asked before on here but I could not find the
entry - so sorry if it has.

Can anyone give me a few pointers on:-
1) Best way to create a custom dialog.
2) Where should this be plug into in the diagram setup ?

Thanks for any help,

Stu
Re: Custom Dialog for a certain type of Node [message #131216 is a reply to message #130149] Wed, 30 May 2007 10:53 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: fbanica.soluta.net

Me, for instance, I made a new action (for a menu voice in the pop-up menu)
and from the run method I create and open a dialog. Inside I put the
controls and the logic I needed...


"Stu" <evaandoli@dodo.com.au> wrote in message
news:f36eat$fbj$1@build.eclipse.org...
> Hi,
> I'd like to create a custom dialog when a user adds a certains type of
> node to the diagram.
> I thought this had been asked before on here but I could not find the
> entry - so sorry if it has.
>
> Can anyone give me a few pointers on:-
> 1) Best way to create a custom dialog.
> 2) Where should this be plug into in the diagram setup ?
>
> Thanks for any help,
>
> Stu
>
Re: Custom Dialog for a certain type of Node [message #131340 is a reply to message #131216] Wed, 30 May 2007 23:43 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: evaandoli.dodo.com.au

Its the "Inside (dialog) I put the controls and the logic I needed".
That Im not sure how to start.
I haven't created a custom dialog before and I find myseld running around
trying to find examples of how to (without much success).

Stu

"Florin Banica" <fbanica@soluta.net> wrote in message
news:f3k36u$cd4$1@build.eclipse.org...
> Me, for instance, I made a new action (for a menu voice in the pop-up
> menu) and from the run method I create and open a dialog. Inside I put the
> controls and the logic I needed...
>
>
> "Stu" <evaandoli@dodo.com.au> wrote in message
> news:f36eat$fbj$1@build.eclipse.org...
>> Hi,
>> I'd like to create a custom dialog when a user adds a certains type of
>> node to the diagram.
>> I thought this had been asked before on here but I could not find the
>> entry - so sorry if it has.
>>
>> Can anyone give me a few pointers on:-
>> 1) Best way to create a custom dialog.
>> 2) Where should this be plug into in the diagram setup ?
>>
>> Thanks for any help,
>>
>> Stu
>>
>
>
Re: Custom Dialog for a certain type of Node [message #131382 is a reply to message #131340] Thu, 31 May 2007 03:37 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: fbanica.soluta.net

Here it is a small example of a dialog (including the action, a command
needed for modifying the GMF resource and some content and label providers
for a listview and a comboview).

The action is a contribution to the org.eclipse.ui.popupMenus extension
point:

...
<action
class=" net.soluta.factory05.negotiation.diagram.utils.CreateVariabl esAction "
enablesFor="1"
id=" net.soluta.factory05.negotiation.diagram.utils.CreateVariabl esActionID "
label="%createVariables"
menubarPath="additions">
</action>
...

Inside the CreateVariablesAction class, in it's run method you declare a
dialog variable:

VariablesDialog dialog = new VariablesDialog(shell, selection);

and then you just open it:

dialog.open();

You could also check the return code of open (it returns an int) and act in
consequence.

Inside the VariablesDialog class you will find how it is made (how controls
are declared and used) and how it's working.

There is a series of articles about this and related themes:
1. http://www.eclipse.org/articles/viewArticle/ViewArticle2.htm l
2.
http://www.eclipse.org/articles/Article-JFace%20Wizards/wiza rdArticle.html
3. http://www.eclipse.org/articles/Article-TreeViewer/TreeViewe rArticle.htm

Have a look at them and then try to make it on your own...

Hope it will help you make yourself an idea about the dialog and how it
works...


Good luck,




Floppy


"Stu" <evaandoli@dodo.com.au> wrote in message
news:f3lg9p$47j$1@build.eclipse.org...
> Its the "Inside (dialog) I put the controls and the logic I needed".
> That Im not sure how to start.
> I haven't created a custom dialog before and I find myseld running around
> trying to find examples of how to (without much success).
>
> Stu
>
> "Florin Banica" <fbanica@soluta.net> wrote in message
> news:f3k36u$cd4$1@build.eclipse.org...
>> Me, for instance, I made a new action (for a menu voice in the pop-up
>> menu) and from the run method I create and open a dialog. Inside I put
>> the
>> controls and the logic I needed...
>>
>>
>> "Stu" <evaandoli@dodo.com.au> wrote in message
>> news:f36eat$fbj$1@build.eclipse.org...
>>> Hi,
>>> I'd like to create a custom dialog when a user adds a certains type of
>>> node to the diagram.
>>> I thought this had been asked before on here but I could not find the
>>> entry - so sorry if it has.
>>>
>>> Can anyone give me a few pointers on:-
>>> 1) Best way to create a custom dialog.
>>> 2) Where should this be plug into in the diagram setup ?
>>>
>>> Thanks for any help,
>>>
>>> Stu
>>>
>>
>>
>
>








Re: Custom Dialog for a certain type of Node [message #131710 is a reply to message #131382] Thu, 31 May 2007 21:29 Go to previous message
Eclipse UserFriend
Originally posted by: evaandoli.dodo.com.au

Excellent reply - thank you very much for this.

Stu

"Florin Banica" <fbanica@soluta.net> wrote in message
news:f3lu07$ao0$1@build.eclipse.org...
> Here it is a small example of a dialog (including the action, a command
> needed for modifying the GMF resource and some content and label providers
> for a listview and a comboview).
>
> The action is a contribution to the org.eclipse.ui.popupMenus extension
> point:
>
> ...
> <action
> class=" net.soluta.factory05.negotiation.diagram.utils.CreateVariabl esAction "
> enablesFor="1"
>
> id=" net.soluta.factory05.negotiation.diagram.utils.CreateVariabl esActionID "
> label="%createVariables"
> menubarPath="additions">
> </action>
> ...
>
> Inside the CreateVariablesAction class, in it's run method you declare a
> dialog variable:
>
> VariablesDialog dialog = new VariablesDialog(shell, selection);
>
> and then you just open it:
>
> dialog.open();
>
> You could also check the return code of open (it returns an int) and act
> in consequence.
>
> Inside the VariablesDialog class you will find how it is made (how
> controls are declared and used) and how it's working.
>
> There is a series of articles about this and related themes:
> 1. http://www.eclipse.org/articles/viewArticle/ViewArticle2.htm l
> 2.
> http://www.eclipse.org/articles/Article-JFace%20Wizards/wiza rdArticle.html
> 3.
> http://www.eclipse.org/articles/Article-TreeViewer/TreeViewe rArticle.htm
>
> Have a look at them and then try to make it on your own...
>
> Hope it will help you make yourself an idea about the dialog and how it
> works...
>
>
> Good luck,
>
>
>
>
> Floppy
>
>
> "Stu" <evaandoli@dodo.com.au> wrote in message
> news:f3lg9p$47j$1@build.eclipse.org...
>> Its the "Inside (dialog) I put the controls and the logic I needed".
>> That Im not sure how to start.
>> I haven't created a custom dialog before and I find myseld running around
>> trying to find examples of how to (without much success).
>>
>> Stu
>>
>> "Florin Banica" <fbanica@soluta.net> wrote in message
>> news:f3k36u$cd4$1@build.eclipse.org...
>>> Me, for instance, I made a new action (for a menu voice in the pop-up
>>> menu) and from the run method I create and open a dialog. Inside I put
>>> the
>>> controls and the logic I needed...
>>>
>>>
>>> "Stu" <evaandoli@dodo.com.au> wrote in message
>>> news:f36eat$fbj$1@build.eclipse.org...
>>>> Hi,
>>>> I'd like to create a custom dialog when a user adds a certains type of
>>>> node to the diagram.
>>>> I thought this had been asked before on here but I could not find the
>>>> entry - so sorry if it has.
>>>>
>>>> Can anyone give me a few pointers on:-
>>>> 1) Best way to create a custom dialog.
>>>> 2) Where should this be plug into in the diagram setup ?
>>>>
>>>> Thanks for any help,
>>>>
>>>> Stu
>>>>
>>>
>>>
>>
>>
>
>
>
Previous Topic:Resize automatically a Rectangle
Next Topic:OCL constraint
Goto Forum:
  


Current Time: Sun Jul 27 06:25:29 EDT 2025

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

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

Back to the top