Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Retrieving LightWeightDecorator from Decorator Manager
Retrieving LightWeightDecorator from Decorator Manager [message #289980] Tue, 16 August 2005 09:20 Go to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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
>
Previous Topic:A question about Tree and TreeColumns
Next Topic:OleFrame and Form problem ...
Goto Forum:
  


Current Time: Thu May 29 04:03:13 EDT 2025

Powered by FUDForum. Page generated in 0.03182 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top