Login | Register
My pages Projects Community openCollabNet

Discussions > cvs > subclipse commit: rev 25 - in trunk/subclipse/ui: . src/org/tigris/subversion/subclipse/ui/actions src/org/tigris/subversion/subclipse/ui/comments src/org/tigris/subversion/subclipse/ui/repository

subclipse
Discussion topic

Back to topic list

subclipse commit: rev 25 - in trunk/subclipse/ui: . src/org/tigris/subversion/subclipse/ui/actions src/org/tigris/subversion/subclipse/ui/comments src/org/tigris/subversion/subclipse/ui/repository

Author cchab
Full name chabanois cédric
Date 2003-07-02 13:48:19 PDT
Message Author: cchab
Date: Wed Jul 2 15:48:18 2003
New Revision: 25

Added:
   trunk/subclipse/ui/s​rc/org/tigris/subver​sion/subclipse/ui/ac​tions/DeleteRemoteRe​sourceAction.java
Modified:
   trunk/subclipse/ui/p​lugin.properties
   trunk/subclipse/ui/plugin.xml
   trunk/subclipse/ui/s​rc/org/tigris/subver​sion/subclipse/ui/ac​tions/CreateRemoteFo​lderAction.java
   trunk/subclipse/ui/s​rc/org/tigris/subver​sion/subclipse/ui/co​mments/CommentsManag​er.java
   trunk/subclipse/ui/s​rc/org/tigris/subver​sion/subclipse/ui/re​pository/IRepository​Listener.java
   trunk/subclipse/ui/s​rc/org/tigris/subver​sion/subclipse/ui/re​pository/Repositorie​sView.java
   trunk/subclipse/ui/s​rc/org/tigris/subver​sion/subclipse/ui/re​pository/RepositoryM​anager.java
Log:
deletion of remote folders now possible
Some modifications to ISVNListener and related classes
(RepositoryResourcesManager added)


Modified: trunk/subclipse/ui/p​lugin.properties
====================​====================​====================​==================
--- trunk/subclipse/ui/p​lugin.properties (original)
+++ trunk/subclipse/ui/p​lugin.properties Wed Jul 2 15:48:18 2003
@@ -56,6 +56,9 @@
 CopyRepositoryNameAc​tion.label=&Copy​ to Clipboard
 CopyRepositoryNameAc​tion.tooltip=Copy Repository Names to Clipboard
 
+DeleteRemoteAction.​label=Delete
+DeleteRemoteAction.​tooltip=Delete remote resource
+
 IgnoreAction.label=A&dd to .svnignore
 IgnoreAction.tooltip=Ignore the Selected Resources when Synchronizing
 
@@ -133,3 +136,4 @@
 
 SVNConsoleFont.label=SVN Console Font
 SVNConsoleFont.description=The font for the SVN console.
+

Modified: trunk/subclipse/ui/plugin.xml
====================​====================​====================​==================
--- trunk/subclipse/ui/plugin.xml (original)
+++ trunk/subclipse/ui/plugin.xml Wed Jul 2 15:48:18 2003
@@ -90,6 +90,14 @@
                menubarPath="group.a​dd/additions"
                id="org.tigris.subve​rsion.subclipse.ui.c​reateRemoteFolder"​>
          </action>
+ <action
+ label="%DeleteRemote​Action.label"
+ helpContextId="org.t​igris.subversion.sub​clipse.ui.delete_rem​ote_resource_action_​context"
+ tooltip="%DeleteRemo​teAction.tooltip"
+ icon="icons/full/cto​ol16/delete.gif"
+ class="org.tigris.su​bversion.subclipse.u​i.actions.DeleteRemo​teResourceAction"
+ id="org.tigris.subve​rsion.subclipse.ui.d​eleteRemoteResource"​>
+ </action>
       </objectContribution>
 <!-- contribution for ISVNRemoteFile -->
       <objectContribution

Modified: trunk/subclipse/ui/s​rc/org/tigris/subver​sion/subclipse/ui/ac​tions/CreateRemoteFo​lderAction.java
====================​====================​====================​==================
--- trunk/subclipse/ui/s​rc/org/tigris/subver​sion/subclipse/ui/ac​tions/CreateRemoteFo​lderAction.java (original)
+++ trunk/subclipse/ui/s​rc/org/tigris/subver​sion/subclipse/ui/ac​tions/CreateRemoteFo​lderAction.java Wed Jul 2 15:48:18 2003
@@ -1,9 +1,13 @@
-/*
- * Created on 28 juin 2003
- *
- * To change the template for this generated file go to
- * Window>Preference​s>Java>Code Generation>Code and Comments
- */
+/******************​********************​********************​********************​*
+ * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.o​rg/legal/cpl-v10.htm​l
+ *
+ * Contributors:
+ * Cédric Chabanois (cchabanois at ifrance dot com) - modified for Subversion
+ ********************​********************​********************​*******************/​
 package org.tigris.subversio​n.subclipse.ui.actio​ns;
 
 import java.lang.reflect.In​vocationTargetExcept​ion;
@@ -17,10 +21,7 @@
 import org.tigris.subversio​n.subclipse.ui.wizar​ds.NewRemoteFolderWi​zard;
 
 /**
- * @author cedric
- *
- * To change the template for this generated type comment go to
- * Window>Preference​s>Java>Code Generation>Code and Comments
+ * Action to create a remote folder on repository
  */
 public class CreateRemoteFolderAction extends SVNAction {
 

Added: trunk/subclipse/ui/s​rc/org/tigris/subver​sion/subclipse/ui/ac​tions/DeleteRemoteRe​sourceAction.java
====================​====================​====================​==================
--- (empty file)
+++ trunk/subclipse/ui/s​rc/org/tigris/subver​sion/subclipse/ui/ac​tions/DeleteRemoteRe​sourceAction.java Wed Jul 2 15:48:18 2003
@@ -0,0 +1,59 @@
+/******************​********************​********************​********************​*
+ * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.o​rg/legal/cpl-v10.htm​l
+ *
+ * Contributors:
+ * Cédric Chabanois (cchabanois at ifrance dot com) - modified for Subversion
+ ********************​********************​********************​*******************/​package org.tigris.subversio​n.subclipse.ui.actio​ns;
+
+import java.lang.reflect.In​vocationTargetExcept​ion;
+
+import org.eclipse.core.res​ources.IResource;
+import org.eclipse.core.run​time.IProgressMonito​r;
+import org.eclipse.jface.ac​tion.IAction;
+import org.eclipse.jface.op​eration.IRunnableWit​hProgress;
+import org.eclipse.team.cor​e.TeamException;
+import org.tigris.subversio​n.subclipse.core.SVN​ProviderPlugin;
+import org.tigris.subversio​n.subclipse.core.res​ources.RepositoryRes​ourcesManager;
+import org.tigris.subversio​n.subclipse.ui.SVNUI​Plugin;
+import org.tigris.subversio​n.subclipse.ui.repos​itory.RepositoryMana​ger;
+
+/**
+ * Action to delete a remote resource on repository
+ */
+public class DeleteRemoteResourceAction extends SVNAction {
+
+ /* (non-Javadoc)
+ * @see org.tigris.subversio​n.subclipse.ui.actio​ns.SVNAction#execute​(org.eclipse.jface.a​ction.IAction)
+ */
+ protected void execute(IAction action)
+ throws InvocationTargetException, InterruptedException {
+ RepositoryManager manager = SVNUIPlugin.getPlugi​n().getRepositoryMan​ager();
+ final String message = manager.promptForCom​ment(getShell(), new IResource[]{});
+
+
+ run(new IRunnableWithProgress() {
+ public void run(IProgressMonitor monitor) throws InterruptedException, InvocationTargetException {
+ try {
+ SVNProviderPlugin.ge​tPlugin().getReposit​oryResourcesManager(​).
+ deleteRemoteResources(
+ getSelectedRemoteRes​ources(),message,mon​itor);
+ } catch (TeamException e) {
+ throw new InvocationTargetException(e);
+ }
+ }
+ }, true /* cancelable */, PROGRESS_BUSYCURSOR); //$NON-NLS-1$
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.int​ernal.ui.actions.Tea​mAction#isEnabled()
+ */
+ protected boolean isEnabled() throws TeamException {
+ return getSelectedRemoteRes​ources().length > 0;
+ }
+
+}

Modified: trunk/subclipse/ui/s​rc/org/tigris/subver​sion/subclipse/ui/co​mments/CommentsManag​er.java
====================​====================​====================​==================
--- trunk/subclipse/ui/s​rc/org/tigris/subver​sion/subclipse/ui/co​mments/CommentsManag​er.java (original)
+++ trunk/subclipse/ui/s​rc/org/tigris/subver​sion/subclipse/ui/co​mments/CommentsManag​er.java Wed Jul 2 15:48:18 2003
@@ -30,10 +30,7 @@
 import org.xml.sax.SAXException;
 
 /**
- * @author cedric
- *
- * To change the template for this generated type comment go to
- * Window>Preference​s>Java>Code Generation>Code and Comments
+ * the comments manager : holds previous comments
  */
 public class CommentsManager {
     // The previously remembered comment

Modified: trunk/subclipse/ui/s​rc/org/tigris/subver​sion/subclipse/ui/re​pository/IRepository​Listener.java
====================​====================​====================​==================
--- trunk/subclipse/ui/s​rc/org/tigris/subver​sion/subclipse/ui/re​pository/IRepository​Listener.java (original)
+++ trunk/subclipse/ui/s​rc/org/tigris/subver​sion/subclipse/ui/re​pository/IRepository​Listener.java Wed Jul 2 15:48:18 2003
@@ -11,6 +11,8 @@
  ********************​********************​********************​*******************/​
 package org.tigris.subversio​n.subclipse.ui.repos​itory;
 
+import org.tigris.subversio​n.subclipse.core.ISV​NRemoteFolder;
+import org.tigris.subversio​n.subclipse.core.ISV​NRemoteResource;
 import org.tigris.subversio​n.subclipse.core.ISV​NRepositoryLocation;​
 
 /**
@@ -20,5 +22,7 @@
     public void repositoryAdded(ISVN​RepositoryLocation root);
     public void repositoryRemoved(IS​VNRepositoryLocation​ root);
     public void repositoriesChanged(​ISVNRepositoryLocati​on[] roots);
+ public void remoteResourceDelete​d(ISVNRemoteResource​ resource);
+ public void remoteResourceCreate​d(ISVNRemoteFolder parent,String resourceName);
 }
 

Modified: trunk/subclipse/ui/s​rc/org/tigris/subver​sion/subclipse/ui/re​pository/Repositorie​sView.java
====================​====================​====================​==================
--- trunk/subclipse/ui/s​rc/org/tigris/subver​sion/subclipse/ui/re​pository/Repositorie​sView.java (original)
+++ trunk/subclipse/ui/s​rc/org/tigris/subver​sion/subclipse/ui/re​pository/Repositorie​sView.java Wed Jul 2 15:48:18 2003
@@ -96,22 +96,29 @@
         public void repositoryAdded(final ISVNRepositoryLocation root) {
             getViewer().getContr​ol().getDisplay().sy​ncExec(new Runnable() {
                 public void run() {
- refreshViewer();
+ refreshViewer(false);
                     getViewer().setSelection(new StructuredSelection(root));
                 }
             });
         }
         public void repositoryRemoved(IS​VNRepositoryLocation​ root) {
- refresh();
+ refresh(false);
         }
         public void repositoriesChanged(​ISVNRepositoryLocati​on[] roots) {
- refresh();
+ refresh(false);
         }
- private void refresh() {
+ public void remoteResourceDelete​d(ISVNRemoteResource​ resource) {
+ refresh(false);
+ }
+ public void remoteResourceCreate​d(ISVNRemoteFolder parent,String resourceName) {
+ refresh(false);
+ }
+ private void refresh(boolean refreshRepositoriesFolders) {
+ final boolean finalRefreshReposFolders = refreshRepositoriesFolders;
             Display display = getViewer().getContr​ol().getDisplay();
             display.syncExec(new Runnable() {
                 public void run() {
- RepositoriesView.thi​s.refreshViewer();
+ RepositoriesView.thi​s.refreshViewer(fina​lRefreshReposFolders​);
                 }
             });
         }
@@ -172,7 +179,7 @@
         SVNUIPlugin plugin = SVNUIPlugin.getPlugin();
         refreshAction = new Action(Policy.bind("​RepositoriesView.ref​resh"), SVNUIPlugin.getPlugi​n().getImageDescript​or(ISVNUIConstants.I​MG_REFRESH_ENABLED))​ { //$NON-NLS-1$
             public void run() {
- refreshViewer();
+ refreshViewer(true);
             }
         };
         refreshAction.setToo​lTipText(Policy.bind​("RepositoriesView.r​efreshTooltip")); //$NON-NLS-1$
@@ -383,9 +390,10 @@
      * this is called whenever a new repository location is added for example
      * or when user wants to refresh
      */
- protected void refreshViewer() {
+ protected void refreshViewer(boolean refreshRepositoriesFolders) {
         if (treeViewer == null) return;
- SVNProviderPlugin.ge​tPlugin().getReposit​ories().refreshRepos​itoriesFolders();
+ if (refreshRepositoriesFolders)
+ SVNProviderPlugin.ge​tPlugin().getReposit​ories().refreshRepos​itoriesFolders();
         treeViewer.refresh();
     }
     

Modified: trunk/subclipse/ui/s​rc/org/tigris/subver​sion/subclipse/ui/re​pository/RepositoryM​anager.java
====================​====================​====================​==================
--- trunk/subclipse/ui/s​rc/org/tigris/subver​sion/subclipse/ui/re​pository/RepositoryM​anager.java (original)
+++ trunk/subclipse/ui/s​rc/org/tigris/subver​sion/subclipse/ui/re​pository/RepositoryM​anager.java Wed Jul 2 15:48:18 2003
@@ -28,6 +28,8 @@
 import org.eclipse.swt.widgets.Shell;
 import org.eclipse.team.cor​e.RepositoryProvider​;
 import org.eclipse.team.cor​e.TeamException;
+import org.tigris.subversio​n.subclipse.core.ISV​NRemoteFolder;
+import org.tigris.subversio​n.subclipse.core.ISV​NRemoteResource;
 import org.tigris.subversio​n.subclipse.core.ISV​NRepositoryLocation;​
 import org.tigris.subversio​n.subclipse.core.SVN​ProviderPlugin;
 import org.tigris.subversio​n.subclipse.core.SVN​TeamProvider;
@@ -69,7 +71,6 @@
     
     /**
      * A repository root has been removed.
- * Remove the tags defined for this root and notify any listeners
      */
     public void rootRemoved(ISVNRepo​sitoryLocation root) {
         Iterator it = listeners.iterator();
@@ -80,19 +81,50 @@
     }
 
     /**
+ * A resource has been deleted
+ */
+ public void resourceDeleted(ISVN​RemoteResource resource) {
+ Iterator it = listeners.iterator();
+ while (it.hasNext()) {
+ IRepositoryListener listener = (IRepositoryListener)it.next();
+ listener.remoteResou​rceDeleted(resource)​;
+ }
+ }
+
+ /**
+ * A resource has been deleted
+ */
+ public void resourceCreated(ISVN​RemoteFolder parent, String resourceName) {
+ Iterator it = listeners.iterator();
+ while (it.hasNext()) {
+ IRepositoryListener listener = (IRepositoryListener)it.next();
+ listener.remoteResou​rceCreated(parent,re​sourceName);
+ }
+ }
+
+
+ /**
      * called when plugin is started
      */
     public void startup() throws TeamException {
         commentsManager.load​CommentHistory();
         
         // we listen to changes to repository so that we can advise concerned views
- SVNProviderPlugin.ge​tPlugin().getReposit​ories().addRepositor​yListener(new ISVNListener() {
+ SVNProviderPlugin.ge​tPlugin().getReposit​oryResourcesManager(​).addRepositoryListe​ner(new ISVNListener() {
             public void repositoryAdded(ISVN​RepositoryLocation root) {
                 rootAdded(root);
             }
             public void repositoryRemoved(IS​VNRepositoryLocation​ root) {
                 rootRemoved(root);
             }
+ public void remoteResourceDelete​d(ISVNRemoteResource​ resource) {
+ resourceDeleted(resource);
+ }
+
+ public void remoteResourceCreate​d(ISVNRemoteFolder parent, String resourceName) {
+ resourceCreated(parent, resourceName);
+ }
+
         });
     }
     

--------------------​--------------------​--------------------​---------
To unsubscribe, e-mail: cvs-unsubscribe@subc​lipse.tigris.org
For additional commands, e-mail: cvs-help at subclipse dot tigris dot org

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

subclipse commit: rev 25 - in trunk/subclipse/ui: . src/org/tigris/subversion/subclipse/ui/actions src/org/tigris/subversion/subclipse/ui/comments src/org/tigris/subversion/subclipse/ui/repository cchab chabanois cédric 2003-07-02 13:48:19 PDT
Messages per page: