Retrieving LightWeightDecorator from Decorator Manager [message #289980] |
Tue, 16 August 2005 09:20  |
Eclipse User |
|
|
|
Originally posted by: amabok3.yahoo.com.br
Hi!
I'm trying to apply a ligthweight decorator to some treeItems generated in
my code. I've declared the decorator im my plugin.xml file like this...
<extension
point="org.eclipse.ui.decorators">
<!-- class="com.myapp.platform.decorators.SimulatedDecorator"
SIMULATION DECORATOR -->
<decorator
id="myapp.platform.decorator.simulated"
label="Simulated Decorator"
state="true"
location="TOP_LEFT"
icon="icons/model/decorators/lock.gif"
lightweight="true">
<description>Shows decorator when simulated</description>
<enablement>
<objectClass name="com.myapp.platform.views.VPNetworkExplorer"/>
</enablement>
</decorator>
</extension>
... and im my code I try to get the decorator like this
IDecoratorManager man =
CPPlugin.getDefault().getWorkbench().getDecoratorManager();
and
System.out.println("Label decorator1: " +
man.getBaseLabelProvider("myapp.platform.decorator.simulated "));
or
(which is deprecated but I tried it anyway)
System.out.println("Label decorator2: " +
man.getLightweightLabelDecorator("myapp.platform.decorator.simulated "));
In each case I get a null in stdout, that is, I cant get the decorator
object.
Even if I only make the decorator declarative, I can't get it to overlay
the image over the TreeItem icon...
Can someone give me an hint of what is missin or incorrect.
Thanks in advance,
Amadeu
|
|
|
Re: Retrieving LightWeightDecorator from Decorator Manager [message #289985 is a reply to message #289980] |
Tue, 16 August 2005 09:59  |
Eclipse User |
|
|
|
Originally posted by: Michael_Valenta.oti.com
Have a look at the
WorkbenchLabelProvider.getDecoratingWorkbenchLabelProvider() method to see
an example of how to create a label provider that will use decorations.
Also, in some cases, you can just use the label provider returned by this
method (i.e. when the items in the view adapt to IWorkbenchAdaptable).
Michael
"Amadeu Dias" <amabok3@yahoo.com.br> wrote in message
news:096da23a57ffb0c212842f70466292fd$1@www.eclipse.org...
> Hi!
> I'm trying to apply a ligthweight decorator to some treeItems generated in
> my code. I've declared the decorator im my plugin.xml file like this...
>
>
> <extension point="org.eclipse.ui.decorators">
> <!-- class="com.myapp.platform.decorators.SimulatedDecorator" SIMULATION
> DECORATOR --> <decorator
> id="myapp.platform.decorator.simulated"
> label="Simulated Decorator"
> state="true"
> location="TOP_LEFT" icon="icons/model/decorators/lock.gif"
> lightweight="true">
>
> <description>Shows decorator when simulated</description>
> <enablement>
> <objectClass name="com.myapp.platform.views.VPNetworkExplorer"/>
> </enablement>
> </decorator> </extension>
>
> .. and im my code I try to get the decorator like this
>
>
> IDecoratorManager man =
> CPPlugin.getDefault().getWorkbench().getDecoratorManager();
>
> and
> System.out.println("Label decorator1: " +
> man.getBaseLabelProvider("myapp.platform.decorator.simulated "));
>
> or
> (which is deprecated but I tried it anyway)
> System.out.println("Label decorator2: " +
> man.getLightweightLabelDecorator("myapp.platform.decorator.simulated "));
>
>
> In each case I get a null in stdout, that is, I cant get the decorator
> object.
> Even if I only make the decorator declarative, I can't get it to overlay
> the image over the TreeItem icon...
> Can someone give me an hint of what is missin or incorrect.
>
> Thanks in advance,
>
> Amadeu
>
|
|
|
Powered by
FUDForum. Page generated in 0.03182 seconds