Package com.google.gwt.user.client.ui

Examples of com.google.gwt.user.client.ui.TextBox


        VerticalPanel layout = new VerticalPanel();
        layout.setStyleName("fill-layout-width");


        final TextBox filter = new TextBox();
        filter.setMaxLength(30);
        filter.setVisibleLength(20);
        filter.getElement().setAttribute("style", "float:right; width:120px;");
        filter.addKeyUpHandler(new KeyUpHandler() {
            @Override
            public void onKeyUp(KeyUpEvent keyUpEvent) {
                String prefix = filter.getText();
                if(prefix!=null && !prefix.equals(""))
                {
                    // filter by prefix
                    filterByPrefix(prefix);
                }
View Full Code Here


    @Test
    public void testWidget() {
        UnitBoxItem<String> ubi = new UnitBoxItem<String>("amount", "Amount", String.class);
        ubi.setUnitPropertyName("units");
        ComplexPanel widget = (ComplexPanel) ubi.asWidget();
        TextBox foundTextBox = null;
        ListBox foundListBox = null;
        for (int i=0; i < widget.getWidgetCount(); i++) {
            Widget child = widget.getWidget(i);
            if (child instanceof TextBox)
                foundTextBox = (TextBox) child;

            if (child instanceof ListBox)
                foundListBox = (ListBox) child;
        }

        assertNotNull(foundTextBox);
        assertNotNull(foundListBox);

        assertTrue(foundTextBox.isEnabled());
        assertTrue(foundTextBox.isEnabled());

        ubi.setEnabled(false);
        assertFalse(foundTextBox.isEnabled());
        assertFalse(foundTextBox.isEnabled());

        ubi.setEnabled(true);
        assertTrue(foundTextBox.isEnabled());
        assertTrue(foundTextBox.isEnabled());
    }
View Full Code Here

  private void addLoginPanel() {
    RootPanel rootPanel = RootPanel.get("login_area");
    Label nicknameLabel = new Label("Nickname:");
    nicknameLabel.addStyleName("instructions-style");
    final TextBox nicknameTextBox = new TextBox();
    Label passwordLabel = new Label("Password:");
    passwordLabel.addStyleName("instructions-style");
    final PasswordTextBox password = new PasswordTextBox();

    ClickHandler loginHander = new ClickHandler() {

      @Override
      public void onClick(ClickEvent event) {
        String nickname = nicknameTextBox.getText();
        String passwordS = password.getText();

        AsyncCallback<Player> callback = new AsyncCallback<Player>() {

          @Override
View Full Code Here

        if ( this.constraint instanceof SingleFieldConstraint ) {
            SingleFieldConstraint sfc = (SingleFieldConstraint) this.constraint;
            operator = sfc.getOperator();
        }
        if ( OperatorsOracle.operatorRequiresList( operator ) ) {
            final TextBox box = TextBoxFactory.getTextBox( DataType.TYPE_STRING );
            box.setStyleName( "constraint-value-Editor" );
            box.addChangeHandler( new ChangeHandler() {

                public void onChange( ChangeEvent event ) {
                    constraint.setValue( box.getText() );
                    executeOnValueChangeCommand();
                    makeDirty();
                }
            } );

            box.setText( assertValue() );
            attachDisplayLengthHandler( box );
            return box;
        }

        //Date picker
        boolean isCEPOperator = false;
        if ( this.constraint instanceof HasOperator ) {
            isCEPOperator = CEPOracle.isCEPOperator( ( (HasOperator) this.constraint ).getOperator() );
        }
        if ( DataType.TYPE_DATE.equals( this.fieldType ) || ( DataType.TYPE_THIS.equals( this.fieldName ) && isCEPOperator ) ) {

            if ( this.readOnly ) {
                return new SmallLabel( constraint.getValue() );
            }

            final PopupDatePicker dp = new PopupDatePicker( false );

            // Wire up update handler
            dp.addValueChangeHandler( new ValueChangeHandler<Date>() {

                public void onValueChange( ValueChangeEvent<Date> event ) {
                    constraint.setValue( PopupDatePicker.convertToString( event ) );
                    executeOnValueChangeCommand();
                }

            } );

            dp.setValue( assertValue() );
            return dp;
        }

        //Default editor for all other literals
        final TextBox box = TextBoxFactory.getTextBox( fieldType );
        box.setStyleName( "constraint-value-Editor" );
        box.addChangeHandler( new ChangeHandler() {

            public void onChange( ChangeEvent event ) {
                constraint.setValue( box.getText() );
                executeOnValueChangeCommand();
                makeDirty();
            }
        } );

        box.setText( assertValue() );
        attachDisplayLengthHandler( box );
        return box;
    }
View Full Code Here

    /**
     * An editor for the retval "formula" (expression).
     */
    private Widget returnValueEditor() {
        TextBox box = new BoundTextBox( constraint );

        if ( this.readOnly ) {
            return new SmallLabel( box.getText() );
        }

        String msg = Constants.INSTANCE.FormulaEvaluateToAValue();
        Image img = new Image( GuidedRuleEditorResources.INSTANCE.images().functionAssets() );
        img.setTitle( msg );
        box.setTitle( msg );
        box.addChangeHandler( new ChangeHandler() {

            public void onChange( ChangeEvent event ) {
                executeOnValueChangeCommand();
            }
        } );
View Full Code Here

        return box;
    }

    private TextBox textBoxEditor( final RuleAttribute at,
                                   final boolean isReadOnly ) {
        final TextBox box = new TextBox();
        box.setEnabled( !isReadOnly );
        box.setVisibleLength( ( at.getValue().length() < 3 ) ? 3 : at.getValue().length() );
        box.setText( at.getValue() );
        box.addChangeHandler( new ChangeHandler() {
            public void onChange( ChangeEvent event ) {
                at.setValue( box.getText() );
            }
        } );

        if ( at.getAttributeName().equals( DATE_EFFECTIVE_ATTR ) || at.getAttributeName().equals( DATE_EXPIRES_ATTR ) ) {
            if ( at.getValue() == null || "".equals( at.getValue() ) ) {
                box.setText( "" );
            }

            box.setVisibleLength( 10 );
        }

        box.addKeyUpHandler( new KeyUpHandler() {
            public void onKeyUp( KeyUpEvent event ) {
                int length = box.getText().length();
                box.setVisibleLength( length > 0 ? length : 1 );
            }
        } );
        return box;
    }
View Full Code Here

        return box;
    }

    private TextBox textBoxEditor( final RuleMetadata rm,
                                   final boolean isReadOnly ) {
        final TextBox box = new TextBox();
        box.setEnabled( !isReadOnly );
        box.setVisibleLength( ( rm.getValue().length() < 3 ) ? 3 : rm.getValue().length() );
        box.setText( rm.getValue() );
        box.addChangeHandler( new ChangeHandler() {
            public void onChange( ChangeEvent event ) {
                rm.setValue( box.getText() );
            }
        } );

        box.addKeyUpHandler( new KeyUpHandler() {
            public void onKeyUp( KeyUpEvent event ) {
                box.setVisibleLength( box.getText().length() );
            }
        } );
        return box;
    }
View Full Code Here

        pred.add( img );
        if ( c.getValue() == null ) {
            c.setValue( "" );
        }

        final TextBox box = new TextBox();
        box.setText( c.getValue() );

        if ( !this.readOnly ) {
            box.addChangeHandler( new ChangeHandler() {

                public void onChange( ChangeEvent event ) {
                    setModified( true );
                    c.setValue( box.getText() );
                    getModeller().makeDirty();
                }
            } );
            box.setWidth( "100%" );
            pred.add( box );
        } else {
            pred.add( new SmallLabel( c.getValue() ) );
        }
View Full Code Here

        panel.setWidget( r,
                         0,
                         new HTML( lbl ) );

        this.txtEntryPoint = new TextBox();
        this.txtEntryPoint.setText( getFromEntryPointPattern().getEntryPointName() );
        this.txtEntryPoint.addChangeHandler( new ChangeHandler() {

            public void onChange( ChangeEvent event ) {
                getFromEntryPointPattern().setEntryPointName( txtEntryPoint.getText() );
View Full Code Here

    private void showBindingPopUp() {
        final FormStylePopup popup = new FormStylePopup();
        popup.setWidth( 500 + "px" );
        HorizontalPanel vn = new HorizontalPanel();
        final TextBox varName = new TextBox();
        Button ok = new Button( HumanReadableConstants.INSTANCE.Set() );
        vn.add( new Label( Constants.INSTANCE.BindTheExpressionToAVariable() ) );
        vn.add( varName );
        vn.add( ok );

        ok.addClickHandler( new ClickHandler() {
            public void onClick( ClickEvent event ) {
                String var = varName.getText();
                if ( getModeller().isVariableNameUsed( var ) ) {
                    Window.alert( Constants.INSTANCE.TheVariableName0IsAlreadyTaken( var ) );
                    return;
                }
                expression.setBinding( var );
View Full Code Here

TOP

Related Classes of com.google.gwt.user.client.ui.TextBox

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.