Package org.eclipse.mat.query
Class ContextProvider
java.lang.Object
org.eclipse.mat.query.ContextProvider
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 by
IResult.getResultMetaData()
to provide additional information
about rows in a report.- See Also:
-
Constructor Summary
ConstructorDescriptionContextProvider
(String label) Creates a ContextProvider which will be queried later to find out more details about a row in a report.ContextProvider
(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
Modifier and TypeMethodDescriptionabstract IContextObject
getContext
(Object row) Return the context object associated with the specified row.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
.getLabel()
The label for this context provider.Extra operations to calculate more columns.final boolean
hasSameTarget
(ContextProvider other) Used to see if two context providers are the same.final boolean
The default context provider is that for the whole snapshot.
-
Constructor Details
-
ContextProvider
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
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
Constructor using copying values from the give template context provider.- Parameters:
template
- a similar ContextProvider
-
-
Method Details
-
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
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
Extra operations to calculate more columns.- Returns:
- an array of extra operations, could be empty, but not null
-
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
Return the context object associated with the specified row.- Parameters:
row
- the row requested- Returns:
- details of the row
-