Adding elements from menu bar. [message #197427] |
Mon, 03 October 2005 16:18 |
Eclipse User |
|
|
|
Originally posted by: greg.gigon.tugulu.com
Hello again.
Another question just rised in my head after long minutes of thinking
about this problem. How to add elements to diagram by choosing them from
menu. What action should I assosiate Menu Items with in order to provide
that functionality. CreationTool is good for palette but I need to add
this functionality from Eclipse Menu.
In my ActionBarContributor I can override contributeToMenu() method. I
can add some standard action, but how to add "create some element" action?
I'm fully open to all sugestions.
Cheers, Greg
|
|
|
Re: Adding elements from menu bar. [message #197443 is a reply to message #197427] |
Mon, 03 October 2005 16:47 |
Eclipse User |
|
|
|
Originally posted by: none.unknown.com
You create a CreateRequest, get the selected editpart from the viewer (since
that would be the parent editpart inside which the new part would be
created), invoke getCommand() on that part. Then just execute that command
on the CommandStack. The palette uses the same method (although it, of
course, has some extraneous stuff on top).
You can look at the PasteTemplateAction (in the logic plug-in) as an
example. You can copy a part from the palette, and paste it using the Edit
menu. That is in essence the same as what you're trying to do.
"Greg" <greg.gigon@tugulu.com> wrote in message
news:dhrlk9$v8d$1@news.eclipse.org...
> Hello again.
> Another question just rised in my head after long minutes of thinking
> about this problem. How to add elements to diagram by choosing them from
> menu. What action should I assosiate Menu Items with in order to provide
> that functionality. CreationTool is good for palette but I need to add
> this functionality from Eclipse Menu.
>
> In my ActionBarContributor I can override contributeToMenu() method. I
> can add some standard action, but how to add "create some element" action?
>
> I'm fully open to all sugestions.
>
> Cheers, Greg
|
|
|
Re: Adding elements from menu bar. [message #197544 is a reply to message #197443] |
Tue, 04 October 2005 10:59 |
Eclipse User |
|
|
|
Originally posted by: jason.nospam.spam
Pratik Shah wrote:
> You create a CreateRequest, get the selected editpart from the viewer (since
> that would be the parent editpart inside which the new part would be
> created), invoke getCommand() on that part. Then just execute that command
> on the CommandStack. The palette uses the same method (although it, of
> course, has some extraneous stuff on top).
>
> You can look at the PasteTemplateAction (in the logic plug-in) as an
> example. You can copy a part from the palette, and paste it using the Edit
> menu. That is in essence the same as what you're trying to do.
>
>
> "Greg" <greg.gigon@tugulu.com> wrote in message
> news:dhrlk9$v8d$1@news.eclipse.org...
>
>>Hello again.
>>Another question just rised in my head after long minutes of thinking
>>about this problem. How to add elements to diagram by choosing them from
>>menu. What action should I assosiate Menu Items with in order to provide
>>that functionality. CreationTool is good for palette but I need to add
>>this functionality from Eclipse Menu.
>>
>>In my ActionBarContributor I can override contributeToMenu() method. I
>>can add some standard action, but how to add "create some element" action?
>>
>>I'm fully open to all sugestions.
>>
>>Cheers, Greg
>
>
>
On a similar vein, could you tell me if it's possible to create a new
connection from an action, rather than from a palette tool? The idea
would be to right click on a node and decide on one of two possible
types of links which could be created from that node (pass/fail paths).
Once exiting the popup, you would have the endpoint of the newly created
connection Figure tracking the mouse pointer until a target was selected
(ala reconnection mode)...
Many Thanks,
Jason
|
|
|
Powered by
FUDForum. Page generated in 0.02818 seconds