public class ResultMatrix extends Object implements ComplexCalculationResult, Serializable
Modifier and Type | Class and Description |
---|---|
class |
ResultMatrix.AbstractResultMatrixCell |
class |
ResultMatrix.ResultMatrixImageCell |
class |
ResultMatrix.ResultMatrixLinkCell |
class |
ResultMatrix.ResultMatrixOnRowSelection |
class |
ResultMatrix.ResultMatrixStyledCell |
Constructor and Description |
---|
ResultMatrix() |
ResultMatrix(Collection<String> columns)
Creates a new matrix object with an initial set of columns
|
ResultMatrix(Map jsonMap) |
ResultMatrix(String... columns)
Creates a new matrix object with an initial set of columns
|
Modifier and Type | Method and Description |
---|---|
void |
addColumn(String column)
Adds a column to the existing set of columns
|
void |
addColumn(String column,
String tooltip)
Adds a column to the existing set of columns including a tooltip
|
void |
addColumns(Collection<String> columns)
Adds columns to the existing set of columns
|
void |
addColumnTranslation(String column,
Map<String,String> translations)
Adds translated labels for the given column.
|
void |
addRow(List<Object> row)
Adds a data row.
|
void |
addRow(Map<String,Object> row)
Adds a data row.
|
void |
addRow(Object... values)
Adds a data row.
|
Map<String,Object> |
findRow(String key,
Object value)
Retrieves a particular row based on a value check
|
Map<String,FieldFormatType> |
getColumnFormats()
Gets individual column formats (if specified)
|
List<String> |
getColumns()
Gets a list of defined columns
|
Map<String,String> |
getColumnTooltips()
Gets the currently assigned column tooltips
|
Map<String,String> |
getColumnTranslations()
Gets current column translations in raw format
|
FieldFormatType |
getDefaultFormat()
Gets the default format
|
List<Map<String,Object>> |
getEntries()
Returns the current list entries as a list (=the rows) of maps (= the row content)
|
Map<String,Map<String,String>> |
getOnRowSelectEvents() |
String |
getPreferenceName()
Gets the preference name
|
String |
getResultType() |
String |
getTitle()
Gets the current title
|
ResultMatrix.ResultMatrixImageCell |
imageCell(Object value)
Creates an image cell that can then be added as row value.
|
boolean |
isEnableClientFilter() |
boolean |
isEscapeHTML()
Is HTML escaping enabled?
|
boolean |
isSortingDisabled()
UI sorting of matrix grid
|
ResultMatrix.ResultMatrixImageCell |
libraryImage(String mainName,
String statusName) |
ResultMatrix.ResultMatrixLinkCell |
linkCell(Object value,
String targetPage,
String targetPageState) |
ResultMatrix.ResultMatrixLinkCell |
linkToPriceGrid(Object value,
long priceGridID,
Filter filter) |
ResultMatrix.ResultMatrixLinkCell |
linkToPriceList(Object value,
long priceListID,
Filter filter) |
ResultMatrix.ResultMatrixOnRowSelection |
onRowSelection()
Configures a client-side UI event.
|
void |
setColumnFormat(String column,
FieldFormatType fft)
Sets a column format for a specified column
|
void |
setColumnTooltip(String column,
String tooltip)
Adds a tooltip to a column
|
void |
setDefaultFormat(FieldFormatType fft)
Sets a default column format
|
void |
setDisableSorting(boolean disableSorting)
Set sorting capability in UI grid
|
void |
setEnableClientFilter(boolean enableClientFilter) |
void |
setEscapeHTML(boolean escapeHTML)
Set HTML escaping flag.
|
void |
setPreferenceName(String preferenceName)
Sets the so-called preference name.
|
void |
setTitle(String title)
Sets the title that will be shown as window title of the result matrix in the client
|
ResultMatrix.ResultMatrixStyledCell |
styledCell(Object value)
Creates a styled cell that can then be added as row value
|
ResultMatrix.ResultMatrixStyledCell |
styledCell(Object value,
String textColor,
String bgColor)
Creates a styled cell that can then be added as row value
|
ResultMatrix.ResultMatrixStyledCell |
styledCell(Object value,
String textColor,
String bgColor,
String weight)
Creates a styled cell that can then be added as row value
|
ResultMatrix.ResultMatrixStyledCell |
styledCell(Object value,
String textColor,
String bgColor,
String weight,
String alignment)
Creates a styled cell that can then be added as row value
|
Matrix2D |
toMatrix2D() |
String |
toString() |
ResultMatrix |
transpose(String newHeaderColumnName)
Transpose the matrix.
|
ResultMatrix |
transpose(String newHeaderColumnName,
String oldColLabelsInNewColumnName)
Transpose the matrix.
|
public ResultMatrix()
public ResultMatrix(Map jsonMap)
public ResultMatrix(String... columns)
columns
- The initial set of column namespublic ResultMatrix(Collection<String> columns)
columns
- Collection of column namespublic String getTitle()
public void setTitle(String title)
title
- The titlepublic String getPreferenceName()
public boolean isSortingDisabled()
public void setDisableSorting(boolean disableSorting)
disableSorting
- true: sorting is disabled in UI on all columnspublic boolean isEscapeHTML()
public void setEscapeHTML(boolean escapeHTML)
escapeHTML
- public void setPreferenceName(String preferenceName)
preferenceName
- The preference namepublic void addColumnTranslation(String column, Map<String,String> translations)
column
- The column name (as defined e.g. in the constructor)translations
- A map with the translations. The key of the map is the locale, like "de".public Map<String,String> getColumnTranslations()
public void addColumn(String column)
column
- The columns namepublic void addColumn(String column, String tooltip)
column
- The columns namepublic void addColumns(Collection<String> columns)
columns
- Collection of columns namespublic void addRow(Map<String,Object> row)
row
- public void addRow(List<Object> row)
row
- Row as Listpublic void addRow(Object... values)
row
- Row as Arraypublic List<Map<String,Object>> getEntries()
public Map<String,Object> findRow(String key, Object value)
key
- The column name to search onvalue
- The value to match the row's column value topublic ResultMatrix transpose(String newHeaderColumnName)
ProductGroup | AvgPrice | AvgMargin <- header row ----------------------------------- Beef | 4.1€ | 3.6% Pork | 2.2€ | 1.1% Lamb | 4.6€ | 5.2%Transposed matrix:
transpose("ProductGroup") ProductGroup | Beef | Pork | Lamb <- header row --------------------------------- AvgPrice | 4.1€ | 2.2€ | 4.6€ AvgMargin | 3.6% | 1.1% | 5.2%
newHeaderColumnName
- Name of the column that will become the new header rowpublic ResultMatrix transpose(String newHeaderColumnName, String oldColLabelsInNewColumnName)
ProductGroup | AvgPrice | AvgMargin <- header row ------------------------------------ Beef | 4.1€ | 3.6% Pork | 2.2€ | 1.1% Lamb | 4.6€ | 5.2%Transposed matrix:
transpose("ProductGroup", "PG Label") Beef | Pork | Lamb | PG Label <- header row ----------------------------------- Beef | Pork | Lamb | ProductGroup 4.1€ | 2.2€ | 4.6€ | AvgPrice 3.6% | 1.1% | 5.2% | AvgMargin
newHeaderColumnName
- Name of the column that will become the new header rowoldColLabelsInNewColumnName
- Name of the new column that will receive the old column headers as values (optional)public Matrix2D toMatrix2D()
public void setDefaultFormat(FieldFormatType fft)
fft
- public FieldFormatType getDefaultFormat()
public Map<String,FieldFormatType> getColumnFormats()
public void setColumnFormat(String column, FieldFormatType fft)
column
- The column namefft
- The formatpublic Map<String,String> getColumnTooltips()
public void setColumnTooltip(String column, String tooltip)
column
- The column nametooltip
- The tooltip textpublic boolean isEnableClientFilter()
public void setEnableClientFilter(boolean enableClientFilter)
public ResultMatrix.ResultMatrixStyledCell styledCell(Object value)
value
- The value of the cellpublic ResultMatrix.ResultMatrixStyledCell styledCell(Object value, String textColor, String bgColor)
value
- The value of the celltextColor
- The text color of the cellbgColor
- The background color of the cell (HTML hex value)public ResultMatrix.ResultMatrixStyledCell styledCell(Object value, String textColor, String bgColor, String weight)
value
- The value of the celltextColor
- The text color of the cellbgColor
- The background color of the cell (HTML hex value)weight
- The font weightpublic ResultMatrix.ResultMatrixStyledCell styledCell(Object value, String textColor, String bgColor, String weight, String alignment)
value
- The value of the celltextColor
- The text color of the cellbgColor
- The background color of the cell (HTML hex value)weight
- The font weightalignment
- Cell alignement value (valid CSS)public ResultMatrix.ResultMatrixImageCell imageCell(Object value)
value
- The image URLpublic ResultMatrix.ResultMatrixImageCell libraryImage(String mainName, String statusName)
public ResultMatrix.ResultMatrixLinkCell linkToPriceGrid(Object value, long priceGridID, Filter filter)
public ResultMatrix.ResultMatrixLinkCell linkToPriceList(Object value, long priceListID, Filter filter)
public ResultMatrix.ResultMatrixLinkCell linkCell(Object value, String targetPage, String targetPageState)
public ResultMatrix.ResultMatrixOnRowSelection onRowSelection()
matrix.onRowSelection().triggerEvent(api.dashboardWideEvent("CustomerIdChanged-ED")).withColValueAsEventDataAttr("CustomerID", "customerId")The embedded dashboard that receives the event could then look like:
return api.dashboard("EmbeddedDashboard") // Here the user can assign values to the embedded // dashboard inputs common to all three modes .setParam("Customer Id", api.input("Customer Id")) .setParam("Year", api.input("Year")) // Show the dashboard embedded ... .showEmbedded() // ... and reevaluate it on "CustomerIdChanged-ED" // Note: "dashboardWideEvent()" fce makes the event local // to the containing dashboard instance .andRecalculateOn(api.dashboardWideEvent("CustomerIdChanged-ED")) // Pull the "customerId" attribute out of the event payload and expose it // as the "Customer Id" input to the embedded dashboard .withEventDataAttr("customerId").asParam("Customer Id")
public String getResultType()
getResultType
in interface ComplexCalculationResult
Copyright © 2019. All rights reserved.