Package org.eclipse.mat.query
Class ContextProvider
- java.lang.Object
-
- org.eclipse.mat.query.ContextProvider
-
public abstract class ContextProvider extends java.lang.Object
Base class for context provider which is an object which returns the heap objects represented by an arbitrary row in a table/tree. This is used byIResult.getResultMetaData()
to provide additional information about rows in a report.- See Also:
IContextObject
,IContextObjectSet
-
-
Constructor Summary
Constructors Constructor Description ContextProvider(java.lang.String label)
Creates a ContextProvider which will be queried later to find out more details about a row in a report.ContextProvider(java.lang.String label, ContextDerivedData.DerivedOperation... operations)
Creates a ContextProvider which will be queried later to find out more details about a row in a report.ContextProvider(ContextProvider template)
Constructor using copying values from the give template context provider.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract IContextObject
getContext(java.lang.Object row)
Return the context object associated with the specified row.java.net.URL
getIcon()
Returns an icon which could be used on context menus as a top level to represent this entire type of data available from anIStructuredResult
.java.lang.String
getLabel()
The label for this context provider.ContextDerivedData.DerivedOperation[]
getOperations()
Extra operations to calculate more columns.boolean
hasSameTarget(ContextProvider other)
Used to see if two context providers are the same.boolean
isDefault()
The default context provider is that for the whole snapshot.
-
-
-
Constructor Detail
-
ContextProvider
public ContextProvider(java.lang.String label)
Creates a ContextProvider which will be queried later to find out more details about a row in a report.- Parameters:
label
- The label used for context menus.
-
ContextProvider
public ContextProvider(java.lang.String label, ContextDerivedData.DerivedOperation... operations)
Creates a ContextProvider which will be queried later to find out more details about a row in a report.- Parameters:
label
- The label used for context menus.operations
- operations which can be used to calculate extra column information
-
ContextProvider
public ContextProvider(ContextProvider template)
Constructor using copying values from the give template context provider.- Parameters:
template
- a similar ContextProvider
-
-
Method Detail
-
getLabel
public java.lang.String getLabel()
The label for this context provider. Used for context menus to provide a root menu item, with all the queries for this context as sub-items.- Returns:
- the label
-
isDefault
public final boolean isDefault()
The default context provider is that for the whole snapshot.- Returns:
- true if it represents the whole snapshot
-
hasSameTarget
public final boolean hasSameTarget(ContextProvider other)
Used to see if two context providers are the same.- Parameters:
other
- the other context provider to compare- Returns:
- true if they are the same
-
getOperations
public ContextDerivedData.DerivedOperation[] getOperations()
Extra operations to calculate more columns.- Returns:
- an array of extra operations, could be empty, but not null
-
getIcon
public java.net.URL getIcon()
Returns an icon which could be used on context menus as a top level to represent this entire type of data available from anIStructuredResult
.- Returns:
- a URL which can be used to get the icon, can be null
- Since:
- 1.1
-
getContext
public abstract IContextObject getContext(java.lang.Object row)
Return the context object associated with the specified row.- Parameters:
row
- the row requested- Returns:
- details of the row
-
-