org.xnap.gui.action
Class ActionHelper

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

public class ActionHelper
extends java.lang.Object

This class provides a set of static actions.


Nested Class Summary
static interface ActionHelper.ActionExtractor
           
 
Field Summary
static javax.swing.Action copyAction
          Default clipboard copy action that operates on any JTextComponent.
static javax.swing.Action cutAction
          Default clipboard cut action that operates on any JTextComponent.
static javax.swing.Action pasteAction
          Default clipboard paste action that operates on any JTextComponent.
static javax.swing.Action pluginPreferencesDialogAction
           
 
Constructor Summary
ActionHelper()
           
 
Method Summary
static int addCommonActions(AbstractDynamicMenu jm, java.lang.Object[] object, ActionHelper.ActionExtractor ae)
           
static int addCommonActions(AbstractDynamicMenu jm, java.lang.Object[] object, ActionHelper.ActionExtractor ae, int startIndex)
          Uses the ActionExtractor to extract the common actions from all objects in the array and adds them to the AbstractDynamicMenu as temporaries.
static javax.swing.JComponent createMenuItem(javax.swing.Action action)
          MenuItem factory.
static void enqueueFiles(java.io.File[] files, boolean playFirst)
          Used by the Play...Actions for enqueueing files.
static java.util.Collection getCommonActions(java.lang.Object[] items, ActionHelper.ActionExtractor ae)
          Returns a collection of common actions in objects.
static boolean perform(javax.swing.Action[] actions, java.awt.event.ActionEvent event, java.lang.Class requiredInterface)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

copyAction

public static javax.swing.Action copyAction
Default clipboard copy action that operates on any JTextComponent.


cutAction

public static javax.swing.Action cutAction
Default clipboard cut action that operates on any JTextComponent.


pasteAction

public static javax.swing.Action pasteAction
Default clipboard paste action that operates on any JTextComponent.


pluginPreferencesDialogAction

public static javax.swing.Action pluginPreferencesDialogAction
Constructor Detail

ActionHelper

public ActionHelper()
Method Detail

addCommonActions

public static int addCommonActions(AbstractDynamicMenu jm,
                                   java.lang.Object[] object,
                                   ActionHelper.ActionExtractor ae,
                                   int startIndex)
Uses the ActionExtractor to extract the common actions from all objects in the array and adds them to the AbstractDynamicMenu as temporaries.

Returns:
-1, if nothing was added; the number of actions that were added to jm, otherwise

addCommonActions

public static int addCommonActions(AbstractDynamicMenu jm,
                                   java.lang.Object[] object,
                                   ActionHelper.ActionExtractor ae)

getCommonActions

public static java.util.Collection getCommonActions(java.lang.Object[] items,
                                                    ActionHelper.ActionExtractor ae)
Returns a collection of common actions in objects.


createMenuItem

public static javax.swing.JComponent createMenuItem(javax.swing.Action action)
MenuItem factory.


enqueueFiles

public static void enqueueFiles(java.io.File[] files,
                                boolean playFirst)
Used by the Play...Actions for enqueueing files. A thread is used if when array size surpasses 5 elements.

Parameters:
files - array of files to be enqueued
playFirst - play first file

perform

public static boolean perform(javax.swing.Action[] actions,
                              java.awt.event.ActionEvent event,
                              java.lang.Class requiredInterface)


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