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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidSome change events might need to be authorized by all listeners before being processed by chordLeadSheetChanged().voidProcess the change.final org.openide.util.Lookupstatic CL_ContextActionSupportgetInstance(org.openide.util.Lookup context) If context == Utilities.actionsGlobalContext() return a shared instance.final CL_SelectionUtilitiesvoid
-
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:ClsChangeListenerSome change events might need to be authorized by all listeners before being processed by chordLeadSheetChanged().- Specified by:
authorizeChangein 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:ClsChangeListenerProcess the change.Note that this method might be called outside of the EDT.
- Specified by:
chordLeadSheetChangedin interfaceClsChangeListener
-