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 120833 Details for
Bug 211350
[ErrorHandling] Need better error handling in PerspectiveRegistry
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]
PatchToBeReleasedSoon
Patch02.txt (text/plain), 6.28 KB, created by
Krzysztof Daniel
on 2008-12-18 09:40:29 EST
(
hide
)
Description:
PatchToBeReleasedSoon
Filename:
MIME Type:
Creator:
Krzysztof Daniel
Created:
2008-12-18 09:40:29 EST
Size:
6.28 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.ui.tests >Index: Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIDialogs.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIDialogs.java,v >retrieving revision 1.26 >diff -u -r1.26 UIDialogs.java >--- Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIDialogs.java 16 Mar 2007 18:00:00 -0000 1.26 >+++ Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIDialogs.java 18 Dec 2008 14:38:42 -0000 >@@ -10,6 +10,8 @@ > *******************************************************************************/ > package org.eclipse.ui.tests.dialogs; > >+import java.io.IOException; >+ > import junit.framework.TestCase; > > import org.eclipse.core.resources.IProject; >@@ -158,6 +160,18 @@ > dialog.setInitialSelection(description); > DialogCheck.assertDialog(dialog, this); > } >+ >+ // see bug 211350 >+ public void testLoadNotExistingPerspective() throws IOException{ >+ final String fakePerspectivID = "fakeperspetive"; >+ PerspectiveRegistry reg = (PerspectiveRegistry) WorkbenchPlugin >+ .getDefault().getPerspectiveRegistry(); >+ try { >+ reg.getCustomPersp(fakePerspectivID); >+ } catch (WorkbenchException e) { >+ assertTrue(e.getStatus().getMessage().indexOf(fakePerspectivID) != -1); >+ } >+ } > > public void testSelectPerspective() { > Dialog dialog = new SelectPerspectiveDialog(getShell(), PlatformUI >#P org.eclipse.ui.workbench >Index: Eclipse UI/org/eclipse/ui/internal/messages.properties >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/messages.properties,v >retrieving revision 1.389 >diff -u -r1.389 messages.properties >--- Eclipse UI/org/eclipse/ui/internal/messages.properties 16 Dec 2008 09:04:28 -0000 1.389 >+++ Eclipse UI/org/eclipse/ui/internal/messages.properties 18 Dec 2008 14:38:44 -0000 >@@ -601,6 +601,7 @@ > Perspective_errorReadingState = Unable to read workbench state. > Perspective_problemLoadingTitle = Loading Problems > Perspective_errorLoadingState = Unable to load perspective. >+Perspective_couldNotBeFound= Description of ''{0}'' perspective could not be found. > WorkbenchPage_problemRestoringTitle = Restoring Problems > WorkbenchPage_errorReadingState = Unable to read workbench state. > >Index: Eclipse UI/org/eclipse/ui/internal/WorkbenchMessages.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchMessages.java,v >retrieving revision 1.111 >diff -u -r1.111 WorkbenchMessages.java >--- Eclipse UI/org/eclipse/ui/internal/WorkbenchMessages.java 15 Dec 2008 13:57:44 -0000 1.111 >+++ Eclipse UI/org/eclipse/ui/internal/WorkbenchMessages.java 18 Dec 2008 14:38:44 -0000 >@@ -884,6 +884,9 @@ > public static String PerspectiveBar_saveAs; > public static String PerspectiveBar_reset; > >+ >+ public static String Perspective_couldNotBeFound; >+ > public static String PerspectiveSwitcher_dockOn; > public static String PerspectiveSwitcher_topRight; > public static String PerspectiveSwitcher_topLeft; >Index: Eclipse UI/org/eclipse/ui/internal/registry/PerspectiveRegistry.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/registry/PerspectiveRegistry.java,v >retrieving revision 1.51 >diff -u -r1.51 PerspectiveRegistry.java >--- Eclipse UI/org/eclipse/ui/internal/registry/PerspectiveRegistry.java 10 Mar 2008 03:47:52 -0000 1.51 >+++ Eclipse UI/org/eclipse/ui/internal/registry/PerspectiveRegistry.java 18 Dec 2008 14:38:44 -0000 >@@ -39,6 +39,7 @@ > import org.eclipse.jface.resource.StringConverter; > import org.eclipse.jface.util.IPropertyChangeListener; > import org.eclipse.jface.util.PropertyChangeEvent; >+import org.eclipse.osgi.util.NLS; > import org.eclipse.ui.IMemento; > import org.eclipse.ui.IPerspectiveDescriptor; > import org.eclipse.ui.IPerspectiveRegistry; >@@ -55,8 +56,9 @@ > import org.eclipse.ui.internal.WorkbenchPage; > import org.eclipse.ui.internal.WorkbenchPlugin; > import org.eclipse.ui.internal.handlers.ClosePerspectiveHandler; >-import org.eclipse.ui.internal.misc.StatusUtil; > import org.eclipse.ui.internal.util.PrefUtil; >+import org.eclipse.ui.statushandlers.IStatusAdapterConstants; >+import org.eclipse.ui.statushandlers.StatusAdapter; > import org.eclipse.ui.statushandlers.StatusManager; > > /** >@@ -435,6 +437,15 @@ > String xmlString = store.getString(perspectivesList[i] + PERSP); > if (xmlString != null && xmlString.length() != 0) { > reader = new StringReader(xmlString); >+ } else { >+ throw new WorkbenchException( >+ new Status( >+ IStatus.ERROR, >+ WorkbenchPlugin.PI_WORKBENCH, >+ NLS >+ .bind( >+ WorkbenchMessages.Perspective_couldNotBeFound, >+ perspectivesList[i]))); > } > > // Restore the layout state. >@@ -514,10 +525,13 @@ > String msg = WorkbenchMessages.Perspective_errorLoadingState; > if (status == null) { > IStatus errStatus = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, msg); >- StatusManager.getManager().handle(errStatus, StatusManager.SHOW); >+ StatusManager.getManager().handle(errStatus, >+ StatusManager.SHOW | StatusManager.LOG); > } else { >- IStatus errStatus = StatusUtil.newStatus(status, msg); >- StatusManager.getManager().handle(errStatus, StatusManager.SHOW); >+ StatusAdapter sa = new StatusAdapter(status); >+ sa.setProperty(IStatusAdapterConstants.TITLE_PROPERTY, msg); >+ StatusManager.getManager().handle(sa, >+ StatusManager.SHOW | StatusManager.LOG); > } > } > >@@ -564,6 +578,15 @@ > String xmlString = store.getString(id + PERSP); > if (xmlString != null && xmlString.length() != 0) { // defined in store > reader = new StringReader(xmlString); >+ } else { >+ throw new WorkbenchException( >+ new Status( >+ IStatus.ERROR, >+ WorkbenchPlugin.PI_WORKBENCH, >+ NLS >+ .bind( >+ WorkbenchMessages.Perspective_couldNotBeFound, >+ id))); > } > XMLMemento memento = XMLMemento.createReadRoot(reader); > reader.close();
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 211350
:
120686
| 120833