commit 0c3e5a5de94e931f540428d0c1cf1f7527299c97
Author: Patrick Plitzner <p.plitzner@bgbm.org>
Date:   Wed Feb 14 09:57:49 2018 +0100

    ref #6925 Implement utility method to open links in external browser

diff --git a/eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/OpenExternalHelpHandler.java b/eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/OpenExternalHelpHandler.java
index b03e73122..18cf4c770 100644
--- a/eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/OpenExternalHelpHandler.java
+++ b/eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/OpenExternalHelpHandler.java
@@ -1,24 +1,23 @@
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
 
 package eu.etaxonomy.taxeditor;
 
-import java.net.MalformedURLException;
+import java.io.IOException;
 import java.net.URL;
 
 import org.apache.log4j.Logger;
 import org.eclipse.core.commands.AbstractHandler;
 import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.browser.IWorkbenchBrowserSupport;
+
+import eu.etaxonomy.taxeditor.workbench.WorkbenchUtility;
 
 /**
  * <p>OpenExternalHelpHandler class.</p>
@@ -30,23 +29,17 @@ import org.eclipse.ui.browser.IWorkbenchBrowserSupport;
 public class OpenExternalHelpHandler extends AbstractHandler {
 	private static final Logger logger = Logger.getLogger(OpenExternalHelpHandler.class);
 
-	/* (non-Javadoc)
-	 * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
-	 */
 	/** {@inheritDoc} */
-	public Object execute(ExecutionEvent event) throws ExecutionException {
+	@Override
+    public Object execute(ExecutionEvent event) throws ExecutionException {
 		String url = "http://wp5.e-taxonomy.eu/download/taxeditor/stable/EDITTaxonomicEditor-UserManual.pdf";
-	
+
 		try {
-			PlatformUI.getWorkbench().getBrowserSupport().createBrowser
-						(IWorkbenchBrowserSupport.AS_EXTERNAL, "aCustomId", "url", "url").openURL(new URL(url));
-		} catch (PartInitException e) {
-			logger.error(e);
-			throw new RuntimeException(e);
-		} catch (MalformedURLException e) {
-			logger.error(e);
-			throw new RuntimeException(e);
-		}
+            WorkbenchUtility.openWebpage(new URL(url));
+        } catch (IOException| RuntimeException e) {
+            logger.error(e);
+            throw new RuntimeException(e);
+        }
 
 		return null;
 	}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/UriWithLabelElement.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/UriWithLabelElement.java
index 284539b3a..92aa2e810 100644
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/UriWithLabelElement.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/UriWithLabelElement.java
@@ -9,7 +9,7 @@
 
 package eu.etaxonomy.taxeditor.ui.element;
 
-import java.net.MalformedURLException;
+import java.io.IOException;
 import java.net.URI;
 
 import org.eclipse.core.runtime.IStatus;
@@ -19,13 +19,12 @@ import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
 
 import eu.etaxonomy.taxeditor.l10n.Messages;
 import eu.etaxonomy.taxeditor.model.ImageResources;
 import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
+import eu.etaxonomy.taxeditor.workbench.WorkbenchUtility;
 
 /**
  * @author n.hoffmann
@@ -73,11 +72,9 @@ public class UriWithLabelElement extends AbstractUriWithExceptionLabelElement<UR
                 URI uri = parseText();
                 if(uri!=null){
                     try {
-                        PlatformUI.getWorkbench().getBrowserSupport().getExternalBrowser().openURL(uri.toURL());
-                    } catch (PartInitException pie) {
+                        WorkbenchUtility.openWebpage(uri.toURL());
+                    } catch (IOException pie) {
                         MessagingUtils.informationDialog(errorTitle, new Status(IStatus.WARNING, TaxeditorStorePlugin.PLUGIN_ID, errorText, pie));
-                    } catch (MalformedURLException mue) {
-                        MessagingUtils.informationDialog(errorTitle, new Status(IStatus.WARNING, TaxeditorStorePlugin.PLUGIN_ID, errorText, mue));
                     } catch (IllegalArgumentException iae) {
                         MessagingUtils.informationDialog(errorTitle, new Status(IStatus.WARNING, TaxeditorStorePlugin.PLUGIN_ID, errorText, iae));
                     }
@@ -94,6 +91,7 @@ public class UriWithLabelElement extends AbstractUriWithExceptionLabelElement<UR
 
 
 
+
     /**
      * {@inheritDoc}
      */
diff --git a/eu.etaxonomy.taxeditor.workbench/src/main/java/eu/etaxonomy/taxeditor/workbench/OpenExternalAboutPlatformHandler.java b/eu.etaxonomy.taxeditor.workbench/src/main/java/eu/etaxonomy/taxeditor/workbench/OpenExternalAboutPlatformHandler.java
index 9f1edf1db..6481a27da 100644
--- a/eu.etaxonomy.taxeditor.workbench/src/main/java/eu/etaxonomy/taxeditor/workbench/OpenExternalAboutPlatformHandler.java
+++ b/eu.etaxonomy.taxeditor.workbench/src/main/java/eu/etaxonomy/taxeditor/workbench/OpenExternalAboutPlatformHandler.java
@@ -9,14 +9,11 @@
 
 package eu.etaxonomy.taxeditor.workbench;
 
-import java.net.MalformedURLException;
+import java.io.IOException;
 import java.net.URL;
 
 import org.apache.log4j.Logger;
 import org.eclipse.e4.core.di.annotations.Execute;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.browser.IWorkbenchBrowserSupport;
 
 /**
  * @author p.ciardelli
@@ -29,18 +26,14 @@ public class OpenExternalAboutPlatformHandler {
 
 	@Execute
 	public Object execute() {
-		String url = "http://wp5.e-taxonomy.eu/";
+		String url = "https://cybertaxonomy.eu/";
 
 		try {
-			PlatformUI.getWorkbench().getBrowserSupport().createBrowser
-					(IWorkbenchBrowserSupport.AS_EXTERNAL, "aCustomId", "url", "url").openURL(new URL(url));
-		} catch (PartInitException e) {
-			logger.error(e);
-			throw new RuntimeException(e);
-		} catch (MalformedURLException e) {
-			logger.error(e);
-			throw new RuntimeException(e);
-		}
+            WorkbenchUtility.openWebpage(new URL(url));
+        } catch (IOException| RuntimeException e) {
+            logger.error(e);
+            throw new RuntimeException(e);
+        }
 
 		return null;
 	}
diff --git a/eu.etaxonomy.taxeditor.workbench/src/main/java/eu/etaxonomy/taxeditor/workbench/OpenExternalParserHelpHandler.java b/eu.etaxonomy.taxeditor.workbench/src/main/java/eu/etaxonomy/taxeditor/workbench/OpenExternalParserHelpHandler.java
index 12c9abc61..63cccdbbe 100644
--- a/eu.etaxonomy.taxeditor.workbench/src/main/java/eu/etaxonomy/taxeditor/workbench/OpenExternalParserHelpHandler.java
+++ b/eu.etaxonomy.taxeditor.workbench/src/main/java/eu/etaxonomy/taxeditor/workbench/OpenExternalParserHelpHandler.java
@@ -9,14 +9,11 @@
 
 package eu.etaxonomy.taxeditor.workbench;
 
-import java.net.MalformedURLException;
+import java.io.IOException;
 import java.net.URL;
 
 import org.apache.log4j.Logger;
 import org.eclipse.e4.core.di.annotations.Execute;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.browser.IWorkbenchBrowserSupport;
 
 /**
  * <p>OpenExternalParserHelpHandler class.</p>
@@ -34,12 +31,8 @@ public class OpenExternalParserHelpHandler {
 		String url = "http://dev.e-taxonomy.eu/trac/wiki/NameParserDocumentation";
 
 		try {
-			PlatformUI.getWorkbench().getBrowserSupport().createBrowser
-						(IWorkbenchBrowserSupport.AS_EXTERNAL, "aCustomId", "url", "url").openURL(new URL(url));
-		} catch (PartInitException e) {
-			logger.error(e);
-			throw new RuntimeException(e);
-		} catch (MalformedURLException e) {
+            WorkbenchUtility.openWebpage(new URL(url));
+		} catch (IOException| RuntimeException e) {
 			logger.error(e);
 			throw new RuntimeException(e);
 		}
diff --git a/eu.etaxonomy.taxeditor.workbench/src/main/java/eu/etaxonomy/taxeditor/workbench/WorkbenchUtility.java b/eu.etaxonomy.taxeditor.workbench/src/main/java/eu/etaxonomy/taxeditor/workbench/WorkbenchUtility.java
index 7835db44a..31c267a5a 100644
--- a/eu.etaxonomy.taxeditor.workbench/src/main/java/eu/etaxonomy/taxeditor/workbench/WorkbenchUtility.java
+++ b/eu.etaxonomy.taxeditor.workbench/src/main/java/eu/etaxonomy/taxeditor/workbench/WorkbenchUtility.java
@@ -9,6 +9,7 @@
 package eu.etaxonomy.taxeditor.workbench;
 
 import java.io.File;
+import java.net.URL;
 import java.util.List;
 
 import org.eclipse.core.runtime.Platform;
@@ -19,6 +20,7 @@ import org.eclipse.e4.ui.model.application.ui.basic.MPart;
 import org.eclipse.e4.ui.model.application.ui.basic.MPartSashContainerElement;
 import org.eclipse.e4.ui.model.application.ui.basic.MPartStack;
 import org.eclipse.e4.ui.workbench.modeling.EModelService;
+import org.eclipse.swt.program.Program;
 
 import eu.etaxonomy.taxeditor.workbench.part.IE4SavablePart;
 import eu.etaxonomy.taxeditor.workbench.part.ISelectionElementEditingPart;
@@ -97,4 +99,8 @@ public class WorkbenchUtility {
         }
         return null;
     }
+
+    public static boolean openWebpage(URL url){
+        return Program.launch(url.toString());
+    }
 }
