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 103563 Details for
Bug 233461
[Refresh][api] Refresh expanded folder under filter refreshes Filter
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
patch updated again with tweak
patch.txt (text/plain), 11.60 KB, created by
David McKnight
on 2008-06-04 10:30:22 EDT
(
hide
)
Description:
patch updated again with tweak
Filename:
MIME Type:
Creator:
David McKnight
Created:
2008-06-04 10:30:22 EDT
Size:
11.60 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.rse.subsystems.files.core >Index: src/org/eclipse/rse/subsystems/files/core/servicesubsystem/FileServiceSubSystem.java >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/servicesubsystem/FileServiceSubSystem.java,v >retrieving revision 1.72 >diff -u -r1.72 FileServiceSubSystem.java >--- src/org/eclipse/rse/subsystems/files/core/servicesubsystem/FileServiceSubSystem.java 3 Jun 2008 23:24:44 -0000 1.72 >+++ src/org/eclipse/rse/subsystems/files/core/servicesubsystem/FileServiceSubSystem.java 4 Jun 2008 14:28:44 -0000 >@@ -423,7 +423,10 @@ > RemoteFileContext context = getDefaultContext(); > > IRemoteFile[] farr = getHostFileToRemoteFileAdapter().convertToRemoteFiles(this, context, null, results); >- >+ List filteredList = new ArrayList(); >+ >+ IHostFile newParent = null; >+ > // caching > for (int i = 0; i < parents.length; i++) > { >@@ -441,15 +444,28 @@ > if (parentPath.equals(childParentPath)) > { > underParent.add(child); >+ filteredList.add(child); >+ } >+ else if (parentPath.equals(child.getAbsolutePath())) // child is the parent - used for optimized update >+ { >+ newParent = child.getHostFile(); >+ >+ // don't add to the filteredList > } > } >+ >+ // update the remote file >+ updateRemoteFile(parent, newParent, monitor); >+ > if (underParent.size() > 0) > { >- parent.setContents(RemoteChildrenContentsType.getInstance(), filter, underParent.toArray()); >+ IRemoteFile[] qresults = (IRemoteFile[])underParent.toArray(new IRemoteFile[underParent.size()]); >+ >+ parent.setContents(RemoteChildrenContentsType.getInstance(), filter, qresults); > } > } > >- return farr; >+ return (IRemoteFile[])filteredList.toArray(new IRemoteFile[filteredList.size()]); > } > > >@@ -469,6 +485,7 @@ > parentPaths[i] = parents[i].getAbsolutePath(); > } > >+ > List hostFiles = new ArrayList(10); > getFileService().listMultiple(parentPaths, fileNameFilters, fileType, hostFiles, monitor); > IHostFile[] results = new IHostFile[hostFiles.size()]; >@@ -476,7 +493,10 @@ > RemoteFileContext context = getDefaultContext(); > > IRemoteFile[] farr = getHostFileToRemoteFileAdapter().convertToRemoteFiles(this, context, null, results); >- >+ List filteredList = new ArrayList(); >+ >+ IHostFile newParent = null; >+ > // caching > for (int i = 0; i < parents.length; i++) > { >@@ -494,15 +514,27 @@ > if (parentPath.equals(childParentPath)) > { > underParent.add(child); >+ filteredList.add(child); >+ } >+ else if (parentPath.equals(child.getAbsolutePath())) // child is the parent - used for optimized update >+ { >+ newParent = child.getHostFile(); >+ >+ // don't add to the filteredList > } > } >+ >+ // update the remote file >+ updateRemoteFile(parent, newParent, monitor); >+ > if (underParent.size() > 0) > { >- parent.setContents(RemoteChildrenContentsType.getInstance(), filter, underParent.toArray()); >+ IRemoteFile[] qresults = (IRemoteFile[])underParent.toArray(new IRemoteFile[underParent.size()]); >+ parent.setContents(RemoteChildrenContentsType.getInstance(), filter, qresults); > } > } > >- return farr; >+ return (IRemoteFile[])filteredList.toArray(new IRemoteFile[filteredList.size()]); > } > > >@@ -535,17 +567,56 @@ > IStatus.INFO, msgTxt); > throw new SystemMessageException(msg); > } >- >+ > IHostFile[] results = internalList(parentPath, fileNameFilter, fileType, monitor); >- >+ List filteredResults = new ArrayList(); >+ IHostFile newHostParent = null; >+ // look for the file that doesn't have parent as it's parent path >+ // to determine whether we have an updated parent in the results >+ for (int i = 0; i < results.length; i++){ >+ IHostFile result = results[i]; >+ if (!result.getParentPath().equals(parentPath)){ >+ newHostParent = result; // the child is the same as the parent >+ // keep the parent out of the results >+ } >+ else { >+ filteredResults.add(result); >+ } >+ } >+ >+ results = (IHostFile[])filteredResults.toArray(new IHostFile[filteredResults.size()]); >+ >+ updateRemoteFile(parent, newHostParent, monitor); >+ > IRemoteFile[] farr = getHostFileToRemoteFileAdapter().convertToRemoteFiles(this, context, parent, results); > if (parent != null) > parent.setContents(RemoteChildrenContentsType.getInstance(), fileNameFilter, farr); > return farr; > } > >+ >+ >+ private void updateRemoteFile(IRemoteFile parent, IHostFile newHostParent, IProgressMonitor monitor) throws SystemMessageException >+ { >+ // now newHostParent file passed in so we'll assume it wasn't returned and explicitly get it >+ if (newHostParent == null){ >+ String parentParentPath = parent.getParentPath(); >+ if (parentParentPath == null){ >+ parentParentPath = ""; //$NON-NLS-1$ >+ } >+ newHostParent = getFileService().getFile(parentParentPath, parent.getName(), monitor); >+ } >+ >+ if (newHostParent != null){ >+ IHostFile oldHostParent = parent.getHostFile(); >+ if (!newHostParent.equals(oldHostParent)){ >+ ((AbstractRemoteFile)parent).setHostFile(newHostParent); >+ parent.markStale(false); >+ } >+ } >+ } > >- >+ > public IRemoteFile[] listRoots(IRemoteFileContext context, IProgressMonitor monitor) throws InterruptedException > { > IHostFile[] roots = null; >Index: src/org/eclipse/rse/subsystems/files/core/servicesubsystem/AbstractRemoteFile.java >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/servicesubsystem/AbstractRemoteFile.java,v >retrieving revision 1.10 >diff -u -r1.10 AbstractRemoteFile.java >--- src/org/eclipse/rse/subsystems/files/core/servicesubsystem/AbstractRemoteFile.java 3 Jun 2008 16:25:42 -0000 1.10 >+++ src/org/eclipse/rse/subsystems/files/core/servicesubsystem/AbstractRemoteFile.java 4 Jun 2008 14:28:44 -0000 >@@ -14,6 +14,7 @@ > * Contributors: > * David McKnight (IBM) - [231209] [api][breaking] IRemoteFile.getSystemConnection() should be changed to IRemoteFile.getHost() > * Martin Oberhuber (Wind River) - [234726] Update IRemoteFile Javadocs >+ * David McKnight (IBM) - [223461] [Refresh][api] Refresh expanded folder under filter refreshes Filter > *******************************************************************************/ > > package org.eclipse.rse.subsystems.files.core.servicesubsystem; >@@ -199,6 +200,16 @@ > { > return _hostFile; > } >- >+ >+ /** >+ * Replacing the current associated IHostFile with a new one >+ * >+ * @param hostFile the new host file >+ * >+ * @since 3.0 >+ */ >+ public void setHostFile(IHostFile hostFile) { >+ _hostFile = hostFile; >+ } > > } >#P org.eclipse.rse.ui >Index: UI/org/eclipse/rse/internal/ui/view/SystemView.java >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemView.java,v >retrieving revision 1.173 >diff -u -r1.173 SystemView.java >--- UI/org/eclipse/rse/internal/ui/view/SystemView.java 30 May 2008 21:03:51 -0000 1.173 >+++ UI/org/eclipse/rse/internal/ui/view/SystemView.java 4 Jun 2008 14:28:49 -0000 >@@ -1357,6 +1357,7 @@ > } > } > >+ > /** > * Clear current selection. Ignore widget disposed message. > */ >@@ -1366,6 +1367,8 @@ > } catch (Exception exc) { > } > } >+ >+ > > /** > * Returns the implementation of ISystemViewElementAdapter for the given >@@ -2226,6 +2229,11 @@ > case ISystemResourceChangeEvents.EVENT_REFRESH_REMOTE: > if (debug) logDebugMsg("SV event: EVENT_REFRESH_REMOTE: src = " + src); //$NON-NLS-1$ > >+ // Fake expanded is set to the item for the src object if the object is in a collapsed state and >+ // resides directly under a filter. The item is artificially expanded in order to allow >+ // refreshRemoteObject() to go through with a query of the item. After the query is kicked off, >+ // fakeExpanded is contracted in order to retain the original tree expand state. >+ TreeItem fakeExpanded = null; > > ISystemViewElementAdapter adapter = getViewAdapter(src); > if (adapter != null) >@@ -2233,17 +2241,15 @@ > // we need to refresh filters > ISystemRegistry sr = RSECorePlugin.getTheSystemRegistry(); > >+ // if this is a filter reference, we just need to refresh it >+ if (src instanceof ISystemFilterReference) >+ { >+ refresh(src); >+ break; >+ } >+ >+ // need to find filter references contain this object > List filterReferences = sr.findFilterReferencesFor(src, adapter.getSubSystem(src), false); >- // if filters reference this resource we need them refreshed >- for (int f = 0; f < filterReferences.size(); f++) >- { >- ISystemFilterReference ref = (ISystemFilterReference)filterReferences.get(f); >- if (!ref.isStale()) >- { >- ref.markStale(true); >- smartRefresh(ref, true); >- } >- } > > // first, find out if src is a container or not > // if it's a container, just pass into refreshRemoteObject >@@ -2280,45 +2286,30 @@ > TreeItem[] titems = titem.getItems(); > if (titems.length > 0 && !titem.getExpanded()) > { >- src = adapter.getParent(src); >- } >- } >- >- /* old code - issue in 196662 >- String key = adapter.getAbsoluteName(src); >- if (key != null) >- { >- try >- { >- Object srcParent = adapter.getParent(src); // get parent before we query >- // because if after query src doesn't exist, >- // we can't get parent >- if (srcParent != null) >- { >- src = ss.getObjectWithAbsoluteName(key); >- hasChildren = adapter.hasChildren((IAdaptable)src); >- if (!hasChildren) >- { >- // make the src the parent of the src >- src = srcParent; >- } >+ >+ // if filterReferences is not empty, then this is contained directly under a filter >+ if (filterReferences.size() > 0){ >+ // the item is artificially expanded in order to allow the query to go through in >+ // refreshRemoteObject() >+ titem.setExpanded(true); >+ >+ // we set this so that after calling refreshRemoteObject(), the item can be re-collapsed >+ fakeExpanded = titem; >+ } >+ else { >+ src = adapter.getParent(src); > } >- } >- catch (Exception e) >- { >- e.printStackTrace(); > } > } >- */ > } > } > } > } > > refreshRemoteObject(src, parent, originatedHere); >- >- >- >+ if (fakeExpanded != null) >+ fakeExpanded.setExpanded(false); >+ > break; > case ISystemResourceChangeEvents.EVENT_SELECT_REMOTE: > if (debug) logDebugMsg("SV event: EVENT_SELECT_REMOTE: src = " + src); //$NON-NLS-1$ >@@ -6383,4 +6374,9 @@ > } > } > >+ /** commented out - this is workaround for performance problem >+ protected void handleLabelProviderChanged(LabelProviderChangedEvent event) { >+ //System.out.println("handleLableProviderChanged"); >+ }*/ >+ > }
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
Actions:
View
|
Diff
Attachments on
bug 233461
:
102743
|
102745
|
102967
|
102973
|
103142
|
103152
|
103155
|
103156
|
103354
|
103461
|
103474
|
103479
|
103555
|
103563
|
103580
|
103605
|
103630
|
103637
|
103672
|
103780
|
103787
|
103977