use of com.google.gwt.user.client.ui.HTML in project drools-wb by kiegroup.
the class MethodParameterCallValueEditor method showTypeChoice.
protected void showTypeChoice(final Widget w) {
final FormStylePopup form = new FormStylePopup(TestScenarioAltedImages.INSTANCE.Wizard(), TestScenarioConstants.INSTANCE.FieldValue());
Button lit = new Button(TestScenarioConstants.INSTANCE.LiteralValue());
lit.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
methodParameter.nature = FieldData.TYPE_LITERAL;
methodParameter.value = " ";
refresh();
form.hide();
}
});
form.addAttribute(TestScenarioConstants.INSTANCE.LiteralValue() + ":", widgets(lit, new InfoPopup(TestScenarioConstants.INSTANCE.Literal(), TestScenarioConstants.INSTANCE.LiteralValTip())));
form.addRow(new HTML("<hr/>"));
form.addRow(new SmallLabel(TestScenarioConstants.INSTANCE.AdvancedSection()));
/*
* If there is a bound variable that is the same type of the current
* variable type, then show a button
*/
List<String> vars = model.getFactNamesInScope(ex, true);
for (String v : vars) {
boolean createButton = false;
Button variable = new Button(TestScenarioConstants.INSTANCE.BoundVariable());
FactData factData = (FactData) model.getFactTypes().get(v);
if (factData.getType().equals(this.parameterType)) {
createButton = true;
}
if (createButton == true) {
form.addAttribute(TestScenarioConstants.INSTANCE.BoundVariable() + ":", variable);
variable.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
methodParameter.nature = FieldData.TYPE_VARIABLE;
methodParameter.value = "=";
refresh();
form.hide();
}
});
break;
}
}
form.show();
}
use of com.google.gwt.user.client.ui.HTML in project drools-wb by kiegroup.
the class ActionValueEditor method choice.
private Widget choice() {
if (this.readOnly) {
return new HTML();
} else {
Image clickme = GuidedRuleEditorImages508.INSTANCE.Edit();
clickme.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
showTypeChoice();
}
});
return clickme;
}
}
use of com.google.gwt.user.client.ui.HTML in project drools-wb by kiegroup.
the class MethodParameterValueEditor method showTypeChoice.
protected void showTypeChoice() {
final FormStylePopup form = new FormStylePopup(GuidedRuleEditorImages508.INSTANCE.Wizard(), GuidedRuleEditorResources.CONSTANTS.FieldValue());
// Literal values
Button lit = new Button(GuidedRuleEditorResources.CONSTANTS.LiteralValue());
lit.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
methodParameter.setNature(FieldNatureType.TYPE_LITERAL);
methodParameter.setValue("");
refresh();
form.hide();
}
});
form.addAttributeWithHelp(GuidedRuleEditorResources.CONSTANTS.LiteralValue(), GuidedRuleEditorResources.CONSTANTS.LiteralValue(), GuidedRuleEditorResources.CONSTANTS.LiteralValTip(), lit);
if (modeller.isTemplate()) {
Button templateButton = new Button(GuidedRuleEditorResources.CONSTANTS.TemplateKey());
templateButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
methodParameter.setNature(FieldNatureType.TYPE_TEMPLATE);
methodParameter.setValue("");
refresh();
form.hide();
}
});
form.addAttributeWithHelp(GuidedRuleEditorResources.CONSTANTS.TemplateKey(), GuidedRuleEditorResources.CONSTANTS.TemplateKey(), GuidedRuleEditorResources.CONSTANTS.TemplateKeyTip(), templateButton);
}
canTheVariableButtonBeShown(new Callback<Boolean>() {
@Override
public void callback(Boolean result) {
if (result) {
addBoundVariableButton(form);
form.addRow(new HTML("<hr/>"));
form.addRow(new SmallLabel(GuidedRuleEditorResources.CONSTANTS.AdvancedSection()));
}
// Formulas
Button formula = new Button(GuidedRuleEditorResources.CONSTANTS.NewFormula());
formula.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
methodParameter.setNature(FieldNatureType.TYPE_FORMULA);
refresh();
form.hide();
}
});
form.addAttributeWithHelp(GuidedRuleEditorResources.CONSTANTS.AFormula(), GuidedRuleEditorResources.CONSTANTS.AFormula(), GuidedRuleEditorResources.CONSTANTS.FormulaExpressionTip(), formula);
form.show();
}
});
}
use of com.google.gwt.user.client.ui.HTML in project drools-wb by kiegroup.
the class RuleModeller method spacerWidget.
private HTML spacerWidget() {
// NON-NLS
HTML h = new HTML(" ");
// NON-NLS
h.setHeight("2px");
return h;
}
use of com.google.gwt.user.client.ui.HTML in project drools-wb by kiegroup.
the class RuleModeller method wrapLineNumber.
private Widget wrapLineNumber(int number, boolean isLHSLine) {
String id = "rhsLine";
if (isLHSLine) {
id = "lhsLine";
}
id += number;
DirtyableHorizontalPane horiz = new DirtyableHorizontalPane();
horiz.add(new HTML("<div class='form-field' id='" + id + "'>" + number + ".</div>"));
return horiz;
}
Aggregations