org.openide.actions
Class AbstractCompileAction

java.lang.Object
  |
  +--org.openide.util.SharedClassObject
        |
        +--org.openide.util.actions.SystemAction
              |
              +--org.openide.util.actions.CallableSystemAction
                    |
                    +--org.openide.util.actions.NodeAction
                          |
                          +--org.openide.actions.AbstractCompileAction
All Implemented Interfaces:
Action, ActionListener, EventListener, Externalizable, Presenter, Presenter.Menu, Presenter.Popup, Presenter.Toolbar, Serializable
Direct Known Subclasses:
BuildAction, BuildAllAction, CleanAction, CleanAllAction, CompileAction, CompileAllAction

public abstract class AbstractCompileAction
extends NodeAction

Compilation action--compiles all selected nodes. Concrete subclasses must specify what type of compilation is needed (e.g. compile vs. build) and whether to operate recursively.

See Also:
org.openide.compiler, Serialized Form

Inner classes inherited from class org.openide.util.actions.Presenter
Presenter.Menu, Presenter.Popup, Presenter.Toolbar
 
Fields inherited from class org.openide.util.actions.SystemAction
PROP_ENABLED, PROP_ICON
 
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
AbstractCompileAction()
           
 
Method Summary
static boolean compile(Enumeration compileCookies, String name)
          Compile a number of files.
protected abstract  Class cookie()
          Get the requested cookie class.
static CompilerJob createJob(Enumeration en, Compiler.Depth depth)
          Create a job for compilation over a set of cookies.
protected abstract  Compiler.Depth depth()
          Get the depth the compiler compiles on.
protected  boolean enable(Node[] arr)
          Checks whether the depth is supported.
protected  String message()
          Message to display when the action is looking for object that should be processed.
protected  void performAction(Node[] activatedNodes)
          Perform the action based on the currently activated nodes.
 
Methods inherited from class org.openide.util.actions.NodeAction
actionPerformed, addNotify, getActivatedNodes, initialize, isEnabled, performAction, removeNotify, setEnabled, surviveFocusChange
 
Methods inherited from class org.openide.util.actions.CallableSystemAction
getMenuPresenter, getPopupPresenter, getToolbarPresenter
 
Methods inherited from class org.openide.util.actions.SystemAction
clearSharedData, createPopupMenu, createToolbarPresenter, get, getHelpCtx, getIcon, getIcon, getName, getValue, iconResource, linkActions, putValue, setIcon
 
Methods inherited from class org.openide.util.SharedClassObject
addPropertyChangeListener, equals, finalize, findObject, findObject, firePropertyChange, getLock, getProperty, hashCode, putProperty, putProperty, readExternal, removePropertyChangeListener, writeExternal, writeReplace
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.swing.Action
addPropertyChangeListener, removePropertyChangeListener
 

Constructor Detail

AbstractCompileAction

public AbstractCompileAction()
Method Detail

performAction

protected void performAction(Node[] activatedNodes)
Description copied from class: NodeAction
Perform the action based on the currently activated nodes. Note that if the source of the event triggering this action was itself a node, that node will be the sole argument to this method, rather than the activated nodes.
Overrides:
performAction in class NodeAction
Following copied from class: org.openide.util.actions.NodeAction
Parameters:
activatedNodes - current activated nodes, may be empty but not null

enable

protected boolean enable(Node[] arr)
Checks whether the depth is supported.
Overrides:
enable in class NodeAction
Following copied from class: org.openide.util.actions.NodeAction
Parameters:
activatedNodes - current activated nodes, may be empty but not null
Returns:
true to be enabled, false to be disabled

depth

protected abstract Compiler.Depth depth()
Get the depth the compiler compiles on.
Returns:
depth for the job that this compiler works on

cookie

protected abstract Class cookie()
Get the requested cookie class.
Returns:
the class, e.g. CompilerCookie.Compile

message

protected String message()
Message to display when the action is looking for object that should be processed.
Returns:
text to display at status line

createJob

public static CompilerJob createJob(Enumeration en,
                                    Compiler.Depth depth)
Create a job for compilation over a set of cookies.
Parameters:
en - enumeration of CompilerCookie
depth - the requested depth
Returns:
the compiler job

compile

public static boolean compile(Enumeration compileCookies,
                              String name)
Compile a number of files. Should actually be files, not directories (i.e. a zero depth will be used).
Parameters:
compileCookies - enumeration of CompilerCookie
name - name of the job to use
Returns:
true if compilation was successful, false if there was some sort of error


Built on December 12 2001.  |  Portions Copyright 1997-2001 Sun Microsystems, Inc. All rights reserved.