]> git.argeo.org Git - gpl/argeo-slc.git/blob - eclipse/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/commands/DeleteWorkspace.java
Improve slc client ui dist, fix bugs #109, 110, 111
[gpl/argeo-slc.git] / eclipse / plugins / org.argeo.slc.client.ui.dist / src / main / java / org / argeo / slc / client / ui / dist / commands / DeleteWorkspace.java
1 package org.argeo.slc.client.ui.dist.commands;
2
3 import javax.jcr.Repository;
4
5 import org.argeo.slc.client.ui.dist.DistPlugin;
6 import org.eclipse.core.commands.AbstractHandler;
7 import org.eclipse.core.commands.ExecutionEvent;
8 import org.eclipse.core.commands.ExecutionException;
9 import org.eclipse.jface.dialogs.MessageDialog;
10
11 /**
12 * Delete chosen workspace in the current repository.
13 */
14
15 public class DeleteWorkspace extends AbstractHandler {
16 // private static final Log log = LogFactory.getLog(DeleteWorkspace.class);
17 public final static String ID = DistPlugin.ID + ".deleteWorkspace";
18 public final static String PARAM_WORKSPACE_NAME = DistPlugin.ID
19 + ".workspaceName";
20 public final static String DEFAULT_LABEL = "Delete current workspace";
21 public final static String DEFAULT_ICON_PATH = "icons/removeItem.gif";
22
23 /* DEPENDENCY INJECTION */
24 private Repository repository;
25
26 public Object execute(ExecutionEvent event) throws ExecutionException {
27
28 MessageDialog.openWarning(DistPlugin.getDefault()
29 .getWorkbench().getDisplay().getActiveShell(),
30 "WARNING", "Not yet implemented");
31 return null;
32
33 // String workspaceName = event.getParameter(PARAM_WORKSPACE_NAME);
34 // String msg = "Your are about to definitively delete this workspace ["
35 // + workspaceName + "].\n Do you really want to proceed ?";
36
37 // boolean result = MessageDialog.openConfirm(DistPlugin.getDefault()
38 // .getWorkbench().getDisplay().getActiveShell(),
39 // "Confirm deletion", msg);
40 // if (result) {
41 // Session session = null;
42 // try {
43 // session = repository.login();
44 // session.getWorkspace().deleteWorkspace(workspaceName);
45 // CommandHelpers.callCommand(RefreshDistributionsView.ID);
46 // } catch (RepositoryException re) {
47 // throw new ArgeoException(
48 // "Unexpected error while deleting workspace ["
49 // + workspaceName + "].", re);
50 // } finally {
51 // if (session != null)
52 // session.logout();
53 // }
54 // }
55 // return null;
56 }
57
58 /* DEPENDENCY INJECTION */
59 public void setRepository(Repository repository) {
60 this.repository = repository;
61 }
62 }