|Draggable, splittable tabs (just like workbench) on any Composite. [message #755298]
||Mon, 07 November 2011 18:48
| Ned Twigg
Registered: October 2010
I am a huge fan of the Eclipse tabs. It is very intuitive to move tabs around, split a single tab into two tabs, switch side-by-side to top-and-bottom, etc. This functionality is implemented in Eclispe by PartSashContainer, LayoutPart, etc.|
I wish that I could use this tab functionality on any generic Composite. I have had projects in the past where I really wished that there was a FlexiTabContainer class that needed only a Composite in its constructor, which gave me part of the visual functionality of the Eclipse workbench, without requiring me to go full RCP.
For my current project, the product could be made much better if I had such a class, so that I could have draggable tabs within a single editor (the project is already RCP, so I don't mind workbench dependency, although I think it would be better to remove it entirely). So I dug into the eclipse workbench infrastructure, and tried to hack the existing org.eclipse.ui.workbench plugin to do this.
I did this by creating a project org2.eclipse.ui.workbench, which is the original workbench plugin renamed to org2. Then I created another project, org2.eclipse.ui.workbench.modified. Finally, I made a project org2.eclipse.unofficial.flexitabs, which tries to provide a generic tab interface, and depends on org2.eclipse.ui.workbench.modified.
I'd like to do this without modifying the workbench plugin at all, but some of the abstract classes in the plugin have only package access, so I have had to change the visibility of some members to public in order to extend the functionality. By having both the modified and unmodified plugins, I can always compare them to make sure I haven't made any unnecessary changes, in case it turns out that there's a way to do it without any changes at all. The core of the problem is stubbing out WorkbenchPage, and implementing the various LayoutParts that currently have Editor and View implementations.
After bashing around at it for a week, I have gotten stuck. I now have a test that runs, and the PartSashContainer creates PartSash and PartPane objects, but they don't display anything.
Is anybody interested in working on this with me / already done this? In case there are (and to make it easier to look at what I've done so far), I've put it up on Google Code for now. If we do a good job perhaps it can get rolled into SWT or Nebula as a semi-standard widget.
Powered by FUDForum
. Page generated in 0.05158 seconds