Package org.drools.guvnor.client.common

Examples of org.drools.guvnor.client.common.ImageButton


    private VerticalPanel getMovePanel(final List< ? extends Object> list,
                                       final Object object,
                                       final int editingFactIndex) {
        final int index = list.indexOf( object );
        VerticalPanel arrows = new VerticalPanel();
        ImageButton up = new ImageButton( "images/arrow-up.gif",
                                          constants.MoveUp() );
        // Topmost item can not be moved up. So hide the button.
        up.setVisible( index != 0 );
        up.addClickListener( new ClickListener() {
            public void onClick(Widget arg0) {
                Collections.swap( list,
                                  index,
                                  index - 1 );

                if ( object instanceof FactMetaModel ) {
                    editingFact = index - 1;
                } else {
                    editingFact = editingFactIndex;
                }

                renderEditor();
            }
        } );
        arrows.add( up );

        ImageButton down = new ImageButton( "images/arrow-down.gif",
                                            constants.MoveDown() );
        // Last item can not be moved down. So hide the button.
        down.setVisible( index != (list.size() - 1) );
        down.addClickListener( new ClickListener() {
            public void onClick(Widget arg0) {
                Collections.swap( list,
                                  index,
                                  index + 1 );
View Full Code Here


        HorizontalPanel pattern = new HorizontalPanel();
        pattern.add( bindingLabel );
        doBindingLabel();

        Image changePattern = new ImageButton( "images/edit.gif",
                                               constants.ChooseABoundFactThatThisColumnPertainsTo(),
                                               new ClickListener() {
                                                   public void onClick(Widget w) {
                                                       showChangeFact( w );
                                                   }
                                               } );
        pattern.add( changePattern );
        addAttribute( constants.Fact(),
                      pattern );

        HorizontalPanel field = new HorizontalPanel();
        field.add( fieldLabel );
        Image editField = new ImageButton( "images/edit.gif",
                                           constants.EditTheFieldThatThisColumnOperatesOn(),
                                           new ClickListener() {
                                               public void onClick(Widget w) {
                                                   showFieldChange();
                                               }
View Full Code Here

        final FileUpload upload = new FileUpload();
        upload.setName( HTMLFileManagerFields.FILE_UPLOAD_FIELD_NAME_IMPORT );
        panel.add( upload );

        panel.add( new Label( constants.Import() + ":" ) );
        ImageButton ok = new ImageButton( "images/upload.gif" );
        ok.addClickListener( new ClickListener() {
            public void onClick(Widget sender) {
                uploadFormPanel.setAction( GWT.getModuleBaseURL() + "backup?packageImport=true&importAsNew=" + !overWriteCheckBox.isChecked() );
                doImportFile( uploadFormPanel );
            }
View Full Code Here

      public void onChange(Widget sender) {
        fillFieldConstrains();
      }
    });
   
    Image addNewConstraint = new ImageButton("images/new_item.gif"); // NON-NLS
    addNewConstraint.setTitle(constants.AddNewConstraint());

    addNewConstraint.addClickListener(new ClickListener() {
      public void onClick(Widget w) {
        showNewConstrainPop();
      }
    });
   
View Full Code Here

        for ( Iterator iterator = retList.iterator(); iterator.hasNext(); ) {
            final ActivateRuleFlowGroup acticateRuleFlowGroup = (ActivateRuleFlowGroup) iterator.next();
            outer.setWidget( row,
                             0,
                             new SmallLabel( acticateRuleFlowGroup.name ) );
            Image del = new ImageButton( "images/delete_item_small.gif",
                                         "Remove this rule flow activation.",
                                         new ClickListener() {
                                             public void onClick(Widget w) {
                                                 retList.remove( acticateRuleFlowGroup );
                                                 sc.fixtures.remove( acticateRuleFlowGroup );
View Full Code Here

          type = vf.name;
            ab.add(new SmallLabel(Format.format(constants.AFactOfType0HasValues(), vf.name)));
        }
        this.showResults = showResults;

        Image add = new ImageButton("images/add_field_to_fact.gif", constants.AddAFieldToThisExpectation(), new ClickListener() { //NON-NLS
      public void onClick(Widget w) {

        String[] fields = (String[]) sce.getModelFields(type);
        final FormStylePopup pop = new FormStylePopup("images/rule_asset.gif", constants.ChooseAFieldToAdd()); //NON-NLS
        final ListBox b = new ListBox();
View Full Code Here

          }, fld, sce,this.scenario,this.executionTrace);
            data.setWidget(i, 3, cellEditor);

            Image del = new ImageButton("images/delete_item_small.gif", constants.RemoveThisFieldExpectation(), new ClickListener() {
        public void onClick(Widget w) {
          if (Window.confirm(constants.AreYouSureYouWantToRemoveThisFieldExpectation())) {
            vf.fieldValues.remove(fld);
                FlexTable data = render(vf);
                outer.setWidget(1, 0, data);
View Full Code Here

        HorizontalPanel pattern = new HorizontalPanel();
        pattern.add( patternLabel );
        doPatternLabel();

        Image changePattern = new ImageButton( "images/edit.gif",
                                               constants.ChooseAnExistingPatternThatThisColumnAddsTo(),
                                               new ClickListener() { //NON-NLS
                                                   public void onClick(Widget w) {
                                                       showChangePattern( w );
                                                   }
                                               } );
        pattern.add( changePattern );

        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 );
            }
        } );

        HorizontalPanel field = new HorizontalPanel();
        field.add( fieldLabel );
        field.add( fieldLabelInterpolationInfo );
        Image editField = new ImageButton( "images/edit.gif",
                                           constants.EditTheFieldThatThisColumnOperatesOn(),
                                           new ClickListener() { //NON-NLS
                                               public void onClick(Widget w) {
                                                   showFieldChange();
                                               }
                                           } );
        field.add( editField );
        addAttribute( constants.Field(),
                      field );
        doFieldLabel();

        HorizontalPanel operator = new HorizontalPanel();
        operator.add( operatorLabel );
        Image editOp = new ImageButton( "images/edit.gif",
                                        constants.EditTheOperatorThatIsUsedToCompareDataWithThisField(),
                                        new ClickListener() { //NON-NLS
                                            public void onClick(Widget w) {
                                                showOperatorChange();
                                            }
View Full Code Here

            HorizontalPanel h = new HorizontalPanel();
            h.add(b); h.add(num);
            data.setWidget(i, 2, h);

            Image del = new ImageButton("images/delete_item_small.gif", constants.RemoveThisRuleExpectation(), new ClickListener() {
        public void onClick(Widget w) {
          if (Window.confirm(constants.AreYouSureYouWantToRemoveThisRuleExpectation())) {
            rfl.remove(v);
            sc.removeFixture(v);
            outer.setWidget(1, 0, render(rfl, sc));
View Full Code Here

            box.addItem((String)sc.rules.get(i));
        }
        HorizontalPanel filter = new HorizontalPanel();


        final Image add = new ImageButton("images/new_item.gif", constants.AddANewRule());
        add.addClickListener(new ClickListener() {
            public void onClick(Widget w) {
                showRulePopup(w, box, packageName, sc.rules, scWidget);
            }
        });

        final Image remove = new ImageButton("images/trash.gif", constants.RemoveSelectedRule());
        remove.addClickListener(new ClickListener() {
            public void onClick(Widget w) {
                if (box.getSelectedIndex() == -1) {
                    Window.alert(constants.PleaseChooseARuleToRemove());
                } else {
                    String r = box.getItemText(box.getSelectedIndex());
                    sc.rules.remove(r);
                    box.removeItem(box.getSelectedIndex());
                }
            }
        });
        VerticalPanel actions = new VerticalPanel();
        actions.add(add); actions.add(remove);




        final ListBox drop = new ListBox();
        drop.addItem(constants.AllowTheseRulesToFire(), "inc"); //NON-NLS
        drop.addItem(constants.PreventTheseRulesFromFiring(), "exc");    //NON-NLS
        drop.addItem(constants.AllRulesMayFire());
        drop.addChangeListener(new ChangeListener() {
            public void onChange(Widget w) {
                String s = drop.getValue(drop.getSelectedIndex());
                if (s.equals("inc")) {   //NON-NLS
                    sc.inclusive = true;
                    add.setVisible(true); remove.setVisible(true); box.setVisible(true);
                } else if (s.equals("exc")) {     //NON-NLS
                    sc.inclusive = false;
                    add.setVisible(true); remove.setVisible(true); box.setVisible(true);
                } else {
                    sc.rules.clear();
                    box.clear();
                    box.setVisible(false); add.setVisible(false); remove.setVisible(false);
                }
            }
        });

        if (sc.rules.size() > 0) {
          drop.setSelectedIndex((sc.inclusive) ? 0 : 1);
        } else {
          drop.setSelectedIndex(2);
          box.setVisible(false); add.setVisible(false); remove.setVisible(false);
        }


        filter.add(drop);
        filter.add(box);
View Full Code Here

TOP

Related Classes of org.drools.guvnor.client.common.ImageButton

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.