|
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(); |