Alternative versions for build.properties added. Current state set to "dependencies...
[taxeditor.git] / eu.etaxonomy.taxeditor.application / src / main / java / eu / etaxonomy / taxeditor / OpenExternalParserHelpHandler.java
1 // $Id$
2 /**
3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
6 *
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
9 */
10
11 package eu.etaxonomy.taxeditor;
12
13 import java.net.MalformedURLException;
14 import java.net.URL;
15
16 import org.apache.log4j.Logger;
17 import org.eclipse.core.commands.AbstractHandler;
18 import org.eclipse.core.commands.ExecutionEvent;
19 import org.eclipse.core.commands.ExecutionException;
20 import org.eclipse.ui.PartInitException;
21 import org.eclipse.ui.PlatformUI;
22 import org.eclipse.ui.browser.IWorkbenchBrowserSupport;
23
24 /**
25 * <p>OpenExternalParserHelpHandler class.</p>
26 *
27 * @author p.ciardelli
28 * @created 04.09.2009
29 * @version 1.0
30 */
31 public class OpenExternalParserHelpHandler extends AbstractHandler {
32 private static final Logger logger = Logger.getLogger(OpenExternalParserHelpHandler.class);
33
34 /* (non-Javadoc)
35 * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
36 */
37 /** {@inheritDoc} */
38 public Object execute(ExecutionEvent event) throws ExecutionException {
39 String url = "http://dev.e-taxonomy.eu/trac/wiki/NameParserDocumentation";
40
41 try {
42 PlatformUI.getWorkbench().getBrowserSupport().createBrowser
43 (IWorkbenchBrowserSupport.AS_EXTERNAL, "aCustomId", "url", "url").openURL(new URL(url));
44 } catch (PartInitException e) {
45 logger.error(e);
46 throw new RuntimeException(e);
47 } catch (MalformedURLException e) {
48 logger.error(e);
49 throw new RuntimeException(e);
50 }
51
52 return null;
53 }
54 }