Package org.eclipse.mat.query
Class ResultMetaData.Builder
- java.lang.Object
-
- org.eclipse.mat.query.ResultMetaData.Builder
-
- Enclosing class:
- ResultMetaData
public static final class ResultMetaData.Builder extends Object
ResultMetaData
factory
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ResultMetaData.Builder
addContext(ContextProvider provider)
Add a namedContextProvider
to display additional context menus.ResultMetaData.Builder
addDerivedData(ContextDerivedData.DerivedOperation action)
Extra data for the resultResultMetaData.Builder
addDetailResult(DetailResultProvider provider)
Add aDetailResultProvider
which can provide enhanced information about a result.ResultMetaData
build()
Creates and returns the ResultMetaData object, with the context providers list made unmodifiable.ResultMetaData.Builder
setIsPreSortedBy(int columnIndex, Column.SortDirection direction)
Indicates that the table or tree is already sorted by the query and (a) prevents sorting by the UI and (b) sets the sort indicators to the right columns.
-
-
-
Method Detail
-
addContext
public ResultMetaData.Builder addContext(ContextProvider provider)
Add a namedContextProvider
to display additional context menus. For example, a row may represent two different sets of object(s) and in a query menu it may be useful for the user to choose which set before running the next query on a selection.- Parameters:
provider
- the ContextProvider to add to the result- Returns:
- the original Builder to allow chaining
-
addDetailResult
public ResultMetaData.Builder addDetailResult(DetailResultProvider provider)
Add aDetailResultProvider
which can provide enhanced information about a result.- Parameters:
provider
- for enhanced information- Returns:
- the original Builder to allow chaining
-
setIsPreSortedBy
public ResultMetaData.Builder setIsPreSortedBy(int columnIndex, Column.SortDirection direction)
Indicates that the table or tree is already sorted by the query and (a) prevents sorting by the UI and (b) sets the sort indicators to the right columns.- Parameters:
columnIndex
- the column indexdirection
- how to sort the column- Returns:
- the original Builder to allow chaining
-
addDerivedData
public ResultMetaData.Builder addDerivedData(ContextDerivedData.DerivedOperation action)
Extra data for the result- Parameters:
action
- the way of adding the extra information- Returns:
- the original Builder to allow chaining
-
build
public ResultMetaData build()
Creates and returns the ResultMetaData object, with the context providers list made unmodifiable. This can only be called once.- Returns:
- ResultMetaData the extra information for the result which can be attached to the result and be passed around.
-
-