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 79225 Details for
Bug 204684
[regression] error messages from remote are not shown in SystemView
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
ammended patch for better readability and use of paths in comparison
patch.txt (text/plain), 5.65 KB, created by
David McKnight
on 2007-09-26 14:15:08 EDT
(
hide
)
Description:
ammended patch for better readability and use of paths in comparison
Filename:
MIME Type:
Creator:
David McKnight
Created:
2007-09-26 14:15:08 EDT
Size:
5.65 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#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.151 >diff -u -r1.151 SystemView.java >--- UI/org/eclipse/rse/internal/ui/view/SystemView.java 12 Sep 2007 21:31:41 -0000 1.151 >+++ UI/org/eclipse/rse/internal/ui/view/SystemView.java 26 Sep 2007 18:14:25 -0000 >@@ -41,6 +41,7 @@ > * Kevin Doyle (IBM) - [196582] Deprecated getRemoteObjectIdentifier > * Martin Oberhuber (Wind River) - [198650] Fix assertion when restoring workbench state > * Martin Oberhuber (Wind River) - [183176] Fix "widget is disposed" during Platform shutdown >+ * David McKnight (IBM) - [204684] CheckExistsJob used for determining if a remote object exists after a query of it's children > ********************************************************************************/ > > package org.eclipse.rse.internal.ui.view; >@@ -170,6 +171,7 @@ > import org.eclipse.swt.graphics.Cursor; > import org.eclipse.swt.widgets.Composite; > import org.eclipse.swt.widgets.Control; >+import org.eclipse.swt.widgets.Display; > import org.eclipse.swt.widgets.Item; > import org.eclipse.swt.widgets.Menu; > import org.eclipse.swt.widgets.Shell; >@@ -5738,6 +5740,92 @@ > } > */ > >+ /** >+ * For bug 204684: >+ * >+ * Because we don't have an API for ISystemViewElementAdapter.exists()... >+ * This class is used to determine whether an object exists and consequently whether to remove it from the view >+ * after a query comes back with either no children or a SystemMessageObject. We query the parent to determine >+ * whether the remote object exists - in that case we just leave the message as is in the view. In the case where >+ * we detect that the object does not exist, we re-populate the parent node with the new children. >+ */ >+ public class CheckExistenceJob extends Job >+ { >+ >+ >+ private IAdaptable _remoteObject; >+ private TreeItem _parentItem; >+ private IContextObject _context; >+ public CheckExistenceJob(IAdaptable remoteObject, TreeItem parentItem, IContextObject context) >+ { >+ super("Check existence"); //$NON-NLS-1$ >+ _remoteObject = remoteObject; >+ _parentItem = parentItem; >+ _context = context; >+ } >+ >+ public IStatus run(IProgressMonitor monitor) >+ { >+ ISystemViewElementAdapter adapter = (ISystemViewElementAdapter)_remoteObject.getAdapter(ISystemViewElementAdapter.class); >+ >+ final Object[] children = adapter.getChildren(_context, monitor); >+ if (contains(children, _remoteObject)) >+ { >+ // we want to end this so the user sees the error message >+ } >+ else >+ { >+ Display.getDefault().asyncExec(new Runnable(){ >+ public void run() >+ { >+ // first need to remove the old items >+ TreeItem[] items = _parentItem.getItems(); >+ for (int i = 0; i < items.length; i++) { >+ if (items[i].getData() != null) { >+ disassociate(items[i]); >+ items[i].dispose(); >+ } else { >+ items[i].dispose(); >+ } >+ } >+ >+ >+ // we want to propagate the changes to the view >+ add(_context.getModelObject(), children); >+ } >+ }); >+ } >+ >+ return Status.OK_STATUS; >+ } >+ >+ private boolean contains(Object[] children, IAdaptable remoteObject) >+ { >+ ISystemViewElementAdapter adapter1 = (ISystemViewElementAdapter)remoteObject.getAdapter(ISystemViewElementAdapter.class); >+ String path1 = adapter1.getAbsoluteName(remoteObject); >+ for (int i = 0; i < children.length; i++) >+ { >+ if (children[i] == remoteObject) >+ { >+ return true; >+ } >+ else if (children[i] instanceof IAdaptable) >+ { >+ IAdaptable remoteObject2 = (IAdaptable)children[i]; >+ >+ ISystemViewElementAdapter adapter2 = (ISystemViewElementAdapter)remoteObject2.getAdapter(ISystemViewElementAdapter.class); >+ String path2 = adapter2.getAbsoluteName(remoteObject2); >+ if (path1.equals(path2)) >+ { >+ return true; >+ } >+ } >+ } >+ return false; >+ } >+ } >+ >+ > public void add(Object parentElementOrTreePath, Object[] childElements) { > assertElementsNotNull(childElements); > >@@ -5831,10 +5919,26 @@ > { > if (adapter.isRemote(parentElementOrTreePath) && !adapter.hasChildren((IAdaptable)parentElementOrTreePath)) > { >- // refresh the parent >- Object par = adapter.getParent(parentElementOrTreePath); >- ISystemRegistry sr = RSECorePlugin.getTheSystemRegistry(); >- sr.fireEvent(new SystemResourceChangeEvent(par, ISystemResourceChangeEvents.EVENT_REFRESH_REMOTE, null)); >+ /* >+ >+ // refresh the parent >+ Object par = adapter.getParent(parentElementOrTreePath); >+ ISystemRegistry sr = RSECorePlugin.getTheSystemRegistry(); >+ sr.fireEvent(new SystemResourceChangeEvent(par, ISystemResourceChangeEvents.EVENT_REFRESH_REMOTE, null)); >+ >+ */ >+ >+ // for bug 204684, using this job to determine whether or not the object exists before trying to update >+ if (match instanceof TreeItem) >+ { >+ TreeItem parentItem = ((TreeItem)match).getParentItem(); >+ if (parentItem != null) >+ { >+ IContextObject context = getContextObject(parentItem); >+ CheckExistenceJob job = new CheckExistenceJob((IAdaptable)parentElementOrTreePath, parentItem, context); >+ job.schedule(); >+ } >+ } > } > } >
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 204684
:
79220
|
79222
|
79225
|
79234
|
79238