예제 #1
0
  private void setNonCustomValue(String value, int times) {
    comboBox.view.listBoxGotFocus();
    comboBox.listBoxValueChanged(value);
    assertEquals(listBox.isVisible(), true);
    assertEquals(textBox.isVisible(), false);

    verify(modelPresenter, times(times)).setListBoxModelValue(listBox, value);
    assertEquals(comboBox.getValue(), value);
  }
예제 #2
0
  private void setCustomValue(String value) {
    comboBox.view.listBoxGotFocus();
    comboBox.listBoxValueChanged(this.customPrompt);
    assertEquals(listBox.isVisible(), false);
    assertEquals(textBox.isVisible(), true);

    comboBox.view.textBoxGotFocus();
    textBox.setValue(value);
    comboBox.view.textBoxLostFocus();
    comboBox.view.listBoxGotFocus();
    assertEquals(listBox.isVisible(), true);
    assertEquals(textBox.isVisible(), false);

    String listBoxValue = this.quoteStringValues ? StringUtils.createQuotedConstant(value) : value;
    verify(modelPresenter).setTextBoxModelValue(textBox, listBoxValue);
    assertEquals(comboBox.getValue(), listBoxValue);
  }
예제 #3
0
  private void aboutToEditCustomValue(String value, int times) {
    comboBox.view.listBoxGotFocus();
    comboBox.listBoxValueChanged(this.editPrefix + value + this.editSuffix);
    assertEquals(listBox.isVisible(), false);
    assertEquals(textBox.isVisible(), true);

    verify(modelPresenter, times(times)).setTextBoxModelValue(textBox, value);
    assertEquals(textBox.getValue(), value);
  }
예제 #4
0
  private void initComboBoxTest(
      boolean quoteStringValues,
      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, listBox, textBox, quoteStringValues, customPrompt, placeholder);
    comboBox.setListBoxValues(listBoxValues);
    comboBox.setShowCustomValues(true);

    this.quoteStringValues = quoteStringValues;
    this.editPrefix = editPrefix;
    this.editSuffix = editSuffix;
    this.customPrompt = customPrompt;
  }
예제 #5
0
 ListBoxValues getListBoxValues() {
   return comboBox.getListBoxValues();
 }