use of com.google.gwt.user.client.ui.Image in project drools-wb by kiegroup.
the class GuidedRuleEditorImages508 method Error.
public Image Error() {
Image image = new Image(GuidedRuleEditorResources.INSTANCE.images().error());
image.setAltText(GuidedRuleEditorResources.CONSTANTS.Error());
return image;
}
use of com.google.gwt.user.client.ui.Image in project drools-wb by kiegroup.
the class Connectives method connectives.
public Widget connectives(final SingleFieldConstraint c) {
final HorizontalPanel hp = new HorizontalPanel();
if (c.getConnectives() != null && c.getConnectives().length > 0) {
hp.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
hp.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
for (int i = 0; i < c.getConnectives().length; i++) {
final int index = i;
final ConnectiveConstraint con = c.getConnectives()[i];
connectiveOperatorDropDown(con, new Callback<Widget>() {
@Override
public void callback(final Widget w) {
hp.add(w);
hp.add(connectiveValueEditor(con));
if (!isReadOnly) {
Image clear = GuidedRuleEditorImages508.INSTANCE.DeleteItemSmall();
clear.setAltText(GuidedRuleEditorResources.CONSTANTS.RemoveThisRestriction());
clear.setTitle(GuidedRuleEditorResources.CONSTANTS.RemoveThisRestriction());
clear.addClickHandler(createClickHandlerForClearImageButton(c, index));
hp.add(clear);
}
}
});
}
}
return hp;
}
use of com.google.gwt.user.client.ui.Image in project drools-wb by kiegroup.
the class ActionInsertFactWidget method doLayout.
private void doLayout() {
layout.clear();
layout.setWidget(0, 0, getAssertLabel());
layout.setWidget(1, 0, new HTML(" "));
layout.getFlexCellFormatter().setColSpan(0, 0, 2);
FlexTable inner = new FlexTable();
int col = 0;
for (int i = 0; i < model.getFieldValues().length; i++) {
ActionFieldValue val = model.getFieldValues()[i];
inner.setWidget(i, 0 + col, fieldSelector(val));
inner.setWidget(i, 1 + col, 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) {
inner.setWidget(i, 2 + col, remove);
}
}
layout.setWidget(1, 1, inner);
}
use of com.google.gwt.user.client.ui.Image in project drools-wb by kiegroup.
the class ActionCallMethodWidget method getSetterLabel.
private Widget getSetterLabel() {
HorizontalPanel horiz = new HorizontalPanel();
if (model.getState() == ActionCallMethod.TYPE_UNDEFINED) {
Image edit = GuidedRuleEditorImages508.INSTANCE.AddFieldToFact();
edit.setAltText(GuidedRuleEditorResources.CONSTANTS.AddAnotherFieldToThisSoYouCanSetItsValue());
edit.setTitle(GuidedRuleEditorResources.CONSTANTS.AddAnotherFieldToThisSoYouCanSetItsValue());
edit.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
Widget w = (Widget) event.getSource();
showAddFieldPopup(w);
}
});
// NON-NLS
horiz.add(new SmallLabel(HumanReadable.getActionDisplayName("call") + " [" + model.getVariable() + "]"));
if (!this.readOnly) {
horiz.add(edit);
}
} else {
// NON-NLS
horiz.add(new SmallLabel(HumanReadable.getActionDisplayName("call") + " [" + model.getVariable() + "." + model.getMethodName() + "]"));
}
return horiz;
}
use of com.google.gwt.user.client.ui.Image in project drools-wb by kiegroup.
the class FactPatternWidget method drawConstraints.
/**
* Render a hierarchy of constraints, hierarchy here means constraints that
* may themselves depend on members of constraint objects. With this code,
* the GUI enables clicking rules of the form: $result = RoutingResult(
* NerOption.types contains "arzt" )
* @param sortedConst a sorted list of constraints to display.
*/
protected void drawConstraints(List<FieldConstraint> sortedConst, HasConstraints hasConstraints) {
final FlexTable table = new FlexTable();
layout.setWidget(1, 0, table);
List<FieldConstraint> parents = new ArrayList<FieldConstraint>();
for (int i = 0; i < sortedConst.size(); i++) {
traverseSingleFieldConstraints(sortedConst, table, parents, hasConstraints, i);
// now the clear icon
final int currentRow = i;
Image clear = GuidedRuleEditorImages508.INSTANCE.DeleteItemSmall();
clear.setTitle(GuidedRuleEditorResources.CONSTANTS.RemoveThisWholeRestriction());
clear.addClickHandler(createClickHandlerForClearImageButton(currentRow));
if (!this.readOnly) {
// This used to be 5 and Connectives were not rendered
table.setWidget(currentRow, 6, clear);
}
}
}
Aggregations