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 129878 Details for
Bug 190805
[performance][dstore] Right-click > Disconnect on a dstore connection is slow and spawns many Jobs
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
patch for better handling of decorating
patch.txt (text/plain), 13.61 KB, created by
David McKnight
on 2009-03-25 14:53:07 EDT
(
hide
)
Description:
patch for better handling of decorating
Filename:
MIME Type:
Creator:
David McKnight
Created:
2009-03-25 14:53:07 EDT
Size:
13.61 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.rse.subsystems.files.dstore >Index: src/org/eclipse/rse/internal/subsystems/files/dstore/DStoreFileAdapter.java >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.subsystems.files.dstore/src/org/eclipse/rse/internal/subsystems/files/dstore/DStoreFileAdapter.java,v >retrieving revision 1.9 >diff -u -r1.9 DStoreFileAdapter.java >--- src/org/eclipse/rse/internal/subsystems/files/dstore/DStoreFileAdapter.java 20 Nov 2008 20:51:28 -0000 1.9 >+++ src/org/eclipse/rse/internal/subsystems/files/dstore/DStoreFileAdapter.java 25 Mar 2009 18:48:08 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2006, 2008 IBM Corporation and others. >+ * Copyright (c) 2006, 2009 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -16,6 +16,7 @@ > * Martin Oberhuber (Wind River) - [235363][api][breaking] IHostFileToRemoteFileAdapter methods should return AbstractRemoteFile > * David McKnight (IBM) - [244765] Invalid thread access during workbench termination > * David McKnight (IBM) - [255699] NPE when filter string doesn't return result in FileServiceSubSystem.list >+ * David McKnight (IBM) - [190805] [performance][dstore] Right-click > Disconnect on a dstore connection is slow and spawns many Jobs > *******************************************************************************/ > > package org.eclipse.rse.internal.subsystems.files.dstore; >@@ -43,6 +44,9 @@ > > private void registerFilePropertyChangeListener(FileServiceSubSystem ss) > { >+ if (_listener != null && _listener.isFinished()){ >+ _listener = null; >+ } > if (_listener == null) > { > DStoreConnectorService connectorService = (DStoreConnectorService)ss.getConnectorService(); >Index: src/org/eclipse/rse/internal/subsystems/files/dstore/RemoteFilePropertyChangeListener.java >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.subsystems.files.dstore/src/org/eclipse/rse/internal/subsystems/files/dstore/RemoteFilePropertyChangeListener.java,v >retrieving revision 1.7 >diff -u -r1.7 RemoteFilePropertyChangeListener.java >--- src/org/eclipse/rse/internal/subsystems/files/dstore/RemoteFilePropertyChangeListener.java 12 Feb 2008 23:06:59 -0000 1.7 >+++ src/org/eclipse/rse/internal/subsystems/files/dstore/RemoteFilePropertyChangeListener.java 25 Mar 2009 18:48:08 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2002, 2008 IBM Corporation and others. >+ * Copyright (c) 2002, 2009 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -14,6 +14,7 @@ > * Contributors: > * Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core > * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry >+ * David McKnight (IBM) - [190805] [performance][dstore] Right-click > Disconnect on a dstore connection is slow and spawns many Jobs > *******************************************************************************/ > > package org.eclipse.rse.internal.subsystems.files.dstore; >@@ -40,8 +41,6 @@ > import org.eclipse.rse.internal.subsystems.files.core.SystemFileResources; > import org.eclipse.rse.subsystems.files.core.servicesubsystem.FileServiceSubSystem; > import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile; >-import org.eclipse.rse.ui.SystemBasePlugin; >-import org.eclipse.swt.widgets.Display; > import org.eclipse.swt.widgets.Shell; > import org.eclipse.ui.progress.UIJob; > >@@ -64,42 +63,15 @@ > protected boolean _networkDown = false; > > protected HashMap _decorateJobs; >- >- protected static class FindShell implements Runnable >- { >- >- private Shell shell; >- >- /** >- * @see Runnable#run() >- */ >- public void run() >- { >- try >- { >- Shell[] shells = Display.getCurrent().getShells(); >- for (int loop = 0; loop < shells.length && shell == null; loop++) >- { >- if (shells[loop].isEnabled()) >- { >- shell = shells[loop]; >- } >- } >- } >- catch (Exception e) >- { >- SystemBasePlugin.logError( >- "StatusChangeListener.FindShell exception: ", e); //$NON-NLS-1$ >- } >- } >- } >+ >+ protected boolean _finished = false; > > public class DecorateJob extends UIJob > { >- private DStoreFile[] _files; >+ private DataElement[] _files; > private DStoreFile _parentFile; > private boolean _isDone = false; >- public DecorateJob(DStoreFile[] files, DStoreFile parentFile) >+ public DecorateJob(DataElement[] files, DStoreFile parentFile) > { > super(SystemFileResources.RESID_JOB_DECORATEFILES_NAME); > _files= files; >@@ -114,23 +86,28 @@ > public IStatus runInUIThread(IProgressMonitor monitor) > { > _isDone = false; >- for (int i = 0; i < _files.length; i++) >- { >- _registry.fireEvent(new >- org.eclipse.rse.core.events.SystemResourceChangeEvent(_files[i], >- ISystemResourceChangeEvents.EVENT_ICON_CHANGE, >- _parentFile)); >- } >- >- /* >- _registry.fireEvent(new >- org.eclipse.rse.ui.model.SystemResourceChangeEvent(_files, >- ISystemResourceChangeEvent.EVENT_REPLACE_CHILDREN, >- _parentFile)); >- */ >+ IRemoteFile[] children = new IRemoteFile[_files.length]; >+ try { >+ for (int i = 0; i < _files.length; i++) >+ { >+ DataElement file = _files[i]; >+ StringBuffer path = new StringBuffer(file.getAttribute(DE.A_VALUE)); >+ path.append(_fileSubSystem.getSeparatorChar()); >+ path.append(file.getName()); >+ >+ children[i] = _fileSubSystem.getRemoteFileObject(path.toString(), monitor); >+ } >+ >+ _registry.fireEvent(new >+ org.eclipse.rse.core.events.SystemResourceChangeEvent(children, >+ ISystemResourceChangeEvents.EVENT_ICON_CHANGE, >+ _parentFile)); >+ } >+ catch (Exception e){} >+ > _isDone = true; > _decorateJobs.remove(_parentFile); >- return Status.OK_STATUS; >+ return Status.OK_STATUS; > } > > } >@@ -140,6 +117,7 @@ > { > this.shell = shell; > this._fileSubSystem = fileSS; >+ > this.dataStore = dataStore; > this.system = system; > this._registry = RSECorePlugin.getTheSystemRegistry(); >@@ -185,8 +163,14 @@ > public void finish() > { > dataStore.getDomainNotifier().removeDomainListener(this); >+ _finished = true; > } > >+ public boolean isFinished() >+ { >+ return _finished; >+ } >+ > /** > * @see IDomainListener#domainChanged(DomainEvent) > */ >@@ -203,7 +187,6 @@ > parentPath.append(parent.getName()); > DStoreFile parentFile = (DStoreFile) _fileSubSystem.getCachedRemoteFile(parentPath.toString()); > >- boolean refreshParent = false; > List toUpdate = new ArrayList(); > for (int i = 0; i < children.size(); i++) > { >@@ -215,43 +198,19 @@ > type.equals(IUniversalDataStoreConstants.UNIVERSAL_FOLDER_DESCRIPTOR))) > > { >- StringBuffer path = new StringBuffer(subject.getAttribute(DE.A_VALUE)); >- path.append(_fileSubSystem.getSeparatorChar()); >- path.append(subject.getName()); >- >- >- // find cached copy >- try >- { >- DStoreFile updated = (DStoreFile) _fileSubSystem.getCachedRemoteFile(path.toString()); >- >- if (updated != null) >- { >- String classification = updated.getClassification(); >- if (!classification.equals("file") && !classification.equals("directory")) //$NON-NLS-1$ //$NON-NLS-2$ >- { >- refreshParent = true; >- toUpdate.add(updated); >- } >- >- } >- } >- catch (Exception e) >- { >- e.printStackTrace(); >- } >+ toUpdate.add(subject); > } > } > >- if (refreshParent) >+ if (!toUpdate.isEmpty()) > { > DecorateJob job = getDecorateJob(parentFile); > if (job == null) > { >- job = new DecorateJob((DStoreFile[])toUpdate.toArray(new DStoreFile[toUpdate.size()]), parentFile); >+ job = new DecorateJob((DataElement[])toUpdate.toArray(new DataElement[toUpdate.size()]), parentFile); > job.setRule(parentFile); > putDecorateJob(parentFile, job); >- job.schedule(5000); >+ job.schedule(1000); > } > > } >@@ -269,20 +228,7 @@ > _decorateJobs.put(file, job); > } > >- >- public Shell getShell() >- { >- // dy: DomainNotifier (which calls this method) requires the shell not >- // be disposed >- //if (shell == null) { >- if (shell == null || shell.isDisposed()) >- { >- FindShell findShell = new FindShell(); >- Display.getDefault().syncExec(findShell); >- shell = findShell.shell; >- } >- return shell; >- } >+ > > /** > * @see ICommunicationsListener#communicationsStateChange(CommunicationsEvent) >#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.191 >diff -u -r1.191 SystemView.java >--- UI/org/eclipse/rse/internal/ui/view/SystemView.java 13 Jan 2009 16:08:28 -0000 1.191 >+++ UI/org/eclipse/rse/internal/ui/view/SystemView.java 25 Mar 2009 18:48:12 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************** >- * Copyright (c) 2002, 2008 IBM Corporation and others. All rights reserved. >+ * Copyright (c) 2002, 2009 IBM Corporation and others. All rights reserved. > * This program and the accompanying materials are made available under the terms > * of the Eclipse Public License v1.0 which accompanies this distribution, and is > * available at http://www.eclipse.org/legal/epl-v10.html >@@ -67,6 +67,7 @@ > * David McKnight (IBM) - [249245] not showing inappropriate popup actions for: Refresh, Show In Table, Go Into, etc. > * David McKnight (IBM) - [251625] Widget disposed exception when renaming/pasting a folder > * David McKnight (IBM) - [257721] Doubleclick doing special handling and expanding >+ * David McKnight (IBM) - [190805] [performance][dstore] Right-click > Disconnect on a dstore connection is slow and spawns many Jobs > ********************************************************************************/ > > package org.eclipse.rse.internal.ui.view; >@@ -2176,18 +2177,38 @@ > case ISystemResourceChangeEvents.EVENT_ICON_CHANGE: > if (debug) logDebugMsg("SV event: EVENT_ICON_CHANGE "); //$NON-NLS-1$ > >- if (initViewerFilters != null && initViewerFilters.length > 0) { >- Widget w = findItem(src); >- if (w == null) { >- refresh(parent); >+ if (src instanceof Object[]){ >+ Object[] srcs = (Object[])src; >+ for (int s = 0; s < srcs.length; s++){ >+ if (initViewerFilters != null && initViewerFilters.length > 0) { >+ Widget w = findItem(srcs[s]); >+ if (w == null) { >+ refresh(parent); >+ } else { >+ properties[0] = IBasicPropertyConstants.P_IMAGE; >+ update(srcs[s], properties); // for refreshing non-structural properties in viewer when model changes >+ >+ } >+ } else { >+ properties[0] = IBasicPropertyConstants.P_IMAGE; >+ update(srcs[s], properties); // for refreshing non-structural properties in viewer when model changes >+ } >+ } >+ } >+ else { >+ if (initViewerFilters != null && initViewerFilters.length > 0) { >+ Widget w = findItem(src); >+ if (w == null) { >+ refresh(parent); >+ } else { >+ properties[0] = IBasicPropertyConstants.P_IMAGE; >+ update(src, properties); // for refreshing non-structural properties in viewer when model changes >+ >+ } > } else { > properties[0] = IBasicPropertyConstants.P_IMAGE; > update(src, properties); // for refreshing non-structural properties in viewer when model changes >- > } >- } else { >- properties[0] = IBasicPropertyConstants.P_IMAGE; >- update(src, properties); // for refreshing non-structural properties in viewer when model changes > } > > //updatePropertySheet();
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 190805
: 129878