TPTP 4.2.0 Platform Project
Public API Specification

org.eclipse.hyades.trace.ui
Class TraceViewer

java.lang.Object
  extended byorg.eclipse.core.commands.common.EventManager
      extended byorg.eclipse.ui.part.WorkbenchPart
          extended byorg.eclipse.ui.part.ViewPart
              extended byorg.eclipse.hyades.trace.ui.TraceViewer
All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable, IDeleteListener, org.eclipse.core.runtime.IExecutableExtension, IExportViewer, org.eclipse.jface.action.IMenuListener, org.eclipse.ui.IPersistable, IProfileEventListener, org.eclipse.ui.ISelectionListener, org.eclipse.ui.IViewPart, org.eclipse.ui.IWorkbenchPart, org.eclipse.ui.IWorkbenchPart2, org.eclipse.ui.part.IWorkbenchPartOrientation
Direct Known Subclasses:
FilterTraceViewer

public abstract class TraceViewer
extends org.eclipse.ui.part.ViewPart
implements org.eclipse.jface.action.IMenuListener, org.eclipse.ui.ISelectionListener, IProfileEventListener, IDeleteListener, IExportViewer

This class defines an abstract base class for viewers shown in the trace model. This is for the profile monitor navigator, log view naviator.


Field Summary
protected  boolean _initializedMenu
           
protected  org.eclipse.emf.ecore.EObject _mofObject
           
protected  java.util.Hashtable _pages
           
protected  org.eclipse.hyades.trace.ui.internal.actions.OpenTraceReportAction _printColumns
           
protected  boolean contextHandlerSelectionChanged
           
protected  org.eclipse.swt.widgets.Menu fContextMenu
           
protected  boolean fForceRefresh
           
protected  org.eclipse.ui.IPartListener2 fPartListener
           
protected  boolean fPartVisible
           
protected  boolean fRefreshView
           
 java.lang.String GROUP_ADD_VIEWS
           
 java.lang.String GROUP_GENERIC
           
 
Fields inherited from interface org.eclipse.ui.IWorkbenchPart
PROP_TITLE
 
Constructor Summary
TraceViewer()
          Constructor
 
Method Summary
 void addViewPage(org.eclipse.emf.ecore.EObject object)
          Add a page to the workbook.
 void addViewPage(org.eclipse.emf.ecore.EObject object, boolean newPage)
          Add a page to the workbook.
 boolean contextHandlerSelectionChanged()
           
protected  org.eclipse.ui.part.IPage createDefaultPage(org.eclipse.ui.part.PageBook book)
          Returns the default page.
abstract  TraceViewerPage createPage(org.eclipse.emf.ecore.EObject mofObject)
          Creates the TraceViewerPage instance associated with this trace viewer.
 void createPartControl(org.eclipse.swt.widgets.Composite parent)
           
 void deregister(java.lang.Object obj)
          Invoked when a top hierarchy object is deleted from the model.
 void dispose()
           
protected  void enableEditActions()
          This method enables the edit actions.
 org.eclipse.ui.part.IPage getCurrentPage()
          Returns the current page in the view
 java.lang.String getDefaultPageMessage()
          Returns the default page message.
 org.eclipse.jface.viewers.Viewer[] getExportViewer()
           
 java.lang.Object getModelObject()
           
 org.eclipse.emf.ecore.EObject getObjectToView(org.eclipse.emf.ecore.EObject selObject)
          Returns the object that should be viewd if true if the selObject is selected in the monitors view For example, if the process node is selected, the view should display the profiling data if trace collects profiling data
 TraceViewerPage getPage(org.eclipse.emf.ecore.EObject mofObject)
          Returns the TraceViewerPage instance for the given EObject
 java.lang.Object[] getViewerControls()
           
 java.lang.String getViewerTitle()
           
abstract  java.lang.String getViewTitle()
          Returns the title of the view for this viewer
 void handleProfileEvent(ProfileEvent event)
          This method applies the appropriate function on this viewer for the given ProfileEvent
 void init(org.eclipse.ui.IViewSite site)
           
 void init(org.eclipse.ui.IViewSite site, org.eclipse.ui.IMemento memento)
           
 void initializeActionBar()
          Initializes the action bar for this viewer
 void initializedMenu(boolean init)
          Sets where the menu has been initialized
 boolean isFPartVisible()
           
 boolean isFRefreshView()
           
protected  boolean isImportant(org.eclipse.ui.IWorkbenchPart part)
          Answer true if we want to track the given page.
 boolean isInitializedMenu()
          Returns whether the menu has been initialized
 boolean isProcessRefreshEvents()
          Returns true of this viewer processes refresh events.
 boolean isSaveNeeded()
          Returns true if a save is needed for the view
 void makeActions()
          This method is called to create the actions for the viewer
 void menuAboutToShow(org.eclipse.jface.action.IMenuManager menu)
           
protected  void refreshPage(java.lang.Object obj)
          Refreshes the page for the page associated with the given object
protected  void refreshVisiblePage()
          Refresh the visible page when the view has become visible
 void removePage(java.lang.Object obj)
          Removes the page associated with the given object
 void selectionChanged(org.eclipse.ui.IWorkbenchPart part, org.eclipse.jface.viewers.ISelection selection)
          Selection has changed in the Monitors view (PDProjectExplorer)
protected  void selectionChanged(java.lang.Object obj)
          Notify the viewer the selection has changed to the given object
 void setFocus()
          Requests the part to take focus within the desktop.
 void setFPartVisible(boolean partVisible)
           
 void setFRefreshView(boolean refreshView)
           
 void setRecordSelection(org.eclipse.emf.ecore.EObject record, org.eclipse.emf.ecore.EObject treeSel)
          Sets the record selection for this viewer
protected  void setViewTitle(java.lang.Object selection)
          Sets the display view title for the given selection Object
 void showPage(org.eclipse.ui.part.IPage page)
          Shows the given page
 
Methods inherited from class org.eclipse.ui.part.ViewPart
checkSite, getViewSite, 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 org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
 
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

_mofObject

protected org.eclipse.emf.ecore.EObject _mofObject

_initializedMenu

protected boolean _initializedMenu

_pages

protected java.util.Hashtable _pages

fContextMenu

protected org.eclipse.swt.widgets.Menu fContextMenu

GROUP_ADD_VIEWS

public final java.lang.String GROUP_ADD_VIEWS
See Also:
Constant Field Values

GROUP_GENERIC

public final java.lang.String GROUP_GENERIC
See Also:
Constant Field Values

_printColumns

protected org.eclipse.hyades.trace.ui.internal.actions.OpenTraceReportAction _printColumns

fRefreshView

protected boolean fRefreshView

fForceRefresh

protected boolean fForceRefresh

contextHandlerSelectionChanged

protected boolean contextHandlerSelectionChanged

fPartVisible

protected boolean fPartVisible

fPartListener

protected org.eclipse.ui.IPartListener2 fPartListener
Constructor Detail

TraceViewer

public TraceViewer()
Constructor

Method Detail

addViewPage

public void addViewPage(org.eclipse.emf.ecore.EObject object,
                        boolean newPage)
Add a page to the workbook. If the mofObject is null, show default empty page

Parameters:
object - an EObject, the EObject the page will be based on
newPage - a boolean, whether this is a new page to display or not

addViewPage

public void addViewPage(org.eclipse.emf.ecore.EObject object)
Add a page to the workbook. If the mofObject is null, show default empty page

Parameters:
object - an EObject, the EObject the page will be based on

getObjectToView

public org.eclipse.emf.ecore.EObject getObjectToView(org.eclipse.emf.ecore.EObject selObject)
Returns the object that should be viewd if true if the selObject is selected in the monitors view For example, if the process node is selected, the view should display the profiling data if trace collects profiling data

Parameters:
selObject - an EObject
Returns:
an EObject, the object to view

createDefaultPage

protected org.eclipse.ui.part.IPage createDefaultPage(org.eclipse.ui.part.PageBook book)
Returns the default page.

Returns:
an IPage, the default page.

createPage

public abstract TraceViewerPage createPage(org.eclipse.emf.ecore.EObject mofObject)
Creates the TraceViewerPage instance associated with this trace viewer.

Parameters:
mofObject - an EObject, the object associate with this viewer and page
Returns:
a TraceViewerPage instance, the created page

createPartControl

public void createPartControl(org.eclipse.swt.widgets.Composite parent)
Specified by:
createPartControl in interface org.eclipse.ui.IWorkbenchPart
See Also:
IWorkbenchPart.createPartControl(org.eclipse.swt.widgets.Composite)

getCurrentPage

public org.eclipse.ui.part.IPage getCurrentPage()
Returns the current page in the view

Returns:
org.eclipse.eclipse.ui.part.IPage

getPage

public TraceViewerPage getPage(org.eclipse.emf.ecore.EObject mofObject)
Returns the TraceViewerPage instance for the given EObject

Parameters:
mofObject - an EObject instance
Returns:
a TraceViewerPage instances

dispose

public void dispose()
Specified by:
dispose in interface org.eclipse.ui.IWorkbenchPart
See Also:
IWorkbenchPart.dispose()

initializedMenu

public void initializedMenu(boolean init)
Sets where the menu has been initialized

Parameters:
init - a boolean

isImportant

protected boolean isImportant(org.eclipse.ui.IWorkbenchPart part)
Answer true if we want to track the given page.

Parameters:
part - an IWorkbenchPart instance
Returns:
a boolean

isInitializedMenu

public boolean isInitializedMenu()
Returns whether the menu has been initialized

Returns:
boolean

isSaveNeeded

public boolean isSaveNeeded()
Returns true if a save is needed for the view

Returns:
a boolean

makeActions

public void makeActions()
This method is called to create the actions for the viewer


refreshPage

protected void refreshPage(java.lang.Object obj)
Refreshes the page for the page associated with the given object

Parameters:
obj - java.lang.Object

selectionChanged

protected void selectionChanged(java.lang.Object obj)
Notify the viewer the selection has changed to the given object

Parameters:
obj - java.lang.Object

removePage

public void removePage(java.lang.Object obj)
Removes the page associated with the given object

Parameters:
obj - an Object

setFocus

public void setFocus()
Requests the part to take focus within the desktop.

Specified by:
setFocus in interface org.eclipse.ui.IWorkbenchPart

showPage

public void showPage(org.eclipse.ui.part.IPage page)
Shows the given page


selectionChanged

public void selectionChanged(org.eclipse.ui.IWorkbenchPart part,
                             org.eclipse.jface.viewers.ISelection selection)
Selection has changed in the Monitors view (PDProjectExplorer)

Specified by:
selectionChanged in interface org.eclipse.ui.ISelectionListener

init

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

init

public void init(org.eclipse.ui.IViewSite site,
                 org.eclipse.ui.IMemento memento)
          throws org.eclipse.ui.PartInitException
Specified by:
init in interface org.eclipse.ui.IViewPart
Throws:
org.eclipse.ui.PartInitException
See Also:
IViewPart.init(org.eclipse.ui.IViewSite, org.eclipse.ui.IMemento)

getViewTitle

public abstract java.lang.String getViewTitle()
Returns the title of the view for this viewer

Returns:
a String

handleProfileEvent

public void handleProfileEvent(ProfileEvent event)
This method applies the appropriate function on this viewer for the given ProfileEvent

Specified by:
handleProfileEvent in interface IProfileEventListener
Parameters:
event - a ProfileEvent instance

setViewTitle

protected void setViewTitle(java.lang.Object selection)
Sets the display view title for the given selection Object

Parameters:
selection - an Object, the selection the view title is displayed for

initializeActionBar

public void initializeActionBar()
Initializes the action bar for this viewer


setRecordSelection

public void setRecordSelection(org.eclipse.emf.ecore.EObject record,
                               org.eclipse.emf.ecore.EObject treeSel)
Sets the record selection for this viewer

Parameters:
record - an EObject, the record
treeSel - an EObject, the tree selection

isProcessRefreshEvents

public boolean isProcessRefreshEvents()
Returns true of this viewer processes refresh events.

Returns:
a boolean

refreshVisiblePage

protected void refreshVisiblePage()
Refresh the visible page when the view has become visible


menuAboutToShow

public void menuAboutToShow(org.eclipse.jface.action.IMenuManager menu)
Specified by:
menuAboutToShow in interface org.eclipse.jface.action.IMenuListener
See Also:
IMenuListener.menuAboutToShow(org.eclipse.jface.action.IMenuManager)

deregister

public void deregister(java.lang.Object obj)
Invoked when a top hierarchy object is deleted from the model. Deregisters the given object.

Specified by:
deregister in interface IDeleteListener

enableEditActions

protected void enableEditActions()
This method enables the edit actions.


isFRefreshView

public boolean isFRefreshView()

setFRefreshView

public void setFRefreshView(boolean refreshView)

isFPartVisible

public boolean isFPartVisible()

setFPartVisible

public void setFPartVisible(boolean partVisible)

getViewerControls

public java.lang.Object[] getViewerControls()
Specified by:
getViewerControls in interface IExportViewer
Returns:
control containing the data to be exported Subclasses should override this method and return the desired control to be exported

getViewerTitle

public java.lang.String getViewerTitle()
Specified by:
getViewerTitle in interface IExportViewer
Returns:
view title

getExportViewer

public org.eclipse.jface.viewers.Viewer[] getExportViewer()
Specified by:
getExportViewer in interface IExportViewer
Returns:
viewer associated with this view, if applicable can be a TreeViewer, TableTreeViewer or null if the view is not using a viewer

contextHandlerSelectionChanged

public boolean contextHandlerSelectionChanged()

getModelObject

public java.lang.Object getModelObject()
Specified by:
getModelObject in interface IExportViewer
Returns:
the model input for this view

getDefaultPageMessage

public java.lang.String getDefaultPageMessage()
Returns the default page message.


TPTP 4.2.0 Platform Project
Public API Specification