Question about palette [message #546056] |
Sat, 10 July 2010 09:09  |
Eclipse User |
|
|
|
Hi,
what I'd like to do is:
when the user select a diagram, I'd like to check the stereoype of the package used in the diagram to change the palette accordingly.
Is it possible to change the palette at runtime? If yes how?
How to catch the event of selecting the diagram?
Thank you in advance,
star123
|
|
|
|
Re: Question about palette [message #549050 is a reply to message #547283] |
Fri, 23 July 2010 17:15  |
Eclipse User |
|
|
|
Hi,
For a small tutorial about palette customization, you will find some documentation in the online help of Eclipse (Papyrus > user guide > palette customization or something equivalent)
This is the description of the runtime and plugin-based customization of the palette. Currently, in Papyrus, there is an implementation that listens to the profile applications, and depending on the applied profile in the model, switches the available palettes.
This is all based on listeners and preferences system. You will find some interesting classes in the org.eclipse.papyrus.diagram.common plugin, in the "service" package, especially the class org.eclipse.papyrus.diagram.common.service.PaletteProfileApp licationListener
This class is registered as a listener on the model modifications, tracking for profile application. As soon as a profile is applied or unapplied, it updates the palettes which are hidden or visible. Palettes are hidden using the preferences (see org.eclipse.papyrus.diagram.common.part.PapyrusPalettePrefer ences)
Hope this will help
Rémi
|
|
|
Re: Question about palette [message #602569 is a reply to message #547283] |
Fri, 23 July 2010 17:15  |
Eclipse User |
|
|
|
Hi,
For a small tutorial about palette customization, you will find some documentation in the online help of Eclipse (Papyrus > user guide > palette customization or something equivalent)
This is the description of the runtime and plugin-based customization of the palette. Currently, in Papyrus, there is an implementation that listens to the profile applications, and depending on the applied profile in the model, switches the available palettes.
This is all based on listeners and preferences system. You will find some interesting classes in the org.eclipse.papyrus.diagram.common plugin, in the "service" package, especially the class org.eclipse.papyrus.diagram.common.service.PaletteProfileApp licationListener
This class is registered as a listener on the model modifications, tracking for profile application. As soon as a profile is applied or unapplied, it updates the palettes which are hidden or visible. Palettes are hidden using the preferences (see org.eclipse.papyrus.diagram.common.part.PapyrusPalettePrefer ences)
Hope this will help
Rémi
--
http://www.eclipse.org/papyrus
|
|
|
Powered by
FUDForum. Page generated in 0.05663 seconds