Package nextapp.echo2.app

Examples of nextapp.echo2.app.Grid


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


   
    /**
     * Test default values.
     */
    public void testDefaults() {
        Grid grid = new Grid();
        assertEquals(Grid.ORIENTATION_HORIZONTAL, grid.getOrientation());
        assertEquals(2, grid.getSize());
    }
View Full Code Here

   
    /**
     * Test property accessors and mutators.
     */
    public void testProperties() {
        Grid grid = new Grid();
        grid.setBorder(TestConstants.BORDER_THICK_ORANGE);
        grid.setInsets(TestConstants.INSETS_1234);
        grid.setOrientation(Grid.ORIENTATION_VERTICAL);
        grid.setSize(5);
        grid.setWidth(TestConstants.EXTENT_50_PERCENT);
        grid.setHeight(TestConstants.EXTENT_500_PX);
        grid.setColumnWidth(0, TestConstants.EXTENT_100_PX);
        grid.setColumnWidth(1, TestConstants.EXTENT_200_PX);
        grid.setRowHeight(0, TestConstants.EXTENT_30_PX);
        grid.setRowHeight(1, TestConstants.EXTENT_500_PX);
        assertEquals(TestConstants.BORDER_THICK_ORANGE, grid.getBorder());
        assertEquals(TestConstants.INSETS_1234, grid.getInsets());
        assertEquals(Grid.ORIENTATION_VERTICAL, grid.getOrientation());
        assertEquals(5, grid.getSize());
        assertEquals(TestConstants.EXTENT_50_PERCENT, grid.getWidth());
        assertEquals(TestConstants.EXTENT_500_PX, grid.getHeight());
        assertEquals(TestConstants.EXTENT_100_PX, grid.getColumnWidth(0));
        assertEquals(TestConstants.EXTENT_200_PX, grid.getColumnWidth(1));
        assertEquals(TestConstants.EXTENT_30_PX, grid.getRowHeight(0));
        assertEquals(TestConstants.EXTENT_500_PX, grid.getRowHeight(1));
    }
View Full Code Here

        testColumn.add(listBox1);

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

        controlsColumn.addButton("Add ActionListener", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
View Full Code Here

       windowPane.setTitle("****Bug F1047 Window #" + windowNumber++);
       windowPane.setStyleName("Default");

       final Column mainColumn = new Column();
      
       Grid grid = new Grid();
       mainColumn.add(grid);
      
       grid.add(new Label("User"));
       TextField tf = new TextField();
       tf.setText("This Text will render somewhere");
       grid.add(tf);
       grid.add(new Label("Subject"));
       tf = new TextField();
       tf.setText("BLANK OUT THIS FIELD!!!");
       grid.add(tf);
       grid.add(new Label("Message"));
       grid.add(new TextArea());
       grid.add(new Label("Stuff"));
       grid.add(new ListBox(new Object[]{"one", "two", "three"}));
       grid.add(new Label("Things"));
       grid.add(new SelectField(new Object[]{"four", "five", "six"}));
      
       Button okButton = new Button("Ok");
       okButton.addActionListener(new ActionListener() {
           public void actionPerformed(ActionEvent e) {
               Column errorColumn = new Column();
               errorColumn.add(new Label("Did Mozilla break?"));
               errorColumn.add(new Label("Did Mozilla break?"));
               mainColumn.add(errorColumn, 0);
               //**** UNCOMMENT THE FOLLWOING LINE FOR "FIXING" THIS BUG
               //windowPane.setHeight(windowPane.getHeight());
           }
       });
       grid.add(okButton);
       windowPane.add(mainColumn);
       return windowPane;
    }   
View Full Code Here

                processLogin();
            }
        });
        controlRow.add(button);

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

        label = new Label(Messages.getString("LoginScreen.PromptEmailAddress"));
        label.setStyleName("LoginScreen.Prompt");
        layoutGrid.add(label);

        emailAddressField = new TextField();
        emailAddressField.setWidth(PX_300);
        emailAddressField.setStyleName("Default");
        emailAddressField.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                EmailApp.getActive().setFocusedComponent(passwordField);
            }
        });
        layoutGrid.add(emailAddressField);
       
        label = new Label(Messages.getString("LoginScreen.PromptPassword"));
        label.setStyleName("LoginScreen.Prompt");
        layoutGrid.add(label);
       
        passwordField = new PasswordField();
        passwordField.setWidth(PX_300);
        passwordField.setStyleName("Default");
        layoutGrid.add(passwordField);
        passwordField.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                processLogin();
            }
        });
View Full Code Here

        setVisible(false);
       
        setCellSpacing(new Extent(10));
        setInsets(new Insets(3));
       
        Grid headerGrid = new Grid();
        headerGrid.setStyleName("Message.HeaderGrid");
        add(headerGrid);

        toFieldPromptLabel = new Label(Messages.getString("Message.PromptLabel.To"));
        toFieldPromptLabel.setStyleName("Message.HeaderGridPrompt");
        headerGrid.add(toFieldPromptLabel);
       
        toFieldValueLabel = new Label();
        headerGrid.add(toFieldValueLabel);
       
        ccFieldPromptLabel = new Label(Messages.getString("Message.PromptLabel.Cc"));
        ccFieldPromptLabel.setStyleName("Message.HeaderGridPrompt");
        headerGrid.add(ccFieldPromptLabel);
       
        ccFieldValueLabel = new Label();
        headerGrid.add(ccFieldValueLabel);
       
        bccFieldPromptLabel = new Label(Messages.getString("Message.PromptLabel.Bcc"));
        bccFieldPromptLabel.setStyleName("Message.HeaderGridPrompt");
        headerGrid.add(bccFieldPromptLabel);
       
        bccFieldValueLabel = new Label();
        headerGrid.add(bccFieldValueLabel);
       
        Label subjectFieldPromptLabel = new Label(Messages.getString("Message.PromptLabel.Subject"));
        subjectFieldPromptLabel.setStyleName("Message.HeaderGridPrompt");
        headerGrid.add(subjectFieldPromptLabel);
       
        subjectFieldValueLabel = new Label();
        headerGrid.add(subjectFieldValueLabel);
       
        messageColumn = new Column();
        messageColumn.setFont(new Font(Font.MONOSPACE, Font.PLAIN, null));
        add(messageColumn);
    }
View Full Code Here

        Column layoutColumn = new Column();
        layoutColumn.setCellSpacing(new Extent(10));
        layoutColumn.setInsets(new Insets(10));
        mainPane.add(layoutColumn);
       
        Grid headerGrid = new Grid();
        headerGrid.setInsets(new Insets(0, 2));
        layoutColumn.add(headerGrid);
       
        Label label;
       
        label = new Label(Messages.getString("Message.PromptLabel.To"));
        headerGrid.add(label);
       
        toField = new TextField();
        toField.setStyleName("Default");
        toField.setWidth(new Extent(450));
        headerGrid.add(toField);
       
        label = new Label(Messages.getString("Message.PromptLabel.Cc"));
        headerGrid.add(label);
       
        ccField = new TextField();
        ccField.setStyleName("Default");
        ccField.setWidth(new Extent(450));
        headerGrid.add(ccField);
       
        label = new Label(Messages.getString("Message.PromptLabel.Bcc"));
        headerGrid.add(label);
       
        bccField = new TextField();
        bccField.setStyleName("Default");
        bccField.setWidth(new Extent(450));
        headerGrid.add(bccField);
       
        label = new Label(Messages.getString("Message.PromptLabel.Subject"));
        headerGrid.add(label);
       
        subjectField = new TextField();
        subjectField.setStyleName("Default");
        subjectField.setWidth(new Extent(450));
        headerGrid.add(subjectField);
       
        messageField = new TextArea();
        messageField.setStyleName("Default");
        messageField.setWidth(new Extent(520));
        messageField.setHeight(new Extent(18, Extent.EM));
View Full Code Here

        controlsColumn.addButton("Set Content (Grid)", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                if (container.getComponentCount() > 0) {
                    container.removeAll();
                }
                Grid grid = new Grid();
                grid.setBorder(StyleUtil.randomBorder());
                grid.setInsets(new Insets(StyleUtil.randomExtent(8)));
                grid.add(new Label("A label"));
                grid.add(new Label("A label"));
                grid.add(new Label("A label"));
                grid.add(new Label("A label"));
                grid.add(new Label("A label"));
                container.add(grid);
            }
        });
        controlsColumn.addButton("Clear Content", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
View Full Code Here

     * |__|_____|_____|_____|
     *
     * 0   1     2  3  4       (rendered column)
     */
    public void testReduceColumnComplex() {
        Grid grid = new Grid();
       
        // Configure Grid Content
        grid.setSize(7);
        for (int i = 0; i < 12; ++i) {
            Label label = new Label(Integer.toString(i));
            if (i == 1 || i == 2 || i == 3 || i == 5 || i == 8 || i == 10 || i == 11) {
                GridLayoutData layoutData = new GridLayoutData();
                layoutData.setColumnSpan(2);
                if (i == 8) {
                    layoutData.setRowSpan(2);
                }
                label.setLayoutData(layoutData);
            }
            grid.add(label);
        }
       
        // Set Column Sizes
        grid.setColumnWidth(0, new Extent(1));
        grid.setColumnWidth(1, new Extent(2));
        grid.setColumnWidth(2, new Extent(4));
        grid.setColumnWidth(3, new Extent(8));
        grid.setColumnWidth(4, new Extent(16));
        grid.setColumnWidth(5, new Extent(32));
        grid.setColumnWidth(6, new Extent(64));

        GridProcessor gridProcessor = new GridProcessor(grid);
       
        // Verify Grid size is correct.
        assertEquals(5, gridProcessor.getColumnCount());
View Full Code Here

TOP

Related Classes of nextapp.echo2.app.Grid

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.