Package nextapp.echo2.app

Examples of nextapp.echo2.app.Extent


     *         <li><code>CONTROLS_OK</code></li>
     *         <li><code>CONTROLS_YES_NO</code></li>
     *        </ul>
     */
    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);
View Full Code Here


     */
    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

        setStyleName("MessageListTable.Table");
        setModel(messageTableModel);
        setDefaultRenderer(Object.class, messageTableCellRenderer);
       
        TableColumnModel columnModel = getColumnModel();
        columnModel.getColumn(0).setWidth(new Extent(35, Extent.PERCENT));
        columnModel.getColumn(1).setWidth(new Extent(40, Extent.PERCENT));
        columnModel.getColumn(2).setWidth(new Extent(25, Extent.PERCENT));
    }
View Full Code Here

     *
     * @param replyMessage the message being replied to, or null if composing
     *        a new message.
     */
    public ComposeWindow(Message replyMessage) {
        super(Messages.getString("ComposeWindow.Title"), new Extent(600), new Extent(480));
        setResizable(false);
        setDefaultCloseOperation(WindowPane.DO_NOTHING_ON_CLOSE);
        setStyleName("Default");
       
        addWindowPaneListener(new WindowPaneListener() {
            public void windowPaneClosing(WindowPaneEvent e) {
                processDiscard();
            }
        });
       
        SplitPane mainPane = new SplitPane(SplitPane.ORIENTATION_VERTICAL, new Extent(32));
        add(mainPane);
       
        Row controlPane = new Row();
        controlPane.setStyleName("ControlPane");
        mainPane.add(controlPane);
       
        Button sendButton = new Button(Messages.getString("ComposeWindow.SendButton"),
                Styles.ICON_24_YES);
        sendButton.setStyleName("ControlPane.Button");
        sendButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                if (sendMessage()) {
                    ((EmailApp) getApplicationInstance()).getDefaultWindow().getContent().remove(ComposeWindow.this);
                }
            }
        });
        controlPane.add(sendButton);

        Button cancelButton = new Button(Messages.getString("ComposeWindow.DiscardButton"),
                Styles.ICON_24_NO);
        cancelButton.setStyleName("ControlPane.Button");
        cancelButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                processDiscard();
            }
        });
        controlPane.add(cancelButton);

        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));
        layoutColumn.add(messageField);
       
        if (replyMessage == null) {
            EmailApp.getActive().setFocusedComponent(toField);
        } else {
View Full Code Here

    /**
     * Creates a new <code>PageNavigator</code>.
     */
    public PageNavigator() {
        super();
        setCellSpacing(new Extent(20));
       
        Button previousPageButton = new Button(Styles.ICON_24_LEFT_ARROW);
        previousPageButton.setRolloverEnabled(true);
        previousPageButton.setRolloverIcon(Styles.ICON_24_LEFT_ARROW_ROLLOVER);
        previousPageButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                setPageIndex(getPageIndex() - 1);
            }
        });
        add(previousPageButton);
       
        Row entryRow = new Row();
        entryRow.setCellSpacing(new Extent(5));
        add(entryRow);
       
        Label itemLabel = new Label(Messages.getString("PageNavigator.ItemLabel"));
        entryRow.add(itemLabel);
       
        pageField = new TextField();
        pageField.setStyleName("PageNavigator.PageField");
        pageField.setWidth(new Extent(4, Extent.EX));
        pageField.setText("1");
        pageField.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                try {
                    setPageIndex(Integer.parseInt(pageField.getText()) - 1);
View Full Code Here

    public static Color randomColor() {
        return new Color((int) (16777216 * Math.random()));
    }
   
    public static Extent randomExtent(int max) {
        return new Extent((int) (Math.random() * max), Extent.PX);
    }
View Full Code Here

        return new Extent((int) (Math.random() * max), Extent.PX);
    }
   
    public static Font randomFont() {
        Font.Typeface typeface = TYPEFACES[(int) (Math.random() * TYPEFACES.length)];
        Extent size = new Extent(FONT_SIZES[(int) (Math.random() * FONT_SIZES.length)]);
       
        // 1-in-4 chance of each style flag being set:
        int style = 0;
        style |= (((int) (Math.random() * 4)) == 0) ? Font.BOLD : 0;
        style |= (((int) (Math.random() * 4)) == 0) ? Font.ITALIC : 0;
View Full Code Here

       
        ContentPane content = new ContentPane();
        mainWindow.setContent(content);
       
        Column mainColumn = new Column();
        mainColumn.setBorder(new Border(new Extent(4), Color.BLUE, Border.STYLE_OUTSET));
        mainColumn.setInsets(new Insets(40));
        mainColumn.setCellSpacing(new Extent(20));
        content.add(mainColumn);
       
        ContainerContext containerContext = (ContainerContext) getContextProperty(ContainerContext.CONTEXT_PROPERTY_NAME);
       
        Principal principal = containerContext.getUserPrincipal();
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);
View Full Code Here

        logPane.add(column);
    }
   
    public void writeMessage(String message) {
        column.add(new Label(message));
        logPane.setVerticalScroll(new Extent(-1));
    }
View Full Code Here

TOP

Related Classes of nextapp.echo2.app.Extent

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.