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 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
(-)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 (-4 / +27 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 55-62 Link Here
55
import org.eclipse.ui.internal.WorkbenchPage;
56
import org.eclipse.ui.internal.WorkbenchPage;
56
import org.eclipse.ui.internal.WorkbenchPlugin;
57
import org.eclipse.ui.internal.WorkbenchPlugin;
57
import org.eclipse.ui.internal.handlers.ClosePerspectiveHandler;
58
import org.eclipse.ui.internal.handlers.ClosePerspectiveHandler;
58
import org.eclipse.ui.internal.misc.StatusUtil;
59
import org.eclipse.ui.internal.util.PrefUtil;
59
import org.eclipse.ui.internal.util.PrefUtil;
60
import org.eclipse.ui.statushandlers.IStatusAdapterConstants;
61
import org.eclipse.ui.statushandlers.StatusAdapter;
60
import org.eclipse.ui.statushandlers.StatusManager;
62
import org.eclipse.ui.statushandlers.StatusManager;
61
63
62
/**
64
/**
Lines 435-440 Link Here
435
				String xmlString = store.getString(perspectivesList[i] + PERSP);
437
				String xmlString = store.getString(perspectivesList[i] + PERSP);
436
				if (xmlString != null && xmlString.length() != 0) {
438
				if (xmlString != null && xmlString.length() != 0) {
437
					reader = new StringReader(xmlString);
439
					reader = new StringReader(xmlString);
440
				} else {
441
					throw new WorkbenchException(
442
							new Status(
443
									IStatus.ERROR,
444
									WorkbenchPlugin.PI_WORKBENCH,
445
									NLS
446
											.bind(
447
													WorkbenchMessages.Perspective_couldNotBeFound,
448
													perspectivesList[i])));
438
				}
449
				}
439
450
440
				// Restore the layout state.
451
				// Restore the layout state.
Lines 514-523 Link Here
514
		String msg = WorkbenchMessages.Perspective_errorLoadingState;
525
		String msg = WorkbenchMessages.Perspective_errorLoadingState;
515
		if (status == null) {
526
		if (status == null) {
516
			IStatus errStatus = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, msg); 
527
			IStatus errStatus = new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, msg); 
517
	    	StatusManager.getManager().handle(errStatus, StatusManager.SHOW);
528
			StatusManager.getManager().handle(errStatus,
529
					StatusManager.SHOW | StatusManager.LOG);
518
		} else {
530
		} else {
519
			IStatus errStatus = StatusUtil.newStatus(status, msg); 
531
			StatusAdapter sa = new StatusAdapter(status);
520
	    	StatusManager.getManager().handle(errStatus, StatusManager.SHOW);
532
			sa.setProperty(IStatusAdapterConstants.TITLE_PROPERTY, msg);
533
			StatusManager.getManager().handle(sa,
534
					StatusManager.SHOW | StatusManager.LOG);
521
		}
535
		}
522
	}
536
	}
523
537
Lines 564-569 Link Here
564
		String xmlString = store.getString(id + PERSP);
578
		String xmlString = store.getString(id + PERSP);
565
		if (xmlString != null && xmlString.length() != 0) { // defined in store
579
		if (xmlString != null && xmlString.length() != 0) { // defined in store
566
			reader = new StringReader(xmlString);
580
			reader = new StringReader(xmlString);
581
		} else {
582
			throw new WorkbenchException(
583
					new Status(
584
							IStatus.ERROR,
585
							WorkbenchPlugin.PI_WORKBENCH,
586
							NLS
587
									.bind(
588
											WorkbenchMessages.Perspective_couldNotBeFound,
589
											id)));
567
		}
590
		}
568
		XMLMemento memento = XMLMemento.createReadRoot(reader);
591
		XMLMemento memento = XMLMemento.createReadRoot(reader);
569
		reader.close();
592
		reader.close();

Return to bug 211350