Search in sources :

Example 61 with ClickHandler

use of com.google.gwt.event.dom.client.ClickHandler 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 62 with ClickHandler

use of com.google.gwt.event.dom.client.ClickHandler in project drools-wb by kiegroup.

the class RuleAttributeWidget method checkBoxEditor.

private Widget checkBoxEditor(final RuleAttribute at, final boolean isReadOnly) {
    final CheckBox box = new CheckBox();
    box.setEnabled(!isReadOnly);
    if (at.getValue() == null || at.getValue().isEmpty()) {
        box.setValue(false);
        at.setValue(FALSE_VALUE);
    } else {
        box.setValue((at.getValue().equals(TRUE_VALUE)));
    }
    box.addClickHandler(new ClickHandler() {

        public void onClick(ClickEvent event) {
            at.setValue((box.getValue()) ? TRUE_VALUE : FALSE_VALUE);
        }
    });
    return box;
}
Also used : ClickHandler(com.google.gwt.event.dom.client.ClickHandler) CheckBox(org.gwtbootstrap3.client.ui.CheckBox) ClickEvent(com.google.gwt.event.dom.client.ClickEvent)

Example 63 with ClickHandler

use of com.google.gwt.event.dom.client.ClickHandler 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 64 with ClickHandler

use of com.google.gwt.event.dom.client.ClickHandler in project kie-wb-common by kiegroup.

the class NewPackagePopupViewImpl method init.

@PostConstruct
private void init() {
    mainPanel.setFluid(true);
    mainPanel.add(row);
    row.add(column);
    newPackageButton.setType(ButtonType.PRIMARY);
    newPackageButton.setIcon(IconType.PLUS);
    inputGroupButton.add(newPackageButton);
    inputGroup.add(newPackageName);
    inputGroup.add(inputGroupButton);
    newPackageName.setPlaceholder(Constants.INSTANCE.package_id_placeholder());
    newPackageControlGroup.add(inputGroup);
    errorMessagesGroup.add(errorMessages);
    column.add(newPackageControlGroup);
    column.add(newPackageHelpHtml);
    column.add(errorMessagesGroup);
    setBody(mainPanel);
    setTitle(Constants.INSTANCE.new_dataobject_popup_new_package());
    setClosable(true);
    newPackageButton.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            presenter.onCreatePackage();
        }
    });
}
Also used : ClickHandler(com.google.gwt.event.dom.client.ClickHandler) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) PostConstruct(javax.annotation.PostConstruct)

Example 65 with ClickHandler

use of com.google.gwt.event.dom.client.ClickHandler in project cuba by cuba-platform.

the class CubaHorizontalSplitPanelWidget method setDockable.

public void setDockable(boolean dockable) {
    if (isDockable() == dockable) {
        return;
    }
    if (dockable) {
        dockButton = new CubaPlaceHolderWidget();
        dockButton.setStyleName(SP_DOCK_BUTTON);
        dockButton.addStyleName(SP_DOCK_BUTTON_LEFT);
        dockButton.addDomHandler(new ClickHandler() {

            @Override
            public void onClick(ClickEvent event) {
                onDockButtonClick();
            }
        }, ClickEvent.getType());
        dockButtonContainer = new VOverlay();
        dockButtonContainer.addStyleName(SP_DOCK_OVERLAY);
        dockButtonContainer.getElement().getStyle().setZIndex(9999);
        if (dockMode == SplitPanelDockMode.LEFT) {
            dockButtonContainer.setStyleName(SP_DOCK_LEFT);
        } else if (dockMode == SplitPanelDockMode.RIGHT) {
            dockButtonContainer.setStyleName(SP_DOCK_RIGHT);
        }
        dockButtonContainer.setOwner(this);
        dockButtonContainer.setWidget(dockButton);
        dockButtonContainer.show();
        updateDockButtonPosition();
    } else {
        if (dockButtonContainer != null) {
            dockButtonContainer.hide();
            dockButtonContainer.removeFromParent();
            dockButtonContainer = null;
            dockButton = null;
        }
    }
}
Also used : ClickHandler(com.google.gwt.event.dom.client.ClickHandler) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) VOverlay(com.vaadin.client.ui.VOverlay) CubaPlaceHolderWidget(com.haulmont.cuba.web.toolkit.ui.client.placeholder.CubaPlaceHolderWidget)

Aggregations

ClickHandler (com.google.gwt.event.dom.client.ClickHandler)447 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)437 CustomButton (cz.metacentrum.perun.webgui.widgets.CustomButton)168 JsonCallbackEvents (cz.metacentrum.perun.webgui.json.JsonCallbackEvents)143 TabMenu (cz.metacentrum.perun.webgui.widgets.TabMenu)129 ArrayList (java.util.ArrayList)128 JavaScriptObject (com.google.gwt.core.client.JavaScriptObject)110 TabItem (cz.metacentrum.perun.webgui.tabs.TabItem)79 ChangeEvent (com.google.gwt.event.dom.client.ChangeEvent)48 ChangeHandler (com.google.gwt.event.dom.client.ChangeHandler)47 ExtendedSuggestBox (cz.metacentrum.perun.webgui.widgets.ExtendedSuggestBox)41 PerunError (cz.metacentrum.perun.webgui.model.PerunError)38 HashMap (java.util.HashMap)37 Button (com.google.gwt.user.client.ui.Button)35 HTML (com.google.gwt.user.client.ui.HTML)34 ExtendedTextBox (cz.metacentrum.perun.webgui.widgets.ExtendedTextBox)33 Button (org.gwtbootstrap3.client.ui.Button)33 FlexCellFormatter (com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter)31 Image (com.google.gwt.user.client.ui.Image)30 Map (java.util.Map)27