Class TableWidget
- java.lang.Object
-
- org.csstudio.display.builder.model.Widget
-
- org.csstudio.display.builder.model.widgets.VisibleWidget
-
- org.csstudio.display.builder.model.widgets.TableWidget
-
public class TableWidget extends VisibleWidget
Widget that displays a string tableThe 'value' can be either a VTable or a
List<List<String>>
. The latter includes 2-D string arrays written by Jython scripts. Note: this class cannot inherit fromPVWidget
because of the peculiar usage of "runtime value".
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TableWidget.ColumnProperty
-
Field Summary
Fields Modifier and Type Field Description static org.csstudio.display.builder.model.ArrayWidgetProperty.Descriptor<TableWidget.ColumnProperty>
propColumns
'columns' arraystatic org.csstudio.display.builder.model.WidgetDescriptor
WIDGET_DESCRIPTOR
Widget descriptor-
Fields inherited from class org.csstudio.display.builder.model.Widget
BASE_WIDGET_VERSION, USER_DATA_REPRESENTATION, USER_DATA_RUNTIME, USER_DATA_SCRIPT_SUPPORT, USER_DATA_TOOLKIT_PARENT
-
-
Constructor Summary
Constructors Constructor Description TableWidget()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<java.lang.String>
getColumnOptions(int column)
Get options for a column's valuesorg.csstudio.display.builder.model.WidgetConfigurator
getConfigurator(org.csstudio.display.builder.model.Version persisted_version)
Obtain configurator.java.util.List<java.lang.String>
getHeaders()
WidgetProperty<?>
getProperty(java.lang.String name)
Allow scripts to access "value"java.util.List<java.util.List<java.lang.String>>
getValue()
Fetch value, i.e.WidgetProperty<org.csstudio.display.builder.model.properties.WidgetColor>
propBackgroundColor()
org.csstudio.display.builder.model.ArrayWidgetProperty<TableWidget.ColumnProperty>
propColumns()
WidgetProperty<java.lang.Boolean>
propEditable()
WidgetProperty<org.csstudio.display.builder.model.properties.WidgetFont>
propFont()
WidgetProperty<org.csstudio.display.builder.model.properties.WidgetColor>
propForegroundColor()
WidgetProperty<java.lang.String>
propPVName()
WidgetProperty<java.lang.Boolean>
propRowSelectionMode()
WidgetProperty<java.lang.String>
propSelectionPV()
WidgetProperty<java.lang.Boolean>
propToolbar()
WidgetProperty<java.util.List<java.util.List<org.csstudio.display.builder.model.properties.WidgetColor>>>
runtimeCellColors()
WidgetProperty<org.epics.vtype.VType>
runtimePropSelection()
WidgetProperty<java.util.List<java.lang.Integer>>
runtimePropSetSelection()
WidgetProperty<java.lang.Object>
runtimeValue()
void
setCellColor(int row, int column, org.csstudio.display.builder.model.properties.WidgetColor color)
Set the color of a specific cellvoid
setCellValue(int row, int column, java.lang.String cell_text)
Set the text of a specific cellvoid
setColumnOptions(int column, java.util.List<java.lang.String> options)
Set options for a column's valuesvoid
setColumnWidth(int column, int width)
Set width of a columnvoid
setEditable(int column, boolean editable)
Set column to be editable (default) or notvoid
setHeaders(java.util.List<java.lang.String> headers)
Define columns based on column namesvoid
setSelection(java.util.List<java.lang.Integer> rows_cols)
Select specific cellsvoid
setValue(java.lang.Object data)
Set value, i.e.-
Methods inherited from class org.csstudio.display.builder.model.widgets.VisibleWidget
propTooltip, propVisible, runtimePropConnected
-
Methods inherited from class org.csstudio.display.builder.model.Widget
checkDisplayModel, checkProperty, checkProperty, clearUserData, expandPropertyNames, getDisplayModel, getEffectiveMacros, getID, getMacrosOrProperties, getName, getParent, getProperties, getProperty, getPropertyByPath, getPropertyValue, getPropertyValue, getTopDisplayModel, getType, getUserData, getVersion, getWidgetClass, isClean, propActions, propClass, propHeight, propName, propRules, propScripts, propWidth, propX, propY, setConfiguratorResult, setPropertyValue, setPropertyValue, setUserData, toString
-
-
-
-
Field Detail
-
WIDGET_DESCRIPTOR
public static final org.csstudio.display.builder.model.WidgetDescriptor WIDGET_DESCRIPTOR
Widget descriptor
-
propColumns
public static final org.csstudio.display.builder.model.ArrayWidgetProperty.Descriptor<TableWidget.ColumnProperty> propColumns
'columns' array
-
-
Method Detail
-
getProperty
public WidgetProperty<?> getProperty(java.lang.String name)
Allow scripts to access "value"- Overrides:
getProperty
in classWidget
- Parameters:
name
- Property name- Returns:
WidgetProperty
- See Also:
Widget.checkProperty(String)
-
getConfigurator
public org.csstudio.display.builder.model.WidgetConfigurator getConfigurator(org.csstudio.display.builder.model.Version persisted_version) throws java.lang.Exception
Description copied from class:Widget
Obtain configurator.While typically using the default
WidgetConfigurator
, widget may provide a different configurator for reading older persisted date.- Overrides:
getConfigurator
in classWidget
- Parameters:
persisted_version
- Version of the persisted data.- Returns:
- Widget configurator for that version
- Throws:
java.lang.Exception
- if persisted version cannot be handled
-
propBackgroundColor
public WidgetProperty<org.csstudio.display.builder.model.properties.WidgetColor> propBackgroundColor()
- Returns:
- 'background_color' property
-
propForegroundColor
public WidgetProperty<org.csstudio.display.builder.model.properties.WidgetColor> propForegroundColor()
- Returns:
- 'foreground_color' property
-
propFont
public WidgetProperty<org.csstudio.display.builder.model.properties.WidgetFont> propFont()
- Returns:
- 'font' property
-
propToolbar
public WidgetProperty<java.lang.Boolean> propToolbar()
- Returns:
- 'show_toolbar' property
-
propColumns
public org.csstudio.display.builder.model.ArrayWidgetProperty<TableWidget.ColumnProperty> propColumns()
- Returns:
- 'columns' property
-
getHeaders
public java.util.List<java.lang.String> getHeaders()
- Returns:
- Column headers
-
setHeaders
public void setHeaders(java.util.List<java.lang.String> headers)
Define columns based on column namesClears the table, i.e. sets value to empty data.
- Parameters:
headers
- Names of the columns
-
setEditable
public void setEditable(int column, boolean editable)
Set column to be editable (default) or notConvenience routine for
propColumns()
- Parameters:
column
- Column index, must be 0 ..propColumns().size()-1
editable
- Should column be editable?
-
setColumnWidth
public void setColumnWidth(int column, int width)
Set width of a columnConvenience routine for
propColumns()
- Parameters:
column
- Column index, must be 0 ..propColumns().size()-1
width
- Column width
-
getColumnOptions
public java.util.List<java.lang.String> getColumnOptions(int column)
Get options for a column's valuesConvenience routine for
propColumns()
- Parameters:
column
- Column index, must be 0 ..propColumns().size()-1
- Returns:
- Options that combo editor will present for the cells in that column
-
setColumnOptions
public void setColumnOptions(int column, java.util.List<java.lang.String> options)
Set options for a column's valuesConvenience routine for
propColumns()
- Parameters:
column
- Column index, must be 0 ..propColumns().size()-1
options
- Options to present in combo editor for the cells in that column
-
propPVName
public WidgetProperty<java.lang.String> propPVName()
- Returns:
- 'pv_name' property
-
runtimeValue
public WidgetProperty<java.lang.Object> runtimeValue()
- Returns:
- Runtime 'value'
-
setValue
public void setValue(java.lang.Object data)
Set value, i.e. content of cells in tableConvenience routine for
runtimeValue()
. and converting the data to a 2D list of strings.Accepts either a
List
of rows, where each row is aList
of columnString
s, or aVTable
- Parameters:
data
-List
of rows, orVTable
-
setCellValue
public void setCellValue(int row, int column, java.lang.String cell_text)
Set the text of a specific cellConvenience routine for updating the value property
- Parameters:
row
- Table rowcolumn
- Table columncell_text
- Text for that cell.
-
getValue
public java.util.List<java.util.List<java.lang.String>> getValue()
Fetch value, i.e. content of cells in tableConvenience routine for
runtimeValue()
and converting the data to a 2D list of strings.- Returns:
List
of rows, where each row is aList
of columnString
s
-
runtimeCellColors
public WidgetProperty<java.util.List<java.util.List<org.csstudio.display.builder.model.properties.WidgetColor>>> runtimeCellColors()
- Returns:
- Runtime 'cell_colors'
-
setCellColor
public void setCellColor(int row, int column, org.csstudio.display.builder.model.properties.WidgetColor color)
Set the color of a specific cellConvenience routine for updating the 'cell_colors' property
- Parameters:
row
- Table rowcolumn
- Table columncolor
- Color to use for that cell.null
for default.
-
setSelection
public void setSelection(java.util.List<java.lang.Integer> rows_cols)
Select specific cellsSelects based on a flattened list of (row, col) pairs. Even in "row selection mode" where completed rows are selected instead of individual cells, the list must contain (row, col) data, and col may always be 0.
- Parameters:
rows_cols
- List of row, col, row, col, ..
-
propEditable
public WidgetProperty<java.lang.Boolean> propEditable()
- Returns:
- 'editable' property
-
propRowSelectionMode
public WidgetProperty<java.lang.Boolean> propRowSelectionMode()
- Returns:
- Misc. 'row_selection_mode'
-
propSelectionPV
public WidgetProperty<java.lang.String> propSelectionPV()
- Returns:
- Misc. 'selection_pv'
-
runtimePropSelection
public WidgetProperty<org.epics.vtype.VType> runtimePropSelection()
- Returns:
- Runtime 'selection' property
-
runtimePropSetSelection
public WidgetProperty<java.util.List<java.lang.Integer>> runtimePropSetSelection()
- Returns:
- Runtime 'set_selection' property
-
-