edu.wpi.ebob.actions
Class EditPublicFieldAction

java.lang.Object
  extended by org.eclipse.jface.action.Action
      extended by org.eclipse.ui.actions.SelectionProviderAction
          extended by edu.wpi.ebob.actions.EditPublicFieldAction
All Implemented Interfaces:
org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelectionChangedListener

public class EditPublicFieldAction
extends org.eclipse.ui.actions.SelectionProviderAction

Handles the editing of public fields.

Author:
Liam Morley
See Also:
PropertiesView

Field Summary
private  org.eclipse.swt.custom.TreeEditor editor
          editor for the tree viewer's tree
private  ModifiableNode node
          the currently selected node; null if not modifiable.
private  org.eclipse.jface.viewers.TreeViewer viewer
          tree viewer for the inspect view
 
Fields inherited from interface org.eclipse.jface.action.IAction
AS_CHECK_BOX, AS_DROP_DOWN_MENU, AS_PUSH_BUTTON, AS_RADIO_BUTTON, AS_UNSPECIFIED, CHECKED, DESCRIPTION, ENABLED, HANDLED, IMAGE, RESULT, TEXT, TOOL_TIP_TEXT
 
Constructor Summary
EditPublicFieldAction(org.eclipse.jface.viewers.TreeViewer treeViewer)
          Associates this action with the given viewer.
 
Method Summary
private  ModifiableNode getNode(org.eclipse.jface.viewers.IStructuredSelection selection)
          gets the node currently selected in the viewer.
 void run()
          if the current selection in the tree is a public non-final field, an editable text field is placed over it.
 void selectionChanged(org.eclipse.jface.viewers.IStructuredSelection selection)
           
 
Methods inherited from class org.eclipse.ui.actions.SelectionProviderAction
dispose, getSelection, getSelectionProvider, getStructuredSelection, selectionChanged, selectionChanged
 
Methods inherited from class org.eclipse.jface.action.Action
addPropertyChangeListener, convertAccelerator, convertAccelerator, findKeyCode, findKeyString, findModifier, findModifierString, firePropertyChange, firePropertyChange, getAccelerator, getActionDefinitionId, getDescription, getDisabledImageDescriptor, getHelpListener, getHoverImageDescriptor, getId, getImageDescriptor, getMenuCreator, getStyle, getText, getToolTipText, isChecked, isEnabled, isHandled, notifyResult, removeAcceleratorText, removeMnemonics, removePropertyChangeListener, runWithEvent, setAccelerator, setActionDefinitionId, setChecked, setDescription, setDisabledImageDescriptor, setEnabled, setHelpListener, setHoverImageDescriptor, setId, setImageDescriptor, setMenuCreator, setText, setToolTipText
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

viewer

private org.eclipse.jface.viewers.TreeViewer viewer
tree viewer for the inspect view


editor

private org.eclipse.swt.custom.TreeEditor editor
editor for the tree viewer's tree


node

private ModifiableNode node
the currently selected node; null if not modifiable.

Constructor Detail

EditPublicFieldAction

public EditPublicFieldAction(org.eclipse.jface.viewers.TreeViewer treeViewer)
Associates this action with the given viewer.

Parameters:
treeViewer - the tree viewer in the Inspect view.
Method Detail

run

public void run()
if the current selection in the tree is a public non-final field, an editable text field is placed over it.

Specified by:
run in interface org.eclipse.jface.action.IAction
Overrides:
run in class org.eclipse.jface.action.Action
See Also:
IAction.run()

getNode

private ModifiableNode getNode(org.eclipse.jface.viewers.IStructuredSelection selection)
gets the node currently selected in the viewer.


selectionChanged

public void selectionChanged(org.eclipse.jface.viewers.IStructuredSelection selection)
Overrides:
selectionChanged in class org.eclipse.ui.actions.SelectionProviderAction
See Also:
SelectionProviderAction.selectionChanged(IStructuredSelection)