use of org.talend.designer.scd.ui.ColorCombo in project tdi-studio-se by Talend.
the class TableEditorManager method setComboColor.
public void setComboColor(TableItem item, int column, Color color) {
ColorCombo combo = (ColorCombo) getEditor(item, column).getEditor();
combo.setTextBackground(color);
}
use of org.talend.designer.scd.ui.ColorCombo in project tdi-studio-se by Talend.
the class TableEditorManager method createComboEditor.
public TableEditor createComboEditor(Table table, String[] displayText, TableItem item, int column, int selectIndex, final IPropertySetter<Integer> accessor) {
TableEditor editor = new TableEditor(table);
final ColorCombo combo = new ColorCombo(table, SWT.READ_ONLY);
for (String text : displayText) {
combo.add(text);
}
if (accessor != null) {
combo.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
accessor.set(combo.getSelectionIndex());
}
});
}
combo.select(selectIndex);
editor.grabHorizontal = true;
editor.setEditor(combo, item, column);
editor.minimumWidth = combo.computeSize(SWT.DEFAULT, SWT.DEFAULT).x;
table.getColumn(column).setWidth(editor.minimumWidth);
addEditor(item, column, editor);
return editor;
}
Aggregations