Search in sources :

Example 1 with TextLineBreakWrap

use of com.ait.lienzo.client.core.shape.TextLineBreakWrap in project kie-wb-common by kiegroup.

the class RendererUtils method getExpressionText.

private static Group getExpressionText(final GridRendererTheme theme, final String text) {
    final Group g = GWT.create(Group.class);
    final Text t = makeExpressionText(theme);
    t.setText(text);
    t.setListening(false);
    t.setX(EXPRESSION_TEXT_PADDING);
    t.setY(EXPRESSION_TEXT_PADDING);
    t.setTextAlign(TextAlign.LEFT);
    t.setWrapper(new TextLineBreakWrap(t));
    g.add(t);
    return g;
}
Also used : Group(com.ait.lienzo.client.core.shape.Group) Text(com.ait.lienzo.client.core.shape.Text) TextLineBreakWrap(com.ait.lienzo.client.core.shape.TextLineBreakWrap)

Example 2 with TextLineBreakWrap

use of com.ait.lienzo.client.core.shape.TextLineBreakWrap in project kie-wb-common by kiegroup.

the class TextWrapperProviderTest method testLineBreak.

@Test
public void testLineBreak() {
    final ITextWrapper wrapper = TextWrapperProvider.get(TextWrapperStrategy.LINE_BREAK, text);
    assertTrue(wrapper instanceof TextLineBreakWrap);
}
Also used : ITextWrapper(com.ait.lienzo.client.core.shape.ITextWrapper) TextLineBreakWrap(com.ait.lienzo.client.core.shape.TextLineBreakWrap) Test(org.junit.Test)

Aggregations

TextLineBreakWrap (com.ait.lienzo.client.core.shape.TextLineBreakWrap)2 Group (com.ait.lienzo.client.core.shape.Group)1 ITextWrapper (com.ait.lienzo.client.core.shape.ITextWrapper)1 Text (com.ait.lienzo.client.core.shape.Text)1 Test (org.junit.Test)1