|
Lines 10-15
Link Here
|
| 10 |
*******************************************************************************/ |
10 |
*******************************************************************************/ |
| 11 |
package org.eclipse.ui.application; |
11 |
package org.eclipse.ui.application; |
| 12 |
|
12 |
|
|
|
13 |
import java.util.ArrayList; |
| 13 |
import org.eclipse.core.runtime.Assert; |
14 |
import org.eclipse.core.runtime.Assert; |
| 14 |
import org.eclipse.core.runtime.IStatus; |
15 |
import org.eclipse.core.runtime.IStatus; |
| 15 |
import org.eclipse.core.runtime.Status; |
16 |
import org.eclipse.core.runtime.Status; |
|
Lines 21-26
Link Here
|
| 21 |
import org.eclipse.ui.PlatformUI; |
22 |
import org.eclipse.ui.PlatformUI; |
| 22 |
import org.eclipse.ui.WorkbenchException; |
23 |
import org.eclipse.ui.WorkbenchException; |
| 23 |
import org.eclipse.ui.actions.ActionFactory; |
24 |
import org.eclipse.ui.actions.ActionFactory; |
|
|
25 |
import org.eclipse.ui.internal.EditorAreaHelper; |
| 26 |
import org.eclipse.ui.internal.PartStack; |
| 27 |
import org.eclipse.ui.internal.WorkbenchPage; |
| 24 |
import org.eclipse.ui.internal.WorkbenchWindowConfigurer; |
28 |
import org.eclipse.ui.internal.WorkbenchWindowConfigurer; |
| 25 |
import org.eclipse.ui.internal.util.PrefUtil; |
29 |
import org.eclipse.ui.internal.util.PrefUtil; |
| 26 |
import org.eclipse.ui.intro.IIntroManager; |
30 |
import org.eclipse.ui.intro.IIntroManager; |
|
Lines 134-139
Link Here
|
| 134 |
// do nothing |
138 |
// do nothing |
| 135 |
} |
139 |
} |
| 136 |
|
140 |
|
|
|
141 |
/** |
| 142 |
* Close any empty editor stacks that may have been left open when the |
| 143 |
* Workbench Window shut down. May be called from |
| 144 |
* {@link #postWindowRestore()} in the subclass but is not called by |
| 145 |
* default. |
| 146 |
* |
| 147 |
* @since 3.7 |
| 148 |
*/ |
| 149 |
protected void cleanUpEditorArea() { |
| 150 |
// close any empty Editor stacks that may have been left open |
| 151 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=110684 |
| 152 |
if (getWindowConfigurer() != null && getWindowConfigurer().getWindow() != null |
| 153 |
&& getWindowConfigurer().getWindow().getActivePage() != null) { |
| 154 |
WorkbenchPage activePage = (WorkbenchPage) getWindowConfigurer().getWindow() |
| 155 |
.getActivePage(); |
| 156 |
EditorAreaHelper editorAreaHelper = activePage.getEditorPresentation(); |
| 157 |
if (editorAreaHelper != null) { |
| 158 |
ArrayList workbooks = editorAreaHelper.getWorkbooks(); |
| 159 |
for (int i = 0; i < workbooks.size(); i++) { |
| 160 |
PartStack editorStack = (PartStack) workbooks.get(i); |
| 161 |
if (editorStack.getChildren().length == 0) { |
| 162 |
editorStack.getContainer().remove(editorStack); |
| 163 |
} |
| 164 |
} |
| 165 |
} |
| 166 |
} |
| 167 |
} |
| 168 |
|
| 137 |
/** |
169 |
/** |
| 138 |
* Opens the introduction componenet. |
170 |
* Opens the introduction componenet. |
| 139 |
* <p> |
171 |
* <p> |