boolean validateSelectionOffsets() {
		int[] selectedRows = addressTableDialog.getSelectedRows();
		int shortestAddressTableRow = getIndexOfShortestAddressTable(selectedRows);
		Address addr = model.getAddress(selectedRows[shortestAddressTableRow]);
		int offset = addressTableDialog.getOffset();
		AddressTable addrTable = model.get(addr);
		int len = 0;
		if (addrTable != null) {
			len = addrTable.getTableElements().length;
		}

		if (offset >= 0 && offset < len) {
			return true; // offset is in range
		}

		// bad offset
		addressTableDialog.setEnableMakeTableButtons(false);
		String dialogText =
			"Invalid offset length - check table length, " + "must be >= 0 and < " + len;
		addressTableDialog.setDialogText(dialogText);
		addressTableDialog.setOffsetText("");
		offsetLen = 0;

		return false;
	}
@see ghidra.app.plugin.ProgramPlugin#selectionChanged(ProgramSelection)
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/disassembler/AutoTableDisassemblerPlugin.java