How to change the style of Mpart tab in RCP application by css?

287 views Asked by At

I have an application where I want to set the color of a tab dependent on the displayed data, using an id or a tag. I could only find examples on how to set the color of selected and unselected tabs. Is there another built in possibility for styling tabs, or will I need an own renderer?

Note:My partstack has so many mpart and for each mpart tab i want to set color depending on data.

1

There are 1 answers

0
greg-449 On BEST ANSWER

There isn't any way to do this with the standard CSS support.

You will have to use the e4 CSS swt-tab-renderer property to define a new tab renderer, probably based on the e4 org.eclipse.e4.ui.workbench.renderers.swt.CTabRendering renderer. Even then I think this will be difficult.

You also use the org.eclipse.e4.ui.css.core.propertyHandler extension point to define new CSS properties.

The org.eclipse.e4.ui.css.core.elementProvider extension point allows you to define new CSS pseudo classes (such as :active) but this might be difficult to use in this case because an element provider is already defined.