[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.gmf] Re: Change Popup Strings and Icons in Mindmap example

Upon further investigation, it does not seem possible to adjust the text and 
icons of a popup menu based on attributes in an EObject.  The icons are 
looked up based upon an EClass, not an EObject or instance of an EClass.  In 
the mindmap example, Depends, Extends, and Includes all share the same 
EClass (Relationship), meaning they all fetch identical text and icons for 
any popup menus.  So even though using OCL, the tooling and graphical 
definitions, I can assign different figures and tools to each of these 
relationships, there is no way to provide unique popup menus for using the 3 
different tools.  In my scenario, I have 14 different enum attribute values 
that have individual tooling, which would mean that the popup menus will 
have 14 identical appearing options that reference different tools!!! If I 
model these 14 different attribute values as 14 different classes, I can 
assign unique icons and text to the popup menus, but I lose flexibility in 
the way the user can edit and change the properties.

Is there a solution to this issue? It seems somebody out there would have 
run into this problem, especially since it exists in the Mindmap tutorial.

Thanks,
Joe

"Joe Dente" <jdente@xxxxxxxxxxxxxxxxxx> wrote in message 
news:fdet6o$fvi$1@xxxxxxxxxxxxxxxxxxxx
> Hi,
>
> Does anybody know how to change the icon and string that gets displayed in 
> hover/popup menus?
>
> In part 2 of the mindmap example, 
> http://wiki.eclipse.org/index.php/GMF_Tutorial_Part_2, there are 3 types 
> of relationships (depends, includes, and extends).  These relationships 
> are created by 3 seperate tools and distinguished by an enumeration as 
> explained in the tutorial.  There is a problem with this approach however. 
> Since there is a single class for all 3 types (depends, includes, and 
> extends), I cannot assign these 3 types unique icons and strings.  So if I 
> create a relationship without using the pallet, (by dragging an arrow from 
> one node to another node), the popup menu will ask me to "Create a 
> Relationship" three times and simply displays the generic Relationship 
> icon for all 3 options.  Instead, I would like this popup menu to say 
> something like "Create a DependsRelationship", "Create an 
> ExtendsRelationship", "Create an Includes Reltionship" and display custom 
> icons for each action.  This problem does not exist in the pallet, because 
> the pallet extracts names and icons from the tools.  The popup menus, 
> however, appear to extract names and icons from the edit and model code. 
> How can I customize the icons and strings in the popup menus depending on 
> an attribute value?
>
> Thanks,
> Joe
>