private int getLength() throws InvalidInputException {

			Long val = source.getValue();
			if (val == null) {
				throw new InvalidInputException();
			}
			int length = val.intValue();

			long blockSize = block.getSize();
			if (length <= 0 || length >= blockSize) {
				if (length != 0) {
					setStatusText("Length must be less than original block size (0x" +
						Long.toHexString(blockSize) + ")");
				}
				throw new InvalidInputException();
			}
			return length;
		}
Listener on the RegisterField inputs; update other fields when either
of these fields change.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/memory/SplitBlockDialog.java