Package org.drools.guvnor.client.common

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


     */
    public void initWidget() {
        layout.clear();
        this.currentLayoutRow = 0;

        Image addPattern = new ImageButton("images/new_item.gif");
        addPattern.setTitle(constants.AddAConditionToThisRule());
        addPattern.addClickListener(new ClickListener() {

            public void onClick(Widget w) {
                showConditionSelector(w, null);
            }
        });

        layout.getColumnFormatter().setWidth(0, "8%");
        layout.getColumnFormatter().setWidth(1, "87%");
        layout.getColumnFormatter().setWidth(2, "5%");

        //layout.setBorderWidth(2);

        layout.setWidget(currentLayoutRow, 0, new SmallLabel("<b>" + constants.WHEN() + "</b>"));

        if (!lockLHS()) {
            layout.setWidget(currentLayoutRow, 2, addPattern);
        }
        currentLayoutRow++;

        renderLhs(this.model);


        layout.setWidget(currentLayoutRow, 0, new SmallLabel("<b>" + constants.THEN() + "</b>"));

        Image addAction = new ImageButton("images/new_item.gif"); //NON-NLS
        addAction.setTitle(constants.AddAnActionToThisRule());
        addAction.addClickListener(new ClickListener() {

            public void onClick(Widget w) {
                showActionSelector(w, null);
            }
        });
View Full Code Here


        showWarningsAndErrors();
        makeDirty();
    }

    private Widget getAddAttribute() {
        Image add = new ImageButton("images/new_item.gif"); //NON-NLS
        add.setTitle(constants.AddAnOptionToTheRuleToModifyItsBehaviorWhenEvaluatedOrExecuted());

        add.addClickListener(new ClickListener() {

            public void onClick(Widget w) {
                showAttributeSelector(w);
            }
        });
View Full Code Here

    protected void showAttributeSelector(Widget w) {
        final FormStylePopup pop = new FormStylePopup("images/config.png", constants.AddAnOptionToTheRule()); //NON-NLS
        final ListBox list = RuleAttributeWidget.getAttributeList();

        final Image addbutton = new ImageButton("images/new_item.gif");                                                //NON-NLS
        final TextBox box = new TextBox();


        list.setSelectedIndex(0);

        list.addChangeListener(new ChangeListener() {

            public void onChange(Widget w) {
                String attr = list.getItemText(list.getSelectedIndex());
                if (attr.equals(RuleAttributeWidget.LOCK_LHS) || attr.equals(RuleAttributeWidget.LOCK_RHS)) {
                    model.addMetadata(new RuleMetadata(attr, "true"));
                } else {
                    model.addAttribute(new RuleAttribute(attr, ""));
                }
                refreshWidget();
                pop.hide();
            }
        });
        box.setVisibleLength(15);

        addbutton.setTitle(constants.AddMetadataToTheRule());

        addbutton.addClickListener(new ClickListener() {

            public void onClick(Widget w) {

                model.addMetadata(new RuleMetadata(box.getText(), ""));
                refreshWidget();
View Full Code Here

            DirtyableHorizontalPane horiz = new DirtyableHorizontalPane();
            horiz.setWidth("100%");
            //horiz.setBorderWidth(2);

            Image remove = new ImageButton("images/delete_faded.gif"); //NON-NLS
            remove.setTitle(constants.RemoveThisAction());
            final int idx = i;
            remove.addClickListener(new ClickListener() {

                public void onClick(Widget w) {
                    if (Window.confirm(constants.RemoveThisItem())) {
                        model.removeRhsItem(idx);
                        refreshWidget();
View Full Code Here

    private Widget wrapLHSWidget(final RuleModel model,
            int i,
            RuleModellerWidget w) {
        DirtyableHorizontalPane horiz = new DirtyableHorizontalPane();

        final Image remove = new ImageButton("images/delete_faded.gif"); //NON-NLS
        remove.setTitle(constants.RemoveThisENTIREConditionAndAllTheFieldConstraintsThatBelongToIt());
        final int idx = i;
        remove.addClickListener(new ClickListener() {

            public void onClick(Widget w) {
                if (Window.confirm(constants.RemoveThisEntireConditionQ())) {
                    if (model.removeLhsItem(idx)) {
                        refreshWidget();
View Full Code Here

    private void addLineIcon(int row, String img, String title){
        Widget widget = layout.getWidget(row, 0);
        if (widget instanceof DirtyableHorizontalPane){
            DirtyableHorizontalPane horiz = (DirtyableHorizontalPane)widget;
            final Image icon = new ImageButton(img);
            icon.setTitle(title);
            horiz.add(icon);
        }
    }
View Full Code Here

    private Widget getSetterLabel() {
        HorizontalPanel horiz = new HorizontalPanel();

        if ( model.state == ActionCallMethod.TYPE_UNDEFINED ) {
            Image edit = new ImageButton( "images/add_field_to_fact.gif" ); //NON-
            // NLS
            edit.setTitle( constants.AddAnotherFieldToThisSoYouCanSetItsValue() );
            edit.addClickListener( new ClickListener() {
                public void onClick(Widget w) {
                    showAddFieldPopup( w );
                }
            } );
            horiz.add( new SmallLabel( HumanReadable.getActionDisplayName( "call" ) + " [" + model.variable + "]" ) ); // NON-NLS
View Full Code Here

        Grid g = new Grid(permList.size() + 1, 3);
        g.setWidget(0, 0, new HTML("<b>[" + permType + "] for:</b>")); //NON-NLS

        for (int i = 0; i < permList.size(); i++) {
          final String p = permList.get(i);
          ImageButton del = new ImageButton("images/delete_item_small.gif", constants.RemovePermission(), new ClickListener() { //NON-NLS
            public void onClick(Widget w) {
                            if (Window.confirm(Format.format(constants.AreYouSureYouWantToRemovePermission0(), p))) {
                permList.remove(p);
                if (permList.size() == 0) {
                  perms.remove(permType);
                }
                doPermsPanel(perms, vp);
              }
            }
          });

          g.setWidget(i + 1, 1, new SmallLabel(p));
          g.setWidget(i + 1, 2, del);
        }

        vp.add(g);
      }


    }

    //now to be able to add...
    ImageButton newPermission = new ImageButton("images/new_item.gif", constants.AddANewPermission(), new ClickListener() { //NON-NLS
      public void onClick(Widget w) {
        final FormStylePopup pop = new FormStylePopup();
        final ListBox permTypeBox = new ListBox();
        permTypeBox.addItem(constants.Loading());
View Full Code Here

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

        Image changePattern = new ImageButton( "images/edit.gif",
                                               constants.ChooseAPatternThatThisColumnAddsDataTo(),
                                               new ClickListener() {
                                                   public void onClick(Widget w) {
                                                       showChangePattern( w );
                                                   }
                                               } ); //NON-NLS
        pattern.add( changePattern );
        addAttribute( constants.Pattern(),
                      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

                                                  HasHorizontalAlignment.ALIGN_RIGHT );

                HorizontalPanel type = new HorizontalPanel();
                type.setVerticalAlignment( HasVerticalAlignment.ALIGN_MIDDLE );
                type.add( new SmallLabel( getDesc( fm ) ) );
                ImageButton del = new ImageButton( "images/delete_item_small.gif" ); //NON-NLS
                del.addClickListener( new ClickListener() {
                    public void onClick(Widget w) {
                        if ( Window.confirm( Format.format( constants.AreYouSureYouWantToRemoveTheField0(),
                                                            fm.name ) ) ) {
                            mm.fields.remove( fm );
                            editingFact = m.models.indexOf( mm );
                            renderEditor();
                        }
                    }
                } );

                ImageButton edit = new ImageButton( "images/edit.gif" ); //NON-NLS
                edit.addClickListener( new ClickListener() {
                    public void onClick(Widget arg0) {
                        showFieldEditor( m,
                                         mm,
                                         fm );
                    }
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.