This is a helper class for MapGraphics that should be toggled on and off. Some good candidates
are: Scalebar and legend.
This Example is the adding a Toggle action for LegendGraphic.
The following xml snippet must be added to the plugin.xml
<extension
point="org.eclipse.ui.actionSets">
<actionSet
id="net.refractions.udig.project.ui.mapGraphic.action"
label="MapGraphics"
visible="true">
<action
class="net.refractions.udig.legend.ui.actions.LegendAction"
id="net.refractions.udig.project.ui.action.addlegend"
label="Legend"
menubarPath="layer/mapGraphic.ext"
style="push"/>
</actionSet>
</extension>
The following class must be refered to by the xml snippet above(the class attribute)
public class LegendAction extends ActionDelegate implements IWorkbenchWindowActionDelegate {
protected Class getMapGraphicClass() {
return LegendGraphic.class;
}
protected String getExtensionID() {
return "legend"; //$NON-NLS-1$
}
public void init( IWorkbenchWindow window ) {
}
}
author: Jesse since: 1.1.0 |