com.im.ijc.core/1 5.9.4

com.im.ijc.core.api.actions
Class AbstractIJCAction

java.lang.Object
  extended by org.openide.util.SharedClassObject
      extended by org.openide.util.actions.SystemAction
          extended by org.openide.util.actions.CallableSystemAction
              extended by org.openide.util.actions.NodeAction
                  extended by org.openide.util.actions.CookieAction
                      extended by com.im.ijc.core.api.actions.AbstractToolbarCookieAction
                          extended by com.im.ijc.core.api.actions.AbstractIJCAction
All Implemented Interfaces:
ActionListener, Externalizable, Serializable, EventListener, Action, Presenter, Presenter.Menu, Presenter.Popup, Presenter.Toolbar, ContextAwareAction, HelpCtx.Provider
Direct Known Subclasses:
AbstractIJCWidgetCookieAction, AbstractVertexStateCookieAction, DeleteRowsAction

public abstract class AbstractIJCAction
extends AbstractToolbarCookieAction

The main class in the IJC actions hierarchy. Usually an action in IJC wants to be either DFResultSet.VertexState or widget sensitive or both. That is it might listen on changes in which it is interested and implementations might conveniently set their enablement state and adjust their behaviour accordingly.

AbstractIJCAction can handle all cases. Implementations might tell their preference via AbstractIJCAction(boolean, boolean) constructor.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.im.ijc.core.api.actions.AbstractToolbarCookieAction
AbstractToolbarCookieAction.ToolBarAction
 
Nested classes/interfaces inherited from interface org.openide.util.actions.Presenter
Presenter.Menu, Presenter.Popup, Presenter.Toolbar
 
Field Summary
protected static String ALL_ICONS_PREFIX
           
 
Fields inherited from class org.openide.util.actions.CookieAction
MODE_ALL, MODE_ANY, MODE_EXACTLY_ONE, MODE_ONE, MODE_SOME
 
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, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
AbstractIJCAction()
          Delegates to AbstractIJCAction(boolean, boolean) with both arguments set to true.
AbstractIJCAction(boolean listenOnWidget, boolean listenOnVertexState)
          Constructor by which subclass might convey in what changes it is interested.
 
Method Summary
protected  void addListenerTo(IJCWidget widget, PropertyChangeListener selectionListener)
           
protected  boolean asynchronous()
           
protected  Class<?>[] cookieClasses()
           
 boolean enable(Node[] activatedNodes)
           
protected  boolean enableAccordingTo(DFResultSet.VertexState vs, IJCWidget widget)
           
protected  boolean enableOnlyInBrowseMode()
          Says whether an action should be enabled only in browse mode.
protected  boolean enableWhenNoResultSet()
           
protected  boolean enableWhenNoRows()
           
protected  boolean enableWhenNotBound()
           
protected static DFResultSet.VertexState findVS(Node[] activatedNodes)
           
protected static IJCWidget findWidget(Node[] activatedNodes)
           
 HelpCtx getHelpCtx()
           
protected static List<? extends Comparable<?>> getSelectedIds(DFResultSet.VertexState vs, IJCWidget widget)
           
protected static List<? extends Comparable<?>> getSelectedIdsSafely(String lockingMsg, DFResultSet.VertexState vs)
           
protected static List<? extends Comparable<?>> getSelectedIdsSafely(String lockingMsg, DFResultSet.VertexState vs, IJCWidget widget)
           
protected static SelectionDescription getSelection(DFResultSet.VertexState vs, IJCWidget widget)
           
protected  boolean isEventInteresting(PropertyChangeEvent evt)
           
protected  int mode()
           
protected  void removeListenerFrom(IJCWidget widget, PropertyChangeListener selectionListener)
           
protected  void updateEnabledState()
           
 
Methods inherited from class com.im.ijc.core.api.actions.AbstractToolbarCookieAction
getToolbarPresenter
 
Methods inherited from class org.openide.util.actions.CookieAction
createContextAwareInstance
 
Methods inherited from class org.openide.util.actions.NodeAction
actionPerformed, addNotify, getActivatedNodes, initialize, isEnabled, performAction, performAction, removeNotify, setEnabled, surviveFocusChange
 
Methods inherited from class org.openide.util.actions.CallableSystemAction
getMenuPresenter, getPopupPresenter
 
Methods inherited from class org.openide.util.actions.SystemAction
clearSharedData, createPopupMenu, createToolbarPresenter, get, 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, reset, 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, getValue, putValue, removePropertyChangeListener
 

Field Detail

ALL_ICONS_PREFIX

protected static final String ALL_ICONS_PREFIX
See Also:
Constant Field Values
Constructor Detail

AbstractIJCAction

public AbstractIJCAction()
Delegates to AbstractIJCAction(boolean, boolean) with both arguments set to true.


AbstractIJCAction

public AbstractIJCAction(boolean listenOnWidget,
                         boolean listenOnVertexState)
Constructor by which subclass might convey in what changes it is interested.

Parameters:
listenOnWidget - whether action should listen on widget changed
listenOnVertexState - whether action should listen on DFResultSet.VertexState changes
Method Detail

updateEnabledState

protected final void updateEnabledState()

isEventInteresting

protected boolean isEventInteresting(PropertyChangeEvent evt)

addListenerTo

protected void addListenerTo(IJCWidget widget,
                             PropertyChangeListener selectionListener)

removeListenerFrom

protected void removeListenerFrom(IJCWidget widget,
                                  PropertyChangeListener selectionListener)

mode

protected int mode()
Specified by:
mode in class CookieAction

cookieClasses

protected Class<?>[] cookieClasses()
Specified by:
cookieClasses in class CookieAction

getHelpCtx

public HelpCtx getHelpCtx()
Specified by:
getHelpCtx in interface HelpCtx.Provider
Specified by:
getHelpCtx in class SystemAction

enable

public boolean enable(Node[] activatedNodes)
Overrides:
enable in class AbstractToolbarCookieAction

enableAccordingTo

protected boolean enableAccordingTo(DFResultSet.VertexState vs,
                                    IJCWidget widget)

asynchronous

protected boolean asynchronous()
Overrides:
asynchronous in class CallableSystemAction

enableWhenNoRows

protected boolean enableWhenNoRows()

enableWhenNotBound

protected boolean enableWhenNotBound()

enableWhenNoResultSet

protected boolean enableWhenNoResultSet()

enableOnlyInBrowseMode

protected boolean enableOnlyInBrowseMode()
Says whether an action should be enabled only in browse mode.

Returns:
see description

getSelectedIdsSafely

protected static List<? extends Comparable<?>> getSelectedIdsSafely(String lockingMsg,
                                                                    DFResultSet.VertexState vs)

findVS

protected static DFResultSet.VertexState findVS(Node[] activatedNodes)

findWidget

protected static IJCWidget findWidget(Node[] activatedNodes)

getSelection

protected static SelectionDescription getSelection(DFResultSet.VertexState vs,
                                                   IJCWidget widget)

getSelectedIds

protected static List<? extends Comparable<?>> getSelectedIds(DFResultSet.VertexState vs,
                                                              IJCWidget widget)

getSelectedIdsSafely

protected static List<? extends Comparable<?>> getSelectedIdsSafely(String lockingMsg,
                                                                    DFResultSet.VertexState vs,
                                                                    IJCWidget widget)

com.im.ijc.core/1 5.9.4