@Override
	public void actionPerformed(ActionContext context) {
		if (!isEnabledForContext(context)) {
			return;
		}
		int[] selectedComponentRows = model.getSelectedComponentRows();
		boolean hasComponentSelection = model.hasComponentSelection();
		boolean hasContiguousSelection = model.isContiguousComponentSelection();
		if (selectedComponentRows.length == 0) {
			return;
		}

		if (!hasComponentSelection || !hasContiguousSelection) {
			return;
		}

		Arrays.sort(selectedComponentRows);
		int numComponents = model.getNumComponents();
		int maxRow = selectedComponentRows[selectedComponentRows.length - 1];
		if (maxRow < numComponents) {
			createStructure();
		}

		Swing.runLater(() -> {
			provider.toFront();
			provider.requestFocus();
			provider.editorPanel.requestFocus();
			provider.editorPanel.table.requestFocus();
		});
	}
Action for use in the structure data type editor.
This action has help associated with it.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/compositeeditor/CreateInternalStructureAction.java