Wednesday, July 19, 2006

Label Decorators in a Common Navigator Framework viewer

I just posted these comments elsewhere on label decorators, and thought they might be useful to the general audience for the Common Navigator Framework.

If you check out the org.eclipse.ui.tests.navigator plugin from Eclipse CVS repository, there's a simple example of using a lightweight decorator there. (There are instructions on using Eclipse with CVS, which also documents the repository paths.)

The extension looks like:
<!-- Verify decorator extension: Adds ">>" to Test Items that end in "3" -->
<extension point="org.eclipse.ui.decorators">
<decorator class="org.eclipse.ui.tests.navigator.extension.TestLabelDecorator"
id="org.eclipse.ui.tests.navigator.threeDecorator"
label="Items that end in 3 decorator"
lightweight="false"
state="true">
<enablement>
<objectclass
name="org.eclipse.ui.tests.navigator.extension.TestExtensionTreeData" />
</enablement>
</decorator>
</extension>
And the type must implement ILabelDecorator:


import org.eclipse.jface.viewers.ILabelDecorator;
import org.eclipse.jface.viewers.ILabelProviderListener;

public class TestLabelDecorator implements ILabelDecorator
There's an FAQ on label decorators, as well as an article with more detail. Right off, I don't think this topic would merit a full article in this series on contributing label decorators to Common Navigator Framework viewers, so if you think there's enough need out there, chime in!

Sunday, July 16, 2006

PDF versions now available!

Some readers have requested PDF versions of the CNF articles. After some investigation of some pointers from Brian Fitzpatrick, I decided to go with PrimoPDF. The content of each article is roughly unchanged, excluding some minor formatting adjustments.

I have attached versions of the existing articles below, as well as comments to the original posts.

Building a Common Navigator Framework Viewer
What does the Common Navigator Framework help me do? (*.pdf) (original post)

Once a few more of the foundations of building CNF viewers are covered, I will integrate these articles into a more coherent organization and prepose them as Eclipse Corner articles. The links above point to attachments on Bug 143127: [CommonNavigator] Examples.

Thursday, July 13, 2006

It takes a village


With some great help from the community, part of the series is no longer necessary. Aashish Patil has prepared an article on rendering Non-Resource content in a Common Navigator Framework viewer.

Anybody else want to step in to help?


For anyone that decides to jump in, feel free to either build the example in the org.eclipse.ui.examples.navigator plugin in the Eclipse CVS repository (check out as anonymous, generate a patch, and attach it to bug 143127). There are also some instructions on using Eclipse with CVS, which also documents the repository paths.

Or you can just build a complete example as Aashish did, and then attach it to bug 143127: [CommonNavigator] Examples as a zip file to make it available to the community.

Thanks Aashish!