use of org.csstudio.opibuilder.properties.StringTableProperty in project yamcs-studio by yamcs.
the class TableModel method configureProperties.
@Override
protected void configureProperties() {
addProperty(new BooleanProperty(PROP_EDITABLE, "Editable", WidgetPropertyCategory.Behavior, true));
StringTableProperty contentProperty = new StringTableProperty(PROP_DEFAULT_CONTENT, "Default Content", WidgetPropertyCategory.Display, new String[][] { { "" } }, new String[] { "" });
addProperty(contentProperty);
String[] dropDownOptions = new String[org.csstudio.swt.widgets.natives.SpreadSheetTable.CellEditorType.values().length];
for (int i = 0; i < dropDownOptions.length; i++) dropDownOptions[i] = org.csstudio.swt.widgets.natives.SpreadSheetTable.CellEditorType.values()[i].name();
StringTableProperty headersProperty = new StringTableProperty(PROP_COLUMN_HEADERS, "Column Headers", WidgetPropertyCategory.Display, new String[0][0], new String[] { "Column Title", "Column Width", "Editable", "CellEditor" }, new CellEditorType[] { CellEditorType.TEXT, CellEditorType.TEXT, CellEditorType.CHECKBOX, CellEditorType.DROPDOWN }, new Object[] { null, null, new String[] { "Yes", "No" }, dropDownOptions });
addProperty(headersProperty);
IntegerProperty columnsCountProperty = new IntegerProperty(PROP_COLUMNS_COUNT, "Columns Count", WidgetPropertyCategory.Display, 1, 1, 10000);
addProperty(columnsCountProperty);
addProperty(new BooleanProperty(PROP_COLUMN_HEADER_VISIBLE, "Column Header Visible", WidgetPropertyCategory.Display, true));
headersProperty.addPropertyChangeListener(new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
updateContentPropertyTitles();
}
});
columnsCountProperty.addPropertyChangeListener(new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
updateContentPropertyTitles();
}
});
}
Aggregations