PTP
Release 7.0

org.eclipse.ptp.pldt.common.views
Class SimpleTreeTableMarkerView

java.lang.Object
  extended by ViewPart
      extended by org.eclipse.ptp.pldt.common.views.SimpleTreeTableMarkerView

public class SimpleTreeTableMarkerView
extends ViewPart

Like SimpleTableMarkerView - easy view that shows markers - but uses a TreeTable to show some hierarchy. Currently limited to one level of hierarchy Intent: Markers are the leaf nodes.
An attribute in the markers indicates the (artificial) parent node, for grouping.


Nested Class Summary
 class SimpleTreeTableMarkerView.StackList
          a Stack that isn't based on Vector - Generic LIFO stack
 class SimpleTreeTableMarkerView.UpdateVisitor
          Visit the resource delta to look for the marker changes we are interested in
 
Field Summary
protected  ArtifactManager artifactManager_
           
protected  SimpleTreeTableMarkerView.StackList changedArts_
          List of artifacts that were changed due to some action upon them in the view (currently unused)
protected  SimpleTreeTableMarkerView.StackList changedMarkers_
          List of markers that were involved in a change on the the associated artifact due to some action upon them here in the view (currently unused)
protected  String columnID_
          The ID used in the marker for the extra column of information (last column)
static int CONSTANT
           
static String[] CONSTRUCT_TYPE_NAMES
          types of constructs, for the default case
protected  org.eclipse.ptp.pldt.common.views.SimpleTreeTableMarkerView.GenericSorter constructSorter
           
protected static String DESCRIPTION
          Marker id for storage of additional information about the artifact
protected static String FILENAME
          Marker ID for storage of the filename in which the artifact is found
protected  org.eclipse.ptp.pldt.common.views.SimpleTreeTableMarkerView.FilenameSorter filenameSorter
           
static int FUNCTION_CALL
           
protected  Action infoAction
           
protected static String LINE
          Marker id for storage of line number on which the artifact is found.
protected  org.eclipse.ptp.pldt.common.views.SimpleTreeTableMarkerView.GenericSorter lineNoSorter
           
protected static String NAME
          Marker ID for artifact name - e.g.
protected  org.eclipse.ptp.pldt.common.views.SimpleTreeTableMarkerView.GenericSorter nameArtifactSorter
           
protected  ViewerSorter nameSorter
           
static int NONE
           
protected  org.eclipse.ptp.pldt.common.views.SimpleTreeTableMarkerView.GenericSorter orderSorter
           
protected  String parentMarkerAttrib
          marker attribute indicating parent node.
protected  String thingname_
          Be consistent about what we call these things; generic values (can be) replaced on ctor.
protected  String thingnames_
           
protected  String uniqueID_
          The ID used in the marker for the unique ID for each artifact.
protected  TreeViewer viewer
           
protected  SimpleTreeTableMarkerView.UpdateVisitor visitor_
           
 
Constructor Summary
SimpleTreeTableMarkerView()
          Ctor that uses defaults for everything (testing?
SimpleTreeTableMarkerView(AbstractUIPlugin thePlugin, String thingname, String thingnames, String[] attrNames, String[] colNames, String markerID, String parentMarkerAttribName)
          Simple table view with an arbitrary number of extra columns
SimpleTreeTableMarkerView(AbstractUIPlugin thePlugin, String thingname, String thingnames, String columnName, String markerID, String parentMarkerAttrName)
          Simple Artifact Table View constructor Everything can be null, and defaults will be taken, or read from plugin.xml for the view.
 
Method Summary
protected  void checkUndoStatus()
          Set status of undo action (enabled or disabled) based on if there are any artifact changes, or other changes, available to undo
 void createPartControl(Composite parent)
          This is a callback that will allow us to create the viewer and initialize it.
 void dispose()
           
protected  void findViewInfo()
          Find info from the view info in the manifest.
protected  String getAttribute(IMarker marker, String attr)
          convenience method for getting attribute String value.
protected  String getConstructStr(IMarker marker)
          Get string representing the type of construct
protected  int getIntAttr(IMarker marker, String attr)
          Get an int value that is assumed to be stored in a marker in a given attribute.
protected  int getMarkerLineNo(IMarker marker)
          Get marker line numbers.
protected  IArtifact getSimpleArtifact(IMarker marker)
          get artifact from marker
 ImageDescriptor makeImageDescriptor(String iconName)
          Create an ImageDescriptor for an image
protected  void makeShowInfoAction()
          Make "show info" action to display artifact information
protected  void pushChangedInfo(IArtifact artifact, IMarker marker)
          Push change info (artifact and marker) onto a stack so we can remember it, for possible undo action.
 void setFocus()
          Passing the focus request to the viewer's control.
 void showMarker(IMarker marker)
          Display marker information for debugging use
 boolean validForAnalysis(String filename)
          It might be useful for subclasses to override this, to say which filenames should allow the action "run analysis" to create new artifacts and thus new markers.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

viewer

protected TreeViewer viewer

parentMarkerAttrib

protected String parentMarkerAttrib
marker attribute indicating parent node. All markers with this parentAttr will be the children of the same parent, and a node for that parent will be created so that the poor things won't be orphans. It's 4am what can I say?


infoAction

protected Action infoAction

nameSorter

protected ViewerSorter nameSorter

lineNoSorter

protected org.eclipse.ptp.pldt.common.views.SimpleTreeTableMarkerView.GenericSorter lineNoSorter

filenameSorter

protected org.eclipse.ptp.pldt.common.views.SimpleTreeTableMarkerView.FilenameSorter filenameSorter

orderSorter

protected org.eclipse.ptp.pldt.common.views.SimpleTreeTableMarkerView.GenericSorter orderSorter

nameArtifactSorter

protected org.eclipse.ptp.pldt.common.views.SimpleTreeTableMarkerView.GenericSorter nameArtifactSorter

constructSorter

protected org.eclipse.ptp.pldt.common.views.SimpleTreeTableMarkerView.GenericSorter constructSorter

changedArts_

protected SimpleTreeTableMarkerView.StackList changedArts_
List of artifacts that were changed due to some action upon them in the view (currently unused)


changedMarkers_

protected SimpleTreeTableMarkerView.StackList changedMarkers_
List of markers that were involved in a change on the the associated artifact due to some action upon them here in the view (currently unused)


visitor_

protected SimpleTreeTableMarkerView.UpdateVisitor visitor_

thingname_

protected String thingname_
Be consistent about what we call these things; generic values (can be) replaced on ctor.
These are read from plugin.xml if not passed on ctor


thingnames_

protected String thingnames_

artifactManager_

protected ArtifactManager artifactManager_

uniqueID_

protected String uniqueID_
The ID used in the marker for the unique ID for each artifact. Enables mapping back to the Artifact object if necessary.


columnID_

protected String columnID_
The ID used in the marker for the extra column of information (last column)


NAME

protected static final String NAME
Marker ID for artifact name - e.g. API name, pragma name, etc.

See Also:
Constant Field Values

FILENAME

protected static final String FILENAME
Marker ID for storage of the filename in which the artifact is found

See Also:
Constant Field Values

LINE

protected static final String LINE
Marker id for storage of line number on which the artifact is found. Reuse of default ID used by IMarker, repeated here for ease of use and for clarity that THIS is the marker ID for line number.


DESCRIPTION

protected static final String DESCRIPTION
Marker id for storage of additional information about the artifact

See Also:
Constant Field Values

NONE

public static final int NONE
See Also:
Constant Field Values

FUNCTION_CALL

public static final int FUNCTION_CALL
See Also:
Constant Field Values

CONSTANT

public static final int CONSTANT
See Also:
Constant Field Values

CONSTRUCT_TYPE_NAMES

public static final String[] CONSTRUCT_TYPE_NAMES
types of constructs, for the default case

Constructor Detail

SimpleTreeTableMarkerView

public SimpleTreeTableMarkerView(AbstractUIPlugin thePlugin,
                                 String thingname,
                                 String thingnames,
                                 String columnName,
                                 String markerID,
                                 String parentMarkerAttrName)
Simple Artifact Table View constructor

Everything can be null, and defaults will be taken, or read from plugin.xml for the view.

Note: if a null plugIn instance is provided, the default plugin (this one) will not be able to find resources (e.g. icon images) if the derived class is in its own plug-in, and its icons are, too.


SimpleTreeTableMarkerView

public SimpleTreeTableMarkerView(AbstractUIPlugin thePlugin,
                                 String thingname,
                                 String thingnames,
                                 String[] attrNames,
                                 String[] colNames,
                                 String markerID,
                                 String parentMarkerAttribName)
Simple table view with an arbitrary number of extra columns

Parameters:
thePlugin -
thingname -
thingnames -
attrNames - list of marker attributes, for which the column values will be extractd
colNames - list of Column names, used as headers for the values found in the marker attributes
markerID_ -

SimpleTreeTableMarkerView

public SimpleTreeTableMarkerView()
Ctor that uses defaults for everything (testing? theoretically, this should work, and should be reusable since info that must be unique is read from from plugin.xml.)

Method Detail

findViewInfo

protected void findViewInfo()
Find info from the view info in the manifest. This includes the icon name, the view id (used as marker id if none given on ctor), and constructs an artifact manager for this view's artifact objects


validForAnalysis

public boolean validForAnalysis(String filename)
It might be useful for subclasses to override this, to say which filenames should allow the action "run analysis" to create new artifacts and thus new markers.
This is a default implementation

Parameters:
filename -
Returns:

getSimpleArtifact

protected IArtifact getSimpleArtifact(IMarker marker)
get artifact from marker

Parameters:
marker -
Returns:

getConstructStr

protected String getConstructStr(IMarker marker)
                          throws CoreException
Get string representing the type of construct

Parameters:
marker -
Returns:
Throws:
CoreException

createPartControl

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


makeShowInfoAction

protected void makeShowInfoAction()
Make "show info" action to display artifact information


setFocus

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


dispose

public void dispose()

showMarker

public void showMarker(IMarker marker)
Display marker information for debugging use

Parameters:
marker -

makeImageDescriptor

public ImageDescriptor makeImageDescriptor(String iconName)
Create an ImageDescriptor for an image

Parameters:
iconName -
Returns:

pushChangedInfo

protected void pushChangedInfo(IArtifact artifact,
                               IMarker marker)
Push change info (artifact and marker) onto a stack so we can remember it, for possible undo action. Also enables/disables the Undo action button.

Parameters:
artifact -
marker -

checkUndoStatus

protected void checkUndoStatus()
Set status of undo action (enabled or disabled) based on if there are any artifact changes, or other changes, available to undo


getMarkerLineNo

protected int getMarkerLineNo(IMarker marker)
Get marker line numbers.

Parameters:
marker -
Returns:

getIntAttr

protected int getIntAttr(IMarker marker,
                         String attr)
Get an int value that is assumed to be stored in a marker in a given attribute.

Parameters:
marker -
attr - the attribute name
Returns:
the int value, or 0 if none found, or invalid value found

getAttribute

protected String getAttribute(IMarker marker,
                              String attr)
convenience method for getting attribute String value.

Parameters:
marker -
attr -
Returns:

PTP
Release 7.0

Copyright (c) 2011 IBM Corporation and others. All Rights Reserved.