Package nextapp.echo2.testapp.interactive

Examples of nextapp.echo2.testapp.interactive.TestGrid


    colMain.add(rowButtons);
   
    KeyStrokeListener ks = new KeyStrokeListener();
    ks.addKeyCombination(KeyStrokeListener.VK_INSERT,"INSERT");
    ks.addKeyCombination(KeyStrokeListener.VK_DELETE,"DELETE");
    ks.addActionListener(new ActionListener() {

      private static final long serialVersionUID = 1L;

      public void actionPerformed(ActionEvent arg0) {
        if (arg0.getActionCommand().equals("INSERT"))
View Full Code Here


        groupEditor = new GroupEditor();
        cbbMainGroup = new GroupCombo();
        companyEditor = new CompanyEditor();

        btnAddGroup = new JbsButton("+");
        btnAddGroup.addActionListener(new ActionListener() {

            private static final long serialVersionUID = 1L;

            public void actionPerformed(ActionEvent arg0) {
                FmJbsBaseObjectList fmSelectGroup = new FmJbsBaseObjectList(JbsL10N.getString("JbsUserGroup.selectGroup"));
                PnUserGroupList pnUserGroupList = new PnUserGroupList();
                pnUserGroupList.setToolPaneVisible(ClientGlobals.getUser().isRoot());
                fmSelectGroup.setPnList(pnUserGroupList);
                fmSelectGroup.showForm();
                fmSelectGroup.addActionListener(new ActionListener() {

                    private static final long serialVersionUID = 1L;

                    public void actionPerformed(ActionEvent arg0) {
                        System.out.println(arg0.getActionCommand());
View Full Code Here

    protected void createComponents() {
        lbUserGroups = new LbUserGroups();

        btnAdd = new JbsButton("+");
        btnAdd.setWidth(new JbsExtent(20));
        btnAdd.addActionListener(new ActionListener() {

            private static final long serialVersionUID = 1L;

            public void actionPerformed(ActionEvent arg0) {
                addGroup();
            }
        });

        btnDelete = new JbsButton("-");
        btnDelete.setWidth(new JbsExtent(20));
        btnDelete.addActionListener(new ActionListener() {

            private static final long serialVersionUID = 1L;

            public void actionPerformed(ActionEvent arg0) {
                deleteGroup();
View Full Code Here

        colMain.add(rowButtons);

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

            private static final long serialVersionUID = 1L;

            public void actionPerformed(ActionEvent arg0) {
                if (arg0.getActionCommand().equals("INSERT")) {
View Full Code Here

        this.txEmail = new JbsTextField();
        this.txWebsite = new JbsTextField();

        this.usCompanyLogo = new JbsUploadSelect();
        try {
            this.usCompanyLogo.addUploadListener(new UploadListener() {

                public void fileUpload(UploadEvent e) {
                    uploadImage(e);
                }
View Full Code Here

        this.addControl(groupName, groupName, control);
    }

    public void addSeparator(String groupName) {
        Row row = new Row();
        ColumnLayoutData layout = new ColumnLayoutData();
        layout.setHeight(new JbsExtent(15, JbsExtent.PX));
        row.setLayoutData(layout);
        this.addControl(groupName, row);
    }
View Full Code Here

        colMain.add(label);
    }
   
    public void addBlankLine() {
        Row row = new Row();
        ColumnLayoutData layout = new ColumnLayoutData();
        layout.setHeight(new JbsExtent(15,JbsExtent.PX));
        row.setLayoutData(layout);
        colMain.add(row);
    }
View Full Code Here

                    break;
                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

        //If nor group is found then create a new one:
        if (newColumn == null) {
            newColumn = new Column();
            newColumn.setId(groupName);
            newColumn.setStyleName("Default");
            AccordionPaneLayoutData layoutData = new AccordionPaneLayoutData();
            layoutData.setTitle(groupTitle);
            newColumn.setLayoutData(layoutData);
            this.add(newColumn);
        }
        return newColumn;
    }
View Full Code Here

        Column controlGroupsColumn = new Column();
        controlGroupsColumn.setCellSpacing(new Extent(5));
        controlGroupsColumn.setStyleName("TestControlsColumn");
        add(controlGroupsColumn);

        final TestGrid testGrid = new TestGrid();
        splitPaneLayoutData = new SplitPaneLayoutData();
        splitPaneLayoutData.setInsets(new Insets(15));
        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);
View Full Code Here

TOP

Related Classes of nextapp.echo2.testapp.interactive.TestGrid

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.