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 79220 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]
patch to check if remote object exists in job via query
patch.txt (text/plain), 4.39 KB, created by
David McKnight
on 2007-09-26 12:29:40 EDT
(
hide
)
Description:
patch to check if remote object exists in job via query
Filename:
MIME Type:
Creator:
David McKnight
Created:
2007-09-26 12:29:40 EDT
Size:
4.39 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 16:26:00 -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; >@@ -5738,6 +5739,74 @@ > } > */ > >+ /** >+ * 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 UIJob >+ { >+ private IAdaptable _remoteObject; >+ private TreeItem _item; >+ public CheckExistenceJob(IAdaptable remoteObject, TreeItem item) >+ { >+ super("Check existence"); >+ _remoteObject = remoteObject; >+ _item = item; >+ setSystem(true); >+ } >+ >+ public IStatus runInUIThread(IProgressMonitor monitor) >+ { >+ ISystemViewElementAdapter adapter = (ISystemViewElementAdapter)_remoteObject.getAdapter(ISystemViewElementAdapter.class); >+ >+ TreeItem parentItem = _item.getParentItem(); >+ >+ IContextObject context = getContextObject(parentItem); >+ Object[] children = adapter.getChildren(context, monitor); >+ if (contains(children, _remoteObject)) >+ { >+ // we want to end this so the user sees the error message >+ } >+ else >+ { >+ // 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) >+ { >+ for (int i = 0; i < children.length; i++) >+ { >+ if (children[i] == remoteObject) >+ { >+ return true; >+ } >+ } >+ return false; >+ } >+ } >+ >+ > public void add(Object parentElementOrTreePath, Object[] childElements) { > assertElementsNotNull(childElements); > >@@ -5831,10 +5900,19 @@ > { > 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 >+ CheckExistenceJob job = new CheckExistenceJob((IAdaptable)parentElementOrTreePath, (TreeItem)match); >+ 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