use of com.google.gwt.user.client.ui.Image in project drools-wb by kiegroup.
the class RuleModeller method wrapRHSWidget.
/**
* This adds the widget to the UI, also adding the remove icon.
*/
private Widget wrapRHSWidget(final RuleModel model, int i, RuleModellerWidget w) {
final FlexTable wrapper = new FlexTable();
final Image remove = GuidedRuleEditorImages508.INSTANCE.DeleteItemSmall();
remove.setTitle(GuidedRuleEditorResources.CONSTANTS.RemoveThisAction());
final int idx = i;
remove.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
if (Window.confirm(GuidedRuleEditorResources.CONSTANTS.RemoveThisItem())) {
model.removeRhsItem(idx);
refreshWidget();
// Signal possible change in Template variables
TemplateVariablesChangedEvent tvce = new TemplateVariablesChangedEvent(model);
eventBus.fireEventFromSource(tvce, model);
}
}
});
// if ( !(w instanceof ActionRetractFactWidget) ) {
// w.setWidth( "100%" );
// horiz.setWidth( "100%" );
// }
wrapper.getColumnFormatter().setWidth(0, "100%");
w.setWidth("100%");
wrapper.setWidget(0, 0, w);
if (!(this.lockRHS() || w.isReadOnly()) || !w.isFactTypeKnown()) {
wrapper.setWidget(0, 1, remove);
wrapper.getColumnFormatter().setWidth(1, "20px");
}
return wrapper;
}
use of com.google.gwt.user.client.ui.Image in project drools-wb by kiegroup.
the class RuleModeller method initWidget.
/**
* This updates the widget to reflect the state of the model.
*/
public void initWidget() {
layout.removeAllRows();
currentLayoutRow = 0;
Image addPattern = GuidedRuleEditorImages508.INSTANCE.NewItem();
addPattern.setTitle(GuidedRuleEditorResources.CONSTANTS.AddAConditionToThisRule());
addPattern.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
showConditionSelector(null);
}
});
layout.getColumnFormatter().setWidth(0, "20px");
layout.getColumnFormatter().setWidth(1, "20px");
layout.getColumnFormatter().setWidth(2, "48px");
layout.getColumnFormatter().setWidth(4, "64px");
if (this.showExtendedRuleDropdown()) {
addExtendedRuleDropdown();
}
if (this.showLHS()) {
layout.setWidget(currentLayoutRow, 0, new SmallLabel("<b>" + GuidedRuleEditorResources.CONSTANTS.WHEN() + "</b>"));
layout.getFlexCellFormatter().setColSpan(currentLayoutRow, 0, 4);
if (!lockLHS()) {
layout.setWidget(currentLayoutRow, 1, addPattern);
}
currentLayoutRow++;
renderLhs(this.model);
}
if (this.showRHS()) {
layout.setWidget(currentLayoutRow, 0, new SmallLabel("<b>" + GuidedRuleEditorResources.CONSTANTS.THEN() + "</b>"));
layout.getFlexCellFormatter().setColSpan(currentLayoutRow, 0, 4);
Image addAction = GuidedRuleEditorImages508.INSTANCE.NewItem();
addAction.setTitle(GuidedRuleEditorResources.CONSTANTS.AddAnActionToThisRule());
addAction.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
showActionSelector(null);
}
});
if (!lockRHS()) {
layout.setWidget(currentLayoutRow, 1, addAction);
}
currentLayoutRow++;
renderRhs(this.model);
}
if (showAttributes()) {
final int optionsRowIndex = currentLayoutRow;
if (!this.showingOptions) {
ClickableLabel showMoreOptions = new ClickableLabel(GuidedRuleEditorResources.CONSTANTS.ShowOptions(), new ClickHandler() {
public void onClick(ClickEvent event) {
showingOptions = true;
renderOptions(optionsRowIndex);
}
});
layout.setWidget(optionsRowIndex, 2, showMoreOptions);
} else {
renderOptions(optionsRowIndex);
}
}
currentLayoutRow++;
layout.setWidget(currentLayoutRow + 1, 3, spacerWidget());
layout.getCellFormatter().setHeight(currentLayoutRow + 1, 3, "100%");
}
use of com.google.gwt.user.client.ui.Image in project drools-wb by kiegroup.
the class GuidedRuleEditorImages508 method Edit.
public Image Edit() {
Image image = new Image(CommonImages.INSTANCE.edit());
image.setAltText(GuidedRuleEditorResources.CONSTANTS.Edit());
return image;
}
use of com.google.gwt.user.client.ui.Image in project drools-wb by kiegroup.
the class GuidedRuleEditorImages508 method Wizard.
public Image Wizard() {
Image image = new Image(GuidedRuleEditorResources.INSTANCE.images().newWiz());
image.setAltText(GuidedRuleEditorResources.CONSTANTS.Wizard());
return image;
}
use of com.google.gwt.user.client.ui.Image in project drools-wb by kiegroup.
the class GuidedRuleEditorImages508 method DeleteItemSmall.
public Image DeleteItemSmall() {
Image image = new Image(GuidedRuleEditorResources.INSTANCE.itemImages().deleteItemSmall());
image.setAltText(GuidedRuleEditorResources.CONSTANTS.DeleteItem());
return image;
}
Aggregations