Package nextapp.echo2.app

Examples of nextapp.echo2.app.SplitPane


    public MessageDialog(String title, String message, int type, int controlConfiguration) {
        super(title, new Extent(320), new Extent(240));
        setStyleName("Default");
        setModal(true);

        SplitPane splitPane = new SplitPane(SplitPane.ORIENTATION_VERTICAL_BOTTOM_TOP, new Extent(32));
        add(splitPane);
       
        Row controlsRow = new Row();
        controlsRow.setStyleName("ControlPane");
        splitPane.add(controlsRow);

        Button button;
        switch (controlConfiguration) {
        case CONTROLS_OK:
            button = new Button(Messages.getString("Generic.Ok"), Styles.ICON_24_YES);
            button.setStyleName("ControlPane.Button");
            button.setActionCommand(COMMAND_OK);
            button.addActionListener(actionProcessor);
            controlsRow.add(button);
            break;
        case CONTROLS_YES_NO:
            button = new Button(Messages.getString("Generic.Yes"), Styles.ICON_24_YES);
            button.setStyleName("ControlPane.Button");
            button.setActionCommand(COMMAND_OK);
            button.addActionListener(actionProcessor);
            controlsRow.add(button);
            button = new Button(Messages.getString("Generic.No"), Styles.ICON_24_NO);
            button.setStyleName("ControlPane.Button");
            button.setActionCommand(COMMAND_CANCEL);
            button.addActionListener(actionProcessor);
            controlsRow.add(button);
            break;
        }
       
        Label contentLabel = new Label(message);
        contentLabel.setStyleName("MessageDialog.ContentLabel");
        splitPane.add(contentLabel);
       
        setModal(true);
    }
View Full Code Here


    /**
     * Test empty constructor and verify default state.
     */
    public void testEmptyConstructor() {
        SplitPane splitPane = new SplitPane();
        assertNull(splitPane.getSeparatorPosition());
        assertFalse(splitPane.isResizable());
    }
View Full Code Here

   
    /**
     * Test receiving input from client.
     */
    public void testInput() {
        SplitPane splitPane = new SplitPane();
        splitPane.add(new Label("one label"));
        splitPane.add(new Label("one more label"));
        splitPane.setSeparatorPosition(new Extent(80));
        splitPane.processInput(SplitPane.PROPERTY_SEPARATOR_POSITION, new Extent(212));
        assertEquals(new Extent(212), splitPane.getSeparatorPosition());
    }
View Full Code Here

   
    /**
     * Attempt to illegally add more than two children, tests for failure.
     */
    public void testOverload() {
        SplitPane splitPane = new SplitPane();
        splitPane.add(new Label("one label"));
        splitPane.add(new Label("one more label"));
        boolean exceptionThrown = false;
        try {
            splitPane.add(new Label("one label too many"));
        } catch (IllegalChildException ex) {
            exceptionThrown = true;
        }
        assertTrue(exceptionThrown);
    }
View Full Code Here

    /**
     * Test primary constructor.
     */
    public void testPrimaryConstructor() {
        SplitPane splitPane;
        splitPane = new SplitPane(SplitPane.ORIENTATION_VERTICAL, TestConstants.EXTENT_200_PX);
        assertEquals(SplitPane.ORIENTATION_VERTICAL, splitPane.getOrientation());
        assertEquals(TestConstants.EXTENT_200_PX, splitPane.getSeparatorPosition());
       
        splitPane = new SplitPane(SplitPane.ORIENTATION_HORIZONTAL, TestConstants.EXTENT_500_PX);
        assertEquals(SplitPane.ORIENTATION_HORIZONTAL, splitPane.getOrientation());
        assertEquals(TestConstants.EXTENT_500_PX, splitPane.getSeparatorPosition());
    }
View Full Code Here

   
    /**
     * Test property accessors and mutators.
     */
    public void testProperties() {
        SplitPane splitPane = new SplitPane();
        splitPane.setOrientation(SplitPane.ORIENTATION_VERTICAL);
        assertEquals(SplitPane.ORIENTATION_VERTICAL, splitPane.getOrientation());
        splitPane.setSeparatorPosition(TestConstants.EXTENT_200_PX);
        assertEquals(TestConstants.EXTENT_200_PX, splitPane.getSeparatorPosition());
        splitPane.setSeparatorHeight(TestConstants.EXTENT_30_PX);
        assertEquals(TestConstants.EXTENT_30_PX, splitPane.getSeparatorHeight());
        splitPane.setSeparatorWidth(TestConstants.EXTENT_100_PX);
        assertEquals(TestConstants.EXTENT_100_PX, splitPane.getSeparatorWidth());
        splitPane.setSeparatorColor(Color.RED);
        assertEquals(Color.RED, splitPane.getSeparatorColor());
        splitPane.setResizable(true);
        assertEquals(true, splitPane.isResizable());
        splitPane.setSeparatorHorizontalImage(TestConstants.BACKGROUND_IMAGE);
        assertEquals(TestConstants.BACKGROUND_IMAGE, splitPane.getSeparatorHorizontalImage());
        splitPane.setSeparatorVerticalImage(TestConstants.BACKGROUND_IMAGE);
        splitPane.setSeparatorHorizontalImage(null);
        assertEquals(TestConstants.BACKGROUND_IMAGE, splitPane.getSeparatorVerticalImage());
    }
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;
        }
        assertTrue(exceptionThrown);
    }
View Full Code Here

    public ConsoleWindowPane() {
        super();
        setTitle("Console");
        setStyleName("Default");
       
        SplitPane splitPane = new SplitPane(SplitPane.ORIENTATION_VERTICAL_BOTTOM_TOP, new Extent(32));
        add(splitPane);
       
        Row controlRow = new Row();
        controlRow.setStyleName("ControlPane");
        splitPane.add(controlRow);
       
        Button button = new Button("Clear", Styles.ICON_24_NO);
        button.setStyleName("ControlPane.Button");
        button.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                column.removeAll();
            }
        });
        controlRow.add(button);
       
        SplitPaneLayoutData splitPaneLayoutData;
        logPane = new ContentPane();
        logPane.setFont(new Font(Font.MONOSPACE, Font.PLAIN, new Extent(10)));
        logPane.setForeground(Color.GREEN);
        splitPaneLayoutData = new SplitPaneLayoutData();
        splitPaneLayoutData.setBackground(Color.BLACK);
        logPane.setLayoutData(splitPaneLayoutData);
        splitPane.add(logPane);
       
        column = new Column();
        column.setInsets(new Insets(5));
        logPane.add(column);
    }
View Full Code Here

     * Creates a new <code>MailScreen</code>.
     */
    public MailScreen() {
        super();
       
        SplitPane mainSplitPane = new SplitPane(SplitPane.ORIENTATION_HORIZONTAL, new Extent(175));
        mainSplitPane.setSeparatorWidth(new Extent(1, Extent.PX));
        add(mainSplitPane);
       
        SplitPane titleOptionSplitPane = new SplitPane(SplitPane.ORIENTATION_VERTICAL, new Extent(70));
        titleOptionSplitPane.setSeparatorHeight(new Extent(1, Extent.PX));
        mainSplitPane.add(titleOptionSplitPane);
       
        Column titleColumn = new Column();
        titleColumn.setStyleName("MailScreen.TitleColumn");
        titleOptionSplitPane.add(titleColumn);
        Label label;
       
        label = new Label(Messages.getString("Application.Title.Main"));
        label.setStyleName("Title.Main");
        titleColumn.add(label);
       
        label = new Label(Messages.getString("Application.Title.Sub"));
        label.setStyleName("Title.Sub");
        titleColumn.add(label);
       
        titleOptionSplitPane.add(createOptionPane());
       
        SplitPane mailSplitPane = new SplitPane(SplitPane.ORIENTATION_VERTICAL, new Extent(320));
        mailSplitPane.setResizable(true);
        mainSplitPane.add(mailSplitPane);
       
        SplitPane messageListSplitPane = new SplitPane(SplitPane.ORIENTATION_VERTICAL, new Extent(32));
        messageListSplitPane.setSeparatorHeight(new Extent(1, Extent.PX));
        mailSplitPane.add(messageListSplitPane);
       
        Row controlPane = new Row();
        controlPane.setStyleName("ControlPane");
        messageListSplitPane.add(controlPane);
       
        pageNavigator = new PageNavigator();
        pageNavigator.addPageIndexChangeListener(new PageNavigator.PageIndexChangeListener() {
            public void pageIndexChanged(PageIndexChangeEvent e) {
                try {
                    messageListTable.setPageIndex(e.getNewPageIndex());
                    messagePane.setMessage(null);
                } catch (MessagingException ex) {
                    EmailApp.getApp().processFatalException(ex);
                }
            }
        });
        controlPane.add(pageNavigator);
       
        messageListTable = new MessageListTable();
        messageListTable.addMessageSelectionListener(new MessageListTable.MessageSelectionListener() {
            public void messageSelected(MessageSelectionEvent e) {
                try {
                    selectedMessage = e.getMessage();
                    messagePane.setMessage(selectedMessage);
                } catch (MessagingException ex) {
                    EmailApp.getApp().processFatalException(ex);
                }
            }
        });
        messageListSplitPane.add(messageListTable);
       
        messagePane = new MessagePane();
        mailSplitPane.add(messagePane);
    }
View Full Code Here

        });
       
        groupContainerColumn.add(new PaneControlsColumn(0));
        groupContainerColumn.add(new PaneControlsColumn(1));

        testPane = new SplitPane(ORIENTATION_VERTICAL, new Extent(200, Extent.PX));
        testPane.setStyleName("DefaultResizable");
        add(testPane);
    }
View Full Code Here

TOP

Related Classes of nextapp.echo2.app.SplitPane

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.