Hello,
2. I think you can also define an icon in the toolbox entry. Not sure why you would want that though. It seems logical to use the same icon for the toolbox and for the project browser. Anything else would seem confusing to me.
You must be very confused by EA's built-in toolboxes then. They use different icons for the browser and the toolbox all over the shop.
It's obvious in activities, but it's the same with classes, interfaces, etc etc.
The stereotype icon
<<>> should only ever be seen in the "Profile" toolbox. If it shows up in a toolbox from your technology, that's EA's way of telling you you've messed something up. Probably the icon file you're referring to couldn't be found or is in the wrong format. I believe EA prefers PNG for browser icons, and BMP for toolbox icons.
There are two icons associated with a stereotype: the browser icon, and the toolbox icon.
In a custom stereotype, if you specify an
icon attribute in the «stereotype» class, that will be used in both the browser and the toolbox. If you don't specify an icon, the defaults will be used.
If you want a different icon in the toolbox, like EA encourages, it's a bit of a mess. Actually, it's a lot of a mess.
Firstly, you can add an
icon attribute to the «stereotype» class of the toolbox, ie one that extends ToolboxPage. However, this applies to the whole toolbox page, not to an individual element or connector in it. So it really only works for "hidden" toolbox pages, which show just a single element/connector in the toolbox but then pop a menu in the diagram when the user would normally place the new element.
What you instead need to to is introduce a new «metaclass» class to the toolbox profile and name it ToolboxItemImage. You'll have to create it manually as I recall, it's not in the toolbox nor in the metaclass selection dialog. It should not have any attributes.
You then create one «stereotype» class for each element, stereotype or pattern where you want to specify the toolbox icon. This class must be named FQStereotypeName(FQMetatypeName). For a custom profile MyProfile with a stereotype mystereotype which extends a UML activity, this would be "MyProfile::mystereotype(UML::Activity)". It's the same as the name of the attribute in the toolbox page class. (So for patterns you specify not the profile name but the technology ID as the first part of the name.)
This «stereotype» class should have only an
icon attribute, which specifies the path to the toolbox icon.
All these extra elements go into the same toolbox profile, but have no connectors to any of the elements in there. Depending on how you work, you might put them in a separate diagram but they do need to be part of the same "published" toolbox profile.
For completeness, if you are working with "hidden" toolbox pages, it's a little messier still.
For those, the
icon attribute should go in the toolbox page «stereotype» classes as I mentioned. This means that those classes must extend ToolboxItemImage in addition to extending ToolboxPage.
The messiest case is where you want a toolbox-specific icon for a "hidden" toolbox (which becomes the popup menu) and you also want toolbox-specific icons for the menu items. In this case, you must add the
icon attribute to the toolbox page class and have it extend ToolboxItemImage, and you must also add a separate icon-only «stereotype» class for each menu item, also extending ToolboxItemImage.
If you are working with "hidden" toolboxes they should contain toolbox icons instead of browser icons (where those differ), because that's how EA does it.
So that's how to add custom toolbox icons. If you want to use custom browser stereotypes, but default toolbox stereotypes, the problem is that the toolbox will use your browser icon, and the toolbox images for the built-in stereotypes are not published anywhere.
One way of getting around this would be to capture the images you want from EA using whatever image-capture program you prefer, and then include them in the toolboxes as I've described. But this might well violate the license agreement.
Phew! You read all that?

HTH,
/Uffe