![JAR search and dependency download from the Maven repository](/logo.png)
schema.decorators.exsd Maven / Gradle / Ivy
The newest version!
This extension point is used to add decorators to views that subscribe to a decorator manager. As of 2.1 there is the concept of a lightweight decorator that will handle the image management for the decorator. It is also possible to declare a lightweight decorator that simply overlays an icon when enabled that requires no implementation from the plug-in.
a fully qualified identifier of the target extension point
an optional identifier of the extension instance
an optional name of the extension instance
a unique name that will be used to identify this decorator.
a translatable name that will be used in the workbench window menu to represent this decorator.
a fully qualified name of a class which implements <samp>org.eclipse.jface.viewers.ILabelDecorator</samp>
if <b><i> lightweight</i></b> is false or <samp>org.eclipse.jface.viewers.ILightweightLabelDecorator</samp> if lightweight is true. The default value is false. If there is no <b><i>class</i></b> element it is assumed to be lightweight.
In the case where there is no decorator class this is said to be declarative. Declarative decorators with an enablement based on session properties, persistant properties or project description values (such as natures) will need to be updated explicitly when these values change using <code>IDecoratorManager#update()</code>.
a fully qualified name of a class which this decorator will be applied to. Deprecated in 2.1. Make this value part of the enablement.
a flag that indicates if types that can adapt to objects other than thier objectClass should use this object contribution.
For non-lightweight decorators, this flag only has an effect if objectClass adapts to IResource. For lightweight decorators, adaptability to any objectClass is supported as long as adaptability is defined through the adapter manager (see the class org.eclipse.runtime.IAdapterManager). Default value is false.
a flag that indicates if the decorator is on by default. Default value is false.
The lightweight flag indicates that the decorator is either
declarative or implements
<samp>org.eclipse.jface.viewers.ILightweightLabelDecorator</samp>.
if the decorator is <b><i>lightweight</i></b> and the <b><i>class</i></b> is not specified this is the path to the overlay image to apply
if the decorator is <b><i>lightweight</i></b> this is the location to apply the decorator to. Defaults to BOTTOM_RIGHT. A new possible value REPLACE was added in 3.4.
an optional subelement whose body should contain text providing a short description of the decorator. This will be shown in the Decorators preference page so it is recommended that this is included. Default value is an empty String.
2.0
The following are example of decorators:
<p>
A full decorator. The plug-in developer must handle their own image support.
</p>
<p>
<pre>
<extension point="org.eclipse.ui.decorators">
<decorator
id="com.xyz.decorator"
label="XYZ Decorator"
state="true"
class="com.xyz.DecoratorContributor">
<enablement>
<objectClass name="org.eclipse.core.resources.IResource"/>
</enablement>
</decorator>
</extension>
</pre>
</p>
<p>
A lightweight decorator. There is a concrete class but as it is an
ILightweightLabelDecorator it only needs to supply text and an ImageDescriptor and therefore needs no resource handling.
</p>
<p>
<pre>
<extension point="org.eclipse.ui.decorators">
<decorator
id="com.xyz.lightweight.decorator"
label="XYZ Lightweight Decorator"
state="false"
class="com.xyz.LightweightDecoratorContributor"
lightweight="true" >
<enablement>
<objectClass name="org.eclipse.core.resources.IResource"/>
</enablement>
</decorator>
</extension>
</pre>
</p>
<p>A declarative lightweight decorator. There is no concrete class so it
supplies an icon and a quadrant to apply that icon.
</p>
<p>
<pre>
<extension point="org.eclipse.ui.decorators">
<decorator
id="com.xyz.lightweight.declarative.decorator"
label="XYZ Lightweight Declarative Decorator"
state="false"
lightweight="true"
icon="icons/full/declarative.gif"
location="TOP_LEFT">
<enablement>
<objectClass name="org.eclipse.core.resources.IResource"/>
</enablement>
</decorator>
</extension>
</pre>
</p>
The value of the <samp>class</samp> attribute must be the fully qualified name of a class that implements <samp>org.eclipse.jface.viewers.ILabelDecorator</samp> (if lightweight is false) or <samp>org.eclipse.jface.viewers.ILightweightLabelDecorator</samp>. This class is loaded as late as possible to avoid loading the entire plug-in before it is really needed. Declarative decorators do not entail any plug-in activation and should be used whenever possible. Non-lightweight decorators will eventually be deprecated.
Plug-ins may use this extension point to add new decorators to be applied to views that use the decorator manager as their label decorator.
To use the decorator manager, use the result of IViewPart.getDecoratorManager() as the decorator for an instance of DecoratingLabelProvider.
This is currently in use by the Resource Navigator.
Copyright (c) 2002, 2005 IBM Corporation and others.<br>
All rights reserved. This program and the accompanying materials are made
available under the terms of the Eclipse Public License v1.0 which accompanies
this distribution, and is available at <a
href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>
© 2015 - 2025 Weber Informatics LLC | Privacy Policy