Revision 2585

tmp/org.txm.rcp/src/main/java/org/txm/rcp/Application.java (revision 2585)
36 36
import java.util.Map;
37 37
import java.util.logging.Level;
38 38

  
39
import org.eclipse.core.commands.ExecutionException;
39 40
import org.eclipse.core.net.proxy.IProxyService;
40 41
import org.eclipse.core.runtime.Platform;
41 42
import org.eclipse.core.runtime.preferences.ConfigurationScope;
......
46 47
import org.eclipse.osgi.util.TextProcessor;
47 48
import org.eclipse.swt.SWT;
48 49
import org.eclipse.swt.widgets.Display;
50
import org.eclipse.swt.widgets.Event;
51
import org.eclipse.swt.widgets.Listener;
49 52
import org.eclipse.swt.widgets.MessageBox;
50 53
import org.eclipse.swt.widgets.Shell;
51 54
import org.eclipse.ui.PlatformUI;
52
import org.eclipse.ui.ide.IDE;
53 55
import org.eclipse.ui.internal.ide.ChooseWorkspaceData;
54
import org.eclipse.ui.internal.ide.ChooseWorkspaceDialog;
55 56
import org.eclipse.ui.internal.ide.IDEWorkbenchPlugin;
56 57
import org.osgi.framework.Bundle;
57 58
import org.osgi.framework.ServiceReference;
......
60 61
import org.txm.Toolbox;
61 62
import org.txm.core.messages.TXMCoreMessages;
62 63
import org.txm.core.preferences.TBXPreferences;
64
import org.txm.rcp.commands.workspace.LoadBinaryCorpus;
63 65
import org.txm.rcp.messages.TXMUIMessages;
64 66
import org.txm.rcp.preferences.RCPPreferences;
65 67
import org.txm.rcp.swt.dialog.CGUMessageDialog;
......
90 92

  
91 93
		Display display = PlatformUI.createDisplay();
92 94

  
95
		
96
		
93 97
		//		if (Platform.inDevelopmentMode() || Platform.inDebugMode()) {
94 98
		//			// this can not work in development environment
95 99
		//			// as it need to have a default workspace set to none
......
235 239
			// initialization code has been put in ApplicationWorkbenchAdvisor
236 240
			// as it should
237 241

  
242
			// add listener to catch --launcher.openFile 
243
			display.addListener(SWT.OpenDocument, new Listener() {
244

  
245
				@Override
246
				public void handleEvent(Event event) {
247
					if (event.text != null && event.text.endsWith(".txm")) {
248
						File f = new File(event.text);
249
						
250
						try {
251
							LoadBinaryCorpus.loadBinaryCorpusArchive(f);
252
						} catch (ExecutionException e) {
253
							// TODO Auto-generated catch block
254
							e.printStackTrace();
255
						}
256
					}
257
				}
258
			});
259
			
238 260
			//run the application mainloop
239 261
			awa = new ApplicationWorkbenchAdvisor();
240 262
			System.out.println("Running TXM workbench.");

Also available in: Unified diff