Package nextapp.echo2.app

Examples of nextapp.echo2.app.Label


     * by querying the <code>ChatApp</code> for new messages.
     */
    public void update() {
        ChatApp app = ChatApp.getApp();
        ChatSession.Message[] messages = app.getNewMessages();
        Label label;
       
        for (int i = 0; i < messages.length; ++i) {
            boolean announcement = messages[i].getUserName() == null;
            Row row = new Row();
           
            row.setStyleName(announcement ? "MessagePane.MessageRow.Announcement" : "MessagePane.MessageRow");
           
            label = new Label(dateFormat.format(messages[i].getDate()));
            label.setStyleName("MessagePane.DateLabel");
            row.add(label);

            if (announcement) {
                label =  new Label(messages[i].getContent());
                label.setStyleName("MessagePane.SystemMessageLabel");
                row.add(label);
            } else {
                label = new Label(messages[i].getUserName());
                label.setStyleName(userName.equals(messages[i].getUserName())
                        ? "MessagePane.UserNameLabel.Yourself" : "MessagePane.UserNameLabel.Other");
                row.add(label);
               
                label =  new Label(messages[i].getContent());
                row.add(label);
            }
           
            listColumn.add(row);
        }
View Full Code Here


            button.addActionListener(actionProcessor);
            controlsRow.add(button);
            break;
        }
       
        Label contentLabel = new Label(message);
        contentLabel.setStyleName("MessageDialog.ContentLabel");
        splitPane.add(contentLabel);
       
        setModal(true);
    }
View Full Code Here

   
    /**
     * @see nextapp.echo2.testapp.thousandmonkeys.ComponentFactory#newInstance()
     */
    public Component newInstance() {
        Label label = new Label();
        switch ((int) (Math.random() * 3)) {
        case 0:
            label.setText("Label #" + ++count);
            label.setBackground(new Color((int) (16777216 * Math.random())));
            break;
        case 1:
            label.setText("The quirk red fox jumps over the lazy brown dog.");
            label.setForeground(new Color((int) (16777216 * Math.random())));
            break;
        case 2:
            label.setText("Initially Plain Label");
            break;
        }
        return label;
    }
View Full Code Here

        splitPaneLayoutData.setInsets(new Insets(10));
        setLayoutData(splitPaneLayoutData);
       
        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() {
View Full Code Here

        ApplicationInstance.setActive(columnApp);
       
        Window window = columnApp.doInit();
        assertTrue(window.isRegistered());
        assertTrue(columnApp.getColumn().isRegistered());
        Label label = new Label();
        assertFalse(label.isRegistered());
        columnApp.getColumn().add(label);
        assertTrue(label.isRegistered());
        columnApp.getColumn().remove(label);
        assertFalse(label.isRegistered());
        columnApp.getColumn().add(label);
        assertTrue(label.isRegistered());
        columnApp.getContentPane().remove(columnApp.getColumn());
        assertFalse(label.isRegistered());

        ApplicationInstance.setActive(null);
    }
View Full Code Here

        ButtonColumn controlsColumn;
       
        controlsColumn = new ButtonColumn();
        groupContainerColumn.add(controlsColumn);

        controlsColumn.add(new Label("TableModel"));
       
        controlsColumn.addButton("Multiplication Model", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                testTable.setModel(new MultiplicationTableModel());
            }
        });
       
        controlsColumn.addButton("DefaultTableModel (Empty)", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                testTable.setModel(new DefaultTableModel());
            }
        });
       
        controlsColumn.addButton("DefaultTableModel (Employees)", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                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()));
            }
        });
        controlsColumn.addButton("Change Border Style", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                testTable.setBorder(StyleUtil.nextBorderStyle(testTable.getBorder()));
            }
        });
       
        controlsColumn.addButton("Set Insets 0px", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                testTable.setInsets(new Insets(0));
            }
        });
        controlsColumn.addButton("Set Insets 2px", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                testTable.setInsets(new Insets(2));
            }
        });
        controlsColumn.addButton("Set Insets 10/5px", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                testTable.setInsets(new Insets(10, 5));
            }
        });
        controlsColumn.addButton("Set Insets 10/20/30/40px", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                testTable.setInsets(new Insets(10, 20, 30, 40));
            }
        });
        controlsColumn.addButton("Set Width = null", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                testTable.setWidth(null);
            }
        });
        controlsColumn.addButton("Set Width = 500px", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                testTable.setWidth(new Extent(500));
            }
        });
        controlsColumn.addButton("Set Width = 100%", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                testTable.setWidth(new Extent(100, Extent.PERCENT));
            }
        });
        controlsColumn.addButton("Set ColumnWidths Equal", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                TableColumnModel columnModel = testTable.getColumnModel();
                int columnCount = columnModel.getColumnCount();
                    if (columnCount > 0) {
                    Extent width = new Extent(100 / columnCount, Extent.PERCENT);
                    for (int i = 0; i < columnCount; ++i) {
                        columnModel.getColumn(i).setWidth(width);
                    }
                }
            }
        });
        controlsColumn.addButton("Toggle Header Visible", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                testTable.setHeaderVisible(!testTable.isHeaderVisible());
            }
        });
        controlsColumn.addButton("Toggle Enabled State", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                testTable.setEnabled(!testTable.isEnabled());
            }
        });
       
        // Rollover Effect Settings

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

        controlsColumn.addButton("Enable Rollover Effects", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                testTable.setRolloverEnabled(true);
            }
        });
        controlsColumn.addButton("Disable Rollover Effects", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                testTable.setRolloverEnabled(false);
            }
        });
        controlsColumn.addButton("Set Rollover Foreground", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                testTable.setRolloverForeground(StyleUtil.randomColor());
            }
        });
        controlsColumn.addButton("Clear Rollover Foreground", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                testTable.setRolloverForeground(null);
            }
        });
        controlsColumn.addButton("Set Rollover Background", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                 testTable.setRolloverBackground(StyleUtil.randomColor());
            }
        });
        controlsColumn.addButton("Clear Rollover Background", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                testTable.setRolloverBackground(null);
            }
        });
        controlsColumn.addButton("Set Rollover Font", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                testTable.setRolloverFont(StyleUtil.randomFont());
            }
        });
        controlsColumn.addButton("Clear Rollover Font", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                testTable.setRolloverFont(null);
            }
        });
        controlsColumn.addButton("Set Rollover Background Image", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                testTable.setRolloverBackgroundImage(Styles.BG_SHADOW_LIGHT_BLUE);
            }
        });
        controlsColumn.addButton("Clear Rollover Background Image", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                testTable.setRolloverBackgroundImage(null);
            }
        });
       
        // Selection Settings

        controlsColumn = new ButtonColumn();
        groupContainerColumn.add(controlsColumn);
       
        controlsColumn.add(new Label("Selection"));

        controlsColumn.addButton("Enable Selection", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                testTable.setSelectionEnabled(true);
            }
        });
        controlsColumn.addButton("Disable Selection", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                testTable.setSelectionEnabled(false);
            }
        });
        controlsColumn.addButton("Set SelectionMode = Single", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                testTable.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
            }
        });
        controlsColumn.addButton("Set SelectionMode = Multiple", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                testTable.getSelectionModel().setSelectionMode(ListSelectionModel.MULTIPLE_SELECTION);
            }
        });
        controlsColumn.addButton("Toggle Selection of Row #2", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                ListSelectionModel selectionModel = testTable.getSelectionModel();
                selectionModel.setSelectedIndex(2, !selectionModel.isSelectedIndex(2));
            }
        });
        controlsColumn.addButton("Toggle Selection of Row #500 (there isn't one)", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                ListSelectionModel selectionModel = testTable.getSelectionModel();
                selectionModel.setSelectedIndex(500, !selectionModel.isSelectedIndex(500));
            }
        });
        controlsColumn.addButton("Set Selection Foreground", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                testTable.setSelectionForeground(StyleUtil.randomColor());
            }
        });
        controlsColumn.addButton("Clear Selection Foreground", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                testTable.setSelectionForeground(null);
            }
        });
        controlsColumn.addButton("Set Selection Background", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                 testTable.setSelectionBackground(StyleUtil.randomColor());
            }
        });
        controlsColumn.addButton("Clear Selection Background", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                testTable.setSelectionBackground(null);
            }
        });
        controlsColumn.addButton("Set Selection Font", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                testTable.setSelectionFont(StyleUtil.randomFont());
            }
        });
        controlsColumn.addButton("Clear Selection Font", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                testTable.setSelectionFont(null);
            }
        });
        controlsColumn.addButton("Set Selection Background Image", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                testTable.setSelectionBackgroundImage(Styles.BUTTON_PRESSED_BACKGROUND_IMAGE);
            }
        });
        controlsColumn.addButton("Clear Selection Background Image", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                testTable.setSelectionBackgroundImage(null);
            }
        });
       
        // Listener Settings

        controlsColumn = new ButtonColumn();
        groupContainerColumn.add(controlsColumn);
       
        controlsColumn.add(new Label("Listeners"));

        controlsColumn.addButton("Add ActionListener", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                testTable.addActionListener(actionListener);
            }
        });
        controlsColumn.addButton("Remove ActionListener", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                testTable.removeActionListener(actionListener);
            }
        });
        controlsColumn.addButton("Add ChangeListener", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                testTable.getSelectionModel().addChangeListener(changeListener);
            }
        });
        controlsColumn.addButton("Remove ChangeListener", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                testTable.getSelectionModel().removeChangeListener(changeListener);
            }
        });
       
        // Cell Settings

        controlsColumn = new ButtonColumn();
        groupContainerColumn.add(controlsColumn);
       
        controlsColumn.add(new Label("Cell Renderer"));

        controlsColumn.addButton("Default Cell Renderer", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                testTable.setDefaultRenderer(Object.class, new DefaultTableCellRenderer());
            }
View Full Code Here

            /**
             * @see nextapp.echo2.app.table.TableCellRenderer#getTableCellRendererComponent(nextapp.echo2.app.Table,
             *      java.lang.Object, int, int)
             */
            public Component getTableCellRendererComponent(Table table, Object value, int column, int row) {
                Label label = new Label(value == null ? null : value.toString());
                TableLayoutData layoutData = new TableLayoutData();
                layoutData.setAlignment(alignment);
                label.setLayoutData(layoutData);
                return label;
            }
        };
    }
View Full Code Here

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

     */
    public LoginScreen() {
        super();
        setStyleName("LoginScreen.ContentPane");
       
        Label label;

        Column column = new Column();
        column.setStyleName("LoginScreen.Column");
        add(column);
       
        label = new Label(Styles.NEXTAPP_LOG_IMAGE);
        column.add(label);
       
        label = new Label(Styles.ECHO2_IMAGE);
        column.add(label);
       
        label = new Label(Styles.CHAT_EXAMPLE_IMAGE);
        column.add(label);
       
        WindowPane loginWindow = new WindowPane();
        loginWindow.setTitle(Messages.getString("LoginScreen.LoginWindowTitle"));
        loginWindow.setStyleName("LoginScreen.LoginWindow");
        loginWindow.setClosable(false);
        add(loginWindow);
       
        SplitPane splitPane = new SplitPane(SplitPane.ORIENTATION_VERTICAL_BOTTOM_TOP, new Extent(32));
        loginWindow.add(splitPane);
       
        Row controlRow = new Row();
        controlRow.setStyleName("ControlPane");
        splitPane.add(controlRow);
       
        Button button = new Button(Messages.getString("LoginScreen.Continue"), Styles.ICON_24_YES);
        button.setStyleName("ControlPane.Button");
        button.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                processLogin();
            }
        });
        controlRow.add(button);

        Grid layoutGrid = new Grid();
        layoutGrid.setStyleName("LoginScreen.LayoutGrid");
        splitPane.add(layoutGrid);

        Column warningColumn = new Column();
        GridLayoutData gridLayoutData = new GridLayoutData();
        gridLayoutData.setColumnSpan(2);
        warningColumn.setLayoutData(gridLayoutData);
        layoutGrid.add(warningColumn);
       
        label = new Label(Messages.getString("LoginScreen.WarningTitle"));
        label.setStyleName("LoginScreen.WarningTitle");
        warningColumn.add(label);
       
        label = new Label(Messages.getString("LoginScreen.WarningMessage"));
        label.setStyleName("LoginScreen.WarningMessage");
        warningColumn.add(label);

        label = new Label(Messages.getString("LoginScreen.PromptUserName"));
        label.setStyleName("LoginScreen.Prompt");
        layoutGrid.add(label);
       
        nameField = new TextField();
        nameField.setWidth(PX_300);
        nameField.setStyleName("Default");
View Full Code Here

        // 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) {
View Full Code Here

TOP

Related Classes of nextapp.echo2.app.Label

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.