Search in sources :

Example 31 with Image

use of com.google.gwt.user.client.ui.Image in project drools-wb by kiegroup.

the class MethodParameterValueEditor method choice.

private Widget choice() {
    Image clickme = GuidedRuleEditorImages508.INSTANCE.Edit();
    clickme.addClickHandler(new ClickHandler() {

        public void onClick(ClickEvent event) {
            showTypeChoice();
        }
    });
    return clickme;
}
Also used : ClickHandler(com.google.gwt.event.dom.client.ClickHandler) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) Image(com.google.gwt.user.client.ui.Image)

Example 32 with Image

use of com.google.gwt.user.client.ui.Image in project drools-wb by kiegroup.

the class RuleAttributeWidget method getRemoveIcon.

private Image getRemoveIcon(final int idx) {
    Image remove = new Image(ItemImages.INSTANCE.deleteItemSmall());
    remove.addClickHandler(new ClickHandler() {

        public void onClick(ClickEvent event) {
            if (Window.confirm(GuidedRuleEditorResources.CONSTANTS.RemoveThisRuleOption())) {
                model.removeAttribute(idx);
                parent.refreshWidget();
            }
        }
    });
    return remove;
}
Also used : ClickHandler(com.google.gwt.event.dom.client.ClickHandler) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) Image(com.google.gwt.user.client.ui.Image)

Example 33 with Image

use of com.google.gwt.user.client.ui.Image in project drools-wb by kiegroup.

the class RuleAttributeWidget method getRemoveMetaIcon.

private Image getRemoveMetaIcon(final int idx) {
    Image remove = new Image(ItemImages.INSTANCE.deleteItemSmall());
    remove.addClickHandler(new ClickHandler() {

        public void onClick(ClickEvent event) {
            if (Window.confirm(GuidedRuleEditorResources.CONSTANTS.RemoveThisRuleOption())) {
                model.removeMetadata(idx);
                parent.refreshWidget();
            }
        }
    });
    return remove;
}
Also used : ClickHandler(com.google.gwt.event.dom.client.ClickHandler) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) Image(com.google.gwt.user.client.ui.Image)

Example 34 with Image

use of com.google.gwt.user.client.ui.Image in project drools-wb by kiegroup.

the class RuleModeller method wrapLHSWidget.

/**
 * This adds the widget to the UI, also adding the remove icon.
 */
private Widget wrapLHSWidget(final RuleModel model, int i, RuleModellerWidget w) {
    final FlexTable wrapper = new FlexTable();
    final Image remove = GuidedRuleEditorImages508.INSTANCE.DeleteItemSmall();
    remove.setTitle(GuidedRuleEditorResources.CONSTANTS.RemoveThisENTIREConditionAndAllTheFieldConstraintsThatBelongToIt());
    final int idx = i;
    remove.addClickHandler(new ClickHandler() {

        public void onClick(ClickEvent event) {
            if (Window.confirm(GuidedRuleEditorResources.CONSTANTS.RemoveThisEntireConditionQ())) {
                if (model.removeLhsItem(idx)) {
                    refreshWidget();
                    // Signal possible change in Template variables
                    TemplateVariablesChangedEvent tvce = new TemplateVariablesChangedEvent(model);
                    eventBus.fireEventFromSource(tvce, model);
                } else {
                    ErrorPopup.showMessage(GuidedRuleEditorResources.CONSTANTS.CanTRemoveThatItemAsItIsUsedInTheActionPartOfTheRule());
                }
            }
        }
    });
    wrapper.getColumnFormatter().setWidth(0, "100%");
    w.setWidth("100%");
    wrapper.setWidget(0, 0, w);
    if (!(this.lockLHS() || w.isReadOnly()) || !w.isFactTypeKnown()) {
        wrapper.setWidget(0, 1, remove);
        wrapper.getColumnFormatter().setWidth(1, "20px");
    }
    return wrapper;
}
Also used : ClickHandler(com.google.gwt.event.dom.client.ClickHandler) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) FlexTable(com.google.gwt.user.client.ui.FlexTable) Image(com.google.gwt.user.client.ui.Image) TemplateVariablesChangedEvent(org.drools.workbench.screens.guided.rule.client.editor.events.TemplateVariablesChangedEvent)

Example 35 with Image

use of com.google.gwt.user.client.ui.Image in project drools-wb by kiegroup.

the class RuleModeller method addInvalidPatternIcon.

private void addInvalidPatternIcon() {
    final Image image = GuidedRuleEditorImages508.INSTANCE.Error();
    image.setTitle(GuidedRuleEditorResources.CONSTANTS.InvalidPatternSectionDisabled());
    this.addLineIcon(currentLayoutRow, 0, image);
}
Also used : Image(com.google.gwt.user.client.ui.Image)

Aggregations

Image (com.google.gwt.user.client.ui.Image)98 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)28 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)28 HorizontalPanel (com.google.gwt.user.client.ui.HorizontalPanel)15 Test (org.junit.Test)13 FlexTable (com.google.gwt.user.client.ui.FlexTable)12 HTML (com.google.gwt.user.client.ui.HTML)10 Element (com.google.gwt.dom.client.Element)8 Label (com.google.gwt.user.client.ui.Label)8 ImageResource2x (org.rstudio.core.client.resources.ImageResource2x)7 SmallLabel (org.uberfire.ext.widgets.common.client.common.SmallLabel)7 ImageResource (com.google.gwt.resources.client.ImageResource)6 Widget (com.google.gwt.user.client.ui.Widget)6 FlowPanel (com.google.gwt.user.client.ui.FlowPanel)5 Style (com.google.gwt.dom.client.Style)4 Anchor (com.google.gwt.user.client.ui.Anchor)4 VerticalPanel (com.google.gwt.user.client.ui.VerticalPanel)4 ChangeEvent (com.google.gwt.event.dom.client.ChangeEvent)3 ChangeHandler (com.google.gwt.event.dom.client.ChangeHandler)3 ValueChangeEvent (com.google.gwt.event.logical.shared.ValueChangeEvent)3