use of com.google.gwt.user.client.ui.Image in project drools-wb by kiegroup.
the class GuidedRuleEditorImages508 method EditDisabled.
public Image EditDisabled() {
Image image = new Image(GuidedRuleEditorResources.INSTANCE.images().editDisabled());
image.setAltText(GuidedRuleEditorResources.CONSTANTS.EditDisabled());
return image;
}
use of com.google.gwt.user.client.ui.Image in project drools-wb by kiegroup.
the class ActionSetFieldWidget method doLayout.
private void doLayout() {
layout.clear();
for (int i = 0; i < model.getFieldValues().length; i++) {
ActionFieldValue val = model.getFieldValues()[i];
layout.setWidget(i, 0, getSetterLabel());
layout.setWidget(i, 1, fieldSelector(val));
layout.setWidget(i, 2, valueEditor(val));
final int idx = i;
Image remove = GuidedRuleEditorImages508.INSTANCE.DeleteItemSmall();
remove.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
if (Window.confirm(GuidedRuleEditorResources.CONSTANTS.RemoveThisItem())) {
model.removeField(idx);
setModified(true);
getModeller().refreshWidget();
// Signal possible change in Template variables
TemplateVariablesChangedEvent tvce = new TemplateVariablesChangedEvent(getModeller().getModel());
getEventBus().fireEventFromSource(tvce, getModeller().getModel());
}
}
});
if (!this.readOnly) {
layout.setWidget(i, 3, remove);
}
}
if (model.getFieldValues().length == 0) {
HorizontalPanel h = new HorizontalPanel();
h.add(getSetterLabel());
if (!this.readOnly) {
Image image = GuidedRuleEditorImages508.INSTANCE.Edit();
image.setAltText(GuidedRuleEditorResources.CONSTANTS.AddFirstNewField());
image.setTitle(GuidedRuleEditorResources.CONSTANTS.AddFirstNewField());
image.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent sender) {
showAddFieldPopup(sender);
}
});
h.add(image);
}
layout.setWidget(0, 0, h);
}
// layout.setWidget( 0, 1, inner );
}
use of com.google.gwt.user.client.ui.Image in project drools-wb by kiegroup.
the class CompositeFactPatternWidget method wrapLHSWidget.
/**
* Wraps a RuleModellerWidget with an icon to delete the pattern
*/
private Widget wrapLHSWidget(final CompositeFactPattern model, int i, RuleModellerWidget w) {
DirtyableHorizontalPane horiz = new DirtyableHorizontalPane();
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 (pattern.removeFactPattern(idx)) {
getModeller().refreshWidget();
}
}
}
});
horiz.setWidth("100%");
w.setWidth("100%");
horiz.add(w);
if (!(getModeller().lockLHS() || w.isReadOnly())) {
horiz.add(remove);
}
return horiz;
}
use of com.google.gwt.user.client.ui.Image in project drools-wb by kiegroup.
the class FactPatternWidget method compositeFieldConstraintEditor.
/**
* This will show the constraint editor - allowing field constraints to be
* nested etc.
*/
private Widget compositeFieldConstraintEditor(final CompositeFieldConstraint constraint) {
FlexTable t = new FlexTable();
String desc = null;
ClickHandler click = new ClickHandler() {
public void onClick(ClickEvent event) {
popupCreator.showPatternPopupForComposite(constraint);
}
};
if (constraint.getCompositeJunctionType().equals(CompositeFieldConstraint.COMPOSITE_TYPE_AND)) {
desc = GuidedRuleEditorResources.CONSTANTS.AllOf() + ":";
} else {
desc = GuidedRuleEditorResources.CONSTANTS.AnyOf() + ":";
}
t.setWidget(0, 0, new ClickableLabel(desc, click, !this.readOnly));
t.getFlexCellFormatter().setColSpan(0, 0, 2);
FieldConstraint[] nested = constraint.getConstraints();
FlexTable inner = new FlexTable();
if (nested != null) {
for (int i = 0; i < nested.length; i++) {
this.renderFieldConstraint(inner, i, nested[i], constraint, true, 0);
// add in remove icon here...
final int currentRow = i;
Image clear = GuidedRuleEditorImages508.INSTANCE.DeleteItemSmall();
clear.setTitle(GuidedRuleEditorResources.CONSTANTS.RemoveThisNestedRestriction());
clear.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
if (Window.confirm(GuidedRuleEditorResources.CONSTANTS.RemoveThisItemFromNestedConstraint())) {
setModified(true);
constraint.removeConstraint(currentRow);
getModeller().refreshWidget();
}
}
});
if (!this.readOnly) {
// This used to be 5 and Connectives were not rendered
inner.setWidget(i, 6, clear);
}
}
}
t.setWidget(1, 1, inner);
t.setWidget(1, 0, new HTML(" "));
return t;
}
use of com.google.gwt.user.client.ui.Image in project drools-wb by kiegroup.
the class FromCompositeFactPatternWidget method addRemoveButton.
protected Widget addRemoveButton(Widget w, ClickHandler listener) {
DirtyableHorizontalPane horiz = new DirtyableHorizontalPane();
final Image remove = GuidedRuleEditorImages508.INSTANCE.DeleteItemSmall();
remove.setAltText(GuidedRuleEditorResources.CONSTANTS.RemoveThisBlockOfData());
remove.setTitle(GuidedRuleEditorResources.CONSTANTS.RemoveThisBlockOfData());
remove.addClickHandler(listener);
horiz.setWidth("100%");
w.setWidth("100%");
horiz.add(w);
if (!this.readOnly) {
horiz.add(remove);
}
return horiz;
}
Aggregations