Package kiyut.sketsa.actions

## Class AbstractEditorBooleanStateAction

- java.lang.Object
- - org.openide.util.SharedClassObject
  - - org.openide.util.actions.SystemAction
    - - org.openide.util.actions.BooleanStateAction
      - - kiyut.sketsa.actions.AbstractEditorBooleanStateAction

- All Implemented Interfaces:
    `ActionListener`, `Externalizable`, `Serializable`, `EventListener`, `Action`, `org.openide.util.actions.Presenter`, `org.openide.util.actions.Presenter.Menu`, `org.openide.util.actions.Presenter.Popup`, `org.openide.util.actions.Presenter.Toolbar`, `org.openide.util.HelpCtx.Provider`
  Direct Known Subclasses:
    `ShowGridAction`, `ShowRulerAction`, `SnapToGridAction`

      public abstract class AbstractEditorBooleanStateAction
      extends org.openide.util.actions.BooleanStateAction

  AbstractEditorAction which listen for the presence or absence of `SVGEditorCookie` on the `Lookup`, by default it listen the global lookup context
  Author:
    Kiyut
  See Also:
    Serialized Form

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.openide.util.actions.Presenter

      `org.openide.util.actions.Presenter.Menu, org.openide.util.actions.Presenter.Popup, org.openide.util.actions.Presenter.Toolbar`

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected org.openide.util.Lookup` | `context` | Lookup
    `protected SVGEditorCookie` | `editorCookie` | SVGEditorCookie
    `protected org.openide.util.LookupListener` | `editorCookieLookupListener` | Lookup Listener
    `protected org.openide.util.Lookup.Result<SVGEditorCookie>` | `result` | Lookup.Result

    - ### Fields inherited from class org.openide.util.actions.BooleanStateAction

      `PROP_BOOLEAN_STATE`

    - ### 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

    Constructors
    Constructor | Description
    --- | ---
    `AbstractEditorBooleanStateAction()` |

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `protected void` | `editorCookieLookupListenerResultChanged​(org.openide.util.LookupEvent evt)` | Listen for the presence or absence of `SVGEditorCookie` on the lookup and set the enabled state for this action.
    `org.openide.util.HelpCtx` | `getHelpCtx()` | Overidden to return HelpCtx.DEFAULT_HELP
    `JMenuItem` | `getMenuPresenter()` |
    `protected abstract void` | `propertyChange​(PropertyChangeEvent evt)` |
    `void` | `setBooleanState​(boolean value)` |
    `void` | `setEnabled​(boolean value)` |

    - ### Methods inherited from class org.openide.util.actions.BooleanStateAction

      `actionPerformed, getBooleanState, getPopupPresenter, getToolbarPresenter, initialize`

    - ### Methods inherited from class org.openide.util.actions.SystemAction

      `clearSharedData, createPopupMenu, createToolbarPresenter, get, getIcon, getIcon, getName, getValue, iconResource, isEnabled, linkActions, putValue, setIcon`

    - ### Methods inherited from class org.openide.util.SharedClassObject

      `addNotify, addPropertyChangeListener, equals, finalize, findObject, findObject, firePropertyChange, getLock, getProperty, hashCode, putProperty, putProperty, readExternal, removeNotify, 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

      `accept, addPropertyChangeListener, removePropertyChangeListener`

- - ### Field Detail

    - #### context

          protected org.openide.util.Lookup context

      Lookup

    - #### result

          protected org.openide.util.Lookup.Result<SVGEditorCookie> result

      Lookup.Result

    - #### editorCookieLookupListener

          protected org.openide.util.LookupListener editorCookieLookupListener

      Lookup Listener

    - #### editorCookie

          protected SVGEditorCookie editorCookie

      SVGEditorCookie

  - ### Constructor Detail

    - #### AbstractEditorBooleanStateAction

          public AbstractEditorBooleanStateAction()

  - ### Method Detail

    - #### getHelpCtx

          public org.openide.util.HelpCtx getHelpCtx()

      Overidden to return HelpCtx.DEFAULT_HELP
      Specified by:
        `getHelpCtx` in interface `org.openide.util.HelpCtx.Provider`
      Specified by:
        `getHelpCtx` in class `org.openide.util.actions.SystemAction`

    - #### propertyChange

          protected abstract void propertyChange​(PropertyChangeEvent evt)

    - #### editorCookieLookupListenerResultChanged

          protected void editorCookieLookupListenerResultChanged​(org.openide.util.LookupEvent evt)

      Listen for the presence or absence of `SVGEditorCookie` on the lookup and set the enabled state for this action. It also set the boolean state to false if editorCookie.isOpened() == false
      Parameters:
        `evt` - the Event

    - #### getMenuPresenter

          public JMenuItem getMenuPresenter()

      Specified by:
        `getMenuPresenter` in interface `org.openide.util.actions.Presenter.Menu`
      Overrides:
        `getMenuPresenter` in class `org.openide.util.actions.BooleanStateAction`

    - #### setBooleanState

          public void setBooleanState​(boolean value)

      Overrides:
        `setBooleanState` in class `org.openide.util.actions.BooleanStateAction`

    - #### setEnabled

          public void setEnabled​(boolean value)

      Specified by:
        `setEnabled` in interface `Action`
      Overrides:
        `setEnabled` in class `org.openide.util.actions.SystemAction`