Package nextapp.echo2.app

Examples of nextapp.echo2.app.ContentPane


        txShortName = new JbsLangTextField(ClientGlobals.getMainDbLanguage());
    }

    @Override
    protected void initPanel() {
        ContentPane cpStdData = new ContentPane();

        JbsGrid grdMain = new JbsGrid(2);
        grdMain.setInsets(new Insets(5, 5));
        grdMain.setColumnWidth(0, new JbsExtent(150));
       
        grdMain.add(new JbsLabel(JbsL10N.getString("QtyUnit.name")));
        grdMain.add(this.txName);
       
        grdMain.add(new JbsLabel(JbsL10N.getString("QtyUnit.shortName")));
        grdMain.add(this.txShortName);
       
       
        cpStdData.add(grdMain);
        this.add(cpStdData);
    }
View Full Code Here


     * @see nextapp.echo2.app.ApplicationInstance#init()
     */
    public Window init() {
        Window window = new Window();
        window.setTitle("Thousand Monkeys (Start)");
        ContentPane contentPane = new ContentPane();
        window.setContent(contentPane);
        monkey = new Monkey(contentPane);
        startGhostTask();
        return window;
    }
View Full Code Here

        Column groupContainerColumn = new Column();
        groupContainerColumn.setCellSpacing(new Extent(5));
        groupContainerColumn.setStyleName("TestControlsColumn");
        add(groupContainerColumn);
       
        contentPane = new ContentPane();
        add(contentPane);
        windowPane = new WindowPane();
        contentPane.add(windowPane);

        ButtonColumn controlsColumn;
View Full Code Here

    public ContentPaneTest() {
        super(SplitPane.ORIENTATION_HORIZONTAL, new Extent(250, Extent.PX));
        setStyleName("DefaultResizable");
       
        final ContentPane rootContentPane = InteractiveApp.getApp().getDefaultWindow().getContent();
        final Label contentLabel = new Label(StyleUtil.QUASI_LATIN_TEXT_1 + StyleUtil.QUASI_LATIN_TEXT_1);
       
        ButtonColumn controlsColumn = new ButtonColumn();
        controlsColumn.setStyleName("TestControlsColumn");
        add(controlsColumn);
       
        final ContentPane testContentPane = new ContentPane();
        add(testContentPane);

        controlsColumn.add(new Label("Root Content Pane"));

        controlsColumn.addButton("Reset", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                rootContentPane.setBackground(null);
                rootContentPane.setForeground(null);
                rootContentPane.setFont(null);
            }
        });
        controlsColumn.addButton("Change Background", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                rootContentPane.setBackground(StyleUtil.randomColor());
            }
        });
        controlsColumn.addButton("Change Foreground", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                rootContentPane.setForeground(StyleUtil.randomColor());
            }
        });
        controlsColumn.addButton("Change Font", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                rootContentPane.setFont(StyleUtil.randomFont());
            }
        });
       
        controlsColumn.add(new Label("Test Content Pane"));
       
        controlsColumn.addButton("Reset", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                testContentPane.setBackground(null);
                testContentPane.setForeground(null);
                testContentPane.setFont(null);
            }
        });
        controlsColumn.addButton("Change Background", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                testContentPane.setBackground(StyleUtil.randomColor());
            }
        });
        controlsColumn.addButton("Change Foreground", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                testContentPane.setForeground(StyleUtil.randomColor());
            }
        });
        controlsColumn.addButton("Background Image", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                testContentPane.setBackgroundImage(Styles.BG_SHADOW_LIGHT_BLUE);
            }
        });
        controlsColumn.addButton("Background Image @ 50px", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                testContentPane.setBackgroundImage(Styles.BG_SHADOW_LIGHT_BLUE_50_PX_REPEAT);
            }
        });
        controlsColumn.addButton("Background Image @ 1%", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                testContentPane.setBackgroundImage(Styles.BG_SHADOW_LIGHT_BLUE_1_PERCENT_REPEAT);
            }
        });
        controlsColumn.addButton("Background Image @ 50%", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                testContentPane.setBackgroundImage(Styles.BG_SHADOW_LIGHT_BLUE_50_PERCENT_REPEAT);
            }
        });
        controlsColumn.addButton("Background Null", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                testContentPane.setBackgroundImage(null);
            }
        });
        controlsColumn.addButton("Change Font", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                testContentPane.setFont(StyleUtil.randomFont());
            }
        });
       
        controlsColumn.addButton("Add Label", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                removeAllContent(testContentPane);
                testContentPane.add(contentLabel);
            }
        });
        controlsColumn.addButton("Add SplitPane", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                removeAllContent(testContentPane);
                SplitPane splitPane = new SplitPane();
                splitPane.setResizable(true);
               
                Label label;
                SplitPaneLayoutData layoutData;

                layoutData = new SplitPaneLayoutData();
                layoutData.setBackground(new Color(0xafafff));
                label = new Label(StyleUtil.QUASI_LATIN_TEXT_1);
                label.setLayoutData(layoutData);
                splitPane.add(label);

                layoutData = new SplitPaneLayoutData();
                layoutData.setBackground(new Color(0xafffaf));
                label = new Label(StyleUtil.QUASI_LATIN_TEXT_1);
                label.setLayoutData(layoutData);
                splitPane.add(label);

                testContentPane.add(splitPane);
            }
        });
        controlsColumn.addButton("Add SplitPane / ContentPane / Button", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                removeAllContent(testContentPane);
                SplitPane splitPane = new SplitPane();
                splitPane.setResizable(true);
               
                Label label;
                SplitPaneLayoutData layoutData;

                layoutData = new SplitPaneLayoutData();
                layoutData.setBackground(new Color(0xafafff));
                ContentPane subContentPane = new ContentPane();
                subContentPane.setLayoutData(layoutData);
                splitPane.add(subContentPane);
               
                SplitPane splitPane2 = new SplitPane(SplitPane.ORIENTATION_VERTICAL);
                subContentPane.add(splitPane2);
               
                ContentPane subContentPane2 = new ContentPane();
                splitPane2.add(subContentPane2);
                subContentPane2.add(new Label("Test!"));
               
                ContentPane subContentPane3 = new ContentPane();
                splitPane2.add(subContentPane3);
               
               
                final Button button = new Button("Alpha");
                button.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        button.setText("Alpha".equals(button.getText()) ? "Omega" : "Alpha");
                    }
                });
                subContentPane3.add(button);

                layoutData = new SplitPaneLayoutData();
                layoutData.setBackground(new Color(0xafffaf));
                label = new Label(StyleUtil.QUASI_LATIN_TEXT_1);
                label.setLayoutData(layoutData);
View Full Code Here

        ButtonColumn controlsColumn = new ButtonColumn();
        controlsColumn.setCellSpacing(new Extent(5));
        controlsColumn.setStyleName("TestControlsColumn");
        add(controlsColumn);
       
        ContentPane contentPane = new ContentPane();
        add(contentPane);
       
        final Column contentColumn = new Column();
        contentPane.add(contentColumn);
       
        WindowTestControls windowTestControls;
        windowTestControls = new WindowTestControls("Root Level", InteractiveApp.getApp().getDefaultWindow().getContent());
        controlsColumn.add(windowTestControls);
        windowTestControls = new WindowTestControls("Embedded", contentPane);
View Full Code Here

        ButtonColumn column = new ButtonColumn();
        windowPane.add(column);

        column.addButton("Add Modal Window", new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                ContentPane contentPane = (ContentPane) windowPane.getParent();
                WindowPane newWindowPane = createModalWindow("YetAnotherModal");
                newWindowPane.setModal(true);
                contentPane.add(newWindowPane);
            }
        });
       
        return windowPane;
    }
View Full Code Here

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

    /**
     * Tests changing content of window.
     */
    public void testChangeContent() {
        Window window = new Window();
        window.setContent(new ContentPane());
        ContentPane content = new ContentPane();
        window.setContent(content);
        assertEquals(content, window.getContent());
    }
View Full Code Here

     * <code>Window</code>, tests for failure.
     */
    public void testOverload() {
        Window window = new Window();
        window.removeAll();
        window.add(new ContentPane());
        boolean exceptionThrown = false;
        try {
            window.add(new ContentPane());
        } catch (IllegalChildException ex) {
            exceptionThrown = true;
        }
        assertTrue(exceptionThrown);
    }
View Full Code Here

     */
    public Window init() {
        Window window = new Window();
        window.setTitle("Hello, world!");
       
        ContentPane contentPane = new ContentPane();
        window.setContent(contentPane);
       
        contentPane.add(new Label("Hello, world!"));
       
        return window;
    }
View Full Code Here

TOP

Related Classes of nextapp.echo2.app.ContentPane

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.