1 package org
.argeo
.slc
.client
.ui
.dist
.commands
;
3 import javax
.jcr
.Repository
;
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
;
12 * Delete chosen workspace in the current repository.
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
20 public final static String DEFAULT_LABEL
= "Delete current workspace";
21 public final static String DEFAULT_ICON_PATH
= "icons/removeItem.gif";
23 /* DEPENDENCY INJECTION */
24 private Repository repository
;
26 public Object
execute(ExecutionEvent event
) throws ExecutionException
{
28 MessageDialog
.openWarning(DistPlugin
.getDefault()
29 .getWorkbench().getDisplay().getActiveShell(),
30 "WARNING", "Not yet implemented");
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 ?";
37 // boolean result = MessageDialog.openConfirm(DistPlugin.getDefault()
38 // .getWorkbench().getDisplay().getActiveShell(),
39 // "Confirm deletion", msg);
41 // Session session = null;
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);
51 // if (session != null)
58 /* DEPENDENCY INJECTION */
59 public void setRepository(Repository repository
) {
60 this.repository
= repository
;