Package org.eclipse.handly.ui.outline

# Class ToggleActionContribution

java.lang.Object
org.eclipse.handly.ui.outline.OutlineContribution
org.eclipse.handly.ui.outline.OutlineActionContribution
org.eclipse.handly.ui.outline.ToggleActionContribution

All Implemented Interfaces:
  `IOutlineContribution`

Direct Known Subclasses:
  `LexicalSortActionContribution`, `LinkWithEditorActionContribution`

public abstract class ToggleActionContribution extends OutlineActionContribution
An abstract base class for outline action contributions that toggle a boolean-valued preference.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ToggleActionContribution()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected abstract void`
  `configureAction(org.eclipse.jface.action.IAction action)`
  Hook to configure the contributed action (set its id, text, image, etc.) This method is called once, when this contribution is initializing.
  `protected final org.eclipse.jface.action.IAction`
  `createAction()`
  Returns a new action that is to be contributed to the outline page.
  `protected final void`
  `disposeAction(org.eclipse.jface.action.IAction action)`
  Disposes of the contributed action.
  `protected abstract IBooleanPreference`
  `getPreference()`
  Returns a boolean-valued preference that is to be toggled by the contributed action.

  ### Methods inherited from class org.eclipse.handly.ui.outline.OutlineActionContribution

  `contribute, dispose, getContributionManager, init`

  ### Methods inherited from class org.eclipse.handly.ui.outline.OutlineContribution

  `getOutlinePage`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### ToggleActionContribution

    public ToggleActionContribution()

- ## Method Details

  - ### createAction

    protected final org.eclipse.jface.action.IAction createAction()
    Description copied from class: `OutlineActionContribution`
    Returns a new action that is to be contributed to the outline page.
    Specified by:
      `createAction` in class `OutlineActionContribution`
    Returns:
      the created action, or `null`

  - ### disposeAction

    protected final void disposeAction(org.eclipse.jface.action.IAction action)
    Description copied from class: `OutlineActionContribution`
    Disposes of the contributed action.

    Default implementation does nothing. Subclasses may override.

    Overrides:
      `disposeAction` in class `OutlineActionContribution`
    Parameters:
      `action` - the action to dispose (never `null`)

  - ### getPreference

    protected abstract IBooleanPreference getPreference()
    Returns a boolean-valued preference that is to be toggled by the contributed action. May return `null`, in which case this contribution will be effectively disabled. This method is called once, when this contribution is initializing.
    Returns:
      the linked preference, or `null`

  - ### configureAction

    protected abstract void configureAction(org.eclipse.jface.action.IAction action)
    Hook to configure the contributed action (set its id, text, image, etc.) This method is called once, when this contribution is initializing.
    Parameters:
      `action` - the action to configure (never `null`)