Révision 2222
tmp/org.txm.rcp/src/main/java/org/txm/rcp/swt/SelectDirectoryWidget.java (revision 2222) | ||
---|---|---|
1 | 1 |
package org.txm.rcp.swt; |
2 | 2 |
|
3 | 3 |
import org.eclipse.swt.SWT; |
4 |
import org.eclipse.swt.events.ModifyEvent; |
|
5 |
import org.eclipse.swt.events.ModifyListener; |
|
4 | 6 |
import org.eclipse.swt.events.SelectionEvent; |
5 | 7 |
import org.eclipse.swt.events.SelectionListener; |
6 | 8 |
import org.eclipse.swt.layout.GridData; |
... | ... | |
39 | 41 |
t = new Text(this, SWT.BORDER); |
40 | 42 |
t.setText(initialDefault); |
41 | 43 |
t.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false)); |
44 |
t.addModifyListener(new ModifyListener() { |
|
45 |
|
|
46 |
@Override |
|
47 |
public void modifyText(ModifyEvent e) { |
|
48 |
path = t.getText(); |
|
49 |
} |
|
50 |
}); |
|
42 | 51 |
|
43 | 52 |
Button selectDirectoryButton = new Button(this, SWT.PUSH); |
44 | 53 |
selectDirectoryButton.setText("..."); |
... | ... | |
63 | 72 |
} |
64 | 73 |
|
65 | 74 |
public String getPath() { |
75 |
if (!t.isDisposed()) return t.getText(); |
|
76 |
|
|
66 | 77 |
return path; |
67 | 78 |
} |
68 | 79 |
} |
tmp/org.txm.rcp/src/main/java/org/txm/rcp/ApplicationWorkbenchAdvisor.java (revision 2222) | ||
---|---|---|
118 | 118 |
import org.txm.utils.io.IOUtils; |
119 | 119 |
import org.txm.utils.logger.Log; |
120 | 120 |
|
121 |
// TODO: Auto-generated Javadoc |
|
122 | 121 |
/** |
123 | 122 |
* Manages the opening and closing of TXM |
124 | 123 |
*/ |
... | ... | |
259 | 258 |
} |
260 | 259 |
} |
261 | 260 |
|
262 |
public static void closeEmptyEditors() { |
|
261 |
public static void closeEmptyEditors(boolean closeOthersEditors) {
|
|
263 | 262 |
Log.fine("Closing empty editors..."); //$NON-NLS-1$ |
264 | 263 |
String REF = "org.eclipse.ui.internal.emptyEditorTab"; //$NON-NLS-1$ |
265 | 264 |
|
266 | 265 |
for (final IWorkbenchPage page : DeleteObject.getPages()) { |
267 | 266 |
ArrayList<IEditorReference> editorRefsList = new ArrayList<IEditorReference>(); |
268 | 267 |
for (IEditorReference editorref : page.getEditorReferences()) { |
269 |
if (editorref.getId().equals(REF)) { |
|
268 |
if (closeOthersEditors || editorref.getId().equals(REF)) {
|
|
270 | 269 |
Log.fine(TXMUIMessages.closingColon+editorref.getId()); |
271 | 270 |
editorRefsList.add(editorref); |
272 | 271 |
} |
... | ... | |
479 | 478 |
*/ |
480 | 479 |
@Override |
481 | 480 |
public boolean preShutdown() { |
481 |
try { |
|
482 |
closeEmptyEditors(true); |
|
483 |
} catch(Exception e) { |
|
484 |
e.printStackTrace(); |
|
485 |
} |
|
486 |
|
|
482 | 487 |
return continueShutDownForPersistedResults(); |
483 | 488 |
} |
484 | 489 |
|
... | ... | |
978 | 983 |
|
979 | 984 |
// CLOSE Empty&Error editors |
980 | 985 |
jobHandler.setTaskName(TXMUIMessages.closingEmptyEditors); |
981 |
closeEmptyEditors(); |
|
986 |
closeEmptyEditors(false);
|
|
982 | 987 |
|
983 | 988 |
// remove some preference pages |
984 | 989 |
setPreferencesConfiguration(); |
Formats disponibles : Unified diff