Search in sources :

Example 6 with ListBoxValues

use of org.kie.workbench.common.stunner.bpmn.client.forms.util.ListBoxValues in project kie-wb-common by kiegroup.

the class AssignmentListItemWidgetTest method testSetProcessVariablesConst.

@Test
public void testSetProcessVariablesConst() {
    ListBoxValues.ValueTester processVarTester = new ListBoxValues.ValueTester() {

        public String getNonCustomValueForUserString(String userValue) {
            return null;
        }
    };
    ListBoxValues processVarListBoxValues = new ListBoxValues(AssignmentListItemWidgetView.CONSTANT_PROMPT, StunnerFormsClientFieldsConstants.INSTANCE.Edit() + " ", processVarTester, ActivityDataIOEditorViewImpl.CONSTANT_MAX_DISPLAY_LENGTH);
    processVarComboBox.setAddCustomValues(true);
    processVarComboBox.setListBoxValues(processVarListBoxValues);
    String sConstant = "\"abcdeabcde12345\"";
    widget.setConstant(sConstant);
    widget.setProcessVariables(processVarListBoxValues);
    verify(processVarComboBox, times(1)).setListBoxValues(processVarListBoxValues);
    verify(processVarComboBox, times(2)).setListBoxValues(any(ListBoxValues.class));
    verify(processVarComboBox).addCustomValueToListBoxValues(sConstant, "");
    verify(processVar).setValue("\"abcdeabcde...\"");
}
Also used : Mockito.anyString(org.mockito.Mockito.anyString) ListBoxValues(org.kie.workbench.common.stunner.bpmn.client.forms.util.ListBoxValues) Test(org.junit.Test)

Example 7 with ListBoxValues

use of org.kie.workbench.common.stunner.bpmn.client.forms.util.ListBoxValues in project kie-wb-common by kiegroup.

the class AssignmentListItemWidgetTest method testSetDataTypes.

@Test
public void testSetDataTypes() {
    ListBoxValues dataTypeListBoxValues = new ListBoxValues(null, null, null);
    String sCustomType = "com.test.CustomType";
    widget.setCustomDataType(sCustomType);
    widget.setDataTypes(dataTypeListBoxValues);
    verify(dataTypeComboBox).setListBoxValues(dataTypeListBoxValues);
    verify(dataTypeComboBox).addCustomValueToListBoxValues(sCustomType, "");
}
Also used : Mockito.anyString(org.mockito.Mockito.anyString) ListBoxValues(org.kie.workbench.common.stunner.bpmn.client.forms.util.ListBoxValues) Test(org.junit.Test)

Example 8 with ListBoxValues

use of org.kie.workbench.common.stunner.bpmn.client.forms.util.ListBoxValues in project kie-wb-common by kiegroup.

the class ActivityDataIOEditorViewImpl method setInputAssignmentsProcessVariables.

@Override
public void setInputAssignmentsProcessVariables(final List<String> processVariables) {
    ListBoxValues processVarListBoxValues = new ListBoxValues(AssignmentListItemWidgetView.CONSTANT_PROMPT, StunnerFormsClientFieldsConstants.INSTANCE.Edit() + " ", presenter.processVarTester(), CONSTANT_MAX_DISPLAY_LENGTH);
    processVarListBoxValues.addValues(processVariables);
    inputAssignmentsWidget.setProcessVariables(processVarListBoxValues);
}
Also used : ListBoxValues(org.kie.workbench.common.stunner.bpmn.client.forms.util.ListBoxValues)

Example 9 with ListBoxValues

use of org.kie.workbench.common.stunner.bpmn.client.forms.util.ListBoxValues in project kie-wb-common by kiegroup.

the class ActivityDataIOEditorViewImpl method setPossibleOutputAssignmentsDataTypes.

@Override
public void setPossibleOutputAssignmentsDataTypes(final List<String> dataTypeDisplayNames) {
    ListBoxValues dataTypeListBoxValues = new ListBoxValues(AssignmentListItemWidgetView.CUSTOM_PROMPT, StunnerFormsClientFieldsConstants.INSTANCE.Edit() + " ", presenter.dataTypesTester());
    dataTypeListBoxValues.addValues(dataTypeDisplayNames);
    outputAssignmentsWidget.setDataTypes(dataTypeListBoxValues);
}
Also used : ListBoxValues(org.kie.workbench.common.stunner.bpmn.client.forms.util.ListBoxValues)

Example 10 with ListBoxValues

use of org.kie.workbench.common.stunner.bpmn.client.forms.util.ListBoxValues in project kie-wb-common by kiegroup.

the class AbstractComboBoxFieldRenderer method setComboBoxValues.

protected void setComboBoxValues(final List<String> values) {
    valueListBoxValues = new ListBoxValues(ComboBoxWidgetView.CUSTOM_PROMPT, "Edit" + " ", null);
    valueListBoxValues.addValues(values);
    view.setComboBoxValues(valueListBoxValues);
}
Also used : ListBoxValues(org.kie.workbench.common.stunner.bpmn.client.forms.util.ListBoxValues)

Aggregations

ListBoxValues (org.kie.workbench.common.stunner.bpmn.client.forms.util.ListBoxValues)15 Test (org.junit.Test)7 Mockito.anyString (org.mockito.Mockito.anyString)4