use of com.google.gwt.user.client.ui.HTML in project drools-wb by kiegroup.
the class CompositeFactPatternWidget method doLayout.
protected void doLayout() {
this.layout.setWidget(0, 0, getCompositeLabel());
this.layout.getFlexCellFormatter().setColSpan(0, 0, 2);
// this.layout.getFlexCellFormatter().setWidth(0, 0, "15%");
this.layout.setWidget(1, 0, new HTML(" "));
if (this.pattern.getPatterns() != null) {
DirtyableVerticalPane vert = new DirtyableVerticalPane();
IFactPattern[] facts = pattern.getPatterns();
for (int i = 0; i < facts.length; i++) {
RuleModellerWidget widget = this.getModeller().getWidgetFactory().getWidget(this.getModeller(), this.getEventBus(), facts[i], this.readOnly);
widget.addOnModifiedCommand(new Command() {
public void execute() {
setModified(true);
}
});
// Wrap widget so the Fact pattern can be deleted
vert.add(wrapLHSWidget(pattern, i, widget));
vert.add(spacerWidget());
}
this.layout.setWidget(1, 1, vert);
}
}
use of com.google.gwt.user.client.ui.HTML in project drools-wb by kiegroup.
the class ConstraintValueEditor method expressionEditor.
private Widget expressionEditor() {
ExpressionBuilder builder = null;
builder = new ExpressionBuilder(this.modeller, this.eventBus, this.constraint.getExpressionValue(), this.readOnly);
builder.addOnModifiedCommand(new Command() {
public void execute() {
executeOnValueChangeCommand();
}
});
Widget ed = widgets(new HTML(" "), builder);
return ed;
}
use of com.google.gwt.user.client.ui.HTML in project drools-wb by kiegroup.
the class MethodParameterValueEditor method addBoundVariableButton.
private void addBoundVariableButton(final FormStylePopup form) {
form.addRow(new HTML("<hr/>"));
form.addRow(new SmallLabel(GuidedRuleEditorResources.CONSTANTS.AdvancedSection()));
Button variableButton = new Button(GuidedRuleEditorResources.CONSTANTS.BoundVariable());
form.addAttribute(GuidedRuleEditorResources.CONSTANTS.BoundVariable() + ":", variableButton);
variableButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
methodParameter.setNature(FieldNatureType.TYPE_VARIABLE);
methodParameter.setValue("=");
refresh();
form.hide();
}
});
}
use of com.google.gwt.user.client.ui.HTML in project drools-wb by kiegroup.
the class RuleModellerActionSelectorPopup method getContent.
@Override
public Widget getContent() {
if (position == null) {
positionCbo.addItem(GuidedRuleEditorResources.CONSTANTS.Bottom(), String.valueOf(this.model.rhs.length));
positionCbo.addItem(GuidedRuleEditorResources.CONSTANTS.Top(), "0");
for (int i = 1; i < model.rhs.length; i++) {
positionCbo.addItem(GuidedRuleEditorResources.CONSTANTS.Line0(i), String.valueOf(i));
}
} else {
// if position is fixed, we just add one element to the drop down.
positionCbo.addItem(String.valueOf(position));
positionCbo.setSelectedIndex(0);
}
if (oracle.getDSLConditions().size() == 0 && oracle.getFactTypes().length == 0) {
layoutPanel.addRow(new HTML("<div class='highlight'>" + GuidedRuleEditorResources.CONSTANTS.NoModelTip() + "</div>"));
}
// only show the drop down if we are not using fixed position.
if (position == null) {
HorizontalPanel hp0 = new HorizontalPanel();
hp0.add(new HTML(GuidedRuleEditorResources.CONSTANTS.PositionColon()));
hp0.add(positionCbo);
hp0.add(new InfoPopup(GuidedRuleEditorResources.CONSTANTS.PositionColon(), GuidedRuleEditorResources.CONSTANTS.ActionPositionExplanation()));
layoutPanel.addRow(hp0);
layoutPanel.addRow(new HTML("<hr/>"));
}
// Add a widget to filter DSLs if applicable
final RuleModellerSelectorFilter filterWidget = GWT.create(RuleModellerSelectorFilter.class);
filterWidget.setFilterChangeConsumer((filter) -> choicesPanel.setWidget(makeChoicesListBox(filter)));
layoutPanel.add(filterWidget);
choices = makeChoicesListBox(filterWidget.getFilterText());
choicesPanel.add(choices);
layoutPanel.addRow(choicesPanel);
// DSL might be prohibited (e.g. editing a DRL file. Only DSLR files can contain DSL)
if (ruleModeller.isDSLEnabled()) {
CheckBox chkOnlyDisplayDSLConditions = new CheckBox();
chkOnlyDisplayDSLConditions.setText(GuidedRuleEditorResources.CONSTANTS.OnlyDisplayDSLActions());
chkOnlyDisplayDSLConditions.setValue(onlyShowDSLStatements);
chkOnlyDisplayDSLConditions.addValueChangeHandler(new ValueChangeHandler<Boolean>() {
public void onValueChange(ValueChangeEvent<Boolean> event) {
onlyShowDSLStatements = event.getValue();
choicesPanel.setWidget(makeChoicesListBox(filterWidget.getFilterText()));
}
});
layoutPanel.addRow(chkOnlyDisplayDSLConditions);
}
return layoutPanel;
}
use of com.google.gwt.user.client.ui.HTML in project drools-wb by kiegroup.
the class FromEntryPointFactPatternWidget method getCompositeLabel.
@Override
protected Widget getCompositeLabel() {
ClickHandler click = new ClickHandler() {
public void onClick(ClickEvent event) {
showFactTypeSelector();
}
};
String lbl = "<div class='form-field'>" + HumanReadable.getCEDisplayName("from entry-point") + "</div>";
FlexTable panel = new FlexTable();
int r = 0;
if (pattern.getFactPattern() == null) {
panel.setWidget(r, 0, new ClickableLabel("<br> <font color='red'>" + GuidedRuleEditorResources.CONSTANTS.clickToAddPatterns() + "</font>", click, !this.readOnly));
r++;
}
panel.setWidget(r, 0, new HTML(lbl));
this.txtEntryPoint = new TextBox();
this.txtEntryPoint.setText(getFromEntryPointPattern().getEntryPointName());
this.txtEntryPoint.addChangeHandler(new ChangeHandler() {
public void onChange(ChangeEvent event) {
getFromEntryPointPattern().setEntryPointName(txtEntryPoint.getText());
setModified(true);
}
});
panel.setWidget(r, 1, this.txtEntryPoint);
return panel;
}
Aggregations