Révision 3619
TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/Application.java (revision 3619) | ||
---|---|---|
48 | 48 |
import org.eclipse.swt.widgets.Display; |
49 | 49 |
import org.eclipse.swt.widgets.MessageBox; |
50 | 50 |
import org.eclipse.swt.widgets.Shell; |
51 |
import org.eclipse.ui.IWorkbench; |
|
51 | 52 |
import org.eclipse.ui.PlatformUI; |
52 | 53 |
import org.eclipse.ui.internal.ide.ChooseWorkspaceData; |
53 | 54 |
import org.eclipse.ui.internal.ide.IDEWorkbenchPlugin; |
... | ... | |
64 | 65 |
import org.txm.utils.BundleUtils; |
65 | 66 |
import org.txm.utils.logger.Log; |
66 | 67 |
|
68 |
|
|
67 | 69 |
/** |
68 | 70 |
* This class controls all aspects of the application's execution. |
69 | 71 |
*/ |
70 | 72 |
public class Application implements IApplication { |
71 |
|
|
72 | 73 |
/** The Constant PLUGIN_ID. */ |
73 | 74 |
public static final String PLUGIN_ID = "org.txm.rcp"; //$NON-NLS-1$ |
74 | 75 |
|
... | ... | |
87 | 88 |
|
88 | 89 |
Display display = PlatformUI.createDisplay(); |
89 | 90 |
|
91 |
|
|
90 | 92 |
// if (Platform.inDevelopmentMode() || Platform.inDebugMode()) { |
91 | 93 |
// // this can not work in development environment |
92 | 94 |
// // as it need to have a default workspace set to none |
... | ... | |
160 | 162 |
Toolbox.setPreference(TBXPreferences.LOG_LEVEL, "ALL"); //$NON-NLS-1$ |
161 | 163 |
Toolbox.setPreference(TBXPreferences.LOG_STACKTRACE, true); |
162 | 164 |
} |
163 |
if (argsList.contains("-run")) { //$NON-NLS-1$ |
|
165 |
|
|
166 |
if (argsList.contains("-run") || System.getProperty("os.name").contains("Mac") || Platform.inDevelopmentMode()) { //$NON-NLS-1$ |
|
164 | 167 |
System.out.println("Running TXM"); //$NON-NLS-1$ |
165 | 168 |
// FIXME: need to check that all has been well moved in Workspace class or build.properties |
166 | 169 |
// } else if (argsList.contains("-standalone")) { //$NON-NLS-1$ |
... | ... | |
232 | 235 |
Log.warning(TXMCoreMessages.bind(TXMUIMessages.couldNotStartProxyConfigurationColon, e)); |
233 | 236 |
} |
234 | 237 |
|
235 |
try { |
|
236 |
// initialization code has been put in ApplicationWorkbenchAdvisor |
|
237 |
// as it should |
|
238 |
|
|
239 |
// add listener to catch --launcher.openFile |
|
240 |
// display.addListener(SWT.OpenDocument, new Listener() { |
|
241 |
// |
|
242 |
// @Override |
|
243 |
// public void handleEvent(Event event) { |
|
244 |
// if (event.text != null && event.text.endsWith(".txm")) { |
|
245 |
// File f = new File(event.text); |
|
246 |
// |
|
247 |
// try { |
|
248 |
// LoadBinaryCorpus.loadBinaryCorpusArchive(f); |
|
249 |
// } catch (ExecutionException e) { |
|
250 |
// // TODO Auto-generated catch block |
|
251 |
// e.printStackTrace(); |
|
252 |
// } |
|
253 |
// } |
|
254 |
// } |
|
255 |
// }); |
|
256 |
|
|
238 |
try { |
|
257 | 239 |
// run the application mainloop |
258 | 240 |
awa = new ApplicationWorkbenchAdvisor(); |
259 | 241 |
System.out.println("Running TXM workbench."); //$NON-NLS-1$ |
Formats disponibles : Unified diff