Package nextapp.echo2.webrender.output

Examples of nextapp.echo2.webrender.output.CssStyle


    }

    public void editTexts() {
        final FmLangStringsEditLong fmLangStringsEdit = new FmLangStringsEditLong(JbsL10N.getString("Language.editStrings"));
        fmLangStringsEdit.setLangStrings(this.getLangStrings());
        fmLangStringsEdit.addActionListener(new ActionListener() {

            private static final long serialVersionUID = 1L;

            public void actionPerformed(ActionEvent e) {
                if (e.getActionCommand().equals(JbsDialogWindowOKCancel.ACTION_OK)) {
View Full Code Here


     * @param actionCommand
     */
    protected void addAction(String actionCommand) {
        EventListener[] listeners = listenerList.getListeners(ActionListener.class);
        for (int i = 0; i < listeners.length; i++) {
            ActionListener actionListener = (ActionListener) listeners[i];
            try {
                actionListener.actionPerformed(new ActionEvent(PnEditJbsObject.this, actionCommand));
            } catch (Throwable t) {
                logger.error("Error adding action.",t);
            }
        }
    }
View Full Code Here

        this.addControl(groupName, groupName, control);
    }

    public void addSeparator(String groupName) {
        Row row = new Row();
        ColumnLayoutData layout = new ColumnLayoutData();
        layout.setHeight(new JbsExtent(15, JbsExtent.PX));
        row.setLayoutData(layout);
        this.addControl(groupName, row);
    }
View Full Code Here

        colMain.add(label);
    }
   
    public void addBlankLine() {
        Row row = new Row();
        ColumnLayoutData layout = new ColumnLayoutData();
        layout.setHeight(new JbsExtent(15,JbsExtent.PX));
        row.setLayoutData(layout);
        colMain.add(row);
    }
View Full Code Here

        //If nor group is found then create a new one:
        if (newColumn == null) {
            newColumn = new Column();
            newColumn.setId(groupName);
            newColumn.setStyleName("Default");
            AccordionPaneLayoutData layoutData = new AccordionPaneLayoutData();
            layoutData.setTitle(groupTitle);
            newColumn.setLayoutData(layoutData);
            this.add(newColumn);
        }
        return newColumn;
    }
View Full Code Here

    /**
     * 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

*/
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

        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

        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

        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

TOP

Related Classes of nextapp.echo2.webrender.output.CssStyle

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.