// Path: AnyEditTools/src/de/loskutov/anyedit/AnyEditToolsPlugin.java
// public class AnyEditToolsPlugin extends AbstractUIPlugin {
// 
//     private static AnyEditToolsPlugin plugin;
// 
//     private static boolean isSaveHookInitialized;
// 
//     /**
//      * The constructor.
//      */
//     public AnyEditToolsPlugin() {
//         super();
//         if(plugin != null) {
//             throw new IllegalStateException("AnyEditToolsPlugin is a singleton!");
//         }
//         plugin = this;
//     }
// 
//     public static String getId(){
//         return getDefault().getBundle().getSymbolicName();
//     }
// 
//     /**
//      * Returns the shared instance.
//      */
//     public static AnyEditToolsPlugin getDefault() {
//         return plugin;
//     }
// 
//     /**
//      * Returns the workspace instance.
//      */
//     public static Shell getShell() {
//         return getDefault().getWorkbench().getActiveWorkbenchWindow().getShell();
//     }
// 
//     public static void errorDialog(String message, Throwable error) {
//         Shell shell = getShell();
//         if (message == null) {
//             message = Messages.error;
//         }
//         message = message + " " + error.getMessage();
// 
//         getDefault().getLog().log(
//                 new Status(IStatus.ERROR, getId(), IStatus.OK, message, error));
// 
//         MessageDialog.openError(shell, Messages.title, message);
//     }
// 
//     /**
//      * @param error
//      */
//     public static void logError(String message, Throwable error) {
//         if (message == null) {
//             message = error.getMessage();
//             if (message == null) {
//                 message = error.toString();
//             }
//         }
//         getDefault().getLog().log(
//                 new Status(IStatus.ERROR, getId(), IStatus.OK, message, error));
//     }
// 
//     public static void logInfo(String message) {
//         getDefault().getLog().log(
//                 new Status(IStatus.INFO, getId(), IStatus.OK, message, null));
//     }
// 
//     public static void errorDialog(String message) {
//         Shell shell = getShell();
//         MessageDialog.openError(shell, Messages.title, message);
//     }
// 
//     /**
//      * @param isSaveHookInitialized
//      *            The isSaveHookInitialized to set.
//      */
//     public static void setSaveHookInitialized(boolean isSaveHookInitialized) {
//         AnyEditToolsPlugin.isSaveHookInitialized = isSaveHookInitialized;
//     }
// 
//     /**
//      * @return Returns the isSaveHookInitialized.
//      */
//     public static boolean isSaveHookInitialized() {
//         return isSaveHookInitialized;
//     }
// 
// }


import java.net.MalformedURLException;
import java.net.URL;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Link;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.browser.IWebBrowser;
import org.eclipse.ui.browser.IWorkbenchBrowserSupport;
import de.loskutov.anyedit.AnyEditToolsPlugin;
            }
        });

        link = new Link(commonPanel, SWT.NONE);
        link.setFont(font);
        link.setText(" - <a>make a donation to support plugin development</a>");
        link.setToolTipText("You do NOT need a PayPal account!");
        link.addListener (SWT.Selection, new Listener () {
            @Override
            public void handleEvent(Event event) {
                handleUrlClick("https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=R5SHJLNGUXKHU");
            }
        });
    }

    private static void handleUrlClick(final String urlStr) {
        try {
            IWorkbenchBrowserSupport support = PlatformUI.getWorkbench().getBrowserSupport();
            IWebBrowser externalBrowser = support.getExternalBrowser();
            if(externalBrowser != null){
                externalBrowser.openURL(new URL(urlStr));
            } else {
                IWebBrowser browser = support.createBrowser(urlStr);
                if(browser != null){
                    browser.openURL(new URL(urlStr));
                }
            }
        } catch (PartInitException e) {
            AnyEditToolsPlugin.logError("Failed to open url " + urlStr, e);
        } catch (MalformedURLException e) {
// Path: AnyEditTools/src/de/loskutov/anyedit/AnyEditToolsPlugin.java
// public class AnyEditToolsPlugin extends AbstractUIPlugin {
// 
//     private static AnyEditToolsPlugin plugin;
// 
//     private static boolean isSaveHookInitialized;
// 
//     /**
//      * The constructor.
//      */
//     public AnyEditToolsPlugin() {
//         super();
//         if(plugin != null) {
//             throw new IllegalStateException("AnyEditToolsPlugin is a singleton!");
//         }
//         plugin = this;
//     }
// 
//     public static String getId(){
//         return getDefault().getBundle().getSymbolicName();
//     }
// 
//     /**
//      * Returns the shared instance.
//      */
//     public static AnyEditToolsPlugin getDefault() {
//         return plugin;
//     }
// 
//     /**
//      * Returns the workspace instance.
//      */
//     public static Shell getShell() {
//         return getDefault().getWorkbench().getActiveWorkbenchWindow().getShell();
//     }
// 
//     public static void errorDialog(String message, Throwable error) {
//         Shell shell = getShell();
//         if (message == null) {
//             message = Messages.error;
//         }
//         message = message + " " + error.getMessage();
// 
//         getDefault().getLog().log(
//                 new Status(IStatus.ERROR, getId(), IStatus.OK, message, error));
// 
//         MessageDialog.openError(shell, Messages.title, message);
//     }
// 
//     /**
//      * @param error
//      */
//     public static void logError(String message, Throwable error) {
//         if (message == null) {
//             message = error.getMessage();
//             if (message == null) {
//                 message = error.toString();
//             }
//         }
//         getDefault().getLog().log(
//                 new Status(IStatus.ERROR, getId(), IStatus.OK, message, error));
//     }
// 
//     public static void logInfo(String message) {
//         getDefault().getLog().log(
//                 new Status(IStatus.INFO, getId(), IStatus.OK, message, null));
//     }
// 
//     public static void errorDialog(String message) {
//         Shell shell = getShell();
//         MessageDialog.openError(shell, Messages.title, message);
//     }
// 
//     /**
//      * @param isSaveHookInitialized
//      *            The isSaveHookInitialized to set.
//      */
//     public static void setSaveHookInitialized(boolean isSaveHookInitialized) {
//         AnyEditToolsPlugin.isSaveHookInitialized = isSaveHookInitialized;
//     }
// 
//     /**
//      * @return Returns the isSaveHookInitialized.
//      */
//     public static boolean isSaveHookInitialized() {
//         return isSaveHookInitialized;
//     }
// 
// }


// Path: AnyEditTools/src/de/loskutov/anyedit/ui/preferences/SupportPanel.java
import java.net.MalformedURLException;
import java.net.URL;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Link;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.browser.IWebBrowser;
import org.eclipse.ui.browser.IWorkbenchBrowserSupport;
import de.loskutov.anyedit.AnyEditToolsPlugin;

            }
        });

        link = new Link(commonPanel, SWT.NONE);
        link.setFont(font);
        link.setText(" - <a>make a donation to support plugin development</a>");
        link.setToolTipText("You do NOT need a PayPal account!");
        link.addListener (SWT.Selection, new Listener () {
            @Override
            public void handleEvent(Event event) {
                handleUrlClick("https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=R5SHJLNGUXKHU");
            }
        });
    }

    private static void handleUrlClick(final String urlStr) {
        try {
            IWorkbenchBrowserSupport support = PlatformUI.getWorkbench().getBrowserSupport();
            IWebBrowser externalBrowser = support.getExternalBrowser();
            if(externalBrowser != null){
                externalBrowser.openURL(new URL(urlStr));
            } else {
                IWebBrowser browser = support.createBrowser(urlStr);
                if(browser != null){
                    browser.openURL(new URL(urlStr));
                }
            }
        } catch (PartInitException e) {
            AnyEditToolsPlugin.logError("Failed to open url " + urlStr, e);
        } catch (MalformedURLException e) {
            AnyEditToolsPlugin.logError("Failed to open url " + urlStr, e);