Search in sources :

Example 1 with SuperTypeMatcher

use of org.drools.workbench.screens.guided.rule.client.editor.util.SuperTypeMatcher in project drools-wb by kiegroup.

the class MethodParameterValueEditor method canTheVariableButtonBeShown.

private void canTheVariableButtonBeShown(final Callback<Boolean> callback) {
    List<String> factTypes = new ArrayList<String>();
    for (String variable : modeller.getModel().getAllVariables()) {
        String factType = getFactType(variable);
        factTypes.add(factType);
        if (factType.equals(this.parameterType)) {
            callback.callback(true);
            return;
        }
    }
    new SuperTypeMatcher(oracle).isThereAMatchingSuperType(factTypes, parameterType, callback);
}
Also used : ArrayList(java.util.ArrayList) SuperTypeMatcher(org.drools.workbench.screens.guided.rule.client.editor.util.SuperTypeMatcher)

Example 2 with SuperTypeMatcher

use of org.drools.workbench.screens.guided.rule.client.editor.util.SuperTypeMatcher in project drools-wb by kiegroup.

the class MethodParameterValueEditor method boundVariable.

private ListBox boundVariable() {
    BoundListBox boundListBox = new BoundListBox(modeller, methodParameter, new SuperTypeMatcher(oracle));
    boundListBox.addChangeHandler(new ChangeHandler() {

        public void onChange(ChangeEvent event) {
            ListBox w = (ListBox) event.getSource();
            setMethodParameterValue(w.getValue(w.getSelectedIndex()));
            refresh();
        }
    });
    return boundListBox;
}
Also used : ChangeEvent(com.google.gwt.event.dom.client.ChangeEvent) ValueChangeEvent(com.google.gwt.event.logical.shared.ValueChangeEvent) ValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler) ChangeHandler(com.google.gwt.event.dom.client.ChangeHandler) SuperTypeMatcher(org.drools.workbench.screens.guided.rule.client.editor.util.SuperTypeMatcher) ListBox(org.gwtbootstrap3.client.ui.ListBox)

Aggregations

SuperTypeMatcher (org.drools.workbench.screens.guided.rule.client.editor.util.SuperTypeMatcher)2 ChangeEvent (com.google.gwt.event.dom.client.ChangeEvent)1 ChangeHandler (com.google.gwt.event.dom.client.ChangeHandler)1 ValueChangeEvent (com.google.gwt.event.logical.shared.ValueChangeEvent)1 ValueChangeHandler (com.google.gwt.event.logical.shared.ValueChangeHandler)1 ArrayList (java.util.ArrayList)1 ListBox (org.gwtbootstrap3.client.ui.ListBox)1