Package nextapp.echo2.app

Examples of nextapp.echo2.app.Component


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

    protected void initPanel() {
        Column colMain = new Column();
        colMain.setInsets(new Insets(5, 5));

        Iterator<JbsLangEntryHelper> it = this.getTextFields().iterator();
        while (it.hasNext()) {
            JbsLangEntryTextArea txtField = (JbsLangEntryTextArea) it.next();
            txtField.setWidth(new JbsExtent(400, JbsExtent.PX));
            txtField.setHeight(new JbsExtent(300, JbsExtent.PX));
            colMain.add(new Label(txtField.getLanguage().getName()));
            colMain.add(txtField);
        }

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


                editTexts();
            }

        });

        Column column = new Column();
        column.add(this.getTextArea());
        column.add(this.getBtnSelect());
        this.add(column);
    }
View Full Code Here

    /**
     * Adds a button to the toolbar
     * @param button
     */
    public void addButton(BtnToolbar button) {
        Column colButton = new Column();
        colButton.setInsets(new Insets(5));
        colButton.add(button);
        this.add(colButton);
    }
View Full Code Here

    /**
     * Adds a component to the Toolbar
     * @param comp
     */
    public void addComponent(Component comp) {
        Column colButton = new Column();
        colButton.setInsets(new Insets(5));
        colButton.add(comp);
        this.add(colButton);
    }
View Full Code Here

                message = lines;
            }
        }


        Column messageColumn = new Column();

        if (message.getClass().isArray()) {
            Object[] messageList = (Object[]) message;
            for (int i = 0; i < messageList.length; i++) {
                messageColumn.add(new Label(messageList[i].toString()));
            }
        } else {
            messageColumn.add(new Label(message.toString()));
        }
        final int labelCount = messageColumn.getComponentCount();
       
        JbsButton btnDetails = null;
        if (exception!=null) {
            btnDetails = new JbsButton("Details...");
            btnDetails.addActionListener(new ActionListener() {

                public void actionPerformed(ActionEvent arg0) {
                    showException(exception);
                }
            });
        }


        Row topRow = new Row();
        topRow.setCellSpacing(new JbsExtent(DIALOG_INSETS));
        topRow.add(iconLabel);
        topRow.add(messageColumn);

        KeyStrokeListener ks = new KeyStrokeListener();

        ArrayList<JbsButton> buttons = new ArrayList<JbsButton>();

        if (optionType == DEFAULT_OPTION) {
            buttons.add(defaultButton = createButton(JbsL10N.getString("Generic.ok"), OK_OPTION));
            ks.addKeyCombination(KeyStrokeListener.VK_RETURN, OK_OPTION);
        } else if (optionType == YES_NO_OPTION) {
            buttons.add(defaultButton = createButton(JbsL10N.getString("Generic.yes"), YES_OPTION));
            ks.addKeyCombination(KeyStrokeListener.VK_RETURN, YES_OPTION);
            buttons.add(createButton(JbsL10N.getString("Generic.no"), NO_OPTION));
            ks.addKeyCombination(KeyStrokeListener.VK_ESCAPE, NO_OPTION);
        } else if (optionType == YES_NO_CANCEL_OPTION) {
            buttons.add(defaultButton = createButton(JbsL10N.getString("Generic.yes"), YES_OPTION));
            ks.addKeyCombination(KeyStrokeListener.VK_RETURN, YES_OPTION);
            buttons.add(createButton(JbsL10N.getString("Generic.no"), NO_OPTION));
            buttons.add(createButton(JbsL10N.getString("Generic.cancel"), CANCEL_OPTION));
            ks.addKeyCombination(KeyStrokeListener.VK_ESCAPE, CANCEL_OPTION);
        } else if (optionType == OK_CANCEL_OPTION) {
            buttons.add(defaultButton = createButton(JbsL10N.getString("Generic.ok"), OK_OPTION));
            ks.addKeyCombination(KeyStrokeListener.VK_RETURN, OK_OPTION);
            buttons.add(createButton(JbsL10N.getString("Generic.cancel"), CANCEL_OPTION));
            ks.addKeyCombination(KeyStrokeListener.VK_ESCAPE, CANCEL_OPTION);
        }
       
        if (btnDetails!=null)
            buttons.add(btnDetails);
       
        ks.addActionListener(this);
        topRow.add(ks);

        ButtonPanel buttonPanel = new ButtonPanel();
        ColumnLayoutData buttonPanelLayout = new ColumnLayoutData();
        buttonPanelLayout.setAlignment(new Alignment(Alignment.CENTER, Alignment.TOP));
        buttonPanel.setLayoutData(buttonPanelLayout);
        for (int i = 0; i < buttons.size(); i++) {
            buttonPanel.add((AbstractButton) buttons.get(i));
        }

        Column mainColumn = new Column();
        mainColumn.setCellSpacing(new JbsExtent(COMMAND_SEPARATION));
        mainColumn.add(topRow);
        mainColumn.add(buttonPanel);

        add(mainColumn);

        int dialogHeight = /*titleHeight*/ 60 + DIALOG_INSETS * 2 +
                Math.max(LABEL_HEIGHT * labelCount, iconHeight) +
View Full Code Here

    /**
     * Adds all controls to the panel
     */
    protected void addControls() {
        super.addControls();
        colMain = new Column();
        colMain.add(this.getTbMain());
       
        initKeyStrokeListener();

        //this.add(colMain);
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

    public class CrTblInvoicesForDunning extends CrTblJbsBaseObject {
        private static final long serialVersionUID = 1L;

        @Override
        public Component getTableCellRendererComponent(Table table, Object value, int column, int row) {
            Component component = null;

            TblInvoicesForDunning tblInvoices = (TblInvoicesForDunning) table;
            final boolean selectable = tblInvoices.isSelectable();
            final TblMInvoicesForDunning tableModel = (TblMInvoicesForDunning)tblInvoices.getModel();
            final Invoice invoice = (Invoice) tblInvoices.getJbsBaseObjects().get(row);

            switch (column) {
                case 0:
                    if (selectable) {
                        final CheckBox checkBox = new CheckBox("");
                        checkBox.setSelected((Boolean) value);
                        checkBox.addActionListener(new ActionListener() {

                            public void actionPerformed(ActionEvent arg0) {
                                if (checkBox.isSelected())
                                    tableModel.selectInvoice(invoice);
                                else
                                    tableModel.deSelectInvoice(invoice);
                            }
                        });
                        component = checkBox;
                    } else {
                        component = new JbsLabel();
                    }
                    break;
                case 4 :
                    component = super.getTableCellRendererComponent(table, value, column, row);
                    TableLayoutData rightLayout = new TableLayoutData();
                    rightLayout.setAlignment(Alignment.ALIGN_RIGHT);
                    component.setLayoutData(rightLayout);
                    break;
                case 5 :
                    component = super.getTableCellRendererComponent(table, value, column, row);
                    TableLayoutData sumPayedLayout = new TableLayoutData();
                    sumPayedLayout.setAlignment(Alignment.ALIGN_RIGHT);
                    component.setLayoutData(sumPayedLayout);
                    break;
                case 6:
                    final JbsButton btnShowInvoice = new JbsButton("Ansehen");
                    btnShowInvoice.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent arg0) {
View Full Code Here

        else
        label = new Label("");
        return label;
         */

        Component component = super.getTableCellRendererComponent(arg0, arg1, arg2, arg3);
        if (logger.isDebugEnabled()) {
            logger.debug("Header-Class: " + component.getClass().getName());
        }
        ((Button) component).setBorder(null);
        ((Button) component).setDisabledBorder(null);
        ((Button) component).setRolloverBorder(null);
        ((Button) component).setPressedBorder(null);

        StyleSheet stylesheet = Styles.DEFAULT_STYLE_SHEET;
        Style style = stylesheet.getStyle(nextapp.echo2.app.Component.class, "TblJbsBaseObject.Header");
        component.setStyle(style);

        TableLayoutData layout = (TableLayoutData) style.getProperty("layoutData");
        // remove the button's background
        component.setBackground(null);
        //set the button's layoutData
        component.setLayoutData(layout);

        return component;
    }
View Full Code Here

            addParentIndex = ((int) Math.random() * (components.size() + 1)) - 1;
        } else {
            addParentIndex = ((int) Math.random() * components.size());
        }
        ComponentFactory componentFactory = componentFactories[((int) (Math.random() * componentFactories.length))];
        Component child = componentFactory.newInstance();
       
        for (int i = 0; i < 5; ++i) {
            Component parent = addParentIndex == -1 ? contentPane : (Component) components.get(addParentIndex);
            try {
                parent.add(child);
                components.add(child);
                return;
            } catch (IllegalChildException ex) { }
        }
    }
View Full Code Here

TOP

Related Classes of nextapp.echo2.app.Component

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.