问题
Similar to this question's screenshot, my RCP App has those annoying spaces between actions on the coolbar. My guess is that it's because I'm using deprecated extensions in the plugin.xml
(i.e. viewActions
actionSet
s).
For now, I don't want to begin changing all those action implementations to comply with the new rules (mostly because there are A LOT of those actions).
Question: Can I somehow apply CSS styling to that CoolBar
so that extra spaces are grabbed by the actions?
The road so far:
- NO e4 STUFF! This question does not satisfy mine.
- My other (similar) question. Feel free to complete that guy's answer.
- RAP CSS - does this apply to RCP as well?
回答1:
Looking at the debug plugin which does align the toolbar entries correctly it first defines a toolbar like this:
<extension
point="org.eclipse.ui.menus">
<menuContribution
locationURI="toolbar:org.eclipse.ui.main.toolbar?after=additions">
<toolbar
id="org.eclipse.debug.ui.main.toolbar"
label="%DebugActionSet.label">
<separator
name="breakpointGroup"
visible="true">
</separator>
<separator
name="threadGroup"
visible="true">
</separator>
<separator
name="stepGroup">
</separator>
<separator
name="stepIntoGroup">
</separator>
<separator
name="stepOverGroup">
</separator>
<separator
name="stepReturnGroup">
</separator>
<separator
name="emptyStepGroup">
</separator>
<separator
name="renderGroup"
visible="true">
</separator>
</toolbar>
</menuContribution>
and then in the actionSet
references the defined toolbar:
<action
toolbarPath="org.eclipse.debug.ui.main.toolbar/breakpointGroup"
... other stuff ...
id="org.eclipse.debug.ui.actions.SkipAllBreakpoints">
</action>
来源:https://stackoverflow.com/questions/20385974/eclipse-kepler-rcp-coolbar-actions-css