Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Create a figure without model representation in an existing GEF editor
Create a figure without model representation in an existing GEF editor [message #249235] Thu, 11 June 2009 07:45 Go to next message
Eclipse UserFriend
Originally posted by: alexia.allanic.atosorigin.com

Hi,

I want to create for a GEF editor without modifying it an action which
can add a figure (for example a rectangle).

I don't want to add my action in the palette but if possible in a menu.
The figure created doesn't have to be persisted in the diagram file.

Is This kind of action is possible ? And how can i realize it ?
Regards

Alexia
Re: Create a figure without model representation in an existing GEF editor [message #249267 is a reply to message #249235] Sat, 13 June 2009 01:01 Go to previous messageGo to next message
Ben Vitale is currently offline Ben VitaleFriend
Messages: 247
Registered: July 2009
Senior Member
You can certainly write an action that will just add a Figure without a
backing edit part or model. But then you will have to manage the state
of that figure yourself. Might be easier to use a model, but tweak
whatever serializes your model to not serialize that object. Perhaps
you would like to elaborate on the use case a bit?

Regarding the action itself, just read the platform developer guide on
how to put actions in menus. Then instantiate your action such that it
knows how to get a handle to the graphical viewer. The DeleteAction that
the Logic Example uses is one example of how to hook up a GEF type of
action.

Hope that helps
Ben

ALLANIC Alexia wrote:
> Hi,
>
> I want to create for a GEF editor without modifying it an action which
> can add a figure (for example a rectangle).
>
> I don't want to add my action in the palette but if possible in a menu.
> The figure created doesn't have to be persisted in the diagram file.
>
> Is This kind of action is possible ? And how can i realize it ?
> Regards
>
> Alexia
Re: Create a figure without model representation in an existing GEF editor [message #249285 is a reply to message #249267] Mon, 15 June 2009 10:01 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: alexia.allanic.atosorigin.com

Hi,

I have many GEF editors and I want to add a generic action which permits
to add a figure which mustn't be add on the model, the diagram file.

Ben Vitale a écrit :
> You can certainly write an action that will just add a Figure without a
> backing edit part or model. But then you will have to manage the state
> of that figure yourself. Might be easier to use a model, but tweak
> whatever serializes your model to not serialize that object. Perhaps
> you would like to elaborate on the use case a bit?
>
> Regarding the action itself, just read the platform developer guide on
> how to put actions in menus. Then instantiate your action such that it
> knows how to get a handle to the graphical viewer. The DeleteAction that
> the Logic Example uses is one example of how to hook up a GEF type of
> action.
>
> Hope that helps
> Ben
>
> ALLANIC Alexia wrote:
>> Hi,
>>
>> I want to create for a GEF editor without modifying it an action which
>> can add a figure (for example a rectangle).
>>
>> I don't want to add my action in the palette but if possible in a menu.
>> The figure created doesn't have to be persisted in the diagram file.
>>
>> Is This kind of action is possible ? And how can i realize it ?
>> Regards
>>
>> Alexia
Re: Create a figure without model representation in an existing GEF editor [message #249303 is a reply to message #249285] Tue, 16 June 2009 09:32 Go to previous message
Tristan Faure is currently offline Tristan FaureFriend
Messages: 460
Registered: July 2009
Senior Member
HI !
i work in the same team as Alexia

Actually we have a plugin which works with some Gef editors : GMF ...

we want to add a menu which permit to add a rectangle on any diagram
working for our plugin.

We have some possibilites :
1) designing a top level generic plugin which only works with gef
possibilites
2) designing a plugin with specific editor capacities

in both way we don't know how to add dynamically a figure which is not
expected by current editor

if somebody has a solution it could be a pleasure :)

Regards

Tristan FAURE

ALLANIC Alexia a écrit :
> Hi,
>
> I have many GEF editors and I want to add a generic action which
> permits to add a figure which mustn't be add on the model, the diagram
> file.
>
> Ben Vitale a écrit :
>> You can certainly write an action that will just add a Figure without
>> a backing edit part or model. But then you will have to manage the
>> state of that figure yourself. Might be easier to use a model, but
>> tweak whatever serializes your model to not serialize that object.
>> Perhaps you would like to elaborate on the use case a bit?
>>
>> Regarding the action itself, just read the platform developer guide
>> on how to put actions in menus. Then instantiate your action such
>> that it knows how to get a handle to the graphical viewer. The
>> DeleteAction that the Logic Example uses is one example of how to
>> hook up a GEF type of action.
>>
>> Hope that helps
>> Ben
>>
>> ALLANIC Alexia wrote:
>>> Hi,
>>>
>>> I want to create for a GEF editor without modifying it an action
>>> which can add a figure (for example a rectangle).
>>>
>>> I don't want to add my action in the palette but if possible in a menu.
>>> The figure created doesn't have to be persisted in the diagram file.
>>>
>>> Is This kind of action is possible ? And how can i realize it ?
>>> Regards
>>>
>>> Alexia




Previous Topic:Connect nodes via keyboard
Next Topic:[Announce] GEF 3.5.0 I200906051552 is available
Goto Forum:
  


Current Time: Fri Apr 26 13:14:33 GMT 2024

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

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

Back to the top