+ IWorkbenchPart view = iww.getActivePage().getActivePart();
+ if (view instanceof DistributionsView) {
+ DistributionViewSelectedElement dvse = ((DistributionsView) view)
+ .getSelectedElement();
+ if (dvse != null && (dvse.isRepository || dvse.isWorkspaceGroup)) {
+ repository = dvse.repository;
+ credentials = dvse.credentials;
+ prefix = dvse.wkspPrefix;
+ }
+ }
+
+ if (repository != null) {
+ // TODO : add an input validator
+ InputDialog inputDialog = new InputDialog(iww.getShell(),
+ "Workspace name?",
+ "Choose a name for the workspace to create", prefix + "-",
+ null);
+ int result = inputDialog.open();
+
+ String workspaceName = inputDialog.getValue();
+
+ // Canceled by user
+ if (result == Dialog.CANCEL || workspaceName == null
+ || "".equals(workspaceName.trim()))
+ return null;