TPTP 4.4.0 Platform Project
Public API Specification

org.eclipse.tptp.platform.analysis.core.element
Class AbstractAnalysisElement

java.lang.Object
  extended byorg.eclipse.tptp.platform.analysis.core.element.AbstractAnalysisElement
All Implemented Interfaces:
IAnalysisElement
Direct Known Subclasses:
AbstractAnalysisProvider, AbstractAnalysisResult, AbstractAnalysisRule, AnalysisProviderManager, DefaultAnalysisCategory

public abstract class AbstractAnalysisElement
extends java.lang.Object
implements IAnalysisElement

This class handles code common to all analysis elements. Under normal circumstances this class will never be used directly by user code


Field Summary
static int CATEGORY_ELEMENT_TYPE
          The type identifier for category elements
static java.lang.String COMBO_VALUE
          The name of the combo value extension point for rule parameters
static java.lang.String DETAIL_PROVIDER
          The name of the extension point used to specify detail providers for a rule
protected static java.lang.String PLUGIN_PROP_CATEGORY
          Analysis element plugin field name
protected static java.lang.String PLUGIN_PROP_CLASS
          "class" plugin field name
protected static java.lang.String PLUGIN_PROP_CONFIGURATION
          "configuration" plugin field name
protected static java.lang.String PLUGIN_PROP_DESCRIPTION
          "description" plugin field name
protected static java.lang.String PLUGIN_PROP_HELP
          "help" plugin field name
protected static java.lang.String PLUGIN_PROP_ICON
          "icon" plugin field name
protected static java.lang.String PLUGIN_PROP_ID
          "id" plugin field name
protected static java.lang.String PLUGIN_PROP_LABEL
          "label" plugin field name
protected static java.lang.String PLUGIN_PROP_MANAGER
          "manager" plugin field name
protected static java.lang.String PLUGIN_PROP_PROVIDER
          "provider" plugin field name
protected static java.lang.String PLUGIN_PROP_QUICKFIX_ICON
          "quickfixIcon" plugin field name
protected static java.lang.String PLUGIN_PROP_RESULT_VIEW_ID
          "resultViewId" plugin field name
protected static java.lang.String PLUGIN_PROP_SEVERITY
          "severity" plugin field name - used by rule extensions
protected static java.lang.String PLUGIN_PROP_VIEWER
          "viewer" plugin field name
static int PROVIDER_ELEMENT_TYPE
          The type identifier for provider elements
static int PROVIDER_MANAGER_ELEMENT_TYPE
          The type identifier for provider manager elements
static int RESULT_ELEMENT_TYPE
          The type identifier for result elements
static int RULE_ELEMENT_TYPE
          The type identifier for rule elements
 
Constructor Summary
AbstractAnalysisElement(int newElementType)
          Constructor
 
Method Summary
 void addDetailProvider(RuleDetailProvider details)
          Add a new detail provider to this element.
 void addHistoryResultSet(java.lang.String historyId)
          Add this element to the history result set
 void addOwnedElement(AbstractAnalysisElement element)
          Add an IAnalysisElement instance to the list of owned elements
 void addOwnedElements(java.util.Collection c)
          Add a collection of IAnalysisElement instances to the list of owned elements
 void addParameter(AnalysisParameter parameter)
          Add a bew analysis parameter
 void addParameters(java.util.List parameters)
          Add a list of parameters
 void deleteHistoryResults(java.lang.String historyId)
          Delete the results from a given history
 void dispose()
          Called when the element is about to be disposed.
 java.util.List getDetailProviders()
          This method returns a list of detail provider definitions specified for this element.
 int getElementType()
          Return the element type.
 java.util.Map getExecutionHistory()
           
 java.util.Map getExternalDataMap()
           
 java.lang.String getHelpID()
           
 java.util.List getHistoryResults(java.lang.String historyId)
          Return the analysis result for a given history
 java.lang.String getIconName()
           
 java.lang.String getId()
           
 java.lang.String getLabel()
           
 java.util.List getOwnedElements()
           
 AbstractAnalysisElement getOwner()
           
 java.lang.String getOwnerId()
          Returns the unique id of the analysis element that owns this element
 AnalysisParameter getParameter(java.lang.String name)
           
 int getParameterCount()
          Returns the number of parameters associated with the current analysis element
 java.util.List getParameterList()
           
 java.lang.String getPluginId()
           
 AbstractAnalysisProvider getProvider()
           
 AnalysisProviderManager getProviderManager()
           
 java.lang.String getViewerID()
           
 int getVisibleParameterCount()
          Returns the number of paramaters that are displayable for the current analysis element
protected  void loadOwnedVariables(org.eclipse.core.runtime.IConfigurationElement parentElement, AbstractAnalysisElement element)
          Load any variables associated with this element
protected  void loadOwnedVariables(java.lang.String parameterType, org.eclipse.core.runtime.IConfigurationElement parentElement, AbstractAnalysisElement element)
          Load variables that are owned by this element
 void postAnalyze()
          Perform any tear down required after analysis ends.
 void preAnalyze()
          Perform any set up required before analysis starts.
 void removeHistoryResultSet(java.lang.String historyId)
          Remove the result data associated with the specified history id
 void setElementType(int newElementType)
          Set the element type.
 void setExternalDataMap(java.util.Map externalMap)
          INTERNAL USE ONLY Set the map of ExternalMap instances.
 void setHelpID(java.lang.String newHelpID)
          Internal use only.
 void setIconName(java.lang.String newIconName)
          Allows an element to configure its own icon name
 void setId(java.lang.String newId)
          Internal use only.
 void setInitializationData(org.eclipse.core.runtime.IConfigurationElement config)
           
 void setLabel(java.lang.String newLabel)
          Allows an analysis element to configure it own display label
 void setOwner(AbstractAnalysisElement newOwner)
          Tell this element who its owner is.
 void setOwnerId(java.lang.String ownerId)
          Internal Use.
 void setPluginId(java.lang.String newPluginId)
          Used Internally.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PLUGIN_PROP_CATEGORY

protected static final java.lang.String PLUGIN_PROP_CATEGORY
Analysis element plugin field name

See Also:
Constant Field Values

PLUGIN_PROP_CLASS

protected static final java.lang.String PLUGIN_PROP_CLASS
"class" plugin field name

See Also:
Constant Field Values

PLUGIN_PROP_SEVERITY

protected static final java.lang.String PLUGIN_PROP_SEVERITY
"severity" plugin field name - used by rule extensions

See Also:
Constant Field Values

PLUGIN_PROP_ICON

protected static final java.lang.String PLUGIN_PROP_ICON
"icon" plugin field name

See Also:
Constant Field Values

PLUGIN_PROP_QUICKFIX_ICON

protected static final java.lang.String PLUGIN_PROP_QUICKFIX_ICON
"quickfixIcon" plugin field name

See Also:
Constant Field Values

PLUGIN_PROP_ID

protected static final java.lang.String PLUGIN_PROP_ID
"id" plugin field name

See Also:
Constant Field Values

PLUGIN_PROP_LABEL

protected static final java.lang.String PLUGIN_PROP_LABEL
"label" plugin field name

See Also:
Constant Field Values

PLUGIN_PROP_DESCRIPTION

protected static final java.lang.String PLUGIN_PROP_DESCRIPTION
"description" plugin field name

See Also:
Constant Field Values

PLUGIN_PROP_PROVIDER

protected static final java.lang.String PLUGIN_PROP_PROVIDER
"provider" plugin field name

See Also:
Constant Field Values

PLUGIN_PROP_MANAGER

protected static final java.lang.String PLUGIN_PROP_MANAGER
"manager" plugin field name

See Also:
Constant Field Values

PLUGIN_PROP_VIEWER

protected static final java.lang.String PLUGIN_PROP_VIEWER
"viewer" plugin field name

See Also:
Constant Field Values

PLUGIN_PROP_CONFIGURATION

protected static final java.lang.String PLUGIN_PROP_CONFIGURATION
"configuration" plugin field name

See Also:
Constant Field Values

PLUGIN_PROP_HELP

protected static final java.lang.String PLUGIN_PROP_HELP
"help" plugin field name

See Also:
Constant Field Values

PLUGIN_PROP_RESULT_VIEW_ID

protected static final java.lang.String PLUGIN_PROP_RESULT_VIEW_ID
"resultViewId" plugin field name

See Also:
Constant Field Values

PROVIDER_MANAGER_ELEMENT_TYPE

public static final int PROVIDER_MANAGER_ELEMENT_TYPE
The type identifier for provider manager elements

See Also:
Constant Field Values

PROVIDER_ELEMENT_TYPE

public static final int PROVIDER_ELEMENT_TYPE
The type identifier for provider elements

See Also:
Constant Field Values

CATEGORY_ELEMENT_TYPE

public static final int CATEGORY_ELEMENT_TYPE
The type identifier for category elements

See Also:
Constant Field Values

RULE_ELEMENT_TYPE

public static final int RULE_ELEMENT_TYPE
The type identifier for rule elements

See Also:
Constant Field Values

RESULT_ELEMENT_TYPE

public static final int RESULT_ELEMENT_TYPE
The type identifier for result elements

See Also:
Constant Field Values

COMBO_VALUE

public static final java.lang.String COMBO_VALUE
The name of the combo value extension point for rule parameters

See Also:
Constant Field Values

DETAIL_PROVIDER

public static final java.lang.String DETAIL_PROVIDER
The name of the extension point used to specify detail providers for a rule

See Also:
Constant Field Values
Constructor Detail

AbstractAnalysisElement

public AbstractAnalysisElement(int newElementType)
Constructor

Parameters:
newElementType - The type of element being created, must be one of: PROVIDER_MANAGER_ELEMENT_TYPE, PROVIDER_ELEMENT_TYPE, CATEGORY_ELEMENT_TYPE, RULE_ELEMENT_TYPE, RESULT_ELEMENT_TYPE
Method Detail

setInitializationData

public final void setInitializationData(org.eclipse.core.runtime.IConfigurationElement config)
See Also:
IExecutableExtension.setInitializationData(org.eclipse.core.runtime.IConfigurationElement, java.lang.String, java.lang.Object)

dispose

public void dispose()
Called when the element is about to be disposed. This can be overridden by derived class to perform and special object teardown.

Specified by:
dispose in interface IAnalysisElement

getOwner

public final AbstractAnalysisElement getOwner()
Specified by:
getOwner in interface IAnalysisElement
Returns:
The parent element that owns this analysis element

setOwner

public final void setOwner(AbstractAnalysisElement newOwner)
Tell this element who its owner is. Used Internally

Specified by:
setOwner in interface IAnalysisElement
Parameters:
newOwner - The element that owns this element

getOwnerId

public java.lang.String getOwnerId()
Returns the unique id of the analysis element that owns this element

Returns:
A string containing the unique identifier of the owner

setOwnerId

public void setOwnerId(java.lang.String ownerId)
Internal Use. Sets the unique identifier of the owning analysis element. This method can be called only once.

Parameters:
ownerId - The unique identifer of the owner

getOwnedElements

public java.util.List getOwnedElements()
Specified by:
getOwnedElements in interface IAnalysisElement
Returns:
A list of IAnalysisElement instances owned by this element

addOwnedElement

public final void addOwnedElement(AbstractAnalysisElement element)
Add an IAnalysisElement instance to the list of owned elements

Specified by:
addOwnedElement in interface IAnalysisElement
Parameters:
element - THe new element to add

addOwnedElements

public final void addOwnedElements(java.util.Collection c)
Add a collection of IAnalysisElement instances to the list of owned elements

Specified by:
addOwnedElements in interface IAnalysisElement
Parameters:
c - The collection of elements to add

addHistoryResultSet

public final void addHistoryResultSet(java.lang.String historyId)
Add this element to the history result set

Specified by:
addHistoryResultSet in interface IAnalysisElement
Parameters:
historyId - The id of the history analysis run

removeHistoryResultSet

public void removeHistoryResultSet(java.lang.String historyId)
Remove the result data associated with the specified history id

Specified by:
removeHistoryResultSet in interface IAnalysisElement
Parameters:
historyId - The id of the history analysis run being removed

getHistoryResults

public final java.util.List getHistoryResults(java.lang.String historyId)
Return the analysis result for a given history

Specified by:
getHistoryResults in interface IAnalysisElement
Parameters:
historyId - The id of the history analysis run to return
Returns:
A list of IAnalysisResult elements for the given history

deleteHistoryResults

public final void deleteHistoryResults(java.lang.String historyId)
Delete the results from a given history

Parameters:
historyId - The id of the history whose results will be removes

getLabel

public java.lang.String getLabel()
Specified by:
getLabel in interface IAnalysisElement
Returns:
The display name to use for this element

setLabel

public final void setLabel(java.lang.String newLabel)
Description copied from interface: IAnalysisElement
Allows an analysis element to configure it own display label

Specified by:
setLabel in interface IAnalysisElement
Parameters:
newLabel - The label
Returns:
The file name of the icon to use for this element

setIconName

public final void setIconName(java.lang.String newIconName)
Allows an element to configure its own icon name

Specified by:
setIconName in interface IAnalysisElement
Parameters:
newIconName - The path name of the icon to use for this element

getIconName

public java.lang.String getIconName()
Specified by:
getIconName in interface IAnalysisElement
Returns:
The file name of the icon to use for this element
See Also:
IAnalysisElement.getIconName()

getPluginId

public final java.lang.String getPluginId()
Specified by:
getPluginId in interface IAnalysisElement
Returns:
The unique id of the plugin that defined the analysis element

setPluginId

public final void setPluginId(java.lang.String newPluginId)
Used Internally. Calling this method will have no effect

Specified by:
setPluginId in interface IAnalysisElement
Parameters:
newPluginId -

preAnalyze

public void preAnalyze()
Perform any set up required before analysis starts. This action happens only once (e.g. when the user clicks the "analyze" button) per analysis run, ApplicationAnalysisElement derivatives should override this method if they need to do special work before analysis starts

Specified by:
preAnalyze in interface IAnalysisElement

postAnalyze

public void postAnalyze()
Perform any tear down required after analysis ends. This action happens only once per analysis run. ApplicationAnalysisElement derivatives should override this method if they need to do special work after analysis completes


loadOwnedVariables

protected void loadOwnedVariables(org.eclipse.core.runtime.IConfigurationElement parentElement,
                                  AbstractAnalysisElement element)
Load any variables associated with this element

Parameters:
parentElement - The parent extension being loaded
element - The analysis element being loaded

loadOwnedVariables

protected void loadOwnedVariables(java.lang.String parameterType,
                                  org.eclipse.core.runtime.IConfigurationElement parentElement,
                                  AbstractAnalysisElement element)
Load variables that are owned by this element

Parameters:
parameterType -
parentElement -
element -

getElementType

public final int getElementType()
Return the element type. Values returned are: PROVIDER_MANAGER_ELEMENT_TYPE, PROVIDER_ELEMENT_TYPE, CATEGORY_ELEMENT_TYPE, RULE_ELEMENT_TYPE, RESULT_ELEMENT_TYPE

Specified by:
getElementType in interface IAnalysisElement
Returns:
The unique element type for this element

setElementType

public final void setElementType(int newElementType)
Set the element type. This method can be called only once. Subsequent calls are ignored. Valid values for this method are defined in the following constants: PROVIDER_MANAGER_ELEMENT_TYPE, PROVIDER_ELEMENT_TYPE, CATEGORY_ELEMENT_TYPE, RULE_ELEMENT_TYPE, RESULT_ELEMENT_TYPE

Specified by:
setElementType in interface IAnalysisElement
Parameters:
newElementType - The new element type.

getId

public final java.lang.String getId()
Specified by:
getId in interface IAnalysisElement
Returns:
The unique identifier for this element

setId

public final void setId(java.lang.String newId)
Internal use only. Sets the unique id of this element.

Specified by:
setId in interface IAnalysisElement
Parameters:
newId - The new id for the element

getHelpID

public final java.lang.String getHelpID()
Specified by:
getHelpID in interface IAnalysisElement
Returns:
A string contianging the unique identifier of the help page for this element

setHelpID

public final void setHelpID(java.lang.String newHelpID)
Internal use only. Sets the unique id of this element's context-sensitive help.

Specified by:
setHelpID in interface IAnalysisElement
Parameters:
newHelpID - The new id for the element's context-sensitive help

getViewerID

public final java.lang.String getViewerID()
Returns:
The viewer ID for the viewer attached to this element

toString

public java.lang.String toString()
Returns:
the String version of the analysis element

getExecutionHistory

public final java.util.Map getExecutionHistory()
Returns:
A hashtable os execution history instances.

addDetailProvider

public final void addDetailProvider(RuleDetailProvider details)
Add a new detail provider to this element. A detail provider can display information about the element. For example it might include a detailed description or a possible solution to a problem indicated by the analysis element.

Specified by:
addDetailProvider in interface IAnalysisElement
Parameters:
details - The definition of a detail provider

getDetailProviders

public final java.util.List getDetailProviders()
This method returns a list of detail provider definitions specified for this element. The list returned contains instances of RuleDetailProvider, which contains the data needed to show a particular detail.

Specified by:
getDetailProviders in interface IAnalysisElement
Returns:
The detail providers defined for this element

setExternalDataMap

public void setExternalDataMap(java.util.Map externalMap)
INTERNAL USE ONLY Set the map of ExternalMap instances.

Specified by:
setExternalDataMap in interface IAnalysisElement
Parameters:
externalMap - The map of ExternalData to store for this element

getExternalDataMap

public final java.util.Map getExternalDataMap()
Specified by:
getExternalDataMap in interface IAnalysisElement
Returns:
The map of ExternalData object for this element

addParameter

public final void addParameter(AnalysisParameter parameter)
Add a bew analysis parameter

Parameters:
parameter - The AnalysisParameter to add

addParameters

public final void addParameters(java.util.List parameters)
Add a list of parameters

Parameters:
parameters - The list of AnalysisParameters to add

getParameter

public final AnalysisParameter getParameter(java.lang.String name)

getParameterList

public final java.util.List getParameterList()

getParameterCount

public final int getParameterCount()
Returns the number of parameters associated with the current analysis element

Returns:
The total number of analysis parameters

getVisibleParameterCount

public final int getVisibleParameterCount()
Returns the number of paramaters that are displayable for the current analysis element

Returns:
The number of parameters that are visible in the user interface (i.e. They have a label)

getProviderManager

public final AnalysisProviderManager getProviderManager()
Returns:
the provider manager, which is top-most owner of all elements

getProvider

public final AbstractAnalysisProvider getProvider()
Returns:
the analysis provider that owns this element

TPTP 4.4.0 Platform Project
Public API Specification