Package nextapp.echo2.app

Examples of nextapp.echo2.app.DerivedMutableStyle


            }
        });
    }

    protected void initPane() {
        Column colMain = new Column();
        colMain.add(this.getLbUserGroups());

        Row rowButtons = new Row();
        rowButtons.setAlignment(new Alignment(Alignment.RIGHT, Alignment.TOP));
        rowButtons.add(this.getBtnAdd());
        rowButtons.add(this.getBtnDelete());
        colMain.add(rowButtons);

        KeyStrokeListener ks = new KeyStrokeListener();
        ks.addKeyCombination(KeyStrokeListener.VK_INSERT, "INSERT");
        ks.addKeyCombination(KeyStrokeListener.VK_DELETE, "DELETE");
        ks.addActionListener(new ActionListener() {
View Full Code Here


*/
public class CrTblTransactions extends CrTblJbsBaseObject {

    @Override
    public Component getTableCellRendererComponent(Table table, Object value, int column, int row) {
        Component component = super.getTableCellRendererComponent(table, value, column, row);
       
        if (component instanceof Label) {
            //TableLayoutData layoutData = new TableLayoutData();
            int align;
            switch (column) {
View Full Code Here

     */
    @Override
    protected void createControls() throws Exception {
        super.createControls();
        this.tbMain = new JbsToolbar();
        this.pnMain = new ContentPane();
       
        this.btnNew = new JbsObjectToolPaneButton("add.png",JbsL10N.getString("StdList.newCaption"),false);
        this.btnNew.setToolTipText(JbsL10N.getString("StdList.newTooltip"));
        this.btnNew.addActionListener(new ActionListener() {
       
View Full Code Here

        }
    }

    @Override
    protected void initPanel() {
        ContentPane cpStdData = new ContentPane();

        JbsGrid grdMain = new JbsGrid(2);
        grdMain.setInsets(new Insets(5, 5));
        grdMain.setColumnWidth(0, new JbsExtent(300));

        grdMain.add(new Label(JbsL10N.getString("JbsUser.userName")));
        grdMain.add(txUserName);
        grdMain.add(new Label(JbsL10N.getString("JbsUser.password")));
        grdMain.add(txPassword);
        grdMain.add(new Label(JbsL10N.getString("JbsUser.addInfo")));
        grdMain.add(txAddInfo);
        grdMain.add(new Label(JbsL10N.getString("JbsUser.mainGroup")));
        grdMain.add(cbbMainGroup);

        grdMain.add(new Label(JbsL10N.getString("JbsUser.groupList")));
        grdMain.add(groupEditor);
        if (ClientGlobals.getUser().isRoot()) { //No other person is allowed to set companies for a user
            grdMain.add(new Label(JbsL10N.getString("JbsUser.companyList")));
            grdMain.add(companyEditor);
        }

        grdMain.add(new Label(JbsL10N.getString("JbsUser.contact")));
        grdMain.add(this.contactSelectField);
       
        grdMain.add(new Label(JbsL10N.getString("JbsUser.canChangePassword")));
        grdMain.add(this.cbCanChangePassword);

        grdMain.add(new Label(JbsL10N.getString("JbsUser.startModule")));
        grdMain.add(this.selStartModule);
       
        cpStdData.add(grdMain);
        this.add(cpStdData);
    }
View Full Code Here

        }
    }

    @Override
    protected void initPanel() {
        ContentPane cpStdData = new ContentPane();

        JbsGrid grdMain = new JbsGrid(2);
        grdMain.setInsets(new Insets(5, 5));
        grdMain.setColumnWidth(0, new JbsExtent(300));

        grdMain.add(new Label(JbsL10N.getString("JbsCompany.name1")));
        grdMain.add(txName1);
        grdMain.add(new Label(JbsL10N.getString("JbsCompany.name2")));
        grdMain.add(txName2);
        grdMain.add(new Label(JbsL10N.getString("JbsCompany.name3")));
        grdMain.add(txName3);
        grdMain.add(new Label(JbsL10N.getString("JbsCompany.street")));
        grdMain.add(txStreet);
        grdMain.add(new Label(JbsL10N.getString("JbsCompany.zip")));
        grdMain.add(txZip);
        grdMain.add(new Label(JbsL10N.getString("JbsCompany.city")));
        grdMain.add(txCity);
        grdMain.add(new Label(JbsL10N.getString("JbsCompany.phone")));
        grdMain.add(txPhone);
        grdMain.add(new Label(JbsL10N.getString("JbsCompany.fax")));
        grdMain.add(txFax);
        grdMain.add(new Label(JbsL10N.getString("JbsCompany.email")));
        grdMain.add(txEmail);
        grdMain.add(new Label(JbsL10N.getString("JbsCompany.website")));
        grdMain.add(txWebsite);

        grdMain.add(new Label(JbsL10N.getString("JbsCompany.logo")));
        grdMain.add(usCompanyLogo);
        grdMain.add(new Label(""));
        grdMain.add(this.logoImage);

        cpStdData.add(grdMain);
        this.add(cpStdData);
    }
View Full Code Here

        MutableStyle baseStyle = new MutableStyle();
        baseStyle.setIndexedProperty("alpha", 1, "a");
        baseStyle.setIndexedProperty("bravo", 2"b");
        baseStyle.setIndexedProperty("bravo", 1"b3");
       
        DerivedMutableStyle derivedStyle = new DerivedMutableStyle(baseStyle);
        derivedStyle.setIndexedProperty("bravo", 2, "b2");
        derivedStyle.setIndexedProperty("charlie", 3, "c");

        assertEquals("b", baseStyle.getIndexedProperty("bravo", 2));
       
        assertEquals("b2", derivedStyle.getIndexedProperty("bravo", 2));
        assertEquals("c", derivedStyle.getIndexedProperty("charlie", 3));
       
        assertEquals("a", derivedStyle.getIndexedProperty("alpha", 1));
        assertEquals("b3", derivedStyle.getIndexedProperty("bravo", 1));
       
        assertTrue(derivedStyle.isIndexedPropertySet("alpha", 1));
        assertFalse(derivedStyle.isIndexedPropertySet("alpha", 2));
        assertFalse(derivedStyle.isIndexedPropertySet("bravo", 0));
        assertTrue(derivedStyle.isIndexedPropertySet("bravo", 1));
        assertTrue(derivedStyle.isIndexedPropertySet("bravo", 2));
        assertFalse(derivedStyle.isIndexedPropertySet("bravo", 3));
    }
View Full Code Here

    public void testSimple() {
        MutableStyle baseStyle = new MutableStyle();
        baseStyle.setProperty("alpha", "a");
        baseStyle.setProperty("bravo", "b");
       
        DerivedMutableStyle derivedStyle = new DerivedMutableStyle(baseStyle);
        baseStyle.setProperty("bravo", "b2");
        baseStyle.setProperty("charlie", "c");
       
        assertEquals("a", derivedStyle.getProperty("alpha"));
        assertEquals("b2", derivedStyle.getProperty("bravo"));
        assertEquals("c", derivedStyle.getProperty("charlie"));
    }
View Full Code Here

                // StyleSheet contains reference to Component which does not exist in this ClassLoader,
                // and thus should be ignored.
                continue;
            }
           
            DerivedMutableStyle style  = new DerivedMutableStyle();
           
            Element propertiesElement = DomUtil.getChildElementByTagName(styleElements[i], "properties");
            Style propertyStyle = propertyLoader.createStyle(propertiesElement, type);
            style.addStyleContent(propertyStyle);

            Map classToStyleMap = (Map) namedStyleMap.get(name);
            if (classToStyleMap == null) {
                classToStyleMap = new HashMap();
                namedStyleMap.put(name, classToStyleMap);
            }
            classToStyleMap.put(componentClass, style);
           
            styleSheet.addStyle(componentClass, name, style);
        }
       
        // Second pass, bind derived styles to base styles where applicable.
        for (int i = 0; i < styleElements.length; ++i) {
            if (styleElements[i].hasAttribute("base-name")) {
                String name = styleElements[i].getAttribute("name");
                String type = styleElements[i].getAttribute("type");
                Class componentClass;
                try {
                    componentClass = Class.forName(type, true, classLoader);
                } catch (ClassNotFoundException ex) {
                    // StyleSheet contains reference to Component which does not exist in this ClassLoader,
                    // and thus should be ignored.
                    continue;
                }

                Map classToStyleMap = (Map) namedStyleMap.get(name);
                DerivedMutableStyle style = (DerivedMutableStyle) classToStyleMap.get(componentClass);
               
                String baseName = styleElements[i].getAttribute("base-name");
               
                classToStyleMap = (Map) namedStyleMap.get(baseName);
                if (classToStyleMap == null) {
                    throw new ComponentXmlException("Invalid base style name for style name " + name + ".", null);
                }
                Style baseStyle = (Style) classToStyleMap.get(componentClass);
                while (baseStyle == null && componentClass != Object.class) {
                    componentClass = componentClass.getSuperclass();
                    baseStyle = (Style) classToStyleMap.get(componentClass);
                }
                if (baseStyle == null) {
                    throw new ComponentXmlException("Invalid base style name for style name " + name + ".", null);
                }
               
                style.setParentStyle(baseStyle);
            }
        }
   
        return styleSheet;
    }
View Full Code Here

    protected JbsLangEntryHelper createTextField(JbsLanguage language) {
        return new JbsLangEntryTextField(language);
    }

    protected void initPanel() {
        Grid grdMain = new Grid(2);
        grdMain.setInsets(new nextapp.echo2.app.Insets(5, 5));
        grdMain.setColumnWidth(0, new JbsExtent(300));

        Iterator<JbsLangEntryHelper> it = this.getTextFields().iterator();
        while (it.hasNext()) {
            JbsLangEntryTextField txtField = (JbsLangEntryTextField) it.next();
            grdMain.add(new Label(txtField.getLanguage().getName()));
            grdMain.add(txtField);
        }

        this.getPnMain().add(grdMain);
    }
View Full Code Here

        this.setStyleName("Default");
        this.setMaximizable(false);
        this.setMinimizable(false);
        this.setResizable(false);
        this.setModal(true);
        ImageReference icon = getMessageIcon(messageType);
        Label iconLabel = new Label("");
        int iconHeight = 0;
        if (icon != null) {
            iconLabel.setIcon(icon);
            iconHeight = icon.getHeight().getValue();
        }


        // Split newlines into multiple labels
        if (message instanceof String) {
View Full Code Here

TOP

Related Classes of nextapp.echo2.app.DerivedMutableStyle

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.