|What is the best approach to implement a palette with a tree view [message #1730970]
||Sun, 01 May 2016 08:01
| erwin de ley
Registered: August 2013
For Triquetrum the palette contents are defined through extensions that are interpreted to create our CreationFeature implementations and the palette hierarchy. In this way, anybody is able to extend our editor with extra workflow components.|
The underlying Ptolemy II framework already comes with many tens of components, so we need to be able to provide a palette with a potentially large number of entries, and organized in several levels of hierarchical groups.
For the moment we're still using the default palette view with drawers and tool entries, but this is not sufficient. It only allows a single level of groups, and when you have a large nr of groups the drawers take up too much screen space leaving almost no space left for showing/browsing the actual entries.
A palette tree view would be much better to handle our situation.
Can someone advise on the best approach to implement that in a Graphiti editor?
The palette in a Graphiti editor is defined through several "model" layers, via org.eclipse.gef.palette.PaletteEntry and org.eclipse.graphiti.palette.IPaletteEntry that are then used to construct a PaletteViewer with the standard edit parts for drawers and tools etc.
So I could imagine 3 possible approaches :
1. disable the standard editor palette completely and implement a totally new palette view ourselves, including the DnD, linking to selected editor etc.
(this is the approach I've taken before in the Triq-predecessor Passerelle)
2. build on GEF, i.e. replacing the default Graphiti approach, extending their model and using our own view representation
3. try to plug in a palette tree view on an extended Graphiti palette model and mechanisms
(One problem with options 2 and 3 is that the PaletteGroup class does not allow nesting groups, not in GEF nor in its Graphiti counterpart, so we need to extend the palette model structure with an own nestable group entry.)
Ideally I would like to try option 3 as :
- I would assume this would allow me to reuse existing palette control features as much as possible
- it might end up being of interest for other Graphiti users
But I could not identify the right way for either 2 or 3 yet...
Any advice, examples would be extremely welcome!
[Updated on: Tue, 03 May 2016 18:16]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.02689 seconds