Package nextapp.echo2.app

Examples of nextapp.echo2.app.Border


        this.setStyleName("Default");
        this.setText(title);
        this.setWidth(new JbsExtent(100, JbsExtent.PERCENT));
        //this.setHeight(new (48, .PX));
        this.setStdColor(this.getBackground());
        this.setAlignment(new Alignment(Alignment.LEFT, Alignment.CENTER));
    }
View Full Code Here


    }

    protected JbsContentPane initPnButtons() {
        pnButtons = new JbsContentPane();
        Row mainRow = new Row();
        mainRow.setAlignment(new Alignment(Alignment.RIGHT, Alignment.DEFAULT));
        mainRow.setInsets(new Insets(new JbsExtent(5), new JbsExtent(5)));

        btnOK = new JbsButton(JbsL10N.getString("Generic.ok"));
        btnOK.setAlignmentHorizontal(Alignment.CENTER);
        btnOK.setWidth(new JbsExtent(80));
View Full Code Here

                default :
                    align = Alignment.LEFT;
            }
           
            TableLayoutData layoutData = (TableLayoutData)((Label)component).getLayoutData();
            layoutData.setAlignment(new Alignment(align, Alignment.CENTER));
            ((Label)component).setLayoutData(layoutData);
        }
        return component;
    }
View Full Code Here

        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));
        }
View Full Code Here

    public JbsImageIcon() {
        super(null);
    }
   
    public void setImage(byte[] image) throws IOException {
        AwtImageReference imgRef = null;
        if (image!=null) {
            logger.debug("Showing logo - length: " + image.length);
            Image img = ImageIO.read(new ByteArrayInputStream(image));
            imgRef = new AwtImageReference(img);
        }
        this.setIcon(imgRef);
    }
View Full Code Here

            break;
        case 1:
            button.setText("This is an example button.");
            button.setForeground(new Color((int) (16777216 * Math.random()) & 0x7f7f7f));
            button.setBackground(new Color((int) (16777216 * Math.random()) | 0xb0b0b0));
            button.setBorder(new Border(1, new Color((int) (16777216 * Math.random()) | 0xb3b3b3), Border.STYLE_OUTSET));
            button.setInsets(INSETS_10_5);
            break;
        case 2:
            button.setText("Initially Plain Button");
            break;
View Full Code Here

                testTable.setModel(createEmployeeTableModel());
            }
        });
       
        testTable = new Table();
        testTable.setBorder(new Border(new Extent(1), Color.BLUE, Border.STYLE_SOLID));
        testColumn.add(testTable);

        controlsColumn.add(new Label("Appearance"));
       
        controlsColumn.addButton("Change Foreground", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                testTable.setForeground(StyleUtil.randomColor());
            }
        });
        controlsColumn.addButton("Change Background", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                testTable.setBackground(StyleUtil.randomColor());
            }
        });
        controlsColumn.addButton("Change Border (All Attributes)", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                testTable.setBorder(StyleUtil.randomBorder());
            }
        });
        controlsColumn.addButton("Change Border Color", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                Border border = testTable.getBorder();
                testTable.setBorder(new Border(border.getSize(), StyleUtil.randomColor(), border.getStyle()));
            }
        });
        controlsColumn.addButton("Change Border Size", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                testTable.setBorder(StyleUtil.nextBorderSize(testTable.getBorder()));
View Full Code Here

            throw new IllegalArgumentException("Invalid border style: " + styleString);
        } else {
            style = ((Integer) STYLE_TEXT_TO_CONSTANT.get(styleString)).intValue();
        }
       
        return new Border(size, color, style);
    }
View Full Code Here

        selectField1 = new SelectField(NUMBERS);
        testColumn.add(selectField1);
       
        Grid grid = new Grid();
        grid.setBorder(new Border(1, Color.BLACK, Border.STYLE_SOLID));
        testColumn.add(grid);
       
        selectField2 = new SelectField(NUMBERS);
        grid.add(selectField2);
       
        listBox2 = new ListBox(NUMBERS);
        grid.add(listBox2);
       
        controlsColumn.add(new Label("Global"));

        controlsColumn.addButton("Add ActionListener", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractListComponent listComponent) {
                        listComponent.addActionListener(actionListener);
                    }
                });
            }
        });
        controlsColumn.addButton("Remove ActionListener", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractListComponent listComponent) {
                        listComponent.removeActionListener(actionListener);
                    }
                });
            }
        });
        controlsColumn.addButton("Add ChangeListener", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractListComponent listComponent) {
                        listComponent.getSelectionModel().addChangeListener(changeListener);
                    }
                });
            }
        });
        controlsColumn.addButton("Remove ChangeListener", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractListComponent listComponent) {
                        listComponent.getSelectionModel().removeChangeListener(changeListener);
                    }
                });
            }
        });
        controlsColumn.addButton("Add ListDataListener", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractListComponent listComponent) {
                        listComponent.getModel().addListDataListener(listDataListener);
                    }
                });
            }
        });
        controlsColumn.addButton("Remove ListDataListener", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractListComponent listComponent) {
                        listComponent.getModel().removeListDataListener(listDataListener);
                    }
                });
            }
        });
        controlsColumn.addButton("Toggle Enabled State", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractListComponent listComponent) {
                        listComponent.setEnabled(!listComponent.isEnabled());
                    }
                });
            }
        });
        controlsColumn.addButton("Set ListCellRenderer", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractListComponent listComponent) {
                        listComponent.setCellRenderer(evenOddListCellRenderer);
                    }
                });
            }
        });
        controlsColumn.addButton("Clear ListCellRenderer", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractListComponent listComponent) {
                        listComponent.setCellRenderer(AbstractListComponent.DEFAULT_LIST_CELL_RENDERER);
                    }
                });
            }
        });
        controlsColumn.addButton("Set Border", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                final Border border = StyleUtil.randomBorder();
                apply(new Applicator() {
                    public void apply(AbstractListComponent listComponent) {
                        listComponent.setBorder(border);
                    }
                });
            }
        });
        controlsColumn.addButton("Clear Border", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractListComponent listComponent) {
                        listComponent.setBorder(null);
                    }
                });
            }
        });
        controlsColumn.addButton("Set Foreground", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                final Color color = StyleUtil.randomColor();
                apply(new Applicator() {
                    public void apply(AbstractListComponent listComponent) {
                        listComponent.setForeground(color);
                    }
                });
            }
        });
        controlsColumn.addButton("Set Background", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                final Color color = StyleUtil.randomColor();
                apply(new Applicator() {
                    public void apply(AbstractListComponent listComponent) {
                        listComponent.setBackground(color);
                    }
                });
            }
        });
        controlsColumn.addButton("Set Font", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                final Font font = StyleUtil.randomFont();
                apply(new Applicator() {
                    public void apply(AbstractListComponent listComponent) {
                        listComponent.setFont(font);
                    }
                });
            }
        });
        controlsColumn.addButton("Clear Font", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractListComponent listComponent) {
                        listComponent.setFont(null);
                    }
                });
            }
        });
        controlsColumn.addButton("Set Disabled Border", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                final Border border = StyleUtil.randomBorder();
                apply(new Applicator() {
                    public void apply(AbstractListComponent listComponent) {
                        listComponent.setDisabledBorder(border);
                    }
                });
View Full Code Here

    }
   
    private void addComponentSampler(Column contentColumn, boolean launchModals) {
        Column componentSamplerColumn = new Column();
        if (launchModals) {
            componentSamplerColumn.setBorder(new Border(new Extent(5, Extent.PX), new Color(0xffafaf), Border.STYLE_INSET));
        } else {
            componentSamplerColumn.setBorder(new Border(new Extent(5, Extent.PX), new Color(0xafafff), Border.STYLE_INSET));
        }
        componentSamplerColumn.setInsets(new Insets(10));
        componentSamplerColumn.setCellSpacing(new Extent(1));
        contentColumn.add(componentSamplerColumn);
       
        for (int i = 1; i <= 3; ++i) {
            Button button = new Button("Button #" + i);
            button.setStyleName("Default");
            componentSamplerColumn.add(button);
            if (launchModals && i == 1) {
                button.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        getApplicationInstance().getDefaultWindow().getContent().add(createComponentSamplerModalTestWindow());
                    }
                });
            }
        }
       
        ButtonGroup buttonGroup = new ButtonGroup();
        for (int i = 1; i <= 3; ++i) {
            RadioButton radioButton = new RadioButton("RadioButton #" + i);
            radioButton.setGroup(buttonGroup);
            radioButton.setStyleName("Default");
            componentSamplerColumn.add(radioButton);
            if (launchModals && i == 1) {
                radioButton.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        getApplicationInstance().getDefaultWindow().getContent().add(createComponentSamplerModalTestWindow());
                    }
                });
            }
        }
       
        for (int i = 1; i <= 3; ++i) {
            CheckBox checkBox = new CheckBox("CheckBox #" + i);
            checkBox.setStyleName("Default");
            componentSamplerColumn.add(checkBox);
            if (launchModals && i == 1) {
                checkBox.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        getApplicationInstance().getDefaultWindow().getContent().add(createComponentSamplerModalTestWindow());
                    }
                });
            }
        }
       
        Table table = new Table(TableTest.createEmployeeTableModel());
        table.setBorder(new Border(new Extent(2), new Color(0xafffcf), Border.STYLE_GROOVE));
        table.setInsets(new Insets(15, 5));
        table.setSelectionEnabled(true);
        table.setSelectionBackground(new Color(0xffcfaf));
        table.setRolloverEnabled(true);
        table.setRolloverBackground(new Color(0xafefff));
View Full Code Here

TOP

Related Classes of nextapp.echo2.app.Border

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.