Class SS_ContextActionSupport

java.lang.Object
org.jjazz.ss_editor.api.SS_ContextActionSupport

public class SS_ContextActionSupport extends Object
A helper class to write SS_Editor context aware actions.

Listen to changes in the lookup context:
- RhyhmPart or SongPartParameter presence changes are notified to the registered SS_ContextActionListeners.

SS_ContextActionSupport instances are cached per lookup context. Only weak listeners are used: declaratively registered actions might be transient actions (e.g. ContextAwareAction instances).

  • Method Details

    • getInstance

      public static SS_ContextActionSupport getInstance(org.openide.util.Lookup context)
      Get the instance associated to the specified context.
      Parameters:
      context -
      Returns:
    • getContext

      public final org.openide.util.Lookup getContext()
      Returns:
      the Lookup context
    • getSelection

      public final SS_Selection getSelection()
      Returns:
      The latest selection.
    • addWeakSelectionListener

      public void addWeakSelectionListener(SS_ContextActionListener listener)
    • removeWeakListener

      public void removeWeakListener(SS_ContextActionListener listener)