net.refractions.udig.mapgraphic
Class AbstractToggleMapGraphicAction

java.lang.Object
  extended by ActionDelegate
      extended by net.refractions.udig.mapgraphic.AbstractToggleMapGraphicAction
Direct Known Subclasses:
AddGridAction, ScalebarAction

public abstract class AbstractToggleMapGraphicAction
extends ActionDelegate

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 ) {
   }
 
 }
 

Since:
1.1.0
Author:
Jesse

Constructor Summary
AbstractToggleMapGraphicAction()
           
 
Method Summary
protected abstract  java.lang.String getExtensionID()
           
protected abstract  java.lang.Class<? extends MapGraphic> getMapGraphicClass()
           
 void init(IWorkbenchWindow window)
           
 void run(IAction action)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractToggleMapGraphicAction

public AbstractToggleMapGraphicAction()
Method Detail

run

public void run(IAction action)

getMapGraphicClass

protected abstract java.lang.Class<? extends MapGraphic> getMapGraphicClass()

getExtensionID

protected abstract java.lang.String getExtensionID()

init

public void init(IWorkbenchWindow window)