Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » programmatically create element in a View
programmatically create element in a View [message #200359] Tue, 05 August 2008 09:51 Go to next message
Vadim Chepegin is currently offline Vadim ChepeginFriend
Messages: 9
Registered: July 2009
Junior Member
Hello everybody,

We face a problem when trying to create an element in a View. What we need
is:

1. Create an element of a certain type like it is done when you use a
pallette. But we also need to create it programmatically w/o touching
items on the pallette as a reaction of specific user actions.

2. Update Model.

Help is highly appriciated.

best,
mr.woolf
Re: programmatically create element in a View [message #200374 is a reply to message #200359] Tue, 05 August 2008 10:22 Go to previous messageGo to next message
Vadim Chepegin is currently offline Vadim ChepeginFriend
Messages: 9
Registered: July 2009
Junior Member
I think the problem can be reformulated:

How we can register an action (extention?) that can be triggered when the
user, for example, click a button?

This button is also created by us and it is not tool button or menu item.
Re: programmatically create element in a View [message #200587 is a reply to message #200374] Tue, 05 August 2008 16:27 Go to previous messageGo to next message
Seweryn Niemiec is currently offline Seweryn NiemiecFriend
Messages: 80
Registered: July 2009
Member
mr.woolf wrote:
> I think the problem can be reformulated:
>
> How we can register an action (extention?) that can be triggered when
> the user, for example, click a button?
>
> This button is also created by us and it is not tool button or menu item.

If it's neither tool button nor menu item so what it is?

Maybe this link will be useful for you:
http://wiki.eclipse.org/GMF_Tutorial_Part_3#Custom_Actions

Seweryn
Re: programmatically create element in a View [message #200620 is a reply to message #200587] Tue, 05 August 2008 19:43 Go to previous message
Vadim Chepegin is currently offline Vadim ChepeginFriend
Messages: 9
Registered: July 2009
Junior Member
Thanks for the hint. Unfortunately, it is not what I am looking for.

I have a button which is does not belong to the Palette. By clicking on
this button a user triggers certain actions which should result in
creating a new element on one of the diagrams.

So, what I do is like this:

PreferencesHint preferencesHint = new
PreferencesHint("preference__hint_id");
Node newNode = ViewService.createNode(view, "BLA", preferencesHint);

The question is how I can get this *view*, which has to be a root element
of a particular diagram?
Previous Topic:Modify diagram save as SVG
Next Topic:Replacing an element in your model
Goto Forum:
  


Current Time: Sat May 08 04:43:06 GMT 2021

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

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

Back to the top