- IWorkbenchWindow iww = DistPlugin.getDefault().getWorkbench()
- .getActiveWorkbenchWindow();
- IWorkbenchPart view = iww.getActivePage().getActivePart();
- if (view instanceof DistributionsView) {
- DistributionViewSelectedElement dvse = ((DistributionsView) view)
- .getSelectedElement();
- if (dvse != null && (dvse.isRepository)) {
- InformationDialog inputDialog = new InformationDialog(
- iww.getShell());
- inputDialog.create();
- Session session = null;
- try {
- session = dvse.repository.login(dvse.credentials);
- inputDialog.loginTxt.setText(session.getUserID());
-
- inputDialog.nameTxt.setText(dvse.repoNode.getName());
- inputDialog.uriTxt.setText(JcrUtils.get(dvse.repoNode,
- ArgeoNames.ARGEO_URI));
- inputDialog.readOnlyBtn.setSelection(dvse.isReadOnly);
-
- } catch (RepositoryException e) {
- throw new SlcException("Unexpected error while "
- + "getting repository infos.", e);
- } finally {
- JcrUtils.logoutQuietly(session);
- }
- inputDialog.open();
+ IStructuredSelection iss = (IStructuredSelection) HandlerUtil
+ .getActiveSite(event).getSelectionProvider().getSelection();
+ if (iss.getFirstElement() instanceof RepoElem) {
+ RepoElem re = (RepoElem) iss.getFirstElement();
+
+ Session defaultSession = null;
+ try{
+ defaultSession = RepoUtils.getCorrespondingSession(repositoryFactory, keyring, re.getRepoNode(), re.getUri(), null);
+
+
+ InformationDialog inputDialog = new InformationDialog(HandlerUtil
+ .getActiveSite(event).getShell());
+ inputDialog.create();
+ inputDialog.loginTxt.setText(defaultSession.getUserID());
+ inputDialog.nameTxt.setText(re.getLabel());
+ inputDialog.uriTxt.setText(re.getUri());
+ inputDialog.readOnlyBtn.setSelection(re.isReadOnly());
+
+ inputDialog.open();
+ // } catch (RepositoryException e) {
+ // throw new SlcException("Unexpected error while "
+ // + "getting repository information.", e);
+ } finally {
+ JcrUtils.logoutQuietly(defaultSession);