/** * Clears text in the editable combobox using left-arrow and delete keys. If combobox has no * focus, does simple mouse click on it first. * * @throws TimeoutExpiredException */ public void clearText() { makeComponentVisible(); JTextFieldOperator tfo = getTextField(); tfo.copyEnvironment(this); tfo.setVisualizer(new EmptyVisualizer()); tfo.clearText(); }
/** * Requests a focus, clears text, types new one and pushes Enter. * * @param text New text value. Shouln't include final '\n'. * @throws TimeoutExpiredException */ public void enterText(String text) { makeComponentVisible(); JTextFieldOperator tfo = getTextField(); tfo.copyEnvironment(this); tfo.setVisualizer(new EmptyVisualizer()); tfo.enterText(text); }
/** * Creates an operator for button returned by {@code findJTextField()} method. * * @return new JTextField instance. */ public JTextFieldOperator getTextField() { if (((JComboBox) getSource()).isEditable()) { text = new JTextFieldOperator(findJTextField()); text.copyEnvironment(this); text.setOutput(getOutput().createErrorOutput()); } return text; }