public void createWorkspaceRoot(@Nullable Workspace workspace) {
		Workspace oldWorkspace = this.workspace;
		if (oldWorkspace != null && root != null) {
			// Remove listeners on old workspace
			oldWorkspace.removeWorkspaceModificationListener(root);
			for (WorkspaceResource resource : oldWorkspace.getAllResources(false))
				resource.removeListener(root);
		}

		// Update workspace reference & populate root.
		this.workspace = workspace;
		if (workspace == null) {
			root = null;
		} else {
			// Create root
			WorkspacePathNode rootPath = PathNodes.workspacePath(workspace);
			root = new WorkspaceRootTreeNode(explorerConfig, rootPath);
			root.build();
			root.addWorkspaceListeners();
		}
		FxThreadUtil.run(() -> setRoot(root));
	}
Sets the workspace, and creates a complete model for it.

@param workspace
		Workspace to represent.
recaf-ui/src/main/java/software/coley/recaf/ui/control/tree/WorkspaceTree.java