private boolean applyChanges() {

		setStatusMessage("");
		TableCellEditor editor = editorPanel.getTable().getCellEditor();
		if (editor != null) {
			editor.stopCellEditing();
		}

		Enum editedEnum = editorPanel.getEnum();
		if (editedEnum.getCount() == 0) {
			setStatusMessage("Empty enum is not allowed");
			return false;
		}

		boolean originalDtExists = dataTypeManager.contains(originalEnum);
		boolean renamed = false;
		if (originalDtExists) {
			String editorName = editorPanel.getEnumName().trim();
			renamed = !originalEnumName.equals(editorName);
		}
		String action = originalDtExists ? "Edit" : "Create";
		if (renamed) {
			action += "/Rename";
		}
		int txID = dataTypeManager.startTransaction(action + " Enum " + editedEnum.getName());
		try {

			boolean userSaved = resolveEquateConflicts(editedEnum);
			if (!userSaved) {
				return false;
			}

			Enum newEnuum = (Enum) dataTypeManager.resolve(originalEnum, null);

			applyName(newEnuum);
			applyDescription(newEnuum);
			newEnuum.replaceWith(editedEnum);

			originalEnum = newEnuum;
			originalEnumID = dataTypeManager.getID(newEnuum);
			editorPanel.setEnum((EnumDataType) newEnuum.copy(dataTypeManager));
			applyAction.setEnabled(hasChanges());
		}
		finally {
			dataTypeManager.endTransaction(txID, true);
		}
		return true;
	}
Construct a new enum editor provider.
@param plugin owner of this provider
@param enumDT enum data type
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/datamgr/editor/EnumEditorProvider.java