|Custom toolbar for plugin perspective [message #1838519]
||Sat, 27 February 2021 01:16
I am currently working on a plug-in project, in which I want to customize certain aspects of eclipse. I managed to add a perspective with some views, that get displayed fine in the runtime eclipse.
My problem is customization of the toolbar: I want to remove / rearrange some of the buttons of the "default" toolbar (org.eclipse.ui.main.toolbar), but I dont know how.
I am able to add elements to the toolbar via the org.eclipse.ui.menus extension point and adding a command in the plugin.xml (or add elements to the toolbar by using actionSets). But these get just added to the main toolbar, the default toolbar elements like 'open task' or 'search' remain.
Is there a way to remove (/hide ?) them using the plug-in project?
Or is it maybe possible to start with a entirely blank toolbar, where I just add the things I want?
To clarify this, I dont want to have any "really custom" elements in the toolbar, just things like 'run', 'debug', 'save', ... , that are already part of eclipse, so maybe the explicit definition of commands / actions isnt even necessary, since these actions are already "somewhere there" ?
I tried to manually customize the perspective in the runtime eclipse instance (Window -> Perspective -> Customize Perspective -> in the Toolbar Visibility tab (un-)checking the elements I want), which works fine and gives me the result I want. I think that such customizations are stored in "workspace/.metadata/.plugins/org.eclipse.ui.workbench/workbench.xmi", but I dont know, how I could programatically restore them from the workbench.xmi file, to use them permanently in the plugin definition.
As a code example I can give literally an empty plug-in project with just the eclipse-own "Hello world command contribution" sample and as we see, in the runtime eclipse instance the toolbar consists of more buttons than just the "Say hello world"-button defined in the plugin.xml:
<?xml version="1.0" encoding="UTF-8"?>
tooltip="Say hello world">
I also had a look at the Eclipse 4 application model that looks like I could define my toolbar using it, however my plugin is the ui plugin of a Xtext project, so I dont know, whether the e4 solution can be integrated there easily.
Any comments/suggestions on my thoughts would be nice,
Powered by FUDForum
. Page generated in 0.02203 seconds