Search in sources :

Example 6 with ActionInsertFactFieldsPattern

use of org.drools.workbench.models.guided.dtable.shared.model.ActionInsertFactFieldsPattern in project drools-wb by kiegroup.

the class ActionInsertFactFieldsPageViewImpl method btnRemoveFactTypesClick.

@UiHandler(value = "btnRemoveFactTypes")
public void btnRemoveFactTypesClick(final ClickEvent event) {
    for (ActionInsertFactFieldsPattern p : chosenPatternsSelections) {
        chosenPatterns.remove(p);
        presenter.removePattern(p);
    }
    chosenPatternsSelection = null;
    setChosenPatterns(chosenPatterns);
    setAvailableFields(new ArrayList<AvailableField>());
    setChosenFields(new ArrayList<ActionInsertFactCol52>());
    presenter.stateChanged();
    txtBinding.setText("");
    txtBinding.setEnabled(false);
    btnRemoveFactTypes.setEnabled(false);
    patternDefinition.setVisible(false);
}
Also used : ActionInsertFactCol52(org.drools.workbench.models.guided.dtable.shared.model.ActionInsertFactCol52) LimitedEntryActionInsertFactCol52(org.drools.workbench.models.guided.dtable.shared.model.LimitedEntryActionInsertFactCol52) ActionInsertFactFieldsPattern(org.drools.workbench.models.guided.dtable.shared.model.ActionInsertFactFieldsPattern) UiHandler(com.google.gwt.uibinder.client.UiHandler)

Example 7 with ActionInsertFactFieldsPattern

use of org.drools.workbench.models.guided.dtable.shared.model.ActionInsertFactFieldsPattern in project drools-wb by kiegroup.

the class ActionInsertFactFieldsPageViewImplTest method testPatternsSelectionModel.

@Test
public void testPatternsSelectionModel() throws Exception {
    verify(view.chosenPatternsContainer).add(chosenPatternsWidgetCaptor.capture());
    patternSelectionModel = (MultiSelectionModel<ActionInsertFactFieldsPattern>) chosenPatternsWidgetCaptor.getValue().getSelectionModel();
    pattern = new ActionInsertFactFieldsPattern();
    pattern.setFactType("Message");
    pattern.setBoundName("m");
    patternSelectionModel.setSelected(pattern, true);
    assertTrue(patternSelectionModel.isSelected(pattern));
    pattern.setInsertedLogically(true);
    assertTrue(patternSelectionModel.isSelected(pattern));
}
Also used : ActionInsertFactFieldsPattern(org.drools.workbench.models.guided.dtable.shared.model.ActionInsertFactFieldsPattern) Test(org.junit.Test)

Aggregations

ActionInsertFactFieldsPattern (org.drools.workbench.models.guided.dtable.shared.model.ActionInsertFactFieldsPattern)7 ActionInsertFactCol52 (org.drools.workbench.models.guided.dtable.shared.model.ActionInsertFactCol52)4 UiHandler (com.google.gwt.uibinder.client.UiHandler)2 ArrayList (java.util.ArrayList)2 MultiSelectionModel (com.google.gwt.view.client.MultiSelectionModel)1 SelectionChangeEvent (com.google.gwt.view.client.SelectionChangeEvent)1 IdentityHashMap (java.util.IdentityHashMap)1 List (java.util.List)1 Map (java.util.Map)1 BaseSingleFieldConstraint (org.drools.workbench.models.datamodel.rule.BaseSingleFieldConstraint)1 ActionCol52 (org.drools.workbench.models.guided.dtable.shared.model.ActionCol52)1 LimitedEntryActionInsertFactCol52 (org.drools.workbench.models.guided.dtable.shared.model.LimitedEntryActionInsertFactCol52)1 Label (org.gwtbootstrap3.client.ui.Label)1 Test (org.junit.Test)1