Package nextapp.echo2.app

Examples of nextapp.echo2.app.WindowPane


     *
     * @param name the window name
     * @return the created window
     */
    private WindowPane createTestWindow(String name) {
        final WindowPane windowPane = new WindowPane();
        positionWindowPane(windowPane);
        windowPane.setTitle(name + " Window #" + windowNumber++);
        windowPane.setTitleInsets(new Insets(10, 5));
        windowPane.setTitleBackground(new Color(0x2f2f4f));
        windowPane.setInsets(new Insets(10));
        windowPane.setWidth(new Extent(500));
        windowPane.setHeight(new Extent(280));
        windowPane.setStyleName("Default");
       
        ButtonColumn column = new ButtonColumn();
        windowPane.add(column);
       
        column.addButton("Set Icon", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setIcon(Styles.ICON_24_MAIL_COMPOSE);
                windowPane.setIconInsets(new Insets(4, 2));
            }
        });
       
        column.addButton("Clear Icon", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setIcon(null);
                windowPane.setIconInsets(null);
            }
        });
       
        column.addButton("Set Close Icon (and appropriate Icon Insets)", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setCloseIcon(Styles.ICON_24_NO);
                windowPane.setCloseIconInsets(new Insets(4, 2));
            }
        });
       
        column.addButton("Clear Close Icon", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setCloseIcon(null);
                windowPane.setCloseIconInsets(null);
            }
        });
       
        column.addButton("Set Style Name = Default", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setStyleName("Default");
            }
        });
       
        column.addButton("Clear Style Name", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setStyleName(null);
            }
        });
       
        return windowPane;
    }
View Full Code Here


        groupContainerColumn.setStyleName("TestControlsColumn");
        add(groupContainerColumn);
       
        contentPane = new ContentPane();
        add(contentPane);
        windowPane = new WindowPane();
        contentPane.add(windowPane);

        ButtonColumn controlsColumn;
       
        // Content
       
        controlsColumn = new ButtonColumn();
        controlsColumn.add(new Label("Content"));
        groupContainerColumn.add(controlsColumn);
       
        controlsColumn.addButton("Set Content = Small Label", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.removeAll();
                windowPane.add(new Label("Hello, World!"));
            }
        });
       
        controlsColumn.addButton("Set Content = Big Label", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.removeAll();
                windowPane.add(new Label(StyleUtil.QUASI_LATIN_TEXT_1));
            }
        });
       
        controlsColumn.addButton("Set Content = WindowPaneTest", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.removeAll();
                windowPane.add(new WindowPaneTest());
            }
        });
       
        controlsColumn.addButton("Set Content = Nothing", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.removeAll();
            }
        });
       
        controlsColumn.addButton("Add-Remove-Add", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.removeAll();
                Label label = new Label("Hello, World!");
                windowPane.add(label);
                windowPane.remove(label);
                windowPane.add(label);
            }
        });
       
        // Properties
       
        controlsColumn = new ButtonColumn();
        controlsColumn.add(new Label("Properties"));
        groupContainerColumn.add(controlsColumn);
       
        controlsColumn.addButton("Set Style Name = Default", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setStyleName("Default");
            }
        });
        controlsColumn.addButton("Clear Style Name", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setStyleName(null);
            }
        });
       
        controlsColumn.addButton("Set Border 1", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setBorder(new FillImageBorder(Color.GREEN, new Insets(20), new Insets(5)));
            }
        });

        controlsColumn.addButton("Set Border 2 (L/R only)", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                FillImageBorder fib = new FillImageBorder(Color.GREEN, new Insets(20), new Insets(5));
                fib.setFillImage(FillImageBorder.LEFT, Styles.BG_SHADOW_DARK_BLUE);
                fib.setFillImage(FillImageBorder.RIGHT, Styles.BG_SHADOW_LIGHT_BLUE);
                windowPane.setBorder(fib);
            }
        });

        controlsColumn.addButton("Clear Border", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setBorder(null);
            }
        });

        controlsColumn.addButton("Set Foreground", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setForeground(StyleUtil.randomColor());
            }
        });
        controlsColumn.addButton("Clear Foreground", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setForeground(null);
            }
        });
        controlsColumn.addButton("Set Background", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setBackground(StyleUtil.randomColor());
            }
        });
        controlsColumn.addButton("Clear Background", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setBackground(null);
            }
        });
        controlsColumn.addButton("Set Font", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setFont(StyleUtil.randomFont());
            }
        });
        controlsColumn.addButton("Clear Font", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setFont(null);
            }
        });
        controlsColumn.addButton("Set Background Image", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setBackgroundImage(Styles.BG_SHADOW_LIGHT_BLUE);
            }
        });
        controlsColumn.addButton("Clear Background Image", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setBackgroundImage(null);
            }
        });
        controlsColumn.addButton("Set Content Insets to 0", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setInsets(new Insets(0));
            }
        });
        controlsColumn.addButton("Set Content Insets to 5", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setInsets(new Insets(5));
            }
        });
        controlsColumn.addButton("Set Content Insets to 10/20/40/80", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setInsets(new Insets(10, 20, 40, 80));
            }
        });
        controlsColumn.addButton("Clear Content Insets", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setInsets(null);
            }
        });

        controlsColumn.addButton("Set Position Random", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setPositionX(new Extent((int) (Math.random() * 600)));
                windowPane.setPositionY(new Extent((int) (Math.random() * 500)));
            }
        });
        controlsColumn.addButton("Set Size Random", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setWidth(new Extent(100 + (int) (Math.random() * 400)));
                windowPane.setHeight(new Extent(100 + (int) (Math.random() * 300)));
            }
        });
        controlsColumn.addButton("Set Position&Size Random", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setPositionX(new Extent((int) (Math.random() * 600)));
                windowPane.setPositionY(new Extent((int) (Math.random() * 500)));
                windowPane.setWidth(new Extent(100 + (int) (Math.random() * 400)));
                windowPane.setHeight(new Extent(100 + (int) (Math.random() * 300)));
            }
        });       
       
        // Title-Related Properties
       
        controlsColumn = new ButtonColumn();
        controlsColumn.add(new Label("Properties"));
        groupContainerColumn.add(controlsColumn);
       
        controlsColumn.addButton("Set Title", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setTitle("Window Title");
            }
        });
        controlsColumn.addButton("Set Title Long", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setTitle("This is a fairly long window title that goes on for a little to long to see if " +
                        "wrapping is handled properly and such.");
            }
        });
        controlsColumn.addButton("Clear Title", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setTitle(null);
            }
        });
        controlsColumn.addButton("Set Title Height", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setTitleHeight(new Extent(((int) (Math.random() * 24)) + 24));
            }
        });
        controlsColumn.addButton("Clear Title Height", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setTitleHeight(null);
            }
        });
        controlsColumn.addButton("Set Title Insets to 0", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setTitleInsets(new Insets(0));
            }
        });
        controlsColumn.addButton("Set Title Insets to 5", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setTitleInsets(new Insets(5));
            }
        });
        controlsColumn.addButton("Set Title Insets to 10/20/40/80", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setTitleInsets(new Insets(10, 20, 40, 80));
            }
        });
        controlsColumn.addButton("Clear Title Insets", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setTitleInsets(null);
            }
        });
        controlsColumn.addButton("Set Title Foreground", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setTitleForeground(StyleUtil.randomColor());
            }
        });
        controlsColumn.addButton("Clear Title Foreground", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setTitleForeground(null);
            }
        });
        controlsColumn.addButton("Set Title Background", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setTitleBackground(StyleUtil.randomColor());
            }
        });
        controlsColumn.addButton("Clear Title Background", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setTitleBackground(null);
            }
        });
        controlsColumn.addButton("Set Title Font", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setTitleFont(StyleUtil.randomFont());
            }
        });
        controlsColumn.addButton("Clear Title Font", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setTitleFont(null);
            }
        });

        // Integration Tests
       
        controlsColumn = new ButtonColumn();
        controlsColumn.add(new Label("Content"));
        groupContainerColumn.add(controlsColumn);

        controlsColumn.addButton("Add Component", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                if (contentPane.getComponentCount() == 0) {
                    contentPane.add(windowPane);
                }
            }
        });

        controlsColumn.addButton("Remove Component", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                contentPane.remove(windowPane);
            }
        });

        controlsColumn.addButton("Enable Component", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setEnabled(true);
            }
        });

        controlsColumn.addButton("Disable Component", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                windowPane.setEnabled(false);
            }
        });

        controlsColumn.addButton("Add Modal WindowPane", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                WindowPane modalWindow = new WindowPane();
                modalWindow.setTitle("Blocking Modal WindowPane");
                modalWindow.setModal(true);
                InteractiveApp.getApp().getDefaultWindow().getContent().add(modalWindow);
            }
        });
    }
View Full Code Here

            }
        });
       
        controlsColumn.addButton("Add WindowPane", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                testContentPane.add(new WindowPane());
            }
        });
        controlsColumn.addButton("Set Horizontal Scroll = null", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                testContentPane.setHorizontalScroll(null);
View Full Code Here

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

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

   
    /**
     * Tests basic modal functionality.
     */
    public void testBasicModal() {
        WindowPane windowPane = new WindowPane();
        windowPane.setModal(true);

        assertNull(app.getModalContextRoot());

        app.getDefaultWindow().getContent().add(windowPane);
        assertEquals(windowPane, app.getModalContextRoot());

        app.getDefaultWindow().getContent().remove(windowPane);
        assertNull(app.getModalContextRoot());
       
        windowPane.setModal(false);
        app.getDefaultWindow().getContent().add(windowPane);
        assertNull(app.getModalContextRoot());
       
        windowPane.setModal(true);
        assertEquals(windowPane, app.getModalContextRoot());

        windowPane.setModal(false);
        assertNull(app.getModalContextRoot());
    }
View Full Code Here

   
    /**
     * Ensure invisible objects are not in modal context.
     */
    public void testInvisibleModal() {
        WindowPane windowPane = new WindowPane();
        windowPane.setModal(true);
        app.getDefaultWindow().getContent().add(windowPane);
        assertEquals(windowPane, app.getModalContextRoot());
       
        windowPane.setVisible(false);
        assertEquals(null, app.getModalContextRoot());
       
        windowPane.setVisible(true);
        assertEquals(windowPane, app.getModalContextRoot());
       
        app.getDefaultWindow().getContent().remove(windowPane);
        windowPane.setVisible(false);
        app.getDefaultWindow().getContent().add(windowPane);
        assertEquals(null, app.getModalContextRoot());
    }
View Full Code Here

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

   
    /**
     * Test receiving input from client.
     */
    public void testInput() {
        WindowPane windowPane = new WindowPane();
        windowPane.add(new Label("a label"));
        windowPane.setPositionX(TestConstants.EXTENT_100_PX);
        windowPane.setPositionY(TestConstants.EXTENT_100_PX);
        windowPane.processInput(WindowPane.PROPERTY_POSITION_X, TestConstants.EXTENT_200_PX);
        windowPane.processInput(WindowPane.PROPERTY_POSITION_Y, TestConstants.EXTENT_30_PX);
        assertEquals(TestConstants.EXTENT_200_PX, windowPane.getPositionX());
        assertEquals(TestConstants.EXTENT_30_PX, windowPane.getPositionY());
    }
View Full Code Here

    /**
     * Attempt to illegally add WindowPane to SplitPane, test for failure.
     */
    public void testInvalidParent() {
        SplitPane splitPane = new SplitPane();
        WindowPane windowPane = new WindowPane();
        boolean exceptionThrown = false;
        try {
            splitPane.add(windowPane);
        } catch (IllegalChildException ex) {
            exceptionThrown = true;
View Full Code Here

TOP

Related Classes of nextapp.echo2.app.WindowPane

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.