Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 211350 | Differences between
and this patch

Collapse All | Expand All

(-)Eclipse UI/org/eclipse/ui/internal/messages.properties (+1 lines)
Lines 601-606 Link Here
601
Perspective_errorReadingState = Unable to read workbench state.
601
Perspective_errorReadingState = Unable to read workbench state.
602
Perspective_problemLoadingTitle = Loading Problems
602
Perspective_problemLoadingTitle = Loading Problems
603
Perspective_errorLoadingState = Unable to load perspective.
603
Perspective_errorLoadingState = Unable to load perspective.
604
Perspective_couldNotBeFound= Description of ''{0}'' perspective could not be found.
604
WorkbenchPage_problemRestoringTitle = Restoring Problems
605
WorkbenchPage_problemRestoringTitle = Restoring Problems
605
WorkbenchPage_errorReadingState = Unable to read workbench state.
606
WorkbenchPage_errorReadingState = Unable to read workbench state.
606
607
(-)Eclipse UI/org/eclipse/ui/internal/WorkbenchMessages.java (+3 lines)
Lines 884-889 Link Here
884
	public static String PerspectiveBar_saveAs;
884
	public static String PerspectiveBar_saveAs;
885
	public static String PerspectiveBar_reset;
885
	public static String PerspectiveBar_reset;
886
886
887
888
	public static String Perspective_couldNotBeFound;
889
887
	public static String PerspectiveSwitcher_dockOn;
890
	public static String PerspectiveSwitcher_dockOn;
888
	public static String PerspectiveSwitcher_topRight;
891
	public static String PerspectiveSwitcher_topRight;
889
	public static String PerspectiveSwitcher_topLeft;
892
	public static String PerspectiveSwitcher_topLeft;
(-)Eclipse UI/org/eclipse/ui/internal/registry/PerspectiveRegistry.java (+19 lines)
Lines 39-44 Link Here
39
import org.eclipse.jface.resource.StringConverter;
39
import org.eclipse.jface.resource.StringConverter;
40
import org.eclipse.jface.util.IPropertyChangeListener;
40
import org.eclipse.jface.util.IPropertyChangeListener;
41
import org.eclipse.jface.util.PropertyChangeEvent;
41
import org.eclipse.jface.util.PropertyChangeEvent;
42
import org.eclipse.osgi.util.NLS;
42
import org.eclipse.ui.IMemento;
43
import org.eclipse.ui.IMemento;
43
import org.eclipse.ui.IPerspectiveDescriptor;
44
import org.eclipse.ui.IPerspectiveDescriptor;
44
import org.eclipse.ui.IPerspectiveRegistry;
45
import org.eclipse.ui.IPerspectiveRegistry;
Lines 435-440 Link Here
435
				String xmlString = store.getString(perspectivesList[i] + PERSP);
436
				String xmlString = store.getString(perspectivesList[i] + PERSP);
436
				if (xmlString != null && xmlString.length() != 0) {
437
				if (xmlString != null && xmlString.length() != 0) {
437
					reader = new StringReader(xmlString);
438
					reader = new StringReader(xmlString);
439
				} else {
440
					throw new WorkbenchException(
441
							new Status(
442
									IStatus.ERROR,
443
									WorkbenchPlugin.PI_WORKBENCH,
444
									NLS
445
											.bind(
446
													WorkbenchMessages.Perspective_couldNotBeFound,
447
													perspectivesList[i])));
438
				}
448
				}
439
449
440
				// Restore the layout state.
450
				// Restore the layout state.
Lines 564-569 Link Here
564
		String xmlString = store.getString(id + PERSP);
574
		String xmlString = store.getString(id + PERSP);
565
		if (xmlString != null && xmlString.length() != 0) { // defined in store
575
		if (xmlString != null && xmlString.length() != 0) { // defined in store
566
			reader = new StringReader(xmlString);
576
			reader = new StringReader(xmlString);
577
		} else {
578
			throw new WorkbenchException(
579
					new Status(
580
							IStatus.ERROR,
581
							WorkbenchPlugin.PI_WORKBENCH,
582
							NLS
583
									.bind(
584
											WorkbenchMessages.Perspective_couldNotBeFound,
585
											id)));
567
		}
586
		}
568
		XMLMemento memento = XMLMemento.createReadRoot(reader);
587
		XMLMemento memento = XMLMemento.createReadRoot(reader);
569
		reader.close();
588
		reader.close();
(-)Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIDialogs.java (+14 lines)
Lines 10-15 Link Here
10
 *******************************************************************************/
10
 *******************************************************************************/
11
package org.eclipse.ui.tests.dialogs;
11
package org.eclipse.ui.tests.dialogs;
12
12
13
import java.io.IOException;
14
13
import junit.framework.TestCase;
15
import junit.framework.TestCase;
14
16
15
import org.eclipse.core.resources.IProject;
17
import org.eclipse.core.resources.IProject;
Lines 158-163 Link Here
158
        dialog.setInitialSelection(description);
160
        dialog.setInitialSelection(description);
159
        DialogCheck.assertDialog(dialog, this);
161
        DialogCheck.assertDialog(dialog, this);
160
    }
162
    }
163
    
164
    // see bug 211350
165
    public void testLoadNotExistingPerspective() throws IOException{
166
    	final String fakePerspectivID = "fakeperspetive";
167
		PerspectiveRegistry reg = (PerspectiveRegistry) WorkbenchPlugin
168
				.getDefault().getPerspectiveRegistry();
169
		try {
170
			reg.getCustomPersp(fakePerspectivID);
171
		} catch (WorkbenchException e) {
172
			assertTrue(e.getStatus().getMessage().indexOf(fakePerspectivID) != -1);
173
		}
174
    }
161
175
162
    public void testSelectPerspective() {
176
    public void testSelectPerspective() {
163
        Dialog dialog = new SelectPerspectiveDialog(getShell(), PlatformUI
177
        Dialog dialog = new SelectPerspectiveDialog(getShell(), PlatformUI

Return to bug 211350