Package nextapp.echo2.app

Examples of nextapp.echo2.app.TextField


     * Ensure that a property update whose state is already reflected on the
     * client (because the end-user made the property change) is properly
     * canceled.
     */
    public void testPropertyUpdateCancellation1() {
        TextField textField = new TextField();
        columnApp.getColumn().add(textField);
       
        manager.purge();
        manager.getClientUpdateManager().setComponentProperty(textField, TextField.TEXT_CHANGED_PROPERTY, "a user typed this.");
        manager.processClientUpdates();
View Full Code Here


     * canceled.  This test will ensure that if additional properties changed
     * on a user-updated component, that only the non-user-updated properties
     * are reflected by the <code>UpdateManager</code>.
     */
    public void testPropertyUpdateCancellation2() {
        TextField textField = new TextField();
        columnApp.getColumn().add(textField);
       
        manager.purge();
        textField.setBackground(Color.BLUE);
        manager.getClientUpdateManager().setComponentProperty(textField, TextField.TEXT_CHANGED_PROPERTY, "a user typed this.");
        manager.processClientUpdates();
       
        ServerComponentUpdate[] componentUpdates = manager.getServerUpdateManager().getComponentUpdates();
        assertEquals(1, componentUpdates.length);
View Full Code Here

     * canceled.  This test will ensure that user-changed properties are
     * canceled even in the event that the application ALSO updated the
     * property, though it was later overwritten by a user update.
     */
    public void testPropertyUpdateCancellation3() {
        TextField textField = new TextField();
        columnApp.getColumn().add(textField);
       
        manager.purge();
        textField.setText("first the application set it to this.");
        manager.getClientUpdateManager().setComponentProperty(textField, TextField.TEXT_CHANGED_PROPERTY, "a user typed this.");
        manager.processClientUpdates();
       
        ServerComponentUpdate[] componentUpdates = manager.getServerUpdateManager().getComponentUpdates();
        assertEquals(1, componentUpdates.length);
View Full Code Here

     */
    public void testStyle() {
        MutableStyle style = new MutableStyle();
        style.setProperty(Component.PROPERTY_BACKGROUND, Color.GREEN);
       
        TextField textField = new TextField();
        textField.setForeground(Color.YELLOW);
       
        assertEquals(Color.YELLOW, textField.getRenderProperty(Component.PROPERTY_FOREGROUND));
       
        textField.setStyle(style);
       
        assertEquals(Color.GREEN, textField.getRenderProperty(Component.PROPERTY_BACKGROUND));
       
        textField.setBackground(Color.BLUE);

        assertEquals(Color.BLUE, textField.getRenderProperty(Component.PROPERTY_BACKGROUND));
       
        assertNull(textField.getRenderProperty(Component.PROPERTY_FONT));
    }
View Full Code Here

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

        label = new Label(Messages.getString("LoginScreen.PromptEmailAddress"));
        label.setStyleName("LoginScreen.Prompt");
        layoutGrid.add(label);

        emailAddressField = new TextField();
        emailAddressField.setWidth(PX_300);
        emailAddressField.setStyleName("Default");
        emailAddressField.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                EmailApp.getActive().setFocusedComponent(passwordField);
View Full Code Here

   
    /**
     * Test empty constructor and verify defaults.
     */
    public void testEmptyConstructor() {
        TextField textField = new TextField();
        assertNotNull(textField.getDocument());
        assertEquals(StringDocument.class, textField.getDocument().getClass());
    }
View Full Code Here

   
    /**
     * Attempt to illegally add children, test for failure.
     */
    public void testIllegalChildren() {
        TextField textField = new TextField();
        boolean exceptionThrown = false;
        try {
            textField.add(new Label("you can't add children to this component, right?"));
        } catch (IllegalChildException ex) {
            exceptionThrown = true;
        }
        assertTrue(exceptionThrown);
    }
View Full Code Here

   
    /**
     * Test receiving input from client.
     */
    public void testInput() {
        TextField textField = new TextField();
        textField.processInput(TextField.TEXT_CHANGED_PROPERTY, "ABCDEFGHIJKLMNOPQRSTUVWXYZ");
        assertEquals("ABCDEFGHIJKLMNOPQRSTUVWXYZ", textField.getDocument().getText());
    }
View Full Code Here

    /**
     * Test primary constructor.
     */
    public void testPrimaryConstructor() {
        TextField textField = new TextField(new StringDocument(), "text", 30);
        assertEquals("text", textField.getDocument().getText());
        assertEquals(new Extent(30, Extent.EX), textField.getWidth());
    }
View Full Code Here

TOP

Related Classes of nextapp.echo2.app.TextField

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.