org.eclipse.ohf.stem.ui.ge.views
Class GEViewContentProvider

java.lang.Object
  extended by org.eclipse.ohf.stem.ui.ge.views.GEViewContentProvider
All Implemented Interfaces:
org.eclipse.jface.viewers.IContentProvider, org.eclipse.jface.viewers.ISelectionChangedListener, org.eclipse.jface.viewers.IStructuredContentProvider, ISimulationManagerListener

public class GEViewContentProvider
extends java.lang.Object
implements org.eclipse.jface.viewers.IStructuredContentProvider, ISimulationManagerListener, org.eclipse.jface.viewers.ISelectionChangedListener

GEViewContentProvider


Constructor Summary
GEViewContentProvider()
          default constructor
 
Method Summary
 void dispose()
          Cleanup when user wants to terminate the view
 ISimulation getCurrentSimulation()
          supply the currently selected simulation (if any) GEView does not save the current Simulation that was selected by the user.
 java.lang.Object[] getElements(java.lang.Object parent)
          Provide the data that will be displayed in a list
 void inputChanged(org.eclipse.jface.viewers.Viewer v, java.lang.Object oldInput, java.lang.Object newInput)
          This is given control when the input parent changes.
 void selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent event)
          This method is called whenever ANYTHING is selected in the viewer.
 void simulationsChanged(SimulationManagerEvent event)
          We get here because we are listening for SimulationChanged events and one occured.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GEViewContentProvider

public GEViewContentProvider()
default constructor

Method Detail

inputChanged

public void inputChanged(org.eclipse.jface.viewers.Viewer v,
                         java.lang.Object oldInput,
                         java.lang.Object newInput)
This is given control when the input parent changes. In our case, SimulationManager is the parent(Model) and it never changes after the initial startup.

Specified by:
inputChanged in interface org.eclipse.jface.viewers.IContentProvider
Parameters:
v - Viewer reporting change
oldInput - old SimulationManager or null
newInput - new input source(new SimulationManager)

dispose

public void dispose()
Cleanup when user wants to terminate the view

Specified by:
dispose in interface org.eclipse.jface.viewers.IContentProvider

getElements

public java.lang.Object[] getElements(java.lang.Object parent)
Provide the data that will be displayed in a list

Specified by:
getElements in interface org.eclipse.jface.viewers.IStructuredContentProvider
Parameters:
parent - Set to refer to the SimulationManager singleton

simulationsChanged

public void simulationsChanged(SimulationManagerEvent event)
We get here because we are listening for SimulationChanged events and one occured.

Specified by:
simulationsChanged in interface ISimulationManagerListener
Parameters:
event - the event that records what happened to the manager.
See Also:
com.ibm.almaden.stem.jobs.simulation.ISimulationManagerListener#simulationsChanged(com.ibm.almaden.stem.jobs.simulation.SimulationManagerEvent)

selectionChanged

public void selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent event)
This method is called whenever ANYTHING is selected in the viewer. It's job is to filter out selections of ISimulation instances and mark the Simulation that we want to interface to.

Specified by:
selectionChanged in interface org.eclipse.jface.viewers.ISelectionChangedListener
See Also:
ISelectionListener.selectionChanged(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)

getCurrentSimulation

public ISimulation getCurrentSimulation()
supply the currently selected simulation (if any) GEView does not save the current Simulation that was selected by the user. This method is used to get it.

Returns:
the currentSimulation