org.xnap.gui.action
Class FileActionManager

java.lang.Object
  extended by org.xnap.gui.action.FileActionManager

public class FileActionManager
extends java.lang.Object

Provides a helper class for the file actions. All PasteFileAction should call addPasteListener(javax.swing.Action) to get enabled or disabled when actions are pending.

All calls to this class need to be swing synchronized.

See Also:
CopyFileAction, CutFileAction, PasteFileAction

Field Summary
static int ACTION_COPY
          The action type for a copy operation.
static int ACTION_DO_NOTHING
          The action type for no pending action.
static int ACTION_MOVE
          The action type for a move operation.
 
Method Summary
static void addPasteListener(javax.swing.Action action)
          Adds a listener.
static int getAction()
          Returns the pending action.
static java.io.File[] getFiles()
          Returns the pending File objects.
static void setFiles(java.io.File[] files, int action)
          Sets the File objects and action that a subsequent PasteFileAction would perform.
static void unsetFiles()
          Cancels the pending action.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ACTION_DO_NOTHING

public static final int ACTION_DO_NOTHING
The action type for no pending action.

See Also:
Constant Field Values

ACTION_COPY

public static final int ACTION_COPY
The action type for a copy operation.

See Also:
Constant Field Values

ACTION_MOVE

public static final int ACTION_MOVE
The action type for a move operation.

See Also:
Constant Field Values
Method Detail

addPasteListener

public static void addPasteListener(javax.swing.Action action)
Adds a listener. The action object will be enabled, when an action is pending and disabled after the paste action has been performed.


getAction

public static int getAction()
Returns the pending action.

Returns:
the action type

getFiles

public static java.io.File[] getFiles()
Returns the pending File objects.


setFiles

public static void setFiles(java.io.File[] files,
                            int action)
Sets the File objects and action that a subsequent PasteFileAction would perform.


unsetFiles

public static void unsetFiles()
Cancels the pending action.



Copyright © 2001-2005 XNap Team. All Rights Reserved.