Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 75263 Details for
Bug 198007
Moving multiple folders allows moving to themselves
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Go through all files to be moved when checking if valid
patch.txt (text/plain), 4.10 KB, created by
Kevin Doyle
on 2007-08-02 16:07:21 EDT
(
hide
)
Description:
Go through all files to be moved when checking if valid
Filename:
MIME Type:
Creator:
Kevin Doyle
Created:
2007-08-02 16:07:21 EDT
Size:
4.10 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.rse.files.ui >Index: src/org/eclipse/rse/internal/files/ui/actions/SystemMoveRemoteFileAction.java >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/internal/files/ui/actions/SystemMoveRemoteFileAction.java,v >retrieving revision 1.6 >diff -u -r1.6 SystemMoveRemoteFileAction.java >--- src/org/eclipse/rse/internal/files/ui/actions/SystemMoveRemoteFileAction.java 1 Jun 2007 11:40:31 -0000 1.6 >+++ src/org/eclipse/rse/internal/files/ui/actions/SystemMoveRemoteFileAction.java 2 Aug 2007 20:05:44 -0000 >@@ -14,6 +14,7 @@ > * Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core > * Martin Oberhuber (Wind River) - [186128][refactoring] Move IProgressMonitor last in public base classes > * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry >+ * Kevin Doyle (IBM) - [198007] Moving multiple folders allows moving to themselves > ********************************************************************************/ > > package org.eclipse.rse.internal.files.ui.actions; >@@ -117,31 +118,40 @@ > */ > public SystemMessage isValid(IHost selectedConnection, Object[] selectedObjects, ISystemRemoteElementAdapter[] remoteAdaptersForSelectedObjects) > { >- //if (selectedConnection != sourceConnection) {} // someday, but can't happen today. >+ //if (selectedConnection != sourceConnection) {} // someday, but can't happen today. >+ IRemoteFile[] files = getSelectedFiles(); > Object selectedObject = selectedObjects[0]; >- if (!(selectedObject instanceof IRemoteFile)) >+ if (!(selectedObject instanceof IRemoteFile) || files == null) > return null; > IRemoteFile selectedFolder = (IRemoteFile)selectedObject; >- if (selectedFolder.getAbsolutePath().equals(firstSelectionParent.getAbsolutePath())) >- { >- if (targetEqualsSrcMsg == null) >- targetEqualsSrcMsg = RSEUIPlugin.getPluginMessage(ISystemMessages.FILEMSG_MOVE_TARGET_EQUALS_SOURCE); >- return targetEqualsSrcMsg; >- } >- else if (selectedFolder.getAbsolutePath().equals(firstSelection.getAbsolutePath())) >- { >- if (targetEqualsSrcMsg == null) >- targetEqualsSrcMsg = RSEUIPlugin.getPluginMessage(ISystemMessages.FILEMSG_MOVE_TARGET_EQUALS_SOURCE); // todo: different msg >- return targetEqualsSrcMsg; >- } >- else if (selectedFolder.isDescendantOf(firstSelection)) >- { >- if (targetDescendsFromSrcMsg == null) >- targetDescendsFromSrcMsg = RSEUIPlugin.getPluginMessage(ISystemMessages.FILEMSG_MOVE_TARGET_DESCENDS_FROM_SOURCE); >- return targetDescendsFromSrcMsg; >- } >- else >- return null; >+ String selectedFolderPath = selectedFolder.getAbsolutePath(); >+ >+ for (int i = 0; i < files.length; i++) { >+ IRemoteFile selectedFile = files[i]; >+ if (selectedFile != null && selectedFile.getParentRemoteFile() != null) { >+ IRemoteFile selectedParentFile = selectedFile.getParentRemoteFile(); >+ >+ if (selectedFolderPath.equals(selectedParentFile.getAbsolutePath())) >+ { >+ if (targetEqualsSrcMsg == null) >+ targetEqualsSrcMsg = RSEUIPlugin.getPluginMessage(ISystemMessages.FILEMSG_MOVE_TARGET_EQUALS_SOURCE); >+ return targetEqualsSrcMsg; >+ } >+ else if (selectedFolderPath.equals(selectedFile.getAbsolutePath())) >+ { >+ if (targetEqualsSrcMsg == null) >+ targetEqualsSrcMsg = RSEUIPlugin.getPluginMessage(ISystemMessages.FILEMSG_MOVE_TARGET_EQUALS_SOURCE); // todo: different msg >+ return targetEqualsSrcMsg; >+ } >+ else if (selectedFolder.isDescendantOf(selectedFile)) >+ { >+ if (targetDescendsFromSrcMsg == null) >+ targetDescendsFromSrcMsg = RSEUIPlugin.getPluginMessage(ISystemMessages.FILEMSG_MOVE_TARGET_DESCENDS_FROM_SOURCE); >+ return targetDescendsFromSrcMsg; >+ } >+ } >+ } >+ return null; > } > > /**
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
mober.at+eclipse
:
iplog+
Actions:
View
|
Diff
Attachments on
bug 198007
: 75263