Search in sources :

Example 6 with GridRendererTheme

use of org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.themes.GridRendererTheme in project kie-wb-common by kiegroup.

the class RendererUtils method getExpressionHeaderText.

public static Group getExpressionHeaderText(final EditableHeaderMetaData headerMetaData, final GridHeaderColumnRenderContext context) {
    final GridRenderer gridRenderer = context.getRenderer();
    final GridRendererTheme theme = gridRenderer.getTheme();
    return getExpressionText(theme, headerMetaData.getTitle());
}
Also used : GridRendererTheme(org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.themes.GridRendererTheme) GridRenderer(org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.GridRenderer)

Example 7 with GridRendererTheme

use of org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.themes.GridRendererTheme in project kie-wb-common by kiegroup.

the class RendererUtils method getExpressionCellText.

public static Group getExpressionCellText(final GridBodyCellRenderContext context, final GridCell<String> gridCell) {
    final GridRenderer gridRenderer = context.getRenderer();
    final GridRendererTheme theme = gridRenderer.getTheme();
    return getExpressionText(theme, gridCell.getValue().getValue());
}
Also used : GridRendererTheme(org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.themes.GridRendererTheme) GridRenderer(org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.GridRenderer)

Example 8 with GridRendererTheme

use of org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.themes.GridRendererTheme in project kie-wb-common by kiegroup.

the class RendererUtils method getCenteredCellText.

public static Group getCenteredCellText(final GridBodyCellRenderContext context, final GridCell<String> gridCell) {
    final GridRenderer gridRenderer = context.getRenderer();
    final GridRendererTheme theme = gridRenderer.getTheme();
    final Group g = GWT.create(Group.class);
    String value = gridCell.getValue().getValue();
    final Text t;
    if (!StringUtils.isEmpty(value)) {
        t = theme.getBodyText();
    } else {
        value = gridCell.getValue().getPlaceHolder();
        t = theme.getPlaceholderText();
    }
    t.setText(value);
    t.setListening(false);
    t.setX(context.getCellWidth() / 2);
    t.setY(context.getCellHeight() / 2);
    g.add(t);
    return g;
}
Also used : Group(com.ait.lienzo.client.core.shape.Group) GridRendererTheme(org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.themes.GridRendererTheme) Text(com.ait.lienzo.client.core.shape.Text) GridRenderer(org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.GridRenderer)

Aggregations

GridRenderer (org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.grids.GridRenderer)8 GridRendererTheme (org.uberfire.ext.wires.core.grids.client.widget.grid.renderers.themes.GridRendererTheme)8 Text (com.ait.lienzo.client.core.shape.Text)6 Group (com.ait.lienzo.client.core.shape.Group)3 Test (org.junit.Test)2 Decision (org.kie.workbench.common.dmn.api.definition.model.Decision)1 InformationItemPrimary (org.kie.workbench.common.dmn.api.definition.model.InformationItemPrimary)1 QName (org.kie.workbench.common.dmn.api.property.dmn.QName)1