Package nextapp.echo2.app

Examples of nextapp.echo2.app.Label


     * Adds a header row to the <code>TestGrid</code>.
     *
     * @param text the header text
     */
    public void addHeaderRow(String text) {
        Label label = new Label(text);
        GridLayoutData layoutData = new GridLayoutData();
        layoutData.setBackground(HEADER_CELL_BACKGROUND);
        layoutData.setColumnSpan(2);
        label.setLayoutData(layoutData);
        add(label);
    }
View Full Code Here


     *
     * @param descriptor a description of the item
     * @param testComponent the item <code>Component</code>
     */
    public void addTestRow(String descriptor, Component testComponent) {
        Label label = new Label(descriptor);
        GridLayoutData layoutData = new GridLayoutData();
        layoutData.setBackground(DESCRIPTOR_CELL_BACKGROUND);
        label.setLayoutData(layoutData);
        add(label);
        add(testComponent);
    }
View Full Code Here

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

       
        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);
                } catch (NumberFormatException ex) {
                    setPageIndex(getPageIndex());
                }
            }
        });
        entryRow.add(pageField);
       
        Label prepositionLabel = new Label(Messages.getString("PageNavigator.PrepositionLabel"));
        entryRow.add(prepositionLabel);
       
        totalPagesLabel = new Label("1");
        entryRow.add(totalPagesLabel);
       
        Button nextPageButton = new Button(Styles.ICON_24_RIGHT_ARROW);
        nextPageButton.setRolloverEnabled(true);
        nextPageButton.setRolloverIcon(Styles.ICON_24_RIGHT_ARROW_ROLLOVER);
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());
View Full Code Here

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

        content.add(mainColumn);
       
        ContainerContext containerContext = (ContainerContext) getContextProperty(ContainerContext.CONTEXT_PROPERTY_NAME);
       
        Principal principal = containerContext.getUserPrincipal();
        mainColumn.add(new Label("getUserPrincipal(): " + (principal == null ? "null" : principal.getName())));
        mainColumn.add(new Label("isUserInRole(\"role1\"): " + containerContext.isUserInRole("role1")));
       
        return mainWindow;
    }
View Full Code Here

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

        Column serializeColumn = new Column();
        mainColumn.add(serializeColumn);
       
        Button button;

        serializeColumn.add(new Label("Available Applications:"));
       
        listBox = new ListBox();
        listBox.setWidth(new Extent(100, Extent.PERCENT));
        serializeColumn.add(listBox);
       
View Full Code Here

         WindowPane windowPane = new WindowPane();
         windowPane.setModal(true);
         windowPane.setTitle(error ? "Error" : "Status");
         windowPane.setTitleBackground(error ? Color.RED : Color.GREEN);
         windowPane.setInsets(new Insets(20));
         windowPane.add(new Label(message));
         mainWindow.getContent().add(windowPane);
    }
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.