/** * Gets the strict property. * * @return the value of strict property. */ public boolean isStrict() { return getAutoCompletion().isStrict(); }
@Override public void keyPressed(KeyEvent e) { _hitBackspace = false; if (KeyEvent.VK_ESCAPE != e.getKeyCode()) { setKeyTyped(true); } switch (e.getKeyCode()) { // determine if the pressed key is backspace (needed by the remove method) case KeyEvent.VK_BACK_SPACE: if (isStrict()) { _hitBackspace = true; _hitBackspaceOnSelection = getTextComponent().getSelectionStart() != getTextComponent().getSelectionEnd(); } break; // ignore delete key case KeyEvent.VK_DELETE: if (isStrict()) { _deletePressed = true; _saveText = getTextComponent().getText(); } break; } }
if (isStrict()) { getTextComponent().setText(_saveText); e.consume();