Search in sources :

Example 26 with Text

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);
}
Also used : ScenarioGridCell(org.drools.workbench.screens.scenariosimulation.client.widgets.ScenarioGridCell) Text(com.ait.lienzo.client.core.shape.Text) JSONString(com.google.gwt.json.client.JSONString)

Aggregations

Text (com.ait.lienzo.client.core.shape.Text)26 Group (com.ait.lienzo.client.core.shape.Group)10 GridRenderer (org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.GridRenderer)6 GridRendererTheme (org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.themes.GridRendererTheme)6 Test (org.junit.Test)5 BoundingBox (com.ait.lienzo.client.core.types.BoundingBox)4 Rectangle (com.ait.lienzo.client.core.shape.Rectangle)3 TextBoundsWrap (com.ait.lienzo.client.core.shape.TextBoundsWrap)2 Field (java.lang.reflect.Field)2 GridBodyCellRenderContext (org.uberfire.ext.wires.core.grids.client.widget.context.GridBodyCellRenderContext)2 AnimationProperties (com.ait.lienzo.client.core.animation.AnimationProperties)1 IAnimation (com.ait.lienzo.client.core.animation.IAnimation)1 IAnimationCallback (com.ait.lienzo.client.core.animation.IAnimationCallback)1 IAnimationHandle (com.ait.lienzo.client.core.animation.IAnimationHandle)1 IPathClipper (com.ait.lienzo.client.core.shape.IPathClipper)1 ITextWrapper (com.ait.lienzo.client.core.shape.ITextWrapper)1 MultiPath (com.ait.lienzo.client.core.shape.MultiPath)1 Node (com.ait.lienzo.client.core.shape.Node)1 TextLineBreakWrap (com.ait.lienzo.client.core.shape.TextLineBreakWrap)1 WiresShape (com.ait.lienzo.client.core.shape.wires.WiresShape)1