Package nextapp.echo2.app

Examples of nextapp.echo2.app.Style


        styleSheet = StyleSheetLoader.load(in, StyleSheetLoaderTest.class.getClassLoader());
        in.close();
    }

    public void testAlignment() {
        Style alphaStyle = styleSheet.getStyle(Label.class, "alpha");
        Alignment alignment = (Alignment) alphaStyle.getProperty(Label.PROPERTY_TEXT_POSITION);
        assertNotNull(alignment);
        assertEquals(Alignment.CENTER, alignment.getHorizontal());
        assertEquals(Alignment.BOTTOM, alignment.getVertical());
    }
View Full Code Here


        assertEquals(Alignment.CENTER, alignment.getHorizontal());
        assertEquals(Alignment.BOTTOM, alignment.getVertical());
    }

    public void testDefault() {
        Style bravoStyle = styleSheet.getStyle(Label.class, "bravo");
        Alignment alignment = (Alignment) bravoStyle.getProperty(Label.PROPERTY_TEXT_POSITION);
        assertNotNull(alignment);
        assertEquals(Alignment.DEFAULT, alignment.getHorizontal());
        assertEquals(Alignment.DEFAULT, alignment.getVertical());
    }
View Full Code Here

        styleSheet = StyleSheetLoader.load(in, StyleSheetLoaderTest.class.getClassLoader());
        in.close();
    }

    public void testCustom() {
        Style bravoStyle = styleSheet.getStyle(TextComponent.class, "bravo");
        FillImage backgroundImage = (FillImage) bravoStyle.getProperty(TextComponent.PROPERTY_BACKGROUND_IMAGE);
        assertNotNull(backgroundImage);
        ImageReference imageReference = backgroundImage.getImage();
        assertNotNull(imageReference);
        assertTrue(imageReference instanceof ResourceImageReference);
        assertEquals("nextapp/echo2/test/componentxml/BackgroundImage.png",
View Full Code Here

        assertEquals(new Extent(50), backgroundImage.getHorizontalOffset());
        assertEquals(new Extent(-30, Extent.PERCENT), backgroundImage.getVerticalOffset());
    }
   
    public void testSimple() {
        Style alphaStyle = styleSheet.getStyle(TextComponent.class, "alpha");
        FillImage backgroundImage = (FillImage) alphaStyle.getProperty(TextComponent.PROPERTY_BACKGROUND_IMAGE);
        assertNotNull(backgroundImage);
        ImageReference imageReference = backgroundImage.getImage();
        assertNotNull(imageReference);
        assertTrue(imageReference instanceof ResourceImageReference);
        assertEquals("nextapp/echo2/test/componentxml/BackgroundImage.png",
View Full Code Here

        styleSheet = StyleSheetLoader.load(in, StyleSheetLoaderTest.class.getClassLoader());
        in.close();
    }
   
    public void testBasic() {
        Style alphaStyle = styleSheet.getStyle(Column.class, "alpha");
        GridLayoutData layoutData = (GridLayoutData) alphaStyle.getProperty(Component.PROPERTY_LAYOUT_DATA);
        assertEquals(2, layoutData.getColumnSpan());
        assertEquals(1, layoutData.getRowSpan());
        assertEquals(new Color(0xabcdef), layoutData.getBackground());
        assertEquals(new Insets(20, 30), layoutData.getInsets());
        assertNotNull(layoutData.getBackgroundImage());
View Full Code Here

        styleSheet = StyleSheetLoader.load(in, StyleSheetLoaderTest.class.getClassLoader());
        in.close();
    }
   
    public void testIndexedProperties() {
        Style alphaStyle = styleSheet.getStyle(Grid.class, "alpha");
        assertEquals(new Extent(100), alphaStyle.getIndexedProperty(Grid.PROPERTY_COLUMN_WIDTH, 0));
        assertEquals(new Extent(200), alphaStyle.getIndexedProperty(Grid.PROPERTY_COLUMN_WIDTH, 1));
    }
View Full Code Here

        styleSheet = StyleSheetLoader.load(in, StyleSheetLoaderTest.class.getClassLoader());
        in.close();
    }
   
    public void testResourceImageReferenceInline() {
        Style alphaStyle = styleSheet.getStyle(Button.class, "alpha");
        assertTrue(alphaStyle.getProperty(Button.PROPERTY_ICON) instanceof ResourceImageReference);
        ResourceImageReference icon = (ResourceImageReference) alphaStyle.getProperty(Button.PROPERTY_ICON);
        assertEquals("nextapp.echo2/test/componentxml/Alpha.png", icon.getResource());
    }
View Full Code Here

        ResourceImageReference icon = (ResourceImageReference) alphaStyle.getProperty(Button.PROPERTY_ICON);
        assertEquals("nextapp.echo2/test/componentxml/Alpha.png", icon.getResource());
    }
   
    public void testResourceImageReferencePlain() {
        Style bravoStyle = styleSheet.getStyle(Button.class, "bravo");
        assertTrue(bravoStyle.getProperty(Button.PROPERTY_ICON) instanceof ResourceImageReference);
        ResourceImageReference icon = (ResourceImageReference) bravoStyle.getProperty(Button.PROPERTY_ICON);
        assertEquals("nextapp.echo2/test/componentxml/Bravo.png", icon.getResource());
    }
View Full Code Here

        ResourceImageReference icon = (ResourceImageReference) bravoStyle.getProperty(Button.PROPERTY_ICON);
        assertEquals("nextapp.echo2/test/componentxml/Bravo.png", icon.getResource());
    }
   
    public void testResourceImageReferenceDimensioned() {
        Style charlieStyle = styleSheet.getStyle(Button.class, "charlie");
        assertTrue(charlieStyle.getProperty(Button.PROPERTY_ICON) instanceof ResourceImageReference);
        ResourceImageReference icon = (ResourceImageReference) charlieStyle.getProperty(Button.PROPERTY_ICON);
        assertEquals("nextapp.echo2/test/componentxml/Charlie.png", icon.getResource());
        assertEquals(new Extent(20), icon.getWidth());
        assertEquals(new Extent(30), icon.getHeight());
    }
View Full Code Here

        assertEquals(new Extent(20), icon.getWidth());
        assertEquals(new Extent(30), icon.getHeight());
    }
   
    public void testResourceImageReferenceContentTypeHalfDimensioned() {
        Style deltaStyle = styleSheet.getStyle(Button.class, "delta");
        assertTrue(deltaStyle.getProperty(Button.PROPERTY_ICON) instanceof ResourceImageReference);
        ResourceImageReference icon = (ResourceImageReference) deltaStyle.getProperty(Button.PROPERTY_ICON);
        assertEquals("nextapp.echo2/test/componentxml/Delta.whoknows", icon.getResource());
        assertEquals("image/gif", icon.getContentType());
        assertEquals(new Extent(30), icon.getWidth());
        assertNull(icon.getHeight());
    }
View Full Code Here

TOP

Related Classes of nextapp.echo2.app.Style

Copyright © 2018 www.massapicom. 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.