Package nextapp.echo2.app

Examples of nextapp.echo2.app.Button


        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

    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

   */
  public Component getTableCellRendererComponent(Table arg0, Object arg1,
      int arg2, int arg3) {
    //Component component = super.getTableCellRendererComponent(arg0, arg1, arg2, arg3);
   
    Button component = new Button((String)arg1);
    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

       
        Row controlsRow = new Row();
        controlsRow.setStyleName("ControlPane");
        splitPane.add(controlsRow);

        Button button;
        switch (controlConfiguration) {
        case CONTROLS_OK:
            button = new Button(Messages.getString("Generic.Ok"), Styles.ICON_24_YES);
            button.setStyleName("ControlPane.Button");
            button.setActionCommand(COMMAND_OK);
            button.addActionListener(actionProcessor);
            controlsRow.add(button);
            break;
        case CONTROLS_YES_NO:
            button = new Button(Messages.getString("Generic.Yes"), Styles.ICON_24_YES);
            button.setStyleName("ControlPane.Button");
            button.setActionCommand(COMMAND_OK);
            button.addActionListener(actionProcessor);
            controlsRow.add(button);
            button = new Button(Messages.getString("Generic.No"), Styles.ICON_24_NO);
            button.setStyleName("ControlPane.Button");
            button.setActionCommand(COMMAND_CANCEL);
            button.addActionListener(actionProcessor);
            controlsRow.add(button);
            break;
        }
       
        Label contentLabel = new Label(message);
View Full Code Here

   
    /**
     * @see nextapp.echo2.testapp.thousandmonkeys.ComponentFactory#newInstance()
     */
    public Component newInstance() {
        Button button = new Button();
        switch ((int) (Math.random() * 3)) {
        case 0:
            button.setText("Button #" + ++count);
            button.setBackground(new Color((int) (16777216 * Math.random())));
            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;
        }
        return button;
    }
View Full Code Here

        testGrid.setLayoutData(splitPaneLayoutData);
        add(testGrid);
       
        buttonList = new ArrayList();
       
        Button button;
        testGrid.addHeaderRow("Button");
       
        button = new Button();
        testGrid.addTestRow("No Content", button);
        buttonList.add(button);

        button = new Button("Test Button");
        testGrid.addTestRow("Text", button);
        buttonList.add(button);
       
        button = new Button(Styles.ICON_LOGO);
        testGrid.addTestRow("Icon", button);
        buttonList.add(button);
       
        button = new Button("Test Button", Styles.ICON_LOGO);
        testGrid.addTestRow("Text and Icon", button);
        buttonList.add(button);
       
        CheckBox checkBox;
        testGrid.addHeaderRow("CheckBox");

        checkBox = new CheckBox();
        testGrid.addTestRow("No Content", checkBox);
        buttonList.add(checkBox);

        checkBox = new CheckBox("Test CheckBox");
        testGrid.addTestRow("Text", checkBox);
        buttonList.add(checkBox);
       
        checkBox = new CheckBox(Styles.ICON_LOGO);
        testGrid.addTestRow("Icon", checkBox);
        buttonList.add(checkBox);
       
        checkBox = new CheckBox("Test CheckBox", Styles.ICON_LOGO);
        testGrid.addTestRow("Text and Icon", checkBox);
        buttonList.add(checkBox);
       
        RadioButton radioButton;
        testGrid.addHeaderRow("RadioButton");
       
        ButtonGroup buttonGroup = new ButtonGroup();

        radioButton = new RadioButton();
        radioButton.setGroup(buttonGroup);
        testGrid.addTestRow("No Content", radioButton);
        buttonList.add(radioButton);

        radioButton = new RadioButton("Test RadioButton");
        radioButton.setGroup(buttonGroup);
        testGrid.addTestRow("Text", radioButton);
        buttonList.add(radioButton);
       
        radioButton = new RadioButton(Styles.ICON_LOGO);
        radioButton.setGroup(buttonGroup);
        testGrid.addTestRow("Icon", radioButton);
        buttonList.add(radioButton);
       
        radioButton = new RadioButton("Test RadioButton", Styles.ICON_LOGO);
        radioButton.setGroup(buttonGroup);
        testGrid.addTestRow("Text and Icon", radioButton);
        buttonList.add(radioButton);

        buttonGroup = new ButtonGroup();
        Grid radioGrid = new Grid();
        radioGrid.setInsets(new Insets(10));
        for (int i = 1; i <= 4; ++i) {
            radioButton = new RadioButton(Integer.toString(i));
            radioButton.setGroup(buttonGroup);
            radioGrid.add(radioButton);
            buttonList.add(radioButton);
        }
        testGrid.addTestRow("Separate ButtonGroup", radioGrid);
       
        radioButton = new RadioButton("Test");
        buttonList.add(radioButton);
        testGrid.addTestRow("Null ButtonGroup", radioButton);

        ButtonColumn controlsColumn;
       
        // Create 'AbstractButton Controls Group'
       
        controlsColumn = new ButtonColumn();
        controlGroupsColumn.add(controlsColumn);
       
        controlsColumn.add(new Label("General Settings"));
       
        controlsColumn.addButton("Toggle Container Cell Spacing", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                if (testGrid.getInsets() != null && testGrid.getInsets().getTop().equals(new Extent(5))) {
                    testGrid.setInsets(new Insets(0));
                } else {
                    testGrid.setInsets(new Insets(5));
                }
            }
        });
        controlsColumn.addButton("Add ActionListener", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.addActionListener(actionListener);
                    }
                });
            }
        });
        controlsColumn.addButton("Remove ActionListener", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.removeActionListener(actionListener);
                    }
                });
            }
        });
        controlsColumn.addButton("Add ChangeListener", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        if (button instanceof ToggleButton) {
                            ((ToggleButton) button).addChangeListener(changeListener);
                        }
                    }
                });
            }
        });
        controlsColumn.addButton("Remove ChangeListener", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        if (button instanceof ToggleButton) {
                            ((ToggleButton) button).removeChangeListener(changeListener);
                        }
                    }
                });
            }
        });
        controlsColumn.addButton("Set StyleName = Null", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setStyleName(null);
                    }
                });
            }
        });
        controlsColumn.addButton("Set StyleName = Default", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setStyleName("Default");
                    }
                });
            }
        });
        controlsColumn.addButton("Set Text = Short", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        if (button.getText() != null) {
                            button.setText("Test Button");
                        }
                    }
                });
            }
        });
        controlsColumn.addButton("Set Text = Long", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        if (button.getText() != null) {
                            button.setText("This button has a longer label.  The quick brown fox jumps over the lazy brown dog.");
                        }
                    }
                });
            }
        });
       
        controlsColumn.addButton("Toggle ToolTip Text", new ActionListener(){
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        if (button.getToolTipText() == null) {
                            button.setToolTipText("This is a tool tip.");
                        } else {
                            button.setToolTipText(null);
                        }
                    }
                });
            }
        });
        controlsColumn.addButton("Toggle Enabled State", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setEnabled(!button.isEnabled());
                    }
                });
            }
        });
        controlsColumn.addButton("Toggle Enabled State (Container)", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                testGrid.setEnabled(!testGrid.isEnabled());
            }
        });

        controlsColumn = new ButtonColumn();
        controlGroupsColumn.add(controlsColumn);
       
        controlsColumn.add(new Label("AbstractButton Controls"));
       
        // Base Settings
        controlsColumn.addButton("Set Foreground", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                final Color color = StyleUtil.randomColor();
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setForeground(color);
                    }
                });
            }
        });
        controlsColumn.addButton("Clear Foreground", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setForeground(null);
                    }
                });
            }
        });
        controlsColumn.addButton("Set Background", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                final Color color = StyleUtil.randomColor();
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setBackground(color);
                    }
                });
            }
        });
        controlsColumn.addButton("Clear Background", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setBackground(null);
                    }
                });
            }
        });
        controlsColumn.addButton("Set Font", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                final Font font = StyleUtil.randomFont();
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setFont(font);
                    }
                });
            }
        });
        controlsColumn.addButton("Clear Font", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setFont(null);
                    }
                });
            }
        });
        controlsColumn.addButton("Set Background Image", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setBackgroundImage(Styles.BUTTON_BACKGROUND_IMAGE);
                    }
                });
            }
        });
        controlsColumn.addButton("Clear Background Image", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setBackgroundImage(null);
                    }
                });
            }
        });
        controlsColumn.addButton("Set Line Wrap = true", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setLineWrap(true);
                    }
                });
            }
        });
        controlsColumn.addButton("Set Line Wrap = false", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setLineWrap(false);
                    }
                });
            }
        });
        controlsColumn.addButton("Set Width = Default", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setWidth(null);
                    }
                });
            }
        });
        controlsColumn.addButton("Set Width = 300px", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setWidth(new Extent(300, Extent.PX));
                    }
                });
            }
        });
        controlsColumn.addButton("Set Width = 50%", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setWidth(new Extent(50, Extent.PERCENT));
                    }
                });
            }
        });
        controlsColumn.addButton("Set Height = Default", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setHeight(null);
                    }
                });
            }
        });
        controlsColumn.addButton("Set Height = 100px", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setHeight(new Extent(100, Extent.PX));
                    }
                });
            }
        });
        controlsColumn.addButton("Set Insets = Default", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setInsets(null);
                    }
                });
            }
        });
        controlsColumn.addButton("Set Insets = 10/5px", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setInsets(new Insets(10, 5));
                    }
                });
            }
        });
        controlsColumn.addButton("Set Insets = 30px", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setInsets(new Insets(30, 30));
                    }
                });
            }
        });

        // Rollover Effect Settings

        controlsColumn = new ButtonColumn();
        controlGroupsColumn.add(controlsColumn);
       
        controlsColumn.add(new Label("Rollover Effects"));

        controlsColumn.addButton("Enable Rollover Effects", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setRolloverEnabled(true);
                    }
                });
            }
        });
        controlsColumn.addButton("Disable Rollover Effects", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setRolloverEnabled(false);
                    }
                });
            }
        });
        controlsColumn.addButton("Set Rollover Icon", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        if (button.getIcon() != null) {
                            button.setRolloverIcon(Styles.ROLLOVER_ICON_LOGO);
                        }
                    }
                });
            }
        });
        controlsColumn.addButton("Clear Rollover Icon", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        if (button.getIcon() != null) {
                            button.setRolloverIcon(null);
                        }
                    }
                });
            }
        });
        controlsColumn.addButton("Set Rollover Foreground", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                final Color color = StyleUtil.randomColor();
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setRolloverForeground(color);
                    }
                });
            }
        });
        controlsColumn.addButton("Clear Rollover Foreground", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setRolloverForeground(null);
                    }
                });
            }
        });
        controlsColumn.addButton("Set Rollover Background", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                final Color color = StyleUtil.randomColor();
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setRolloverBackground(color);
                    }
                });
            }
        });
        controlsColumn.addButton("Clear Rollover Background", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setRolloverBackground(null);
                    }
                });
            }
        });
        controlsColumn.addButton("Set Rollover Font", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                final Font font = StyleUtil.randomFont();
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setRolloverFont(font);
                    }
                });
            }
        });
        controlsColumn.addButton("Clear Rollover Font", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setRolloverFont(null);
                    }
                });
            }
        });
        controlsColumn.addButton("Set Rollover Background Image", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setRolloverBackgroundImage(Styles.BUTTON_ROLLOVER_BACKGROUND_IMAGE);
                    }
                });
            }
        });
        controlsColumn.addButton("Clear Rollover Background Image", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setRolloverBackgroundImage(null);
                    }
                });
            }
        });
       
        // Pressed Effect Settings

        controlsColumn = new ButtonColumn();
        controlGroupsColumn.add(controlsColumn);
       
        controlsColumn.add(new Label("Pressed Effects"));

        controlsColumn.addButton("Enable Pressed Effects", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setPressedEnabled(true);
                    }
                });
            }
        });
        controlsColumn.addButton("Disable Pressed Effects", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setPressedEnabled(false);
                    }
                });
            }
        });
        controlsColumn.addButton("Set Pressed Icon", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        if (button.getIcon() != null) {
                            button.setPressedIcon(Styles.PRESSED_ICON_LOGO);
                        }
                    }
                });
            }
        });
        controlsColumn.addButton("Clear Pressed Icon", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        if (button.getIcon() != null) {
                            button.setPressedIcon(null);
                        }
                    }
                });
            }
        });
        controlsColumn.addButton("Set Pressed Foreground", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                final Color color = StyleUtil.randomColor();
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setPressedForeground(color);
                    }
                });
            }
        });
        controlsColumn.addButton("Clear Pressed Foreground", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setPressedForeground(null);
                    }
                });
            }
        });
        controlsColumn.addButton("Set Pressed Background", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                final Color color = StyleUtil.randomColor();
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setPressedBackground(color);
                    }
                });
            }
        });
        controlsColumn.addButton("Clear Pressed Background", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setPressedBackground(null);
                    }
                });
            }
        });
        controlsColumn.addButton("Set Pressed Font", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                final Font font = StyleUtil.randomFont();
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setPressedFont(font);
                    }
                });
            }
        });
        controlsColumn.addButton("Clear Pressed Font", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setPressedFont(null);
                    }
                });
            }
        });
        controlsColumn.addButton("Set Pressed Background Image", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setPressedBackgroundImage(Styles.BUTTON_PRESSED_BACKGROUND_IMAGE);
                    }
                });
            }
        });
        controlsColumn.addButton("Clear Pressed Background Image", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setPressedBackgroundImage(null);
                    }
                });
            }
        });
       
        // Disabled Effect Settings

        controlsColumn = new ButtonColumn();
        controlGroupsColumn.add(controlsColumn);
       
        controlsColumn.add(new Label("Disabled Effects"));

        controlsColumn.addButton("Set Disabled Icon", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        if (button.getIcon() != null) {
                            button.setDisabledIcon(Styles.DISABLED_ICON_LOGO);
                        }
                    }
                });
            }
        });
        controlsColumn.addButton("Clear Disabled Icon", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        if (button.getIcon() != null) {
                            button.setDisabledIcon(null);
                        }
                    }
                });
            }
        });
        controlsColumn.addButton("Set Disabled Foreground", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                final Color color = StyleUtil.randomColor();
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setDisabledForeground(color);
                    }
                });
            }
        });
        controlsColumn.addButton("Clear Disabled Foreground", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setDisabledForeground(null);
                    }
                });
            }
        });
        controlsColumn.addButton("Set Disabled Background", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                final Color color = StyleUtil.randomColor();
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setDisabledBackground(color);
                    }
                });
            }
        });
        controlsColumn.addButton("Clear Disabled Background", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setDisabledBackground(null);
                    }
                });
            }
        });
        controlsColumn.addButton("Set Disabled Font", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                final Font font = StyleUtil.randomFont();
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setDisabledFont(font);
                    }
                });
            }
        });
        controlsColumn.addButton("Clear Disabled Font", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setDisabledFont(null);
                    }
                });
            }
        });
        controlsColumn.addButton("Set Disabled Background Image", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setDisabledBackgroundImage(Styles.BUTTON_DISABLED_BACKGROUND_IMAGE);
                    }
                });
            }
        });
        controlsColumn.addButton("Clear Disabled Background Image", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setDisabledBackgroundImage(null);
                    }
                });
            }
        });
       
        // Text Position

        controlsColumn = new ButtonColumn();
        controlGroupsColumn.add(controlsColumn);
       
        controlsColumn.add(new Label("Text Position"));

        controlsColumn.addButton("TextPosition = Default", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setTextPosition(null);
                    }
                });
            }
        });
        controlsColumn.addButton("TextPosition = Top", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setTextPosition(new Alignment(Alignment.DEFAULT, Alignment.TOP));
                    }
                });
            }
        });
        controlsColumn.addButton("TextPosition = Bottom", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setTextPosition(new Alignment(Alignment.DEFAULT, Alignment.BOTTOM));
                    }
                });
            }
        });
        controlsColumn.addButton("TextPosition = Left", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setTextPosition(new Alignment(Alignment.LEFT, Alignment.DEFAULT));
                    }
                });
            }
        });
        controlsColumn.addButton("TextPosition = Right", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setTextPosition(new Alignment(Alignment.RIGHT, Alignment.DEFAULT));
                    }
                });
            }
        });
        controlsColumn.addButton("TextPosition = Leading", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setTextPosition(new Alignment(Alignment.LEADING, Alignment.DEFAULT));
                    }
                });
            }
        });
        controlsColumn.addButton("TextPosition = Trailing", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setTextPosition(new Alignment(Alignment.TRAILING, Alignment.DEFAULT));
                    }
                });
            }
        });
       
        // Text Alignment

        controlsColumn = new ButtonColumn();
        controlGroupsColumn.add(controlsColumn);
       
        controlsColumn.add(new Label("Text Alignment"));

        controlsColumn.addButton("TextAlignment = Default", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setTextAlignment(null);
                    }
                });
            }
        });
        controlsColumn.addButton("TextAlignment = Top", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setTextAlignment(new Alignment(Alignment.DEFAULT, Alignment.TOP));
                    }
                });
            }
        });
        controlsColumn.addButton("TextAlignment = Center (V)", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setTextAlignment(new Alignment(Alignment.DEFAULT, Alignment.CENTER));
                    }
                });
            }
        });
        controlsColumn.addButton("TextAlignment = Bottom", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setTextAlignment(new Alignment(Alignment.DEFAULT, Alignment.BOTTOM));
                    }
                });
            }
        });
        controlsColumn.addButton("TextAlignment = Left", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setTextAlignment(new Alignment(Alignment.LEFT, Alignment.DEFAULT));
                    }
                });
            }
        });
        controlsColumn.addButton("TextAlignment = Center (H)", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setTextAlignment(new Alignment(Alignment.CENTER, Alignment.DEFAULT));
                    }
                });
            }
        });
        controlsColumn.addButton("TextAlignment = Right", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setTextAlignment(new Alignment(Alignment.RIGHT, Alignment.DEFAULT));
                    }
                });
            }
        });
        controlsColumn.addButton("TextAlignment = Leading", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setTextAlignment(new Alignment(Alignment.LEADING, Alignment.DEFAULT));
                    }
                });
            }
        });
        controlsColumn.addButton("TextAlignment = Trailing", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setTextAlignment(new Alignment(Alignment.TRAILING, Alignment.DEFAULT));
                    }
                });
            }
        });
       
        // Alignment

        controlsColumn = new ButtonColumn();
        controlGroupsColumn.add(controlsColumn);
       
        controlsColumn.add(new Label("Alignment"));

        controlsColumn.addButton("Alignment = Default", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setAlignment(null);
                    }
                });
            }
        });
        controlsColumn.addButton("Alignment = Left", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setAlignment(new Alignment(Alignment.LEFT, Alignment.DEFAULT));
                    }
                });
            }
        });
        controlsColumn.addButton("Alignment = Center (H)", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setAlignment(new Alignment(Alignment.CENTER, Alignment.DEFAULT));
                    }
                });
            }
        });
        controlsColumn.addButton("Alignment = Right", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setAlignment(new Alignment(Alignment.RIGHT, Alignment.DEFAULT));
                    }
                });
            }
        });
        controlsColumn.addButton("Alignment = Leading", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setAlignment(new Alignment(Alignment.LEADING, Alignment.DEFAULT));
                    }
                });
            }
        });
        controlsColumn.addButton("Alignment = Trailing", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setAlignment(new Alignment(Alignment.TRAILING, Alignment.DEFAULT));
                    }
                });
            }
        });
       
        // Icon/Text Margin

        controlsColumn = new ButtonColumn();
        controlGroupsColumn.add(controlsColumn);
       
        controlsColumn.add(new Label("Icon/Text Margin"));

        controlsColumn.addButton("IconTextMargin = default", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setIconTextMargin(null);
                    }
                });
            }
        });
        controlsColumn.addButton("IconTextMargin = 0px", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setIconTextMargin(new Extent(0));
                    }
                });
            }
        });
        controlsColumn.addButton("IconTextMargin = 1px", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setIconTextMargin(new Extent(1));
                    }
                });
            }
        });
        controlsColumn.addButton("IconTextMargin = 2px", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setIconTextMargin(new Extent(2));
                    }
                });
            }
        });
        controlsColumn.addButton("IconTextMargin = 10px", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setIconTextMargin(new Extent(10));
                    }
                });
            }
        });
        controlsColumn.addButton("IconTextMargin = 1in", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setIconTextMargin(new Extent(1, Extent.IN));
                    }
                });
            }
        });

        // Create 'ToggleButton Controls Group'
       
        controlsColumn = new ButtonColumn();
        controlGroupsColumn.add(controlsColumn);
       
        controlsColumn.add(new Label("General ToggleButton Controls"));
       
        controlsColumn.addButton("Selected = False", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        if (button instanceof ToggleButton) {
                            ((ToggleButton) button).setSelected(false);
                        }
                    }
                });
            }
        });
        controlsColumn.addButton("Selected = True", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        if (button instanceof ToggleButton) {
                            ((ToggleButton) button).setSelected(true);
                        }
                    }
                });
            }
        });
        controlsColumn.addButton("Set Custom State Icons", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        if (button instanceof ToggleButton) {
                            ToggleButton toggleButton = (ToggleButton) button;
                            toggleButton.setStateIcon(Styles.RG_STATE_ICON);
                            toggleButton.setSelectedStateIcon(Styles.RG_SELECTED_STATE_ICON);
                            toggleButton.setPressedStateIcon(Styles.RG_PRESSED_STATE_ICON);
                            toggleButton.setPressedSelectedStateIcon(Styles.RG_PRESSED_SELECTED_STATE_ICON);
                            toggleButton.setRolloverStateIcon(Styles.RG_ROLLOVER_STATE_ICON);
                            toggleButton.setRolloverSelectedStateIcon(Styles.RG_ROLLOVER_SELECTED_STATE_ICON);
                        }
                    }
                });
            }
        });
        controlsColumn.addButton("Clear Custom State Icons", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        if (button instanceof ToggleButton) {
                            ToggleButton toggleButton = (ToggleButton) button;
                            toggleButton.setStateIcon(null);
                            toggleButton.setSelectedStateIcon(null);
                            toggleButton.setPressedStateIcon(null);
                            toggleButton.setPressedSelectedStateIcon(null);
                            toggleButton.setRolloverStateIcon(null);
                            toggleButton.setRolloverSelectedStateIcon(null);
                        }
                    }
                });
            }
        });
       
        // ToggleButton State Position

        controlsColumn = new ButtonColumn();
        controlGroupsColumn.add(controlsColumn);
       
        controlsColumn.add(new Label("ToggleButton State Position"));
       
        controlsColumn.addButton("StatePosition = Default", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        if (button instanceof ToggleButton) {
                            ((ToggleButton) button).setStatePosition(null);
                        }
                    }
                });
            }
        });
        controlsColumn.addButton("StatePosition = Top", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        if (button instanceof ToggleButton) {
                            ((ToggleButton) button).setStatePosition(new Alignment(Alignment.DEFAULT, Alignment.TOP));
                        }
                    }
                });
            }
        });
        controlsColumn.addButton("StatePosition = Bottom", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        if (button instanceof ToggleButton) {
                            ((ToggleButton) button).setStatePosition(new Alignment(Alignment.DEFAULT, Alignment.BOTTOM));
                        }
                    }
                });
            }
        });
        controlsColumn.addButton("StatePosition = Left", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        if (button instanceof ToggleButton) {
                            ((ToggleButton) button).setStatePosition(new Alignment(Alignment.LEFT, Alignment.DEFAULT));
                        }
                    }
                });
            }
        });
        controlsColumn.addButton("StatePosition = Right", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        if (button instanceof ToggleButton) {
                            ((ToggleButton) button).setStatePosition(new Alignment(Alignment.RIGHT, Alignment.DEFAULT));
                        }
                    }
                });
            }
        });
        controlsColumn.addButton("StatePosition = Leading", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        if (button instanceof ToggleButton) {
                            ((ToggleButton) button).setStatePosition(new Alignment(Alignment.LEADING, Alignment.DEFAULT));
                        }
                    }
                });
            }
        });
        controlsColumn.addButton("StatePosition = Trailing", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        if (button instanceof ToggleButton) {
                            ((ToggleButton) button).setStatePosition(new Alignment(Alignment.TRAILING, Alignment.DEFAULT));
                        }
                    }
                });
            }
        });
       
        // ToggleButton State Alignment

        controlsColumn = new ButtonColumn();
        controlGroupsColumn.add(controlsColumn);
       
        controlsColumn.add(new Label("ToggleButton State Alignment"));
       
        controlsColumn.addButton("StateAlignment = Default", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        if (button instanceof ToggleButton) {
                            ((ToggleButton) button).setStateAlignment(null);
                        }
                    }
                });
            }
        });
        controlsColumn.addButton("StateAlignment = Top", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        if (button instanceof ToggleButton) {
                            ((ToggleButton) button).setStateAlignment(new Alignment(Alignment.DEFAULT, Alignment.TOP));
                        }
                    }
                });
            }
        });
        controlsColumn.addButton("StateAlignment = Center (V)", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        if (button instanceof ToggleButton) {
                            ((ToggleButton) button).setStateAlignment(new Alignment(Alignment.DEFAULT, Alignment.CENTER));
                        }
                    }
                });
            }
        });
        controlsColumn.addButton("StateAlignment = Bottom", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        if (button instanceof ToggleButton) {
                            ((ToggleButton) button).setStateAlignment(new Alignment(Alignment.DEFAULT, Alignment.BOTTOM));
                        }
                    }
                });
            }
        });
        controlsColumn.addButton("StateAlignment = Left", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        if (button instanceof ToggleButton) {
                            ((ToggleButton) button).setStateAlignment(new Alignment(Alignment.LEFT, Alignment.DEFAULT));
                        }
                    }
                });
            }
        });
        controlsColumn.addButton("StateAlignment = Center (H)", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        if (button instanceof ToggleButton) {
                            ((ToggleButton) button).setStateAlignment(new Alignment(Alignment.CENTER, Alignment.DEFAULT));
                        }
                    }
                });
            }
        });
        controlsColumn.addButton("StateAlignment = Right", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        if (button instanceof ToggleButton) {
                            ((ToggleButton) button).setStateAlignment(new Alignment(Alignment.RIGHT, Alignment.DEFAULT));
                        }
                    }
                });
            }
        });
        controlsColumn.addButton("StateAlignment = Leading", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        if (button instanceof ToggleButton) {
                            ((ToggleButton) button).setStateAlignment(new Alignment(Alignment.LEADING, Alignment.DEFAULT));
                        }
                    }
                });
            }
        });
        controlsColumn.addButton("StateAlignment = Trailing", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        if (button instanceof ToggleButton) {
                            ((ToggleButton) button).setStateAlignment(new Alignment(Alignment.TRAILING, Alignment.DEFAULT));
                        }
                    }
                });
            }
        });

       
        // State Margin

        controlsColumn = new ButtonColumn();
        controlGroupsColumn.add(controlsColumn);
       
        controlsColumn.add(new Label("State Margin"));

        controlsColumn.addButton("StateMargin = default", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        if (button instanceof ToggleButton) {
                            ((ToggleButton) button).setStateMargin(null);
                        }
                    }
                });
            }
        });
        controlsColumn.addButton("StateMargin = 0px", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        if (button instanceof ToggleButton) {
                            ((ToggleButton) button).setStateMargin(new Extent(0));
                        }
                    }
                });
            }
        });
        controlsColumn.addButton("StateMargin = 1px", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        if (button instanceof ToggleButton) {
                            ((ToggleButton) button).setStateMargin(new Extent(1));
                        }
                    }
                });
            }
        });
        controlsColumn.addButton("StateMargin = 2px", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        if (button instanceof ToggleButton) {
                            ((ToggleButton) button).setStateMargin(new Extent(2));
                        }
                    }
                });
            }
        });
        controlsColumn.addButton("StateMargin = 10px", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        if (button instanceof ToggleButton) {
                            ((ToggleButton) button).setStateMargin(new Extent(10));
                        }
                    }
                });
            }
        });
        controlsColumn.addButton("StateMargin = 1in", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        if (button instanceof ToggleButton) {
                            ((ToggleButton) button).setStateMargin(new Extent(1, Extent.IN));
                        }
                    }
                });
            }
        });

        // Localization

        controlsColumn = new ButtonColumn();
        controlGroupsColumn.add(controlsColumn);
       
        controlsColumn.add(new Label("Localization"));
       
        controlsColumn.addButton("Locale = null", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setLocale(null);
                    }
                });
            }
        });
        controlsColumn.addButton("Locale = US", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setLocale(Locale.US);
                    }
                });
            }
        });
        controlsColumn.addButton("Locale = HEBREW (RTL)", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setLocale(new Locale("iw"));
                    }
                });
            }
        });
        controlsColumn.addButton("LayoutDirection = null", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setLayoutDirection(null);
                    }
                });
            }
        });
        controlsColumn.addButton("LayoutDirection = LTR", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setLayoutDirection(LayoutDirection.LTR);
                    }
                });
            }
        });
        controlsColumn.addButton("LayoutDirection = RTL", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                apply(new Applicator() {
                    public void apply(AbstractButton button) {
                        button.setLayoutDirection(LayoutDirection.RTL);
                    }
                });
            }
        });
    }
View Full Code Here

        setCellSpacing(new Extent(20));
       
        statusLabel = new Label("Asynchronous operation not active.");
        add(statusLabel);
       
        Button startButton = new Button("Start Asynchronous (Server Push) Operation");
        startButton.setStyleName("Default");
        startButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                if (taskQueue == null) {
                    // Only start new operation if taskQueue is null, indicating that last operation has completed.
                    taskQueue = getApplicationInstance().createTaskQueue();
                    new SimulatedServerOperation().start();
View Full Code Here

       
        Row controlsRow = new Row();
        controlsRow.setStyleName("ControlPane");
        outerSplitPane.add(controlsRow);
       
        Button logoutButton = new Button(Messages.getString("Generic.Exit"), Styles.ICON_24_EXIT);
        logoutButton.setStyleName("ControlPane.Button");
        logoutButton.addActionListener(new ActionListener(){
            public void actionPerformed(ActionEvent e) {
                ChatApp.getApp().disconnect();
            }
        });
        controlsRow.add(logoutButton);
       
        SplitPane mainSplitPane = new SplitPane(SplitPane.ORIENTATION_VERTICAL_BOTTOM_TOP, new Extent(90));
        mainSplitPane.setStyleName("ChatScreen.SplitPane");
        outerSplitPane.add(mainSplitPane);
       
        SplitPane inputAreaSplitPane = new SplitPane(SplitPane.ORIENTATION_HORIZONTAL_LEADING_TRAILING, new Extent(150));
        mainSplitPane.add(inputAreaSplitPane);

        Label currentUserLabel = new Label(ChatApp.getApp().getUserName() + ":");
        currentUserLabel.setStyleName("ChatScreen.CurrentUserLabel");
        inputAreaSplitPane.add(currentUserLabel);
       
        SplitPane postSplitPane = new SplitPane(SplitPane.ORIENTATION_HORIZONTAL_TRAILING_LEADING, new Extent(100));
        inputAreaSplitPane.add(postSplitPane);

        Button submitPostButton = new Button(Messages.getString("ChatScreen.SubmitPostButton"), Styles.ICON_24_RIGHT_ARROW);
        submitPostButton.setStyleName("ChatScreen.SubmitPostButton");
        submitPostButton.setTextPosition(new Alignment(Alignment.LEFT, Alignment.DEFAULT));
        submitPostButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                postMessage();
            }
        });
        postSplitPane.add(submitPostButton);
View Full Code Here

TOP

Related Classes of nextapp.echo2.app.Button

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.