Login | Register
My pages Projects Community openCollabNet

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

subclipse
Discussion topic

Back to topic list

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

Author cchab
Full name chabanois cédric
Date 2003-07-09 12:34:58 PDT
Message Author: cchab
Date: Wed Jul 9 14:34:57 2003
New Revision: 55

Added:
   trunk/subclipse/ui/s​rc/org/tigris/subver​sion/subclipse/ui/ac​tions/CopyRemoteReso​urceAction.java
   trunk/subclipse/ui/s​rc/org/tigris/subver​sion/subclipse/ui/ac​tions/PasteRemoteRes​ourceAction.java
Modified:
   trunk/subclipse/ui/p​lugin.properties
   trunk/subclipse/ui/plugin.xml
   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:
This now possible to copy and paste remote resources in Repositories view.
This allow to create branches and tags.

Modified: trunk/subclipse/ui/p​lugin.properties
====================​====================​====================​==================
--- trunk/subclipse/ui/p​lugin.properties (original)
+++ trunk/subclipse/ui/p​lugin.properties Wed Jul 9 14:34:57 2003
@@ -53,6 +53,9 @@
 ConvertNature.label=Convert Provider from Nature
 ConvertNature.tooltip=Converts a SVN project from using natures to using properties
 
+CopyRemoteAction.label=Copy
+CopyRemoteAction.tooltip=Copy a remote resource
+
 CopyRepositoryNameAc​tion.label=&Copy​ to Clipboard
 CopyRepositoryNameAc​tion.tooltip=Copy Repository Names to Clipboard
 
@@ -94,6 +97,9 @@
 
 OpenRemoteFileAction​.label=&Open
 OpenRemoteFileAction​.tooltip=Open Remote File
+
+PasteRemoteAction.label=Paste
+PasteRemoteAction.t​ooltip=Paste
 
 ShowHistoryAction.label=Show in Resource &History
 ShowHistoryAction.tooltip=Show in Resource History

Modified: trunk/subclipse/ui/plugin.xml
====================​====================​====================​==================
--- trunk/subclipse/ui/plugin.xml (original)
+++ trunk/subclipse/ui/plugin.xml Wed Jul 9 14:34:57 2003
@@ -97,6 +97,22 @@
                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>
+ <action
+ label="%CopyRemoteAction.label"
+ helpContextId="org.t​igris.subversion.sub​clipse.ui.copy_remot​e_resource_action_co​ntext"
+ tooltip="%CopyRemote​Action.tooltip"
+ icon="icons/full/cto​ol16/copy_edit.gif"
+ class="org.tigris.su​bversion.subclipse.u​i.actions.CopyRemote​ResourceAction"
+ id="org.tigris.subve​rsion.subclipse.ui.c​opyRemoteResource"​>
+ </action>
+ <action
+ label="%PasteRemoteA​ction.label"
+ helpContextId="org.t​igris.subversion.sub​clipse.ui.paste_remo​te_resource_action_c​ontext"
+ tooltip="%PasteRemot​eAction.tooltip"
+ icon="icons/full/cto​ol16/paste_edit.gif"​
+ class="org.tigris.su​bversion.subclipse.u​i.actions.PasteRemot​eResourceAction"
+ id="org.tigris.subve​rsion.subclipse.ui.p​asteRemoteResource"​>
          </action>
       </objectContribution>
 <!-- contribution for ISVNRemoteFile -->

Added: trunk/subclipse/ui/s​rc/org/tigris/subver​sion/subclipse/ui/ac​tions/CopyRemoteReso​urceAction.java
====================​====================​====================​==================
--- (empty file)
+++ trunk/subclipse/ui/s​rc/org/tigris/subver​sion/subclipse/ui/ac​tions/CopyRemoteReso​urceAction.java Wed Jul 9 14:34:57 2003
@@ -0,0 +1,48 @@
+/******************​********************​********************​********************​*
+ * 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.jface.ac​tion.IAction;
+import org.eclipse.swt.dnd.Clipboard;
+import org.eclipse.swt.dnd.Transfer;
+import org.eclipse.team.cor​e.TeamException;
+import org.tigris.subversio​n.subclipse.core.ISV​NRemoteResource;
+import org.tigris.subversio​n.subclipse.core.res​ources.RemoteResourc​eTransfer;
+
+/**
+ * Copy selected remote resources to clipboard
+ */
+public class CopyRemoteResourceAction 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 {
+ ISVNRemoteResource remoteResources[] = getSelectedRemoteResources();
+
+ Clipboard clipboard = new Clipboard(getShell()​.getDisplay());
+ clipboard.setContents(new Object[] { remoteResources[0] }, new Transfer[] { RemoteResourceTransf​er.getInstance() });
+
+ clipboard.dispose();
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.team.int​ernal.ui.actions.Tea​mAction#isEnabled()
+ */
+ protected boolean isEnabled() throws TeamException {
+ return getSelectedRemoteRes​ources().length == 1;
+ }
+
+}

Added: trunk/subclipse/ui/s​rc/org/tigris/subver​sion/subclipse/ui/ac​tions/PasteRemoteRes​ourceAction.java
====================​====================​====================​==================
--- (empty file)
+++ trunk/subclipse/ui/s​rc/org/tigris/subver​sion/subclipse/ui/ac​tions/PasteRemoteRes​ourceAction.java Wed Jul 9 14:34:57 2003
@@ -0,0 +1,76 @@
+/******************​********************​********************​********************​*
+ * 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.swt.dnd.Clipboard;
+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.SVN​ProviderPlugin;
+import org.tigris.subversio​n.subclipse.core.res​ources.RemoteResourc​eTransfer;
+import org.tigris.subversio​n.subclipse.ui.SVNUI​Plugin;
+import org.tigris.subversio​n.subclipse.ui.repos​itory.RepositoryMana​ger;
+
+/**
+ * Paste remote resources to selected directory
+ */
+public class PasteRemoteResourceAction 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[]{});
+
+ Clipboard clipboard = new Clipboard(getShell()​.getDisplay());
+ final ISVNRemoteResource resource = (ISVNRemoteResource)​clipboard.getContent​s(RemoteResourceTran​sfer.getInstance());​
+ clipboard.dispose();
+
+ ISVNRemoteResource selectedResource = getSelectedRemoteRes​ources()[0];
+ final ISVNRemoteFolder destination =
+ (selectedResource.isFolder()?
+ (ISVNRemoteFolder)se​lectedResource:selec​tedResource.getParen​t());
+
+ run(new IRunnableWithProgress() {
+ public void run(IProgressMonitor monitor) throws InterruptedException, InvocationTargetException {
+ try {
+ SVNProviderPlugin.ge​tPlugin().getReposit​oryResourcesManager(​).
+ copyRemoteResource(r​esource,destination,​message,monitor);
+ } 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 {
+ if (getSelectedRemoteRe​sources().length != 1)
+ return false;
+
+ boolean result;
+ Clipboard clipboard = new Clipboard(getShell()​.getDisplay());
+ result = clipboard.getContent​s(RemoteResourceTran​sfer.getInstance()) != null;
+ clipboard.dispose();
+ return result;
+ }
+
+}

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 9 14:34:57 2003
@@ -23,6 +23,7 @@
     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);
+ public void remoteResourceCreate​d(ISVNRemoteFolder parent,String resourceName);
+ public void remoteResourceCopied​(ISVNRemoteResource source,ISVNRemoteFolder destination);
 }
 

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 9 14:34:57 2003
@@ -111,6 +111,9 @@
         public void remoteResourceCreate​d(ISVNRemoteFolder parent,String resourceName) {
             refresh(false);
         }
+ public void remoteResourceCopied​(ISVNRemoteResource source,ISVNRemoteFolder destination) {
+ refresh(false);
+ }
         private void refresh(boolean refreshRepositoriesFolders) {
             final boolean finalRefreshReposFolders = refreshRepositoriesFolders;
             Display display = getViewer().getContr​ol().getDisplay();

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 9 14:34:57 2003
@@ -102,6 +102,17 @@
         }
     }
 
+ /**
+ * A resource has been copied
+ */
+ public void resourceCopied(ISVNR​emoteResource source, ISVNRemoteFolder destination) {
+ Iterator it = listeners.iterator();
+ while (it.hasNext()) {
+ IRepositoryListener listener = (IRepositoryListener)it.next();
+ listener.remoteResou​rceCopied(source, destination);
+ }
+ }
+
 
     /**
      * called when plugin is started
@@ -120,11 +131,12 @@
             public void remoteResourceDelete​d(ISVNRemoteResource​ resource) {
                 resourceDeleted(resource);
             }
-
             public void remoteResourceCreate​d(ISVNRemoteFolder parent, String resourceName) {
                 resourceCreated(parent, resourceName);
             }
-
+ public void remoteResourceCopied​(ISVNRemoteResource source, ISVNRemoteFolder destination) {
+ resourceCopied(source, destination);
+ }
         });
     }
     

--------------------​--------------------​--------------------​---------
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 55 - in trunk/subclipse/ui: . src/org/tigris/subversion/subclipse/ui/actions src/org/tigris/subversion/subclipse/ui/repository cchab chabanois cédric 2003-07-09 12:34:58 PDT
Messages per page: