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

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


        availableFacts.setVisibleItemCount(10);
        selectedFacts.setVisibleItemCount(10);

        Grid btnsPanel = new Grid(2, 1);

        btnsPanel.setWidget(0, 0, new Button(">", new ClickHandler() {
            public void onClick(ClickEvent sender) {
                moveSelected(availableFacts, selectedFacts);
            }
        }));

        btnsPanel.setWidget(1, 0, new Button("<", new ClickHandler() {
            public void onClick(ClickEvent sender) {
                moveSelected(selectedFacts, availableFacts);
            }
        }));
View Full Code Here


        VerticalPanel verticalPanel = new VerticalPanel();
        versionChooser = new ListBox();
        loadHistoryData();
        verticalPanel.add(versionChooser);

        Button open = new Button( "View selected version" );
        open.addClickHandler( new ClickHandler() {
            public void onClick(ClickEvent event) {
              if(!constants.NoHistory().equalsIgnoreCase(versionChooser.getValue(versionChooser.getSelectedIndex()))) {
                    showVersion( versionChooser.getValue( versionChooser.getSelectedIndex() ) );
              }
            }
View Full Code Here

        VerticalPanel vp = new VerticalPanel();
        vp.setWidth( "100%" );
        vp.setHeight( "100%" );
        vp.add( this.externalFrame );

        okButton = new Button( constants.OK() );

        //cancel button with default handler
        cancelButton = new Button( constants.Cancel(),
                                   new ClickHandler() {
                                       public void onClick(ClickEvent event) {
                                           hide();
                                       }
                                   } );
View Full Code Here

            final SingleFieldConstraint con = (SingleFieldConstraint) this.constraint;
            CustomFormConfiguration customFormConfiguration = WorkingSetManager.getInstance().getCustomFormConfiguration( modeller.getAsset().getMetaData().getPackageName(),
                                                                                                                          pattern.getFactType(),
                                                                                                                          fieldName );
            if ( customFormConfiguration != null ) {
                Button btnCustom = new Button( con.getValue(),
                                               new ClickHandler() {

                                                   public void onClick(ClickEvent event) {
                                                       showTypeChoice( (Widget) event.getSource(),
                                                                       constraint );
                                                   }
                                               } );
                btnCustom.setEnabled( !this.readOnly );
                return btnCustom;
            }
        }

        //Enumeration
View Full Code Here

        }

        final FormStylePopup form = new FormStylePopup( images.newexWiz(),
                                                        constants.FieldValue() );

        Button lit = new Button( constants.LiteralValue() );
        lit.addClickHandler( new ClickHandler() {
            public void onClick(ClickEvent event) {
                con.setConstraintValueType( isDropDownDataEnum && dropDownData != null ? SingleFieldConstraint.TYPE_ENUM : SingleFieldConstraint.TYPE_LITERAL );
                doTypeChosen( form );
            }
        } );

        boolean showLiteralOrFormula = true;
        if ( con instanceof SingleFieldConstraint ) {
            SingleFieldConstraint sfc = (SingleFieldConstraint) con;
            if ( sfc.getFieldType().equals( SuggestionCompletionEngine.TYPE_THIS ) ) {
                showLiteralOrFormula = SuggestionCompletionEngine.isCEPOperator( sfc.getOperator() );
            }
        } else if ( con instanceof ConnectiveConstraint ) {
            ConnectiveConstraint cc = (ConnectiveConstraint) con;
            if ( cc.getFieldType().equals( SuggestionCompletionEngine.TYPE_THIS ) ) {
                showLiteralOrFormula = SuggestionCompletionEngine.isCEPOperator( cc.getOperator() );
            }
        }

        if ( showLiteralOrFormula ) {
            form.addAttribute( constants.LiteralValue() + ":",
                               widgets( lit,
                                        new InfoPopup( constants.LiteralValue(),
                                                       constants.LiteralValTip() ) ) );
        }

        if ( modeller.isTemplate() ) {
            String templateKeyLabel = constants.TemplateKey();
            Button templateKeyButton = new Button( templateKeyLabel );
            templateKeyButton.addClickHandler( new ClickHandler() {

                public void onClick(ClickEvent event) {
                    con.setConstraintValueType( BaseSingleFieldConstraint.TYPE_TEMPLATE );
                    doTypeChosen( form );
                }
            } );

            form.addAttribute( templateKeyLabel + ":",
                               widgets( templateKeyButton,
                                        new InfoPopup( templateKeyLabel,
                                                       constants.LiteralValTip() ) ) );
        }

        if ( showLiteralOrFormula ) {
            form.addRow( new HTML( "<hr/>" ) );
            form.addRow( new SmallLabel( constants.AdvancedOptions() ) );
        }

        //only want to show variables if we have some !
        List<String> bindingsInScope = this.model.getBoundVariablesInScope( this.constraint );
        if ( bindingsInScope.size() > 0
                || SuggestionCompletionEngine.TYPE_COLLECTION.equals( this.fieldType ) ) {

            List<String> applicableBindingsInScope = getApplicableBindingsInScope( bindingsInScope );
            if ( applicableBindingsInScope.size() > 0 ) {

                Button variable = new Button( constants.BoundVariable() );
                variable.addClickHandler( new ClickHandler() {

                    public void onClick(ClickEvent event) {
                        con.setConstraintValueType( SingleFieldConstraint.TYPE_VARIABLE );
                        doTypeChosen( form );
                    }
                } );
                form.addAttribute( constants.AVariable(),
                                       widgets( variable,
                                                new InfoPopup( constants.ABoundVariable(),
                                                               constants.BoundVariableTip() ) ) );
            }
        }

        if ( showLiteralOrFormula ) {
            Button formula = new Button( constants.NewFormula() );
            formula.addClickHandler( new ClickHandler() {

                public void onClick(ClickEvent event) {
                    con.setConstraintValueType( SingleFieldConstraint.TYPE_RET_VALUE );
                    doTypeChosen( form );
                }
            } );

            form.addAttribute( constants.AFormula() + ":",
                               widgets( formula,
                                        new InfoPopup( constants.AFormula(),
                                                       constants.FormulaExpressionTip() ) ) );
        }

        Button expression = new Button( constants.ExpressionEditor() );
        expression.addClickHandler( new ClickHandler() {

            public void onClick(ClickEvent event) {
                con.setConstraintValueType( SingleFieldConstraint.TYPE_EXPR_BUILDER_VALUE );
                doTypeChosen( form );
            }
View Full Code Here

            availableRulesHandlerRegistration = availableRulesBox.addChangeHandler( ruleSelectionCL );
            horizontalPanel.add( availableRulesBox );

        } else {

            final Button showList = new Button( constants.showListButton() );
            horizontalPanel.add( showList );
            showList.addClickHandler( new ClickHandler() {

                public void onClick(ClickEvent event) {
                    horizontalPanel.remove( showList );
                    final Image busy = new Image( images.searching() );
                    final Label loading = new SmallLabel( constants.loadingList1() );
                    horizontalPanel.add( busy );
                    horizontalPanel.add( loading );

                    Scheduler scheduler = Scheduler.get();
                    scheduler.scheduleDeferred( new Command() {
                        public void execute() {
                            RepositoryServiceFactory.getPackageService().listRulesInPackage( packageName,
                                                                                      createGenericCallback( horizontalPanel,
                                                                                                             ruleNameTextBox,
                                                                                                             busy,
                                                                                                             loading ) );
                        }

                        private GenericCallback<String[]> createGenericCallback(final HorizontalPanel horizontalPanel,
                                                                                final TextBox ruleNameTextBox,
                                                                                final Image busy,
                                                                                final Label loading) {
                            return new GenericCallback<String[]>() {

                                public void onSuccess(String[] list) {
                                    availableRules = (list);
                                    final ListBox availableRulesBox = scenarioWidgetComponentCreator.createAvailableRulesBox( list );

                                    final ChangeHandler ruleSelectionCL = new ChangeHandler() {
                                        public void onChange(ChangeEvent event) {
                                            ruleNameTextBox.setText( availableRulesBox.getItemText( availableRulesBox.getSelectedIndex() ) );
                                        }
                                    };
                                    availableRulesHandlerRegistration = availableRulesBox.addChangeHandler( ruleSelectionCL );
                                    availableRulesBox.setSelectedIndex( 0 );
                                    horizontalPanel.add( availableRulesBox );
                                    horizontalPanel.remove( busy );
                                    horizontalPanel.remove( loading );
                                }

                            };
                        }
                    } );

                }
            } );

        }

        Button ok = scenarioWidgetComponentCreator.createOkButton( selected,
                                                                   ruleNameTextBox );
        horizontalPanel.add( ok );
        return horizontalPanel;
    }
View Full Code Here

    }

    protected void showTypeChoice(Widget w) {
        final FormStylePopup form = new FormStylePopup( images.newexWiz(),
                                                        constants.FieldValue() );
        Button lit = new Button( constants.LiteralValue() );
        lit.addClickHandler( new ClickHandler() {

            public void onClick(ClickEvent event) {
                methodParameter.nature = FieldNature.TYPE_LITERAL;
                methodParameter.value = " ";
                makeDirty();
                refresh();
                form.hide();
            }

        } );
        form.addAttribute( constants.LiteralValue() + ":",
                           widgets( lit,
                                    new InfoPopup( constants.Literal(),
                                                   constants.LiteralValTip() ) ) );
        form.addRow( new HTML( "<hr/>" ) );
        form.addRow( new SmallLabel( constants.AdvancedSection() ) );

        /*
         * If there is a bound variable that is the same type of the current
         * variable type, then show abutton
         */

        List<String> vars = model.getFactNamesInScope( ex,
                                                       true );
        for ( String v : vars ) {
            boolean createButton = false;
            Button variable = new Button( constants.BoundVariable() );
            FactData factData = (FactData) model.getFactTypes().get( v );
            if ( factData.getType().equals( this.parameterType ) ) {
                createButton = true;
            }
            if ( createButton == true ) {
                form.addAttribute( constants.BoundVariable() + ":",
                                   variable );
                variable.addClickHandler( new ClickHandler() {

                    public void onClick(ClickEvent event) {
                        methodParameter.nature = FieldNature.TYPE_VARIABLE;
                        methodParameter.value = "=";
                        makeDirty();
View Full Code Here

                for ( int i = 0; i < fields.length; i++ ) {
                    String field = fields[i];
                    if ( !existingFields.contains( field ) ) fieldsListBox.addItem( field );
                }

                Button ok = new Button( constants.OK() );
                ok.addClickHandler( new ClickHandler() {

                    public void onClick(ClickEvent event) {
                        String field = fieldsListBox.getItemText( fieldsListBox.getSelectedIndex() );
                        for ( Fixture fixture : definitionList ) {
                            if ( fixture instanceof FactData ) {
View Full Code Here

        getFlexCellFormatter().setHorizontalAlignment( totalRows + 1,
                                                       0,
                                                       HasHorizontalAlignment.ALIGN_RIGHT );

        if ( totalRows == 0 ) {
            Button b = new Button( constants.AddAField() );
            b.addClickHandler( addFieldClickHandler() );

            setWidget( 1,
                       1,
                       b );
        }
View Full Code Here

    private SimplePanel   actions   = new SimplePanel();

    public TestRunnerWidget(final ScenarioWidget parent,
                            final String packageName) {

        final Button run = new Button( constants.RunScenario() );
        run.setTitle( constants.RunScenarioTip() );
        run.addClickHandler( new ClickHandler() {

            public void onClick(ClickEvent event) {
                LoadingPopup.showMessage( constants.BuildingAndRunningScenario() );
                RepositoryServiceFactory.getPackageService().runScenario( parent.getMetaData().getPackageName(),
                                                                   parent.getScenario(),
View Full Code Here

TOP

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

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.