@Override
	public void checkState() {
		super.checkState();
		if (!isValid()) {
			return;
		}
		String portValue = portField.getStringValue();
		if (!portValue.isEmpty()) {
			try {
				int portNumber = Integer.parseInt(portValue);
				if (portNumber < 1024 || portNumber > 0xFFFF) {
					setErrorMessage("Port must be between 1024 and 65535.");
					setValid(false);
					return;
				}
			}
			catch (NumberFormatException e) {
				setErrorMessage("Port must be an integer.");
				setValid(false);
				return;
			}
		}
	}
This class represents a preference page that
is contributed to the Preferences dialog. By 
subclassing <samp>FieldEditorPreferencePage</samp>, we
can use the field support built into JFace that allows
us to create a page that is small and knows how to 
save, restore and apply itself.
<p>
This page is used to modify preferences only. They
are stored in the preference store that belongs to
the main plug-in class. That way, preferences can
be accessed directly via the preference store.
GhidraBuild/EclipsePlugins/GhidraDev/GhidraDevPlugin/src/main/java/ghidradev/ghidrascripteditor/preferences/GhidraScriptEditorPreferencePage.java