use of com.ait.lienzo.client.core.shape.Text in project drools-wb by kiegroup.
the class ScenarioGridColumnRenderer method renderCell.
@Override
public Group renderCell(final GridCell<String> cell, final GridBodyCellRenderContext context) {
if (cell == null || cell.getValue() == null || (cell.getValue().getValue() == null && cell.getValue().getPlaceHolder() == null)) {
return null;
}
final ScenarioGridRendererTheme theme = (ScenarioGridRendererTheme) context.getRenderer().getTheme();
Text text;
String value;
// Show placeholder only if the following conditions are met
if ((cell instanceof ScenarioGridCell) && cell.getValue() != null && (cell.getValue().getValue() == null || cell.getValue().getValue().isEmpty()) && cell.getValue().getPlaceHolder() != null) {
// Render as placeholder
text = theme.getPlaceholderText();
value = cell.getValue().getPlaceHolder();
} else {
text = ((ScenarioGridCell) cell).isErrorMode() ? theme.getErrorText() : theme.getBodyText();
value = getValueToShow((ScenarioGridCell) cell);
}
return internalRenderCell(cell, context, text, value);
}
Aggregations