]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/commands/UnregisterRemoteRepo.java
git-svn-id: https://svn.argeo.org/slc/trunk@6893 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc
[gpl/argeo-slc.git] / plugins / org.argeo.slc.client.ui.dist / src / main / java / org / argeo / slc / client / ui / dist / commands / UnregisterRemoteRepo.java
index 882e2cdf56d07034473d958e87539825d0d544d2..1dab10f45ac0dcf67209d11b588f3b9c89bbe23c 100644 (file)
@@ -21,27 +21,30 @@ import javax.jcr.Repository;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 
+import org.argeo.eclipse.ui.utils.CommandUtils;
 import org.argeo.jcr.ArgeoTypes;
 import org.argeo.jcr.JcrUtils;
 import org.argeo.slc.SlcException;
 import org.argeo.slc.client.ui.dist.DistPlugin;
-import org.argeo.slc.client.ui.dist.utils.CommandHelpers;
 import org.eclipse.core.commands.AbstractHandler;
 import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
 import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.resource.ImageDescriptor;
 
 /**
  * Unregisters a remote repository by deleting the corresponding RepoNode from
- * the NodeRepository. It does not affect the repository instance
+ * the node Repository. It does not affect the repository instance
  */
-
 public class UnregisterRemoteRepo extends AbstractHandler {
        // private static final Log log = LogFactory
        // .getLog(UnregisterRemoteRepo.class);
+       
        public final static String ID = DistPlugin.ID + ".unregisterRemoteRepo";
-       public final static String DEFAULT_LABEL = "Unregister this repository";
-       public final static String DEFAULT_ICON_PATH = "icons/removeItem.gif";
+       public final static String DEFAULT_LABEL = "Unregister";
+       public final static ImageDescriptor DEFAULT_ICON = DistPlugin
+                       .getImageDescriptor("icons/removeItem.gif");
+
        public final static String PARAM_REPO_PATH = DistPlugin.ID
                        + ".repoNodePath";
 
@@ -72,13 +75,12 @@ public class UnregisterRemoteRepo extends AbstractHandler {
                                        rNode.remove();
                                        session.save();
                                }
-                               CommandHelpers.callCommand(RefreshDistributionsView.ID);
+                               CommandUtils.callCommand(RefreshDistributionsView.ID);
                        }
-
-                       // } catch (Exception e) {
                } catch (RepositoryException e) {
                        throw new SlcException(
-                                       "Unexpected error while deleting artifacts.", e);
+                                       "Unexpected error while unregistering remote repository.",
+                                       e);
                } finally {
                        JcrUtils.logoutQuietly(session);
                }