edu.wpi.ebob.views
Class PropertiesView

java.lang.Object
  extended by org.eclipse.ui.part.WorkbenchPart
      extended by org.eclipse.ui.part.ViewPart
          extended by edu.wpi.ebob.views.PropertiesView
All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable, org.eclipse.core.runtime.IExecutableExtension, org.eclipse.ui.IPersistable, org.eclipse.ui.ISelectionListener, org.eclipse.ui.IViewPart, org.eclipse.ui.IWorkbenchPart, org.eclipse.ui.IWorkbenchPart2, org.eclipse.ui.part.IWorkbenchPartOrientation

public class PropertiesView
extends org.eclipse.ui.part.ViewPart
implements org.eclipse.ui.ISelectionListener

This view represents the result of inspecting an instance.


Field Summary
private  Instance currentInstance
           
private  org.eclipse.ui.part.DrillDownAdapter drillDownAdapter
           
private  EditPublicFieldAction editFieldsAction
           
private  org.eclipse.swt.widgets.Label emptySelectionLabel
          shown when there is no selection in the Object Bench View.
private static int LABEL_MARGIN_HEIGHT
          the margin height to use when displaying emptySelectionLabel.
private static int LABEL_MARGIN_WIDTH
          the margin width to use when displaying emptySelectionLabel.
private  org.eclipse.swt.custom.StackLayout layout
          the layout for the view.
private  org.eclipse.swt.widgets.Composite panel
          a reference to the parent composite.
private  org.eclipse.core.runtime.Preferences.IPropertyChangeListener prefChangeListener
           
private  org.eclipse.jface.viewers.TreeViewer viewer
          the viewer for the view.
 
Fields inherited from interface org.eclipse.ui.IWorkbenchPart
PROP_TITLE
 
Constructor Summary
PropertiesView()
           
 
Method Summary
private  void createEmptySelectionLabel()
           
 void createPartControl(org.eclipse.swt.widgets.Composite parent)
          This is a callback that will allow us to create the viewer and initialize it.
private  void createViewer()
          creates the TableTreeViewer for this view.
 void dispose()
          removes the selection listener and the preference listener.
private  void fillLocalToolBar(org.eclipse.jface.action.IToolBarManager manager)
           
private  void hookContextMenu()
           
 void init(org.eclipse.ui.IViewSite site)
           
 void refresh()
          Refreshes the view.
 void selectionChanged(org.eclipse.ui.IWorkbenchPart part, org.eclipse.jface.viewers.ISelection selection)
          listens to changes in the ObjBenchView.
 void setFocus()
          Passing the focus request to the viewer's control.
 
Methods inherited from class org.eclipse.ui.part.ViewPart
checkSite, getViewSite, init, saveState, setContentDescription, setInitializationData, setPartName
 
Methods inherited from class org.eclipse.ui.part.WorkbenchPart
addPropertyListener, firePropertyChange, getAdapter, getConfigurationElement, getContentDescription, getDefaultImage, getOrientation, getPartName, getSite, getTitle, getTitleImage, getTitleToolTip, removePropertyListener, setSite, setTitle, setTitleImage, setTitleToolTip, showBusy
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.ui.IWorkbenchPart
addPropertyListener, getSite, getTitle, getTitleImage, getTitleToolTip, removePropertyListener
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 

Field Detail

LABEL_MARGIN_HEIGHT

private static final int LABEL_MARGIN_HEIGHT
the margin height to use when displaying emptySelectionLabel.

See Also:
Constant Field Values

LABEL_MARGIN_WIDTH

private static final int LABEL_MARGIN_WIDTH
the margin width to use when displaying emptySelectionLabel.

See Also:
Constant Field Values

drillDownAdapter

private org.eclipse.ui.part.DrillDownAdapter drillDownAdapter

editFieldsAction

private EditPublicFieldAction editFieldsAction

emptySelectionLabel

private org.eclipse.swt.widgets.Label emptySelectionLabel
shown when there is no selection in the Object Bench View.


layout

private final org.eclipse.swt.custom.StackLayout layout
the layout for the view.


panel

private org.eclipse.swt.widgets.Composite panel
a reference to the parent composite.


viewer

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


currentInstance

private Instance currentInstance

prefChangeListener

private org.eclipse.core.runtime.Preferences.IPropertyChangeListener prefChangeListener
Constructor Detail

PropertiesView

public PropertiesView()
Method Detail

createEmptySelectionLabel

private void createEmptySelectionLabel()

createPartControl

public void createPartControl(org.eclipse.swt.widgets.Composite parent)
This is a callback that will allow us to create the viewer and initialize it.

Specified by:
createPartControl in interface org.eclipse.ui.IWorkbenchPart
Specified by:
createPartControl in class org.eclipse.ui.part.WorkbenchPart

createViewer

private void createViewer()
creates the TableTreeViewer for this view.


dispose

public void dispose()
removes the selection listener and the preference listener.

Specified by:
dispose in interface org.eclipse.ui.IWorkbenchPart
Overrides:
dispose in class org.eclipse.ui.part.WorkbenchPart
See Also:
IWorkbenchPart.dispose()

fillLocalToolBar

private void fillLocalToolBar(org.eclipse.jface.action.IToolBarManager manager)

hookContextMenu

private void hookContextMenu()

init

public void init(org.eclipse.ui.IViewSite site)
          throws org.eclipse.ui.PartInitException
Specified by:
init in interface org.eclipse.ui.IViewPart
Overrides:
init in class org.eclipse.ui.part.ViewPart
Throws:
org.eclipse.ui.PartInitException
See Also:
IViewPart.init(org.eclipse.ui.IViewSite)

selectionChanged

public void selectionChanged(org.eclipse.ui.IWorkbenchPart part,
                             org.eclipse.jface.viewers.ISelection selection)
listens to changes in the ObjBenchView. If an instance is selected, the tree is displayed; otherwise, a label is displayed.

Specified by:
selectionChanged in interface org.eclipse.ui.ISelectionListener
Parameters:
part - must be an instance of ObjBenchView.
selection - the currently selected instance in the ObjBenchView.
See Also:
ISelectionListener.selectionChanged(IWorkbenchPart, ISelection)

setFocus

public void setFocus()
Passing the focus request to the viewer's control.

Specified by:
setFocus in interface org.eclipse.ui.IWorkbenchPart
Specified by:
setFocus in class org.eclipse.ui.part.WorkbenchPart

refresh

public void refresh()
Refreshes the view. This resets the input, collapses the tree entirely, and then expands the tree 2 levels. TODO it'd be nice if the actual nodes of the tree would refresh instead of having to reset the input.