angrybobcat
angrybobcat

Reputation: 300

Programmatically activating existing label decorator from another plugin

I have a plugin which contributes a label decorator to org.ui.eclipse.decorators. I want this label decorator now to be inactive by default, which is achieved quite straight forward by setting its state-attribute to false.

Now to the point of my question: Is it possible to change the state of this decorator programmatically from another plugin? The User can check and uncheck this decorator from the global preferences, but can this also be achieved by another plugin?

Thanks in advance!

Upvotes: 2

Views: 226

Answers (1)

greg-449
greg-449

Reputation: 111142

You can enable (or disable) a decorator using:

IDecoratorManager manager = PlatformUI.getWorkbench().getDecoratorManager();

manager.setEnabled("decorator id", true);

Upvotes: 3

Related Questions