Package nextapp.echo2.app

Examples of nextapp.echo2.app.Label


     */
    public Window init() {
        window = new Window();
        contentPane = window.getContent();
        column = new Column();
        label = new Label("Label");
        column.add(label);
        contentPane.add(column);
        return window;
    }
View Full Code Here


public class WindowPaneExamplesTest extends SplitPane {
   
    private class WindowTestControls extends ButtonColumn {
       
        private WindowTestControls(String targetName, final ContentPane targetContentPane) {
            add(new Label(targetName));
            addButton("Add Test Window", new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    targetContentPane.add(createTestWindow("Test"));
                }
            });
            addButton("Add Label Window", new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    targetContentPane.add(createSimpleWindow("Simple"));
                }
            });
            addButton("Add GlassBlue Window", new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    WindowPane windowPane = createSimpleWindow("GlassBlue");
                    windowPane.setStyleName("GlassBlue");
                    targetContentPane.add(windowPane);
                }
            });
            addButton("Add TransGreen Window", new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    WindowPane windowPane = createSimpleWindow("TransGreen");
                    windowPane.setStyleName("TransGreen");
                    targetContentPane.add(windowPane);
                }
            });
            addButton("Add Modal Window", new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    WindowPane windowPane = createModalWindow("Modal");
                    windowPane.setModal(true);
                    targetContentPane.add(windowPane);
                }
            });
            addButton("Add Three Modal Windows", new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    for (int i = 0; i < 3; ++i) {
                        WindowPane windowPane = createModalWindow("3Modal");
                        windowPane.setModal(true);
                        windowPane.setZIndex(i + 1);
                        targetContentPane.add(windowPane);
                    }
                }
            });
            addButton("Add Modal Window In A Window", new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    WindowPane w1 = new WindowPane();
                    w1.setStyleName("Default");
                    w1.setWidth(new Extent(650));
                    w1.setHeight(new Extent(450));
                    w1.setTitle("Just A Window");
                    targetContentPane.add(w1);
                   
                    ContentPane c1 = new ContentPane();
                    final Button b1 = new Button("Click me:");
                    b1.setStyleName("Default");
                    b1.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent e) {
                            b1.setText(b1.getText() + "!");
                        }
                    });
                    c1.add(b1);

                    w1.add(c1);
                   
                    WindowPane w2 = new WindowPane();
                    w2.setStyleName("Default");
                    final Button b2 = new Button("Click me:");
                    b2.setStyleName("Default");
                    b2.addActionListener(new ActionListener() {
                        public void actionPerformed(ActionEvent e) {
                            b2.setText(b2.getText() + "!");
                        }
                    });
                    w2.add(b2);
                   
                    w2.setTitle("But this one is modal.");
                    w2.setModal(true);
                   
                    c1.add(w2);
                }
            });
            addButton("Add Constrained Size Window", new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    WindowPane windowPane = createSimpleWindow("Constrained");
                    windowPane.setMinimumWidth(new Extent(400));
                    windowPane.setMaximumWidth(new Extent(500));
                    windowPane.setMinimumHeight(new Extent(200));
                    windowPane.setMaximumHeight(new Extent(280));
                    targetContentPane.add(windowPane);
                }
            });
            addButton("Add Default-Border Window", new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    final WindowPane windowPane = new WindowPane();
                    positionWindowPane(windowPane);
                    windowPane.setTitle("Default-Border Window #" + windowNumber++);
                    targetContentPane.add(windowPane);
                   
                    Column windowPaneColumn = new Column();
                    windowPane.add(windowPaneColumn);
                    windowPaneColumn.add(new Label("First Name:"));
                    windowPaneColumn.add(new TextField());
                    windowPaneColumn.add(new Label("Last Name:"));
                    windowPaneColumn.add(new TextField());
                }
            });
            addButton("Add Immovable Window", new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    WindowPane windowPane = createSimpleWindow("Immovable");
                    windowPane.setMovable(false);
                    targetContentPane.add(windowPane);
                }
            });
            addButton("Add Fixed Size Window", new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    WindowPane windowPane = createSimpleWindow("Fixed Size");
                    windowPane.setResizable(false);
                    targetContentPane.add(windowPane);
                }
            });
            addButton("Add Immovable Fixed Size Window", new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    WindowPane windowPane = createSimpleWindow("Immovable Fixed Size");
                    windowPane.setMovable(false);
                    windowPane.setResizable(false);
                    targetContentPane.add(windowPane);
                }
            });
            addButton("Add SplitPane Window (No Close Icon)", new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    final WindowPane windowPane = new WindowPane();
                    windowPane.setClosable(false);
                    positionWindowPane(windowPane);
                    targetContentPane.add(windowPane);
                    windowPane.setTitle("SplitPane Window #" + windowNumber++);
                    windowPane.setTitleInsets(new Insets(10, 5));
                    windowPane.setStyleName("Default");
                    windowPane.setTitleBackground(new Color(0x2f2f4f));
                    windowPane.setWidth(new Extent(500, Extent.PX));
                    windowPane.setHeight(new Extent(300, Extent.PX));
                    SplitPane splitPane = new SplitPane(SplitPane.ORIENTATION_VERTICAL_BOTTOM_TOP, new Extent(42));
                    SplitPaneLayoutData splitPaneLayoutData;
                   
                    Button okButton = new Button("Ok");
                    okButton.addActionListener(new ActionListener() {
                        /**
                         * @see nextapp.echo2.app.event.ActionListener#actionPerformed(nextapp.echo2.app.event.ActionEvent)
                         */
                        public void actionPerformed(ActionEvent e) {
                            windowPane.getParent().remove(windowPane);
                        }
                    });
                    splitPaneLayoutData = new SplitPaneLayoutData();
                    splitPaneLayoutData.setBackground(new Color(0x5f5f9f));
                    splitPaneLayoutData.setInsets(new Insets(8));
                    splitPaneLayoutData.setAlignment(new Alignment(Alignment.CENTER, Alignment.DEFAULT));
                    splitPaneLayoutData.setOverflow(SplitPaneLayoutData.OVERFLOW_HIDDEN);
                    okButton.setLayoutData(splitPaneLayoutData);
                    okButton.setWidth(new Extent(100));
                    okButton.setStyleName("Default");
                    splitPane.add(okButton);
                   
                    Label contentLabel = new Label(StyleUtil.QUASI_LATIN_TEXT_1);
                    splitPaneLayoutData = new SplitPaneLayoutData();
                    splitPaneLayoutData.setBackground(new Color(0xefefff));
                    contentLabel.setLayoutData(splitPaneLayoutData);
                    splitPane.add(contentLabel);
                   
                    windowPane.add(splitPane);
                }
            });
   
            addButton("Add Multiple SplitPane Nautilus Window", new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    final WindowPane windowPane = new WindowPane();
                    windowPane.setStyleName("Default");
                    windowPane.setWidth(new Extent(500, Extent.PX));
                    windowPane.setHeight(new Extent(500, Extent.PX));
                    windowPane.setTitle("SP Nautilus Window #" + windowNumber++);
                    windowPane.add(new SplitPaneNestedTest(new Extent(50)));
                    positionWindowPane(windowPane);
                    targetContentPane.add(windowPane);
                }
            });
           
            addButton("Add Multiple SplitPane Window", new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    final WindowPane windowPane = new WindowPane();
                    positionWindowPane(windowPane);
                    targetContentPane.add(windowPane);
                    windowPane.setTitle("Multiple SplitPane Window #" + windowNumber++);
                    windowPane.setTitleInsets(new Insets(10, 5));
                    windowPane.setStyleName("Default");
                    windowPane.setTitleBackground(new Color(0x2f2f4f));
                    windowPane.setWidth(new Extent(700, Extent.PX));
                    windowPane.setHeight(new Extent(500, Extent.PX));
                   
                    SplitPane splitPane1 = new SplitPane(SplitPane.ORIENTATION_HORIZONTAL, new Extent(100));
                    splitPane1.setStyleName("DefaultResizable");
                    SplitPaneLayoutData splitPaneLayoutData;
                   
                    Label label;
                   
                    label = new Label(StyleUtil.QUASI_LATIN_TEXT_1);
                    splitPaneLayoutData = new SplitPaneLayoutData();
                    splitPaneLayoutData.setBackground(new Color(0x3fbf5f));
                    splitPaneLayoutData.setInsets(new Insets(5));
                    label.setLayoutData(splitPaneLayoutData);
                    splitPane1.add(label);

                    SplitPane splitPane2 = new SplitPane(SplitPane.ORIENTATION_VERTICAL, new Extent(120));
                    splitPane2.setStyleName("DefaultResizable");
                   
                    SplitPane splitPane3 = new SplitPane(SplitPane.ORIENTATION_HORIZONTAL, new Extent(200));
                    splitPane3.setStyleName("DefaultResizable");
                    splitPane2.add(splitPane3);
                   
                    SplitPane splitPane4 = new SplitPane(SplitPane.ORIENTATION_HORIZONTAL, new Extent(300));
                    splitPane4.setStyleName("DefaultResizable");
                    splitPane2.add(splitPane4);
                   
                    label = new Label(StyleUtil.QUASI_LATIN_TEXT_1);
                    splitPaneLayoutData = new SplitPaneLayoutData();
                    splitPaneLayoutData.setBackground(new Color(0x5f3fbf));
                    splitPaneLayoutData.setInsets(new Insets(5));
                    label.setLayoutData(splitPaneLayoutData);
                    splitPane3.add(label);
                   
                    label = new Label(StyleUtil.QUASI_LATIN_TEXT_1);
                    splitPaneLayoutData = new SplitPaneLayoutData();
                    splitPaneLayoutData.setBackground(new Color(0x3f5fbf));
                    splitPaneLayoutData.setInsets(new Insets(5));
                    label.setLayoutData(splitPaneLayoutData);
                    splitPane3.add(label);
                   
                    label = new Label(StyleUtil.QUASI_LATIN_TEXT_1);
                    splitPaneLayoutData = new SplitPaneLayoutData();
                    splitPaneLayoutData.setBackground(new Color(0xbf5f3f));
                    splitPaneLayoutData.setInsets(new Insets(5));
                    label.setLayoutData(splitPaneLayoutData);
                    splitPane4.add(label);
                   
                    label = new Label(StyleUtil.QUASI_LATIN_TEXT_1);
                    splitPaneLayoutData = new SplitPaneLayoutData();
                    splitPaneLayoutData.setBackground(new Color(0xbf3f5f));
                    splitPaneLayoutData.setInsets(new Insets(5));
                    label.setLayoutData(splitPaneLayoutData);
                    splitPane4.add(label);
   
                    splitPane1.add(splitPane2);
                   
                    windowPane.add(splitPane1);
                }
            });

            addButton("Add Mozilla TextField Quirk Workaround Test Window", new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    targetContentPane.add(createMozillaTextFieldQuirkTestWindow());
                }
            });
           
            addButton("Add init() bug-fix test Window", new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    WindowPane windowPane = new WindowPane();
                    windowPane.add(new Column() {
                        public void init() {
                            super.init();
                            add(new Label("Test"));
                        }
                        public void dispose() {
                            removeAll();
                            super.dispose();
                        }
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.WEBMAIL_EXAMPLE_IMAGE);
        column.add(label);
       
        WindowPane loginWindow = new WindowPane();
        loginWindow.setTitle(Messages.getString("LoginScreen.LoginWindowTitle"));
        loginWindow.setStyleName("LoginScreen.LoginWindow");
        loginWindow.setDefaultCloseOperation(WindowPane.DO_NOTHING_ON_CLOSE);
        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);

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

       
        SplitPane verticalPane = new SplitPane(SplitPane.ORIENTATION_VERTICAL);
        verticalPane.setStyleName("TestPane");
        add(verticalPane);

        Label titleLabel = new Label("NextApp Echo2 Test Application");
        titleLabel.setStyleName("TitleLabel");
        verticalPane.add(titleLabel);
       
        horizontalPane = new SplitPane(SplitPane.ORIENTATION_HORIZONTAL, new Extent(215));
        horizontalPane.setStyleName("DefaultResizable");
        verticalPane.add(horizontalPane);
View Full Code Here

     */
    public Component getTableCellRendererComponent(Table table, Object value, int column, int row) {
        if (value == null) {
            return null;
        } else {
            return new Label(value.toString());
        }
    }
View Full Code Here

    public WelcomePane() {
        super();
        setStyleName("WelcomePane");
        setRenderId("WelcomePane");
       
        Label label;

        WindowPane loginWindow = new WindowPane();
        loginWindow.setTitle("Welcome to the NextApp Echo2 Test Application");
        loginWindow.setStyleName("WelcomePane");
        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("Continue", Styles.ICON_24_YES);
        button.setRenderId("WelcomePaneEnter");
        button.setId("EnterTestApplication");
        button.setStyleName("ControlPane.Button");
        button.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                InteractiveApp.getApp().displayTestPane();
            }
        });
        controlRow.add(button);
       
        Column infoColumn = new Column();
        infoColumn.setInsets(new Insets(20, 5));
        infoColumn.setCellSpacing(new Extent(10));
        splitPane.add(infoColumn);
       
        label = new Label("Please read the following before using the test application:");
        label.setFont(new Font(null, Font.BOLD, null));
        infoColumn.add(label);
       
        label = new Label("This application was built to interactively test components of Echo2 during development.  "
                + "It is also being (mis)used as a public demonstration of Echo2's capabilities. "
                + "Note that if this is a development version of Echo, then some "
                + "of the features and capabilities demonstrated in this application may not be complete.");
        infoColumn.add(label);
       
        label = new Label("Note that you may watch the AJAX XML messages being sent between the client and server by "
                + "enabling \"Debug Mode\".  Debug Mode may be enabled "
                + "by appending \"?debug\" to the end of the URL of this application (for example: "
                + "\"http://demo.nextapp.com/InteractiveTest/ia?debug\"). "
                + "Please be aware that Debug Mode will in most cases result in EXTREMELY SLOW PERFORMANCE. "
                + "You may exit Debug Mode at any time by simply closing the Debug window.");
        infoColumn.add(label);

        label = new Label("Please visit the Echo2 Home Page @ http://echo.nextapp.com for more information.");
        infoColumn.add(label);
       
        Column column = new Column();
        column.setRenderId("MainColumn");
        column.setStyleName("WelcomePane.Column");
        add(column);
       
        label = new Label(Styles.NEXTAPP_LOGO);
        column.add(label);
       
        label = new Label(Styles.ECHO2_IMAGE);
        column.add(label);
       
        label = new Label(Styles.INTERACTIVE_TEST_APPLICATION_IMAGE);
        column.add(label);
    }
View Full Code Here

    public void testInvalidChild() {
        Window window = new Window();
        window.removeAll();
        boolean exceptionThrown = false;
        try {
            window.add(new Label());
        } catch (IllegalChildException ex) {
            exceptionThrown = true;
        }
        assertTrue(exceptionThrown);
    }
View Full Code Here

     */
    public void testIllegalChildren() {
        TextField textField = new TextField();
        boolean exceptionThrown = false;
        try {
            textField.add(new Label("you can't add children to this component, right?"));
        } catch (IllegalChildException ex) {
            exceptionThrown = true;
        }
        assertTrue(exceptionThrown);
    }
View Full Code Here

public class SplitPaneTest extends SplitPane {
   
    private class PaneControlsColumn extends ButtonColumn {
       
        private PaneControlsColumn(final int paneNumber) {
            add(new Label("Configure Pane #" + paneNumber));
   
            addButton("Fill With Text", new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    if (testPane.getComponentCount() < paneNumber + 1) {
                        return;
                    }
                    if (testPane.getComponent(paneNumber) instanceof Label) {
                        Label label = (Label) testPane.getComponent(paneNumber);
                        label.setText(StyleUtil.QUASI_LATIN_TEXT_1);
                    }
                }
            });
            addButton("Change Background Color", new ActionListener() {
                public void actionPerformed(ActionEvent e) {
View Full Code Here

        assertEquals(new Integer(21), model.getValueAt(1, 3));
        assertEquals(Boolean.FALSE, model.getValueAt(2, 3));
    }

    public void testColumModelRendering() {
        Label label;
        DefaultTableModel model = createEmployeeTableModel();
        Table table = new Table(model);
        DefaultTableColumnModel columnModel = (DefaultTableColumnModel) table.getColumnModel();
        assertEquals(0, columnModel.getColumn(0).getModelIndex());
        assertEquals(1, columnModel.getColumn(1).getModelIndex());
        assertEquals(2, columnModel.getColumn(2).getModelIndex());
        table.setAutoCreateColumnsFromModel(false);
        table.validate();
       
        label = (Label) table.getComponent(4);
        assertEquals("32", label.getText());
        label = (Label) table.getComponent(5);
        assertEquals("true", label.getText());
       
        columnModel.getColumn(2).setModelIndex(1);
        columnModel.getColumn(1).setModelIndex(2);
        table.setColumnModel(columnModel);
        table.validate();
       
        // Indices should switch.
        label = (Label) table.getComponent(4);
        assertEquals("true", label.getText());
        label = (Label) table.getComponent(5);
        assertEquals("32", label.getText());
    }
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.