org.eclipse.mat.query.refined
Class RefinedStructuredResult

java.lang.Object
  extended by org.eclipse.mat.query.refined.RefinedStructuredResult
All Implemented Interfaces:
IIconProvider, IResult, ISelectionProvider, IStructuredResult
Direct Known Subclasses:
RefinedTable, RefinedTree

public abstract class RefinedStructuredResult
extends java.lang.Object
implements IStructuredResult, ISelectionProvider, IIconProvider

The result from refining a table or tree.


Nested Class Summary
static class RefinedStructuredResult.DerivedDataJobDefinition
           
static interface RefinedStructuredResult.ICalculationProgress
           
 
Field Summary
 
Fields inherited from interface org.eclipse.mat.query.ISelectionProvider
EMPTY
 
Fields inherited from interface org.eclipse.mat.query.IIconProvider
EMPTY
 
Method Summary
 Column addDerivedDataColumn(ContextProvider provider, ContextDerivedData.DerivedColumn derivedColumn)
           
 TotalsRow buildTotalsRow(java.util.List<?> elements)
           
 void calculate(ContextProvider provider, ContextDerivedData.DerivedOperation operation, java.util.List<?> elements, RefinedStructuredResult.ICalculationProgress progress, IProgressListener listener)
           
 void calculateTotals(java.util.List<?> elements, TotalsRow totals, IProgressListener listener)
           
 void filterChanged(Filter filter)
           
 Column getColumnFor(ContextProvider provider, ContextDerivedData.DerivedColumn derivedColumn)
           
 Column[] getColumns()
          The columns of the tree or table.
 java.lang.Object getColumnValue(java.lang.Object row, int columnIndex)
          Returns the (unformatted) value of a table/tree cell.
 IContextObject getContext(java.lang.Object row)
          The default context of the row which is used to display information in the object inspector.
 Filter[] getFilter()
           
 int getFilteredCount(java.util.List<?> elements)
           
 java.lang.String getFormattedColumnValue(java.lang.Object row, int columnIndex)
           
 java.net.URL getIcon(java.lang.Object row)
           
 java.util.List<RefinedStructuredResult.DerivedDataJobDefinition> getJobs()
           
 ResultMetaData getResultMetaData()
          (Optionally) Return meta data of the result needed to fine-tune the display of the result.
 int getSortColumn()
          -1 if the result is not sorted
 Column.SortDirection getSortDirection()
           
 boolean hasActiveFilter()
           
 boolean isDecorated(int columnIndex)
           
 boolean isExpanded(java.lang.Object row)
          Should this node be expanded.
 boolean isSelected(java.lang.Object row)
          Has the user selected this row
 void setSelectionProvider(ISelectionProvider provider)
           
 void setSortOrder(Column queryColumn, Column.SortDirection direction)
           
 void sort(java.util.List<?> elements)
           
 IStructuredResult unwrap()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setSelectionProvider

public void setSelectionProvider(ISelectionProvider provider)

isDecorated

public boolean isDecorated(int columnIndex)

getFilter

public Filter[] getFilter()

hasActiveFilter

public boolean hasActiveFilter()

getFilteredCount

public int getFilteredCount(java.util.List<?> elements)

filterChanged

public void filterChanged(Filter filter)

getSortColumn

public int getSortColumn()
-1 if the result is not sorted


getSortDirection

public Column.SortDirection getSortDirection()

setSortOrder

public void setSortOrder(Column queryColumn,
                         Column.SortDirection direction)

sort

public void sort(java.util.List<?> elements)

buildTotalsRow

public TotalsRow buildTotalsRow(java.util.List<?> elements)

calculateTotals

public void calculateTotals(java.util.List<?> elements,
                            TotalsRow totals,
                            IProgressListener listener)

getJobs

public java.util.List<RefinedStructuredResult.DerivedDataJobDefinition> getJobs()

addDerivedDataColumn

public Column addDerivedDataColumn(ContextProvider provider,
                                   ContextDerivedData.DerivedColumn derivedColumn)

getColumnFor

public Column getColumnFor(ContextProvider provider,
                           ContextDerivedData.DerivedColumn derivedColumn)

calculate

public void calculate(ContextProvider provider,
                      ContextDerivedData.DerivedOperation operation,
                      java.util.List<?> elements,
                      RefinedStructuredResult.ICalculationProgress progress,
                      IProgressListener listener)
               throws SnapshotException
Throws:
SnapshotException

unwrap

public IStructuredResult unwrap()

getResultMetaData

public ResultMetaData getResultMetaData()
Description copied from interface: IResult
(Optionally) Return meta data of the result needed to fine-tune the display of the result. This could include an additional context, an additional query to run on selected data from the result , additional calculated columns, or an indication that the results are already presorted.

Specified by:
getResultMetaData in interface IResult

getColumns

public Column[] getColumns()
Description copied from interface: IStructuredResult
The columns of the tree or table.

Specified by:
getColumns in interface IStructuredResult

getColumnValue

public java.lang.Object getColumnValue(java.lang.Object row,
                                       int columnIndex)
Description copied from interface: IStructuredResult
Returns the (unformatted) value of a table/tree cell.

Specified by:
getColumnValue in interface IStructuredResult
Parameters:
row - The row object as returned by the IResultTable.getRow(int) or IResultTree.getElements() or IResultTree.getChildren(Object) methods
columnIndex - The index of the column.

getFormattedColumnValue

public java.lang.String getFormattedColumnValue(java.lang.Object row,
                                                int columnIndex)

getContext

public IContextObject getContext(java.lang.Object row)
Description copied from interface: IStructuredResult
The default context of the row which is used to display information in the object inspector. Unless no context provider is given via the ResultMetaData, it is also used for the context menu on a row.

Specified by:
getContext in interface IStructuredResult
Parameters:
row - The row object as returned by the IResultTable.getRow(int) or IResultTree.getElements() or IResultTree.getChildren(Object) methods.

getIcon

public java.net.URL getIcon(java.lang.Object row)
Specified by:
getIcon in interface IIconProvider

isExpanded

public boolean isExpanded(java.lang.Object row)
Description copied from interface: ISelectionProvider
Should this node be expanded.

Specified by:
isExpanded in interface ISelectionProvider
Returns:
true if it should be expanded.

isSelected

public boolean isSelected(java.lang.Object row)
Description copied from interface: ISelectionProvider
Has the user selected this row

Specified by:
isSelected in interface ISelectionProvider
Returns:
true if selected