X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=plugins%2Forg.argeo.slc.client.ui.dist%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Fclient%2Fui%2Fdist%2Fcommands%2FUnregisterRemoteRepo.java;h=1dab10f45ac0dcf67209d11b588f3b9c89bbe23c;hb=abc9e68ee9afc994feb923b40388aca83bdb050f;hp=882e2cdf56d07034473d958e87539825d0d544d2;hpb=60fc68b90de1f65a0d64fe385033e1a9e6de5eef;p=gpl%2Fargeo-slc.git diff --git a/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/commands/UnregisterRemoteRepo.java b/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/commands/UnregisterRemoteRepo.java index 882e2cdf5..1dab10f45 100644 --- a/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/commands/UnregisterRemoteRepo.java +++ b/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/commands/UnregisterRemoteRepo.java @@ -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); }