示例#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();
 }