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 146379 Details for
Bug 211664
[ErrorHandling] ErrorDialog should not display 'Details' button when the children status don't have message
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]
Fix v2
ErrorDialogDetails.txt (text/plain), 3.06 KB, created by
Krzysztof Daniel
on 2009-09-03 08:34:58 EDT
(
hide
)
Description:
Fix v2
Filename:
MIME Type:
Creator:
Krzysztof Daniel
Created:
2009-09-03 08:34:58 EDT
Size:
3.06 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jface >Index: src/org/eclipse/jface/dialogs/ErrorDialog.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jface/src/org/eclipse/jface/dialogs/ErrorDialog.java,v >retrieving revision 1.42 >diff -u -r1.42 ErrorDialog.java >--- src/org/eclipse/jface/dialogs/ErrorDialog.java 25 May 2009 20:52:37 -0000 1.42 >+++ src/org/eclipse/jface/dialogs/ErrorDialog.java 3 Sep 2009 12:34:43 -0000 >@@ -422,11 +422,25 @@ > * > * @param listToPopulate > * The list to fill. >+ * >+ * @see #listContentExists() > */ > private void populateList(List listToPopulate) { > populateList(listToPopulate, status, 0, > shouldIncludeTopLevelErrorInDetails); > } >+ >+ /** >+ * This method checks if any content will be placed on the list. >+ * It mimics the behavior of {@link #populateList(List)}. >+ * >+ * @return true if {@link #populateList(List)} will add anything to a list >+ * >+ * @see #populateList(List) >+ */ >+ private boolean listContentExists() { >+ return listContentExists(status, shouldIncludeTopLevelErrorInDetails); >+ } > > /** > * Populate the list with the messages from the given status. Traverse the >@@ -503,6 +517,58 @@ > populateList(listToPopulate, children[i], nesting, true); > } > } >+ >+ /** >+ * This method checks if {@link #populateList(List, IStatus, int, boolean)} >+ * will add anything to the list. >+ * >+ * @param buildingStatus >+ * A status to be considered. >+ * @param includeStatus >+ * This flag indicates if top level status should be placed on a >+ * list. >+ * @return true if any new content will be added to the list. >+ * @see #listContentExists(IStatus, boolean) >+ */ >+ private boolean listContentExists(IStatus buildingStatus, >+ boolean includeStatus) { >+ >+ if (!buildingStatus.matches(displayMask)) { >+ return false; >+ } >+ >+ Throwable t = buildingStatus.getException(); >+ boolean isCoreException = t instanceof CoreException; >+ >+ if (includeStatus) { >+ return true; >+ } >+ >+ if (!isCoreException && t != null) { >+ return true; >+ } >+ >+ boolean result = false; >+ >+ // Look for a nested core exception >+ if (isCoreException) { >+ CoreException ce = (CoreException) t; >+ IStatus eStatus = ce.getStatus(); >+ // Only print the exception message if it is not contained in the >+ // parent message >+ if (message == null || message.indexOf(eStatus.getMessage()) == -1) { >+ result |= listContentExists(eStatus, true); >+ } >+ } >+ >+ // Look for child status >+ IStatus[] children = buildingStatus.getChildren(); >+ for (int i = 0; i < children.length; i++) { >+ result |= listContentExists(children[i], true); >+ } >+ >+ return result; >+ } > > /** > * Returns whether the given status object should be displayed. >@@ -649,7 +715,7 @@ > * @since 3.1 > */ > protected boolean shouldShowDetailsButton() { >- return status.isMultiStatus() || status.getException() != null; >+ return listContentExists(); > } > > /**
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 211664
:
146167
| 146379