@Override
	public boolean isEnabledForContext(ActionContext context) {
		DataTypeTreeNode node = getSelectedDataTypeTreeNode(context);
		if (node == null) {
			return false;
		}

		if (!(node instanceof DataTypeNode)) {
			return false;
		}
		return node.isModifiable();
	}
Replace the selected data type with the chosen data type
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/datamgr/actions/ReplaceDataTypeAction.java