@Nonnull
	public TextProvider getResourceTextProvider(@Nonnull Workspace workspace,
												@Nonnull WorkspaceResource resource) {
		return () -> {
			if (resource instanceof WorkspaceFileResource fileResource) {
				String name = fileResource.getFileInfo().getName();
				return name.substring(name.lastIndexOf('/') + 1);
			} else if (resource instanceof WorkspaceDirectoryResource directoryResource) {
				return StringUtil.pathToNameString(directoryResource.getDirectoryPath());
			} else if (resource instanceof WorkspaceRemoteVmResource remoteVmResource) {
				return remoteVmResource.getVirtualMachine().id();
			} else if (resource instanceof GeneratedPhantomWorkspaceResource) {
				return Lang.get("tree.phantoms");
			}
			return resource.getClass().getSimpleName();
		};
	}
@param workspace
		Containing workspace.
@param resource
		The resource to create text for.

@return Text provider for the resource.
recaf-ui/src/main/java/software/coley/recaf/services/cell/text/TextProviderService.java