|
Lines 2467-2472
Link Here
|
| 2467 |
public IEditorPart openEditor(final IEditorInput input, |
2467 |
public IEditorPart openEditor(final IEditorInput input, |
| 2468 |
final String editorID, final boolean activate, final int matchFlags) |
2468 |
final String editorID, final boolean activate, final int matchFlags) |
| 2469 |
throws PartInitException { |
2469 |
throws PartInitException { |
|
|
2470 |
return openEditor(input, editorID, activate, matchFlags, null); |
| 2471 |
} |
| 2472 |
|
| 2473 |
/** |
| 2474 |
* This is not public API but for use internally. editorState can be <code>null</code>. |
| 2475 |
*/ |
| 2476 |
public IEditorPart openEditor(final IEditorInput input, |
| 2477 |
final String editorID, final boolean activate, final int matchFlags, |
| 2478 |
final IMemento editorState) |
| 2479 |
throws PartInitException { |
| 2470 |
if (input == null || editorID == null) { |
2480 |
if (input == null || editorID == null) { |
| 2471 |
throw new IllegalArgumentException(); |
2481 |
throw new IllegalArgumentException(); |
| 2472 |
} |
2482 |
} |
|
Lines 2478-2484
Link Here
|
| 2478 |
public void run() { |
2488 |
public void run() { |
| 2479 |
try { |
2489 |
try { |
| 2480 |
result[0] = busyOpenEditor(input, editorID, |
2490 |
result[0] = busyOpenEditor(input, editorID, |
| 2481 |
activate, matchFlags); |
2491 |
activate, matchFlags, editorState); |
| 2482 |
} catch (PartInitException e) { |
2492 |
} catch (PartInitException e) { |
| 2483 |
ex[0] = e; |
2493 |
ex[0] = e; |
| 2484 |
} |
2494 |
} |
|
Lines 2494-2507
Link Here
|
| 2494 |
* @see #openEditor(IEditorInput, String, boolean, int) |
2504 |
* @see #openEditor(IEditorInput, String, boolean, int) |
| 2495 |
*/ |
2505 |
*/ |
| 2496 |
private IEditorPart busyOpenEditor(IEditorInput input, String editorID, |
2506 |
private IEditorPart busyOpenEditor(IEditorInput input, String editorID, |
| 2497 |
boolean activate, int matchFlags) throws PartInitException { |
2507 |
boolean activate, int matchFlags, IMemento editorState) throws PartInitException { |
| 2498 |
|
2508 |
|
| 2499 |
final Workbench workbench = (Workbench) getWorkbenchWindow() |
2509 |
final Workbench workbench = (Workbench) getWorkbenchWindow() |
| 2500 |
.getWorkbench(); |
2510 |
.getWorkbench(); |
| 2501 |
workbench.largeUpdateStart(); |
2511 |
workbench.largeUpdateStart(); |
| 2502 |
|
2512 |
|
| 2503 |
try { |
2513 |
try { |
| 2504 |
return busyOpenEditorBatched(input, editorID, activate, matchFlags); |
2514 |
return busyOpenEditorBatched(input, editorID, activate, matchFlags, editorState); |
| 2505 |
|
2515 |
|
| 2506 |
} finally { |
2516 |
} finally { |
| 2507 |
workbench.largeUpdateEnd(); |
2517 |
workbench.largeUpdateEnd(); |
|
Lines 2514-2520
Link Here
|
| 2514 |
* @see IWorkbenchPage#openEditor(IEditorInput, String, boolean) |
2524 |
* @see IWorkbenchPage#openEditor(IEditorInput, String, boolean) |
| 2515 |
*/ |
2525 |
*/ |
| 2516 |
private IEditorPart busyOpenEditorBatched(IEditorInput input, |
2526 |
private IEditorPart busyOpenEditorBatched(IEditorInput input, |
| 2517 |
String editorID, boolean activate, int matchFlags) throws PartInitException { |
2527 |
String editorID, boolean activate, int matchFlags, IMemento editorState) throws PartInitException { |
| 2518 |
|
2528 |
|
| 2519 |
// If an editor already exists for the input, use it. |
2529 |
// If an editor already exists for the input, use it. |
| 2520 |
IEditorPart editor = getEditorManager().findEditor(editorID, input, matchFlags); |
2530 |
IEditorPart editor = getEditorManager().findEditor(editorID, input, matchFlags); |
|
Lines 2566-2572
Link Here
|
| 2566 |
// Otherwise, create a new one. This may cause the new editor to |
2576 |
// Otherwise, create a new one. This may cause the new editor to |
| 2567 |
// become the visible (i.e top) editor. |
2577 |
// become the visible (i.e top) editor. |
| 2568 |
IEditorReference ref = null; |
2578 |
IEditorReference ref = null; |
| 2569 |
ref = getEditorManager().openEditor(editorID, input, true); |
2579 |
ref = getEditorManager().openEditor(editorID, input, true, editorState); |
| 2570 |
if (ref != null) { |
2580 |
if (ref != null) { |
| 2571 |
editor = ref.getEditor(true); |
2581 |
editor = ref.getEditor(true); |
| 2572 |
} |
2582 |
} |