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 73269 Details for
Bug 194838
Move the code for comparing two objects by absolute name to a common location
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
fix for bug 194838
patch_194838.txt (text/plain), 8.76 KB, created by
Xuan Chen
on 2007-07-08 02:18:28 EDT
(
hide
)
Description:
fix for bug 194838
Filename:
MIME Type:
Creator:
Xuan Chen
Created:
2007-07-08 02:18:28 EDT
Size:
8.76 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.rse.ui >Index: model/org/eclipse/rse/ui/internal/model/SystemRegistry.java >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.ui/model/org/eclipse/rse/ui/internal/model/SystemRegistry.java,v >retrieving revision 1.27 >diff -u -r1.27 SystemRegistry.java >--- model/org/eclipse/rse/ui/internal/model/SystemRegistry.java 27 Jun 2007 12:46:09 -0000 1.27 >+++ model/org/eclipse/rse/ui/internal/model/SystemRegistry.java 8 Jul 2007 05:58:55 -0000 >@@ -31,6 +31,7 @@ > * Martin Oberhuber (Wind River) - [189123] Move renameSubSystemProfile() from UI to Core > * Martin Oberhuber (Wind River) - [175680] Deprecate obsolete ISystemRegistry methods > * Martin Oberhuber (Wind River) - [190271] Move ISystemViewInputProvider to Core >+ * Xuan Chen (IBM) - [194838] Move the code for comparing two objects by absolute name to a common location > ********************************************************************************/ > > package org.eclipse.rse.ui.internal.model; >@@ -40,6 +41,7 @@ > import java.util.List; > import java.util.Vector; > >+import org.eclipse.core.runtime.IAdaptable; > import org.eclipse.core.runtime.IProgressMonitor; > import org.eclipse.core.runtime.Platform; > import org.eclipse.core.runtime.jobs.ISchedulingRule; >@@ -79,6 +81,7 @@ > import org.eclipse.rse.core.subsystems.ISubSystem; > import org.eclipse.rse.core.subsystems.ISubSystemConfiguration; > import org.eclipse.rse.core.subsystems.ISubSystemConfigurationProxy; >+import org.eclipse.rse.core.subsystems.ISystemDragDropAdapter; > import org.eclipse.rse.internal.core.filters.SystemFilterStartHere; > import org.eclipse.rse.internal.core.model.SystemHostPool; > import org.eclipse.rse.internal.core.model.SystemModelChangeEvent; >@@ -1027,6 +1030,82 @@ > dataStream.append(factoryId); > return dataStream.toString(); > } >+ >+ /** >+ * Check if two objects refers to the same system object by comparing it absoluteName with its subsystem id. >+ * >+ * @param firstObject the first object to compare >+ * @param firstObjectFullName the full name of the firstObject. If null, get the full name from the firstObject >+ * @param secondObject the second object to compare >+ * @param secondObjectFullName the full name of the secondObject. If null, get the full name from the secondObject >+ */ >+ public boolean isSameObjectByAbsoluteName(Object firstObject, String firstObjectFullName, Object secondObject, String secondObjectFullName) >+ { >+ if (firstObject == secondObject) >+ { >+ return true; >+ } >+ String firstObjectAbsoluteNameWithSubSystemId = null; >+ >+ //Simply doing comparason of if two object is equal is not enough >+ //If two different objects, but if their absoluate path (with subsystem id) >+ //are the same, they refer to the same remote object. >+ >+ if(firstObject instanceof IAdaptable) >+ { >+ ISystemDragDropAdapter adapter = null; >+ >+ adapter = (ISystemDragDropAdapter)((IAdaptable)firstObject).getAdapter(ISystemDragDropAdapter.class); >+ >+ if (adapter != null ) { >+ // first need to check subsystems >+ ISubSystem subSystem = adapter.getSubSystem(firstObject); >+ String subSystemId = getAbsoluteNameForSubSystem(subSystem); >+ if (firstObjectFullName != null) >+ { >+ firstObjectAbsoluteNameWithSubSystemId = subSystemId + ":" + firstObjectFullName; //$NON-NLS-1$ >+ } >+ else >+ { >+ String absolutePath = adapter.getAbsoluteName(firstObject); >+ firstObjectAbsoluteNameWithSubSystemId = subSystemId + ":" + absolutePath; //$NON-NLS-1$ >+ } >+ >+ } >+ } >+ >+ >+ String secondObjectAbsoluteNameWithSubSystemId = null; >+ if(secondObject instanceof IAdaptable) >+ { >+ ISystemDragDropAdapter adapter = null; >+ >+ adapter = (ISystemDragDropAdapter)((IAdaptable)secondObject).getAdapter(ISystemDragDropAdapter.class); >+ >+ if (adapter != null ) { >+ // first need to check subsystems >+ ISubSystem subSystem = adapter.getSubSystem(secondObject); >+ String subSystemId = getAbsoluteNameForSubSystem(subSystem); >+ if (secondObjectFullName != null) >+ { >+ secondObjectAbsoluteNameWithSubSystemId = subSystemId + ":" + secondObjectFullName; //$NON-NLS-1$ >+ } >+ else >+ { >+ String absolutePath = adapter.getAbsoluteName(secondObject); >+ secondObjectAbsoluteNameWithSubSystemId = subSystemId + ":" + absolutePath; //$NON-NLS-1$ >+ } >+ >+ } >+ } >+ >+ if (firstObjectAbsoluteNameWithSubSystemId != null && firstObjectAbsoluteNameWithSubSystemId.equals(secondObjectAbsoluteNameWithSubSystemId)) >+ { >+ return true; >+ } >+ >+ return false; >+ } > > /* > * (non-Javadoc) >Index: UI/org/eclipse/rse/internal/ui/view/SystemTableViewPart.java >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemTableViewPart.java,v >retrieving revision 1.17 >diff -u -r1.17 SystemTableViewPart.java >--- UI/org/eclipse/rse/internal/ui/view/SystemTableViewPart.java 28 Jun 2007 19:41:37 -0000 1.17 >+++ UI/org/eclipse/rse/internal/ui/view/SystemTableViewPart.java 8 Jul 2007 05:58:54 -0000 >@@ -19,6 +19,7 @@ > * Martin Oberhuber (Wind River) - [190271] Move ISystemViewInputProvider to Core > * David McKnight (IBM) - [191288] Up To Action doesn't go all the way back to the connections > * Xuan Chen (IBM) - [192716] Refresh Error in Table View after Renaming folder shown in table >+ * Xuan Chen (IBM) - [194838] Move the code for comparing two objects by absolute name to a common location > ********************************************************************************/ > > package org.eclipse.rse.internal.ui.view; >@@ -80,6 +81,7 @@ > import org.eclipse.rse.ui.actions.SystemTablePrintAction; > import org.eclipse.rse.ui.dialogs.SystemPromptDialog; > import org.eclipse.rse.ui.dialogs.SystemSelectAnythingDialog; >+import org.eclipse.rse.ui.internal.model.SystemRegistry; > import org.eclipse.rse.ui.messages.ISystemMessageLine; > import org.eclipse.rse.ui.model.ISystemShellProvider; > import org.eclipse.rse.ui.view.IRSEViewPart; >@@ -1608,7 +1610,6 @@ > { > int eventType = event.getEventType(); > Object remoteResource = event.getResource(); >- String inputAbsoluteNameWithSubSystemId = null; > Vector remoteResourceNames = null; > if (remoteResource instanceof Vector) > { >@@ -1621,47 +1622,14 @@ > > Object input = _viewer.getInput(); > >- //Simply doing comparason of if two object is equal is not enough >- //If two different objects, but if their absoluate path (with subsystem id) >- //are the same, they refer to the same remote object. >- >- if(input instanceof IAdaptable) >- { >- ISystemViewElementAdapter adapter = >- (ISystemViewElementAdapter) >- ((IAdaptable)input).getAdapter(ISystemViewElementAdapter.class); >- >- if (adapter != null ) { >- // first need to check subsystems >- ISubSystem subSystem = adapter.getSubSystem(input); >- String subSystemId = RSECorePlugin.getTheSystemRegistry().getAbsoluteNameForSubSystem(subSystem); >- String absolutePath = adapter.getAbsoluteName(input); >- inputAbsoluteNameWithSubSystemId = subSystemId + ":" + absolutePath; //$NON-NLS-1$ >- >- } >- } >- >- String remoteResourceAbsoluteNameWithSubSystemId = null; >- if(child instanceof IAdaptable) >- { >- ISystemViewElementAdapter adapter = >- (ISystemViewElementAdapter) >- ((IAdaptable)child).getAdapter(ISystemViewElementAdapter.class); >- >- if (adapter != null ) { >- // first need to check subsystems >- ISubSystem subSystem = adapter.getSubSystem(child); >- String subSystemId = RSECorePlugin.getTheSystemRegistry().getAbsoluteNameForSubSystem(subSystem); >- remoteResourceAbsoluteNameWithSubSystemId = subSystemId + ":" + event.getOldName(); //$NON-NLS-1$ >- >- } >- } >+ ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry(); > > boolean referToSameObject = false; >- if (inputAbsoluteNameWithSubSystemId != null && inputAbsoluteNameWithSubSystemId.equals(remoteResourceAbsoluteNameWithSubSystemId)) >+ if (registry instanceof SystemRegistry) > { >- referToSameObject = true; >+ referToSameObject = ((SystemRegistry)registry).isSameObjectByAbsoluteName(input, null, child, event.getOldName()); > } >+ > if (input == child || child instanceof Vector || referToSameObject) > { > switch (eventType)
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 194838
: 73269 |
73338