Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Popup Menu / Image / Compartment
Popup Menu / Image / Compartment [message #59168] Wed, 04 October 2006 17:09 Go to next message
Eclipse UserFriend
Originally posted by: leonardo.coelho.siliconstrategy.com.br

Hi!!

I have a EClass that is represented by a node and an element inside a
compartment. They are the same class with subtle differences in
behaviour. And, of course, a strong difference in the interface.

I have 2 pallete buttons and I can represent them with different images,
no problem.

In the diagram, I can represent them with different images overriding
XXXItemProvider#getImage. Then, they are shown different in my diagram.

However, when we stop the cursor over a blank part of the diagram, it
appears a menu where I can choose one of the nodes to insert. And when
we stop the cursor over the compartment, it appears the mentioned
element (to be added to the compartment), but they have the same image!!!

I´d like to represent them with different images... one for the element
that can be added to the whole diagram and another to be inserted in a
specific compartment. Where can I set it??

Thx!!!

--

=============================/============================== ====
Leonardo Coelho
=============================/============================== =====
Re: Popup Menu / Image / Compartment [message #59218 is a reply to message #59168] Wed, 04 October 2006 18:10 Go to previous messageGo to next message
Michael Golubev is currently offline Michael GolubevFriend
Messages: 383
Registered: July 2009
Senior Member
Hi,

Try to set "icon" attributes for your element types in the plugin.xml.
Something like :

<specializationType
id="org.eclipse.uml2.diagram.clazz.Package_3006"
---> icon="/icons/full/obj16/Package.gif"
name="Package"
kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
edithelperadvice=" org.eclipse.uml2.diagram.clazz.edit.helpers.Package2EditHelp erAdvice ">
<specializes id="org.eclipse.uml2.diagram.clazz.Package_1000"/>
<param name="semanticHint" value="3006"/>
</specializationType>

Regards,
Michael

"Leonardo Coelho" <leonardo.coelho@siliconstrategy.com.br> wrote in message
news:eg0pmp$s0f$1@utils.eclipse.org...
> Hi!!
>
> I have a EClass that is represented by a node and an element inside a
> compartment. They are the same class with subtle differences in behaviour.
> And, of course, a strong difference in the interface.
>
> I have 2 pallete buttons and I can represent them with different images,
> no problem.
>
> In the diagram, I can represent them with different images overriding
> XXXItemProvider#getImage. Then, they are shown different in my diagram.
>
> However, when we stop the cursor over a blank part of the diagram, it
> appears a menu where I can choose one of the nodes to insert. And when we
> stop the cursor over the compartment, it appears the mentioned element (to
> be added to the compartment), but they have the same image!!!
>
> I
Re: Popup Menu / Image / Compartment [message #59243 is a reply to message #59218] Wed, 04 October 2006 19:12 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: leonardo.coelho.siliconstrategy.com.br

I´m sorry. I guess i didn´t get it... could you be more clear? which
plugin.xml? edit? diagram?

Have you got my problem? The popup menu I´ve mentioned is auto generated
by GMF to add elements to the diagram. It shows up when we stop moving
the cursor.

I´d like to control (programaticaly would be better) its images and use
it in a different fashion when we are inside a compartment.

Regards,

leo



Michael Golubev escreveu:
> Hi,
>
> Try to set "icon" attributes for your element types in the plugin.xml.
> Something like :
>
> <specializationType
> id="org.eclipse.uml2.diagram.clazz.Package_3006"
> ---> icon="/icons/full/obj16/Package.gif"
> name="Package"
> kind="org.eclipse.gmf.runtime.emf.type.core.IHintedType"
> edithelperadvice=" org.eclipse.uml2.diagram.clazz.edit.helpers.Package2EditHelp erAdvice ">
> <specializes id="org.eclipse.uml2.diagram.clazz.Package_1000"/>
> <param name="semanticHint" value="3006"/>
> </specializationType>
>
> Regards,
> Michael
>
> "Leonardo Coelho" <leonardo.coelho@siliconstrategy.com.br> wrote in message
> news:eg0pmp$s0f$1@utils.eclipse.org...
>> Hi!!
>>
>> I have a EClass that is represented by a node and an element inside a
>> compartment. They are the same class with subtle differences in behaviour.
>> And, of course, a strong difference in the interface.
>>
>> I have 2 pallete buttons and I can represent them with different images,
>> no problem.
>>
>> In the diagram, I can represent them with different images overriding
>> XXXItemProvider#getImage. Then, they are shown different in my diagram.
>>
>> However, when we stop the cursor over a blank part of the diagram, it
>> appears a menu where I can choose one of the nodes to insert. And when we
>> stop the cursor over the compartment, it appears the mentioned element (to
>> be added to the compartment), but they have the same image!!!
>>
>> I´d like to represent them with different images... one for the element
>> that can be added to the whole diagram and another to be inserted in a
>> specific compartment. Where can I set it??
>>
>> Thx!!!
>>
>> --
>>
>> =============================/============================== ====
>> Leonardo Coelho
>> =============================/============================== =====
>
>

--

=============================/============================== ====
Leonardo Coelho
=============================/============================== =====
Re: Popup Menu / Image / Compartment [message #59419 is a reply to message #59243] Thu, 05 October 2006 10:54 Go to previous message
Michael Golubev is currently offline Michael GolubevFriend
Messages: 383
Registered: July 2009
Senior Member
Hi,

Sorry, I had to be more clear.

I meant plugin.xml for diagram editor generated by GMF, extension
point="org.eclipse.gmf.runtime.emf.type.core.elementTypes".

I did not tried this myself. However I believe that this pseudo-popup menu
is created by the
org.eclipse.gmf.runtime.diagram.ui.editpolicies.PopupBaredit Policy class
that, in the populatePopupBars() method (lines 612-613) finds the image
using IconService.getInstance().getIcon((IElementType) type). This in turn
should be dispatched to the image specified in plugin.xml for element type
(if any).

Also please note that most probably this custom xml-definition will be
overwritten on each diagram regeneration, because JET actually does not
support merging for xml files. Would this work for you, than probably it
makes sense to submit scr to support optional ElementType's images in the
GMF GenModel.

Regards,
Michael



"Leonardo Coelho" <leonardo.coelho@siliconstrategy.com.br> wrote in message
news:eg10ud$te7$1@utils.eclipse.org...
> I
Previous Topic:Creating multiple diagrams for the same EMF model
Next Topic:GMF Modelling Beginner question
Goto Forum:
  


Current Time: Wed Jul 24 13:38:36 GMT 2024

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

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

Back to the top