Search in sources :

Example 1 with CEPWindowOperatorsDropdown

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);
            });
        }
    };
}
Also used : CEPWindowOperatorsDropdown(org.drools.workbench.screens.guided.rule.client.editor.CEPWindowOperatorsDropdown) Pattern52(org.drools.workbench.models.guided.dtable.shared.model.Pattern52) CEPWindow(org.drools.workbench.models.datamodel.rule.CEPWindow)

Example 2 with CEPWindowOperatorsDropdown

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;
}
Also used : CEPWindowOperatorsDropdown(org.drools.workbench.screens.guided.rule.client.editor.CEPWindowOperatorsDropdown) ValueChangeEvent(com.google.gwt.event.logical.shared.ValueChangeEvent) OperatorSelection(org.drools.workbench.screens.guided.rule.client.editor.OperatorSelection) HorizontalPanel(com.google.gwt.user.client.ui.HorizontalPanel) Label(com.google.gwt.user.client.ui.Label) ClickableLabel(org.uberfire.ext.widgets.common.client.common.ClickableLabel) SmallLabel(org.uberfire.ext.widgets.common.client.common.SmallLabel) ValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler)

Aggregations

CEPWindowOperatorsDropdown (org.drools.workbench.screens.guided.rule.client.editor.CEPWindowOperatorsDropdown)2 ValueChangeEvent (com.google.gwt.event.logical.shared.ValueChangeEvent)1 ValueChangeHandler (com.google.gwt.event.logical.shared.ValueChangeHandler)1 HorizontalPanel (com.google.gwt.user.client.ui.HorizontalPanel)1 Label (com.google.gwt.user.client.ui.Label)1 CEPWindow (org.drools.workbench.models.datamodel.rule.CEPWindow)1 Pattern52 (org.drools.workbench.models.guided.dtable.shared.model.Pattern52)1 OperatorSelection (org.drools.workbench.screens.guided.rule.client.editor.OperatorSelection)1 ClickableLabel (org.uberfire.ext.widgets.common.client.common.ClickableLabel)1 SmallLabel (org.uberfire.ext.widgets.common.client.common.SmallLabel)1