Now that you have created the CustomLabelProvider,
you will want the CARMADeveloperView class to use
it. You will have to edit the createViewer method
to add the CustomLabelProvider object to the viewer.
To edit the CARMADeveloperView:
- Open the CARMADeveloperView, by double
clicking on the class in the view package of the com.ibm.carma.plugin.view Eclipse
plug-in project. It will open in the editor.
- You want to modify the createViewer method
so that it creates the view from the content provider and then adds
the CustomLabelProvider to the viewer. Ensure
your method looks the same as the source code below.
protected StructuredViewer createViewer(Composite parent)
{
/*
* Create the structure you want to be present in the view here.
* For this tutorial, the CARMA tree model will be used, similar to what is used in the CARMA Repositories view.
*/
CARMATreeViewer viewer = new CARMATreeViewer(parent);
viewer.setLabelProvider(new CustomLabelProvider());
return viewer;
}
- Save the source and debug any errors.