Examples of CssStyle


Examples of com.google.gwt.uibinder.test.client.gss.WidgetUsingCss.CssStyle

    assertEquals(expectedCss, widgetUsingGss.style.getText());
  }

  public void testCssConversion() {
    WidgetUsingCss widgetUsingCss = new WidgetUsingCss();
    CssStyle style = widgetUsingCss.style;
    RootPanel.get().add(widgetUsingCss);

    assertEquals(style.main(), widgetUsingCss.getStyleName());
    String expectedCss = "." + style.main() + "{background-color:black;color:white}";
    assertEquals(expectedCss, widgetUsingCss.style.getText());
  }
View Full Code Here

Examples of nextapp.echo2.webrender.output.CssStyle

    /**
     * Test basic operations.
     */
    public void testBasic() {
        CssStyle style = new CssStyle();
        assertNull(style.getAttribute("color"));
        assertEquals("", style.renderInline());
        assertFalse(style.hasAttributes());
       
        style.setAttribute("border", "10px solid red");
        assertEquals("10px solid red", style.getAttribute("border"));
        assertEquals("border:10px solid red;", style.renderInline());
        assertTrue(style.hasAttributes());
       
        style.setAttribute("border", "10px solid blue");
        assertEquals("10px solid blue", style.getAttribute("border"));
        assertEquals("border:10px solid blue;", style.renderInline());
       
        style.setAttribute("background-color", "green");
        // Note that we know ordering here only because we know the underlying implementation
        // uses the proprietary low-memory associative array technique.
        assertEquals("border:10px solid blue;background-color:green;", style.renderInline());
       
        assertNull(style.getAttribute("color"));
        assertEquals("10px solid blue", style.getAttribute("border"));
        assertEquals("green", style.getAttribute("background-color"));
    }
View Full Code Here

Examples of nextapp.echo2.webrender.output.CssStyle

*/
public class FontRenderTest extends TestCase {

    public void testFontRender() {
        Font font = new Font(Font.VERDANA, Font.BOLD | Font.UNDERLINE, new Extent(12, Extent.PT));
        CssStyle cssStyle = new CssStyle();
        FontRender.renderToStyle(cssStyle, font);
        assertEquals("Verdana,Arial,Helvetica,Sans-Serif", cssStyle.getAttribute("font-family"));
        assertEquals("bold", cssStyle.getAttribute("font-weight"));
        assertEquals("underline", cssStyle.getAttribute("text-decoration"));
        assertEquals(null, cssStyle.getAttribute("font-style"));
    }
View Full Code Here

Examples of nextapp.echo2.webrender.output.CssStyle

        assertEquals("right", cssStyle.getAttribute("text-align"));
    }
   
    public void testHorizontalWithComponentRTL() {
        Alignment alignment;
        CssStyle cssStyle = new CssStyle();
        Component component = new NullComponent();
        component.setLayoutDirection(LayoutDirection.RTL);
       
        alignment = new Alignment(Alignment.DEFAULT, Alignment.DEFAULT);
        AlignmentRender.renderToStyle(cssStyle, alignment, component);
        assertNull(cssStyle.getAttribute("text-align"));
       
        alignment = new Alignment(Alignment.TOP, Alignment.DEFAULT); // Invalid
        AlignmentRender.renderToStyle(cssStyle, alignment, component);
        assertNull(cssStyle.getAttribute("text-align"));
       
        alignment = new Alignment(Alignment.LEFT, Alignment.DEFAULT);
        AlignmentRender.renderToStyle(cssStyle, alignment, component);
        assertEquals("left", cssStyle.getAttribute("text-align"));
       
        alignment = new Alignment(Alignment.CENTER, Alignment.DEFAULT);
        AlignmentRender.renderToStyle(cssStyle, alignment, component);
        assertEquals("center", cssStyle.getAttribute("text-align"));
       
        alignment = new Alignment(Alignment.RIGHT, Alignment.DEFAULT);
        AlignmentRender.renderToStyle(cssStyle, alignment, component);
        assertEquals("right", cssStyle.getAttribute("text-align"));
       
        alignment = new Alignment(Alignment.TRAILING, Alignment.DEFAULT);
        AlignmentRender.renderToStyle(cssStyle, alignment, component);
        assertEquals("left", cssStyle.getAttribute("text-align"));

        alignment = new Alignment(Alignment.LEADING, Alignment.DEFAULT);
        AlignmentRender.renderToStyle(cssStyle, alignment, component);
        assertEquals("right", cssStyle.getAttribute("text-align"));
    }
View Full Code Here

Examples of nextapp.echo2.webrender.output.CssStyle

        assertEquals("right", cssStyle.getAttribute("text-align"));
    }
   
    public void testHorizontalWithoutComponent() {
        Alignment alignment;
        CssStyle cssStyle = new CssStyle();
       
        alignment = new Alignment(Alignment.DEFAULT, Alignment.DEFAULT);
        AlignmentRender.renderToStyle(cssStyle, alignment);
        assertNull(cssStyle.getAttribute("text-align"));
       
        alignment = new Alignment(Alignment.TOP, Alignment.DEFAULT); // Invalid
        AlignmentRender.renderToStyle(cssStyle, alignment);
        assertNull(cssStyle.getAttribute("text-align"));
       
        alignment = new Alignment(Alignment.LEFT, Alignment.DEFAULT);
        AlignmentRender.renderToStyle(cssStyle, alignment);
        assertEquals("left", cssStyle.getAttribute("text-align"));
       
        alignment = new Alignment(Alignment.CENTER, Alignment.DEFAULT);
        AlignmentRender.renderToStyle(cssStyle, alignment);
        assertEquals("center", cssStyle.getAttribute("text-align"));
       
        alignment = new Alignment(Alignment.RIGHT, Alignment.DEFAULT);
        AlignmentRender.renderToStyle(cssStyle, alignment);
        assertEquals("right", cssStyle.getAttribute("text-align"));

        alignment = new Alignment(Alignment.LEADING, Alignment.DEFAULT);
        AlignmentRender.renderToStyle(cssStyle, alignment);
        assertEquals("left", cssStyle.getAttribute("text-align"));
       
        alignment = new Alignment(Alignment.TRAILING, Alignment.DEFAULT);
        AlignmentRender.renderToStyle(cssStyle, alignment);
        assertEquals("right", cssStyle.getAttribute("text-align"));
    }
View Full Code Here

Examples of nextapp.echo2.webrender.output.CssStyle

        assertEquals("right", cssStyle.getAttribute("text-align"));
    }
   
    public void testVertical() {
        Alignment alignment;
        CssStyle cssStyle = new CssStyle();
       
        alignment = new Alignment(Alignment.DEFAULT, Alignment.DEFAULT);
        AlignmentRender.renderToStyle(cssStyle, alignment);
        assertNull(cssStyle.getAttribute("vertical-align"));
       
        alignment = new Alignment(Alignment.DEFAULT, Alignment.LEFT); // Invalid
        AlignmentRender.renderToStyle(cssStyle, alignment);
        assertNull(cssStyle.getAttribute("vertical-align"));
       
        alignment = new Alignment(Alignment.DEFAULT, Alignment.TOP);
        AlignmentRender.renderToStyle(cssStyle, alignment);
        assertEquals("top", cssStyle.getAttribute("vertical-align"));
       
        alignment = new Alignment(Alignment.DEFAULT, Alignment.CENTER);
        AlignmentRender.renderToStyle(cssStyle, alignment);
        assertEquals("middle", cssStyle.getAttribute("vertical-align"));
       
        alignment = new Alignment(Alignment.DEFAULT, Alignment.BOTTOM);
        AlignmentRender.renderToStyle(cssStyle, alignment);
        assertEquals("bottom", cssStyle.getAttribute("vertical-align"));
    }
View Full Code Here

Examples of nextapp.echo2.webrender.output.CssStyle

    private static final Extent EXTENT_3_PX = new Extent(3, Extent.PX);
    private static final Extent EXTENT_4_PX = new Extent(4, Extent.PX);
    private static final Extent EXTENT_2_PT = new Extent(2, Extent.PT);
   
    public void testRenderUnique() {
        CssStyle cssStyle = new CssStyle();
        InsetsRender.renderToStyle(cssStyle, "padding", new Insets(EXTENT_1_PX, EXTENT_2_PX, EXTENT_3_PX, EXTENT_4_PX));
        assertEquals("2px 3px 4px 1px", cssStyle.getAttribute("padding"));
    }
View Full Code Here

Examples of nextapp.echo2.webrender.output.CssStyle

        InsetsRender.renderToStyle(cssStyle, "padding", new Insets(EXTENT_1_PX, EXTENT_2_PX, EXTENT_3_PX, EXTENT_4_PX));
        assertEquals("2px 3px 4px 1px", cssStyle.getAttribute("padding"));
    }

    public void testRenderHV() {
        CssStyle cssStyle = new CssStyle();
        InsetsRender.renderToStyle(cssStyle, "padding", new Insets(EXTENT_2_PX, EXTENT_2_PT));
        assertEquals("2pt 2px 2pt 2px", cssStyle.getAttribute("padding"));
    }
View Full Code Here

Examples of nextapp.echo2.webrender.output.CssStyle

        InsetsRender.renderToStyle(cssStyle, "padding", new Insets(EXTENT_2_PX, EXTENT_2_PT));
        assertEquals("2pt 2px 2pt 2px", cssStyle.getAttribute("padding"));
    }

    public void testRenderSame() {
        CssStyle cssStyle = new CssStyle();
        InsetsRender.renderToStyle(cssStyle, "padding", new Insets(EXTENT_2_PT));
        assertEquals("2pt", cssStyle.getAttribute("padding"));
    }
View Full Code Here

Examples of nextapp.echo2.webrender.output.CssStyle

*
*/
public class BorderRenderTest extends TestCase {
   
    public void testNull() {
        CssStyle cssStyle = new CssStyle();
        Border border = new Border(null, null, Border.STYLE_NONE);
        BorderRender.renderToStyle(cssStyle, border);
        assertEquals("none", cssStyle.getAttribute("border"));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.