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

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


    private static Map<String, PTRadioButton> lastSelectedRadioButtonByGroup = new HashMap<String, PTRadioButton>();

    @Override
    public void create(final PTInstruction create, final UIService uiService) {
        init(create, uiService, new RadioButton(null));
    }
View Full Code Here


        }
    }

    @Override
    protected void addValueChangeHandler(final PTInstruction addHandler, final UIService uiService) {
        final RadioButton radioButton = cast();

        radioButton.addValueChangeHandler(new ValueChangeHandler<Boolean>() {

            @Override
            public void onValueChange(final ValueChangeEvent<Boolean> event) {
                fireInstruction(addHandler.getObjectID(), uiService, event.getValue());

                if (cast().getName() != null) {
                    final PTRadioButton previouslySelected = lastSelectedRadioButtonByGroup.get(cast().getName());
                    if (previouslySelected != null && !previouslySelected.equals(radioButton)) {
                        fireInstruction(previouslySelected.getObjectID(), uiService, previouslySelected.cast().getValue());
                    }
                    lastSelectedRadioButtonByGroup.put(radioButton.getName(), PTRadioButton.this);
                }
            }
        });
    }
View Full Code Here

                                                                                            Format.format( constants.CopySnapshotText(),
                                                                                                           snapshotName ) );
                                            final List<RadioButton> options = new ArrayList<RadioButton>();
                                            VerticalPanel vert = new VerticalPanel();
                                            for ( int i = 0; i < snaps.length; i++ ) {
                                                RadioButton existing = new RadioButton( "snapshotNameGroup",
                                                                                        snaps[i].name ); //NON-NLS
                                                options.add( existing );
                                                vert.add( existing );
                                            }
                                           
                                HorizontalPanel newNameHorizontalPanel = new HorizontalPanel();
                                            final TextBox newNameTextBox = new TextBox();
                                        final String newNameText = constants.NEW() + ": ";

                                final RadioButton newNameRadioButton = new RadioButton( "snapshotNameGroup",
                                    newNameText);
                                newNameHorizontalPanel.add(newNameRadioButton);
                                newNameTextBox.setEnabled(false);
                                newNameRadioButton.addClickListener(new ClickListener() {
                                  public void onClick(Widget w) {
                                    newNameTextBox.setEnabled(true);
                                  }
                                });

                                newNameHorizontalPanel.add(newNameTextBox);
                                options.add(newNameRadioButton);
                                vert.add(newNameHorizontalPanel);                               

                                            copy.addAttribute(constants.ExistingSnapshots(),
                                                               vert );

                                            Button ok = new Button( constants.OK() );
                                            copy.addAttribute( "", ok );
                                            ok.addClickListener( new ClickListener() {
                                                public void onClick(Widget w) {
                                                 
                                              boolean oneButtonIsSelected = false;
                                              for ( RadioButton rb : options ) {
                                                        if ( rb.isChecked() ) {
                                                          oneButtonIsSelected = true;
                                                          break;
                                                        }
                                              }
                                            if (!oneButtonIsSelected) {
                                              Window.alert(constants.YouHaveToEnterOrChoseALabelNameForTheSnapshot());
                                              return;
                                            }
                                           
                                           
                                                    if ( newNameRadioButton.isChecked() ) {
                                                        if ( checkUnique( snaps,
                                                                          newNameTextBox.getText() ) ) {
                                                            serv.copyOrRemoveSnapshot( packageName,
                                                                                       snapshotName,
                                                                                       false,
View Full Code Here

                                       descBox );
        newPackageLayout.addAttribute(constants.ParentPackage(), parentPackage);

        nameBox.setTitle( constants.PackageNameTip() );

        RadioButton newPackage = new RadioButton( "action",
                                                  constants.CreateNewPackageRadio() ); //NON-NLS
        RadioButton importPackage = new RadioButton( "action",
                                                     constants.ImportFromDrlRadio() ); //NON-NLS
        newPackage.setChecked( true );
        newPackageLayout.setVisible( true );

        newPackage.addClickListener( new ClickListener() {
            public void onClick(Widget w) {
                newPackageLayout.setVisible( true );
                importLayout.setVisible( false );
            }
        } );

        this.setAfterShow( new Command() {
            public void execute() {
                nameBox.setFocus( true );
            }
        } );

        importLayout.setVisible( false );

        importPackage.addClickListener( new ClickListener() {
            public void onClick(Widget arg0) {
                newPackageLayout.setVisible( false );
                importLayout.setVisible( true );
            }
        } );
View Full Code Here

        newPackageLayout.addAttribute( constants.DescriptionColon(),
                                       descBox );

        nameBox.setTitle( constants.PackageNameTip() );

        RadioButton newPackage = new RadioButton( "action",
                                                  constants.CreateNewPackageRadio() ); //NON-NLS
        RadioButton importPackage = new RadioButton( "action",
                                                     constants.ImportFromDrlRadio() ); //NON-NLS
        newPackage.setChecked( true );
        newPackageLayout.setVisible( true );

        newPackage.addClickListener( new ClickListener() {
            public void onClick(Widget w) {
                newPackageLayout.setVisible( true );
                importLayout.setVisible( false );
            }
        } );

        this.setAfterShow( new Command() {
            public void execute() {
                nameBox.setFocus( true );
            }
        } );

        importLayout.setVisible( false );

        importPackage.addClickListener( new ClickListener() {
            public void onClick(Widget arg0) {
                newPackageLayout.setVisible( false );
                importLayout.setVisible( true );
            }
        } );
View Full Code Here

        this.conf = conf;
        this.editEvent = editEvent;

        final SimplePanel buildResults = new SimplePanel();

        RadioButton wholePackageRadioButton = new RadioButton( "action",
                                                               constants.BuildWholePackage() );
        RadioButton builtInSelectorRadioButton = new RadioButton( "action",
                                                                  constants.BuildPackageUsingBuiltInSelector() );
        RadioButton customSelectorRadioButton = new RadioButton( "action",
                                                                 constants.BuildPackageUsingCustomSelector() );
        wholePackageRadioButton.addClickListener( new ClickListener() {
            public void onClick(Widget w) {
                buildWholePackageLayout.setVisible( true );
                builtInSelectorLayout.setVisible( false );
                customSelectorLayout.setVisible( false );
                buildMode = "buildWholePackage";
            }
        } );
        builtInSelectorRadioButton.addClickListener( new ClickListener() {
            public void onClick(Widget w) {
                buildWholePackageLayout.setVisible( false );
                builtInSelectorLayout.setVisible( true );
                customSelectorLayout.setVisible( false );
                buildMode = "builtInSelector";
            }
        } );
        customSelectorRadioButton.addClickListener( new ClickListener() {
            public void onClick(Widget arg0) {
                buildWholePackageLayout.setVisible( false );
                builtInSelectorLayout.setVisible( false );
                customSelectorLayout.setVisible( true );
                buildMode = "customSelector";
View Full Code Here

        RepositoryServiceFactory.getService().listSnapshots( packageName,
                                                             new GenericCallback<SnapshotInfo[]>() {
                                                                 public void onSuccess(SnapshotInfo[] result) {
                                                                     for ( int i = 0; i < result.length; i++ ) {
                                                                         RadioButton existing = new RadioButton( "snapshotNameGroup",
                                                                                                                 result[i].name ); //NON-NLS
                                                                         radioList.add( existing );
                                                                         vert.add( existing );
                                                                     }
                                                                     HorizontalPanel newSnap = new HorizontalPanel();

                                                                     final RadioButton newSnapRadio = new RadioButton( "snapshotNameGroup",
                                                                                                                       newSnapshotText ); //NON-NLS
                                                                     newSnap.add( newSnapRadio );
                                                                     newName.setEnabled( false );
                                                                     newSnapRadio.addClickListener( new ClickListener() {

                                                                         public void onClick(Widget w) {
                                                                             newName.setEnabled( true );
                                                                         }

                                                                     } );

                                                                     newSnap.add( newName );
                                                                     radioList.add( newSnapRadio );
                                                                     vert.add( newSnap );

                                                                     LoadingPopup.close();
                                                                 }
                                                             } );

        final TextBox comment = new TextBox();
        form.addAttribute( constants.Comment(),
                           comment );

        Button create = new Button( constants.CreateNewSnapshot() );
        form.addAttribute( "",
                           create );

        create.addClickListener( new ClickListener() {
            String name = "";

            public void onClick(Widget w) {
                boolean replace = false;
                for ( Iterator iter = radioList.iterator(); iter.hasNext(); ) {
                    RadioButton but = (RadioButton) iter.next();
                    if ( but.isChecked() ) {
                        name = but.getText();
                        if ( !but.getText().equals( newSnapshotText ) ) {
                            replace = true;
                        }
                        break;
                    }
                }
View Full Code Here

        this.showCats = showCats;
        this.format = format;

        this.afterCreate = afterCreate;
       
    RadioButton newPackage = new RadioButton("layoutgroup", constants.CreateNewAsset()); // NON-NLS
    RadioButton importPackage = new RadioButton("layoutgroup", constants.CreateLinkedAsset()); // NON-NLS
    newPackage.setChecked(true);
    newAssetLayout.setVisible(true);

    newPackage.addClickListener(new ClickListener() {
      public void onClick(Widget w) {
        newAssetLayout.setVisible(true);
        importAssetLayout.setVisible(false);
      }
    });
    importAssetLayout.setVisible(false);
    importPackage.addClickListener(new ClickListener() {
      public void onClick(Widget arg0) {
        newAssetLayout.setVisible(false);
        importAssetLayout.setVisible(true);
      }
    });
View Full Code Here

        addAttribute( constants.Pattern(),
                      pattern );

        //now a radio button with the type
        RadioButton literal = new RadioButton( "constraintValueType",
                                               constants.LiteralValue() );//NON-NLS
        RadioButton formula = new RadioButton( "constraintValueType",
                                               constants.Formula() ); //NON-NLS
        RadioButton predicate = new RadioButton( "constraintValueType",
                                                 constants.Predicate() ); //NON-NLS

        HorizontalPanel valueTypes = new HorizontalPanel();
        valueTypes.add( literal );
        valueTypes.add( formula );
        valueTypes.add( predicate );
        addAttribute( constants.CalculationType(),
                      valueTypes );

        switch ( editingCol.constraintValueType ) {
            case ISingleFieldConstraint.TYPE_LITERAL :
                literal.setChecked( true );
                break;
            case ISingleFieldConstraint.TYPE_RET_VALUE :
                formula.setChecked( true );
                break;
            case ISingleFieldConstraint.TYPE_PREDICATE :
                predicate.setChecked( true );
        }

        literal.addClickListener( new ClickListener() {
            public void onClick(Widget w) {
                applyConsTypeChange( ISingleFieldConstraint.TYPE_LITERAL );
            }
        } );

        formula.addClickListener( new ClickListener() {
            public void onClick(Widget w) {
                applyConsTypeChange( ISingleFieldConstraint.TYPE_RET_VALUE );
            }
        } );
        predicate.addClickListener( new ClickListener() {
            public void onClick(Widget w) {
                applyConsTypeChange( ISingleFieldConstraint.TYPE_PREDICATE );
            }
        } );
View Full Code Here

        addAttribute( constants.Pattern(),
                      pattern );

        //now a radio button with the type
        RadioButton literal = new RadioButton( "constraintValueType",
                                               constants.LiteralValue() );//NON-NLS
        RadioButton formula = new RadioButton( "constraintValueType",
                                               constants.Formula() ); //NON-NLS
        RadioButton predicate = new RadioButton( "constraintValueType",
                                                 constants.Predicate() ); //NON-NLS

        HorizontalPanel valueTypes = new HorizontalPanel();
        valueTypes.add( literal );
        valueTypes.add( formula );
        valueTypes.add( predicate );
        addAttribute( constants.CalculationType(),
                      valueTypes );

        switch ( editingCol.constraintValueType ) {
            case BaseSingleFieldConstraint.TYPE_LITERAL :
                literal.setChecked( true );
                break;
            case BaseSingleFieldConstraint.TYPE_RET_VALUE :
                formula.setChecked( true );
                break;
            case BaseSingleFieldConstraint.TYPE_PREDICATE :
                predicate.setChecked( true );
        }

        literal.addClickListener( new ClickListener() {
            public void onClick(Widget w) {
                applyConsTypeChange( BaseSingleFieldConstraint.TYPE_LITERAL );
            }
        } );

        formula.addClickListener( new ClickListener() {
            public void onClick(Widget w) {
                applyConsTypeChange( BaseSingleFieldConstraint.TYPE_RET_VALUE );
            }
        } );
        predicate.addClickListener( new ClickListener() {
            public void onClick(Widget w) {
                applyConsTypeChange( BaseSingleFieldConstraint.TYPE_PREDICATE );
            }
        } );
View Full Code Here

TOP

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

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.