use of org.eclipse.scout.rt.client.ui.basic.cell.Cell in project scout.rt by eclipse.
the class AbstractTreeNodeBuilder method createTreeNode.
public ITreeNode createTreeNode(ILookupRow<LOOKUP_ROW_TYPE> lookupRow, int nodeStatus, boolean markChildrenLoaded) {
ITreeNode treeNode = createEmptyTreeNode();
// fill values to treeNode
treeNode.setPrimaryKey(lookupRow.getKey());
treeNode.setEnabled(lookupRow.isEnabled(), IDimensions.ENABLED);
treeNode.setStatusInternal(nodeStatus);
if (markChildrenLoaded) {
treeNode.setChildrenLoaded(markChildrenLoaded);
}
Cell cell = treeNode.getCellForUpdate();
cell.setValue(lookupRow);
cell.setText(lookupRow.getText());
cell.setTooltipText(lookupRow.getTooltipText());
if (cell.getIconId() == null) {
cell.setIconId(lookupRow.getIconId());
}
cell.setCssClass(lookupRow.getCssClass());
cell.setBackgroundColor(lookupRow.getBackgroundColor());
cell.setForegroundColor(lookupRow.getForegroundColor());
cell.setFont(lookupRow.getFont());
// hint for inactive codes
if (!lookupRow.isActive()) {
if (cell.getFont() == null) {
cell.setFont(FontSpec.parse("italic"));
}
cell.setText(lookupRow.getText() + " (" + TEXTS.get("InactiveState") + ")");
}
return treeNode;
}
use of org.eclipse.scout.rt.client.ui.basic.cell.Cell in project scout.rt by eclipse.
the class AbstractTable method addCellObserver.
/**
* Add InternalTableRow as an observer to the cell in order to update the row status on changes
*/
private void addCellObserver(List<InternalTableRow> rows) {
for (InternalTableRow row : rows) {
for (int i = 0; i < row.getCellCount(); i++) {
Cell cell = row.getCellForUpdate(i);
cell.setObserver(row);
}
}
}
use of org.eclipse.scout.rt.client.ui.basic.cell.Cell in project scout.rt by eclipse.
the class AbstractTableRowBuilder method createTableRow.
public ITableRow createTableRow(ILookupRow<T> dataRow) {
ITableRow tableRow = createEmptyTableRow();
tableRow.setEnabled(dataRow.isEnabled());
Cell cell = tableRow.getCellForUpdate(1);
if (dataRow.getTooltipText() != null) {
cell.setTooltipText(dataRow.getTooltipText());
}
if (dataRow.getIconId() != null) {
cell.setIconId(dataRow.getIconId());
}
if (dataRow.getBackgroundColor() != null) {
cell.setBackgroundColor(dataRow.getBackgroundColor());
}
if (dataRow.getForegroundColor() != null) {
cell.setForegroundColor(dataRow.getForegroundColor());
}
if (dataRow.getFont() != null) {
cell.setFont(dataRow.getFont());
}
tableRow.setStatusNonchanged();
return tableRow;
}
use of org.eclipse.scout.rt.client.ui.basic.cell.Cell in project scout.rt by eclipse.
the class AbstractColumn method initCell.
/**
* Initialize cell with column defaults.
*/
@Override
public void initCell(ITableRow row) {
Cell cell = row.getCellForUpdate(this);
if (getForegroundColor() != null) {
cell.setForegroundColor(getForegroundColor());
}
if (getBackgroundColor() != null) {
cell.setBackgroundColor(getBackgroundColor());
}
if (getFont() != null) {
cell.setFont(getFont());
}
if (getCssClass() != null) {
cell.setCssClass(getCssClass());
}
cell.setHorizontalAlignment(getHorizontalAlignment());
cell.setEditable(isEditable());
cell.setHtmlEnabled(isHtmlEnabled());
cell.setMandatory(isMandatory());
}
use of org.eclipse.scout.rt.client.ui.basic.cell.Cell in project scout.rt by eclipse.
the class AbstractContentAssistColumn method applyLookupResult.
protected void applyLookupResult(ITableRow tableRow, List<? extends ILookupRow<?>> result) {
// disable row changed trigger on row
try {
tableRow.setRowChanging(true);
//
Cell cell = tableRow.getCellForUpdate(this);
String separator = getResultRowSeparator();
List<String> texts = CollectionUtility.emptyArrayList();
List<String> tooltipTexts = CollectionUtility.emptyArrayList();
for (ILookupRow<?> row : result) {
texts.add(row.getText());
tooltipTexts.add(row.getTooltipText());
}
cell.setText(StringUtility.join(separator, texts));
cell.setTooltipText(StringUtility.join(separator, tooltipTexts));
} finally {
tableRow.setRowPropertiesChanged(false);
tableRow.setRowChanging(false);
}
}
Aggregations