## com.ibm.lab.soln.contributions
Class TextEditorWordCountAction

    java.lang.Object
      |
      +--com.ibm.lab.soln.contributions.TextEditorWordCountAction

All Implemented Interfaces:
  org.eclipse.ui.IActionDelegate, org.eclipse.ui.IEditorActionDelegate

public class TextEditorWordCountAction
extends java.lang.Object
implements org.eclipse.ui.IEditorActionDelegate

A Workbench toolbar action is defined that counts the words in the selected area of a text file.

See Also:
  `IEditorActionDelegate`

Constructor Summary
`TextEditorWordCountAction()`

Method Summary
`void` | `run(org.eclipse.jface.action.IAction action)` Counts the words in the selected text and displays the result in a dialog
`void` | `selectionChanged(org.eclipse.jface.action.IAction action, org.eclipse.jface.viewers.ISelection selection)` Enables the action if text has been selected, otherwise, the action is disabled.
`void` | `setActiveEditor(org.eclipse.jface.action.IAction action, org.eclipse.ui.IEditorPart targetEditor)` Saves a reference to the current active editor

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### TextEditorWordCountAction

    public TextEditorWordCountAction()

Method Detail

### run

    public void run(org.eclipse.jface.action.IAction action)

  Counts the words in the selected text and displays the result in a dialog
  Specified by:
    `run` in interface `org.eclipse.ui.IActionDelegate`
  See Also:
    `IActionDelegate.run(IAction)`

### selectionChanged

    public void selectionChanged(org.eclipse.jface.action.IAction action,
                                 org.eclipse.jface.viewers.ISelection selection)

  Enables the action if text has been selected, otherwise, the action is disabled.
  Specified by:
    `selectionChanged` in interface `org.eclipse.ui.IActionDelegate`
  See Also:
    `IActionDelegate.selectionChanged(IAction, ISelection)`

### setActiveEditor

    public void setActiveEditor(org.eclipse.jface.action.IAction action,
                                org.eclipse.ui.IEditorPart targetEditor)

  Saves a reference to the current active editor
  Specified by:
    `setActiveEditor` in interface `org.eclipse.ui.IEditorActionDelegate`
  See Also:
    `IEditorActionDelegate.setActiveEditor(IAction, IEditorPart)`