com.groovemanager.actions.file
Class FileNewAction

java.lang.Object
  extended by org.eclipse.jface.action.Action
      extended by com.groovemanager.actions.file.FileNewAction
All Implemented Interfaces:
org.eclipse.jface.action.IAction

public class FileNewAction
extends org.eclipse.jface.action.Action

This subclass of Action is used to create a new file. When performed, an instance of this class will do nothing else than notify all registeres FileNewListeners that a new file should be created.

Author:
Manu Robledo

Field Summary
private  java.util.ArrayList listeners
          List of FileNewListeners registered with this Action
 
Fields inherited from interface org.eclipse.jface.action.IAction
AS_CHECK_BOX, AS_DROP_DOWN_MENU, AS_PUSH_BUTTON, AS_RADIO_BUTTON, AS_UNSPECIFIED, CHECKED, DESCRIPTION, ENABLED, IMAGE, TEXT, TOOL_TIP_TEXT
 
Constructor Summary
FileNewAction(java.lang.String text)
          Constructs a new FileNewAction with the given name
FileNewAction(java.lang.String text, org.eclipse.jface.resource.ImageDescriptor image)
          Constructs a new FileNewAction with the given name and the given image.
FileNewAction(java.lang.String text, int style)
          Constructs a new FileNewAction with the given name using the given style constant
 
Method Summary
 void addFileNewListener(FileNewListener listener)
          Register a FileNewListener with this Action.
 void removeFileNewListener(FileNewListener listener)
          Remove a registered FileNewListener from this Action
 void run()
          Perform this Action.
 
Methods inherited from class org.eclipse.jface.action.Action
addPropertyChangeListener, convertAccelerator, convertAccelerator, findKeyCode, findKeyString, findModifier, findModifierString, firePropertyChange, firePropertyChange, getAccelerator, getActionDefinitionId, getDescription, getDisabledImageDescriptor, getHelpListener, getHoverImageDescriptor, getId, getImageDescriptor, getMenuCreator, getStyle, getText, getToolTipText, isChecked, isEnabled, removeAcceleratorText, removePropertyChangeListener, runWithEvent, setAccelerator, setActionDefinitionId, setChecked, setDescription, setDisabledImageDescriptor, setEnabled, setHelpListener, setHoverImageDescriptor, setId, setImageDescriptor, setMenuCreator, setText, setToolTipText
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

listeners

private java.util.ArrayList listeners
List of FileNewListeners registered with this Action

Constructor Detail

FileNewAction

public FileNewAction(java.lang.String text)
Constructs a new FileNewAction with the given name

Parameters:
text - This Action´s name

FileNewAction

public FileNewAction(java.lang.String text,
                     org.eclipse.jface.resource.ImageDescriptor image)
Constructs a new FileNewAction with the given name and the given image.

Parameters:
text - This Action´s name
image - This Action´s image

FileNewAction

public FileNewAction(java.lang.String text,
                     int style)
Constructs a new FileNewAction with the given name using the given style constant

Parameters:
text - This Action´s name
style - The style constant to be used by this Action
Method Detail

addFileNewListener

public void addFileNewListener(FileNewListener listener)
Register a FileNewListener with this Action.

Parameters:
listener - The FileNewListener to register

removeFileNewListener

public void removeFileNewListener(FileNewListener listener)
Remove a registered FileNewListener from this Action

Parameters:
listener - The FileNewListener to remove.

run

public void run()
Perform this Action. All registered FileNewListeners will be notified that a new file should be opened.

Specified by:
run in interface org.eclipse.jface.action.IAction
Overrides:
run in class org.eclipse.jface.action.Action
See Also:
IAction.run()