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