Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-ui-dev] Correct way to access IWorkbenchThemeConstants

I am writing an Eclipse plugin which includes a tabbed UI. I would like to apply the correct colours to my CTabFolder object to match the current Eclipse theme.

I have come up with the following code fragment to get the correct colour object.

IWorkbench workBench = PlatformUI.getWorkbench();
ITheme theme = workBench.getThemeManager().getCurrentTheme();
ColorRegistry colreg = theme.getColorRegistry();

@SuppressWarnings("restriction")
Color c1 = colreg.get(IWorkbenchThemeConstants.ACTIVE_TAB_BG_START);

However, this causes a compiler warning as IWorkbenchThemeConstants is in an internal package. Is there a public way to access this colour information?

Back to the top