X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=plugins%2Forg.argeo.slc.client.ui.dist%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Fclient%2Fui%2Fdist%2Fcontrollers%2FDistTreeDoubleClickListener.java;h=c280a53e00f8b78d23d4032f2ba99e2dbbbfe999;hb=1e6cf7254fb9f150251594cf0383b3b1c5210517;hp=5136a9128afa4d6ba745e8575f31a03a841bf7e8;hpb=7ac8a536076af44569a23d9d67bb443cdc06018b;p=gpl%2Fargeo-slc.git diff --git a/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/controllers/DistTreeDoubleClickListener.java b/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/controllers/DistTreeDoubleClickListener.java index 5136a9128..c280a53e0 100644 --- a/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/controllers/DistTreeDoubleClickListener.java +++ b/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/controllers/DistTreeDoubleClickListener.java @@ -40,56 +40,36 @@ public class DistTreeDoubleClickListener implements IDoubleClickListener { treeViewer.refresh(obj); } } else if (obj instanceof WorkspaceElem) { - //WorkspaceElem wn = (WorkspaceElem) obj; - // if (!wn.isConnected()) { - // wn.login(); - // treeViewer.refresh(obj); - // } else { WorkspaceElem we = (WorkspaceElem) obj; - Node repoNode = null; - try { - RepoElem repoElem = we.getRepoElem(); - Map params = new HashMap(); + RepoElem repoElem = we.getRepoElem(); + Map params = new HashMap(); + params.put(OpenWorkspaceEditor.PARAM_REPO_NODE_PATH, + repoElem.getRepoNodePath()); + params.put(OpenWorkspaceEditor.PARAM_REPO_URI, repoElem.getUri()); + params.put(OpenWorkspaceEditor.PARAM_WORKSPACE_NAME, + we.getWorkspaceName()); + CommandUtils.callCommand(OpenWorkspaceEditor.ID, params); - repoNode = repoElem.getRepoNode(); - if (repoNode != null) - params.put(OpenWorkspaceEditor.PARAM_REPO_NODE_PATH, - repoNode.getPath()); - params.put(OpenWorkspaceEditor.PARAM_REPO_URI, - repoElem.getUri()); - params.put(OpenWorkspaceEditor.PARAM_WORKSPACE_NAME, - we.getWorkspaceName()); - CommandUtils.callCommand(OpenWorkspaceEditor.ID, params); - } catch (RepositoryException re) { - throw new SlcException("Cannot get path for node " + repoNode - + " while " + "setting parameters of command " - + "OpenWorkspaceEditor", re); - } - // } } else if (obj instanceof ModularDistVersionElem) { ModularDistVersionElem modDistElem = (ModularDistVersionElem) obj; WorkspaceElem wkspElem = modDistElem.getWorkspaceElem(); - Node repoNode = null; Node moduleNode = modDistElem.getModularDistVersionNode(); + RepoElem repoElem = wkspElem.getRepoElem(); + Map params = new HashMap(); + params.put(OpenModuleEditor.PARAM_REPO_NODE_PATH, + repoElem.getRepoNodePath()); + params.put(OpenModuleEditor.PARAM_REPO_URI, repoElem.getUri()); + params.put(OpenModuleEditor.PARAM_WORKSPACE_NAME, + wkspElem.getWorkspaceName()); try { - RepoElem repoElem = wkspElem.getRepoElem(); - Map params = new HashMap(); - repoNode = repoElem.getRepoNode(); - if (repoNode != null) - params.put(OpenModuleEditor.PARAM_REPO_NODE_PATH, - repoNode.getPath()); - params.put(OpenModuleEditor.PARAM_REPO_URI, repoElem.getUri()); - params.put(OpenModuleEditor.PARAM_WORKSPACE_NAME, - wkspElem.getWorkspaceName()); params.put(OpenModuleEditor.PARAM_MODULE_PATH, moduleNode.getPath()); - CommandUtils.callCommand(OpenModuleEditor.ID, params); } catch (RepositoryException re) { - throw new SlcException("Cannot get path for node " + repoNode - + " or " + moduleNode + throw new SlcException("Cannot get path for node " + moduleNode + " while setting parameters for " + "command OpenModuleEditor", re); } + CommandUtils.callCommand(OpenModuleEditor.ID, params); } } } \ No newline at end of file