use of org.drools.workbench.screens.guided.rule.client.editor.CEPWindowOperatorsDropdown in project drools-wb by kiegroup.
the class ValueOptionsPage method newCEPWindowOperatorsDropdown.
private CEPWindowOperatorsDropdown newCEPWindowOperatorsDropdown() {
final Pattern52 editingPattern = editingPattern();
return new CEPWindowOperatorsDropdown(editingPattern, false) {
{
addValueChangeHandler(event -> {
final CEPWindow cepWindow = editingPattern.getWindow();
final String operator = event.getValue().getValue();
cepWindow.setOperator(operator);
});
}
};
}
use of org.drools.workbench.screens.guided.rule.client.editor.CEPWindowOperatorsDropdown in project drools-wb by kiegroup.
the class FactPatternWidget method createCEPWindowWidget.
// Widget for CEP 'windows'
private Widget createCEPWindowWidget(final RuleModeller modeller, final HasCEPWindow c) {
final HorizontalPanel hp = new HorizontalPanel();
modeller.getDataModelOracle().isFactTypeAnEvent(pattern.getFactType(), new Callback<Boolean>() {
@Override
public void callback(final Boolean result) {
if (Boolean.TRUE.equals(result)) {
final Label lbl = new Label(HumanReadableConstants.INSTANCE.OverCEPWindow());
lbl.setStyleName("paddedLabel");
hp.add(lbl);
final CEPWindowOperatorsDropdown cwo = new CEPWindowOperatorsDropdown(c, readOnly);
if (!isReadOnly()) {
cwo.addValueChangeHandler(new ValueChangeHandler<OperatorSelection>() {
public void onValueChange(ValueChangeEvent<OperatorSelection> event) {
setModified(true);
OperatorSelection selection = event.getValue();
String selected = selection.getValue();
c.getWindow().setOperator(selected);
}
});
}
hp.add(cwo);
}
}
});
return hp;
}
Aggregations