@Override
		public void remove(int offs, int len) throws BadLocationException {

			String currentText = getText(0, getLength());
			String beforeOffset = currentText.substring(0, offs);
			String afterOffset = currentText.substring(len + offs, currentText.length());
			String proposedResult = beforeOffset + afterOffset;
			int alignment = getValue(proposedResult);
			if (alignment > 0) {
				super.remove(offs, len);
				model.setAlignment(alignment);
			}
		}
Called before new user input is inserted into the entry text field.  The super
method is called if the input is accepted.
Ghidra/Features/Base/src/main/java/ghidra/features/base/memsearch/gui/MemorySearchOptionsPanel.java