@Nullable
	@SuppressWarnings("unchecked")
	public ContextMenu contextMenuOf(@Nonnull ContextSource source, @Nonnull PathNode<?> item) {
		Workspace workspace = item.getValueOfType(Workspace.class);
		WorkspaceResource resource = item.getValueOfType(WorkspaceResource.class);

		if (workspace == null) {
			logger.error("Path node missing workspace section: {}", item);
			return null;
		}
		if (resource == null) {
			logger.error("Path node missing resource section: {}", item);
			return null;
		}

		if (item instanceof ClassPathNode classPath) {
			ClassBundle<?> bundle = classPath.getValueOfType(ClassBundle.class);
			if (bundle == null) {
				logger.error("Class path node missing bundle section: {}", item);
				return null;
			}

			ClassInfo info = classPath.getValue();
			if (info.isJvmClass()) {
				return contextMenuService.getJvmClassInfoContextMenuProvider(source, workspace, resource,
						(JvmClassBundle) bundle, info.asJvmClass()).makeMenu();
			} else if (info.isAndroidClass()) {
				return contextMenuService.getAndroidClassInfoContextMenuProvider(source, workspace, resource,
						(AndroidClassBundle) bundle, info.asAndroidClass()).makeMenu();
			}
		} else if (item instanceof FilePathNode filePath) {
			FileBundle bundle = filePath.getValueOfType(FileBundle.class);
			if (bundle == null) {
				logger.error("File path node missing bundle section: {}", item);
				return null;
			}

			FileInfo info = filePath.getValue();
			return contextMenuService.getFileInfoContextMenuProvider(source, workspace, resource, bundle, info).makeMenu();
		} else if (item instanceof ClassMemberPathNode memberNode) {
			ClassBundle<?> bundle = memberNode.getValueOfType(ClassBundle.class);
			if (bundle == null) {
				logger.error("Member path node missing bundle section: {}", item);
				return null;
			}

			ClassInfo classInfo = memberNode.getValueOfType(ClassInfo.class);
			if (classInfo == null) {
				logger.error("Member path node missing class section: {}", item);
				return null;
			}

			ClassMember member = memberNode.getValue();
			return contextMenuService.getClassMemberContextMenuProvider(source, workspace, resource, bundle, classInfo, member).makeMenu();
		} else if (item instanceof DirectoryPathNode directoryPath) {
			Bundle<?> bundle = directoryPath.getValueOfType(Bundle.class);
			if (bundle == null) {
				logger.error("Directory/package path node missing bundle section: {}", item);
				return null;
			}

			if (bundle instanceof FileBundle fileBundle) {
				return contextMenuService.getDirectoryContextMenuProvider(source, workspace, resource, fileBundle, directoryPath.getValue()).makeMenu();
			} else if (bundle instanceof ClassBundle<?> classBundle) {
				return contextMenuService.getPackageContextMenuProvider(source, workspace, resource, classBundle, directoryPath.getValue()).makeMenu();
			}
		} else if (item instanceof InnerClassPathNode innerClassPath) {
			ClassBundle<? extends ClassInfo> bundle = innerClassPath.getValueOfType(ClassBundle.class);
			if (bundle == null) {
				logger.error("Inner class path node missing bundle section: {}", item);
				return null;
			}

			ClassInfo outerClass = innerClassPath.getValueOfType(ClassInfo.class);
			if (outerClass == null) {
				logger.error("Inner class path node missing outer class section: {}", item);
				return null;
			}

			InnerClassInfo innerClass = innerClassPath.getValue();
			return contextMenuService.getInnerClassInfoContextMenuProvider(source, workspace, resource,
					bundle, outerClass.asJvmClass(), innerClass).makeMenu();
		} else if (item instanceof AnnotationPathNode annotationPath) {
			ClassBundle<? extends ClassInfo> bundle = annotationPath.getValueOfType(ClassBundle.class);
			if (bundle == null) {
				logger.error("Annotation path node missing bundle section: {}", item);
				return null;
			}

			Annotated annotated = annotationPath.getValueOfType(Annotated.class);
			if (annotated == null) {
				logger.error("Annotation path node missing annotated element section: {}", item);
				return null;
			}

			AnnotationInfo annotation = annotationPath.getValue();
			return contextMenuService.getAnnotationContextMenuProvider(source, workspace, resource, bundle, annotated, annotation).makeMenu();
		} else if (item instanceof BundlePathNode bundlePath) {
			return contextMenuService.getBundleContextMenuProvider(source, workspace, resource, bundlePath.getValue()).makeMenu();
		} else if (item instanceof ResourcePathNode) {
			return contextMenuService.getResourceContextMenuProvider(source, workspace, resource).makeMenu();
		} else if (item instanceof AssemblerPathNode assemblerPath) {
			ClassBundle<?> bundle = assemblerPath.getValueOfType(ClassBundle.class);
			if (bundle == null) {
				logger.error("Assembler path node missing bundle section: {}", item);
				return null;
			}

			ClassInfo declaring = assemblerPath.getValueOfType(ClassInfo.class);
			if (declaring == null) {
				logger.error("Assembler path node missing declaring class section: {}", item);
				return null;
			}

			return contextMenuService.getAssemblerContextMenuProvider(source, workspace, resource, bundle, declaring, assemblerPath.getValue()).makeMenu();
		}

		// No menu
		return null;
	}
@param source
		Origin source of the cell, for context menu specialization.
@param item
		Item to create a context-menu for.

@return Context-menu for the item represented by the path.
recaf-ui/src/main/java/software/coley/recaf/services/cell/CellConfigurationService.java