Package org.jjazz.cl_editor.api
Class CL_ContextActionSupport
java.lang.Object
org.jjazz.cl_editor.api.CL_ContextActionSupport
- All Implemented Interfaces:
ClsChangeListener
A helper class to write CL_Editor context aware actions.
Listen to ChordLeadSheetItem, SelectedBar, ChordLeadSheet presence in the lookup. Listen to the "present" ChordLeadSheet property changes. Fire the corresponding events to listeners.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
Some change events might need to be authorized by all listeners before being processed by chordLeadSheetChanged().void
Process the change.final org.openide.util.Lookup
static CL_ContextActionSupport
getInstance
(org.openide.util.Lookup context) If context == Utilities.actionsGlobalContext() return a shared instance.final CL_SelectionUtilities
void
-
Constructor Details
-
CL_ContextActionSupport
public CL_ContextActionSupport(org.openide.util.Lookup context)
-
-
Method Details
-
getInstance
If context == Utilities.actionsGlobalContext() return a shared instance. Otherwise return a new specific object.- Parameters:
context
-- Returns:
-
getContext
public final org.openide.util.Lookup getContext()- Returns:
- the Lookup context
-
getSelection
- Returns:
- The latest selection.
-
addListener
-
removeListener
-
authorizeChange
Description copied from interface:ClsChangeListener
Some change events might need to be authorized by all listeners before being processed by chordLeadSheetChanged().- Specified by:
authorizeChange
in interfaceClsChangeListener
- Parameters:
e
- The change to authorize.- Throws:
UnsupportedEditException
- Listener shall throw this exception if change is not acceptable. Exception message might be shown to user to explain the problem.
-
chordLeadSheetChanged
Description copied from interface:ClsChangeListener
Process the change.Note that this method might be called outside of the EDT.
- Specified by:
chordLeadSheetChanged
in interfaceClsChangeListener
-