Search in sources :

Example 11 with ListBoxValues

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

the class VariablesEditorFieldRenderer method setDataTypes.

@Override
public void setDataTypes(final List<String> dataTypes, final List<String> dataTypeDisplayNames) {
    this.dataTypes = dataTypes;
    this.dataTypeDisplayNames = dataTypeDisplayNames;
    this.mapDataTypeNamesToDisplayNames = createMapDataTypeNamesToDisplayNames(dataTypes, dataTypeDisplayNames);
    this.mapDataTypeDisplayNamesToNames = createMapDataTypeDisplayNamesToNames(dataTypes, dataTypeDisplayNames);
    dataTypeListBoxValues = new ListBoxValues(VariableListItemWidgetView.CUSTOM_PROMPT, "Edit" + " ", dataTypesTester());
    dataTypeListBoxValues.addValues(dataTypeDisplayNames);
    view.setVariablesDataTypes(dataTypeListBoxValues);
}
Also used : ListBoxValues(org.kie.workbench.common.stunner.bpmn.client.forms.util.ListBoxValues)

Example 12 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 testSetProcessVariablesVar.

@Test
public void testSetProcessVariablesVar() {
    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.setListBoxValues(processVarListBoxValues);
    String sConstant = "sVariableWithALongName";
    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(sConstant);
}
Also used : Mockito.anyString(org.mockito.Mockito.anyString) ListBoxValues(org.kie.workbench.common.stunner.bpmn.client.forms.util.ListBoxValues) Test(org.junit.Test)

Example 13 with ListBoxValues

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

the class ComboBoxWidgetViewImplTest method testSetComboBoxValues.

@Test
public void testSetComboBoxValues() {
    ListBoxValues listBoxValues = new ListBoxValues(null, null, null);
    view.setComboBoxValues(listBoxValues);
    verify(valueComboBox, times(1)).setCurrentTextValue("");
    verify(valueComboBox, times(1)).setListBoxValues(listBoxValues);
    verify(valueComboBox, times(1)).setShowCustomValues(true);
}
Also used : ListBoxValues(org.kie.workbench.common.stunner.bpmn.client.forms.util.ListBoxValues) Test(org.junit.Test)

Example 14 with ListBoxValues

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

the class VariableListItemWidgetTest 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 15 with ListBoxValues

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

the class ComboBoxAllTest method initComboBoxTest.

private void initComboBoxTest(boolean notifyModelChanges, boolean quoteStringValues, boolean addCustomValues, String customPrompt, String placeholder, String editPrefix, String editSuffix, List<String> listBoxStartValues) {
    initPresenter();
    initListBox();
    initTextBox();
    ListBoxValues listBoxValues = new ListBoxValues(customPrompt, editPrefix, null);
    listBoxValues.addValues(listBoxStartValues);
    comboBox.view = view;
    comboBox.init(modelPresenter, notifyModelChanges, listBox, textBox, quoteStringValues, addCustomValues, customPrompt, placeholder);
    comboBox.setListBoxValues(listBoxValues);
    comboBox.setShowCustomValues(true);
    this.quoteStringValues = quoteStringValues;
    this.editPrefix = editPrefix;
    this.editSuffix = editSuffix;
    this.customPrompt = customPrompt;
}
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