net.refractions.udig.project.ui.tool
Class AbstractActionTool

java.lang.Object
  extended by net.refractions.udig.project.ui.tool.AbstractActionTool
All Implemented Interfaces:
ActionTool, Tool

public abstract class AbstractActionTool
extends java.lang.Object
implements ActionTool

Abstract class for action tools.

Since:
UDIG 1.1
Author:
Vitalus

Field Summary
protected  IToolContext context
          Tool context.
 
Fields inherited from interface net.refractions.udig.project.ui.tool.Tool
EDIT, EXTENSION_ID, VIEW
 
Constructor Summary
AbstractActionTool()
           
 
Method Summary
 void addListener(ToolLifecycleListener listener)
          Adds listener of tool's lifecycle.
 IToolContext getContext()
          Returns the AbstractContext that a tool can use in its operations.
 java.lang.Object getProperty(java.lang.String key)
          Returns the property of the particular tool implementation.
 boolean isEnabled()
          Returns enablement statement of the tool.
 void removeListener(ToolLifecycleListener listener)
          Removes a listener of tool's lifecycle.
 void setContext(IToolContext toolContext)
          Called each time an eclipse editor is activated.
 void setEnabled(boolean enabled)
          Sets enablement of the tool.
 void setProperty(java.lang.String key, java.lang.Object value)
          Sets the tool's property value by key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.refractions.udig.project.ui.tool.ActionTool
run
 
Methods inherited from interface net.refractions.udig.project.ui.tool.Tool
dispose
 

Field Detail

context

protected IToolContext context
Tool context.

Constructor Detail

AbstractActionTool

public AbstractActionTool()
Method Detail

setContext

public void setContext(IToolContext toolContext)
Description copied from interface: Tool
Called each time an eclipse editor is activated. The RenderManager and ViewportPane are those that are associated with the newly actived Eclipse view. Intended to be used if something other just changing the current state happens. if false the tool is set as inactive and deregistered with the component.

Specified by:
setContext in interface Tool
Parameters:
toolContext - The tools that the tool can use in its operations
See Also:
net.refractions.udig.project.ui.tool.Tool#setContext(net.refractions.udig.project.ui.tool.ToolContext)

getContext

public IToolContext getContext()
Description copied from interface: Tool
Returns the AbstractContext that a tool can use in its operations.

Specified by:
getContext in interface Tool
Returns:
the AbstractContext that a tool can use in its operations.
See Also:
Tool.getContext()

getProperty

public java.lang.Object getProperty(java.lang.String key)
Description copied from interface: Tool
Returns the property of the particular tool implementation.

Specified by:
getProperty in interface Tool
Parameters:
key - the property key.
Returns:
See Also:
net.refractions.udig.project.ui.tool.Tool#getProperty()

setProperty

public void setProperty(java.lang.String key,
                        java.lang.Object value)
Description copied from interface: Tool
Sets the tool's property value by key.

Specified by:
setProperty in interface Tool
See Also:
net.refractions.udig.project.ui.tool.Tool#setProperty()

isEnabled

public boolean isEnabled()
Description copied from interface: Tool
Returns enablement statement of the tool.

Specified by:
isEnabled in interface Tool
Returns:

setEnabled

public void setEnabled(boolean enabled)
Description copied from interface: Tool
Sets enablement of the tool.

Specified by:
setEnabled in interface Tool

addListener

public void addListener(ToolLifecycleListener listener)
Description copied from interface: Tool
Adds listener of tool's lifecycle.

Specified by:
addListener in interface Tool

removeListener

public void removeListener(ToolLifecycleListener listener)
Description copied from interface: Tool
Removes a listener of tool's lifecycle.

Specified by:
removeListener in interface Tool