/*
* Copyright (c) 2012-2016 Marsha Chechik, Alessio Di Sandro, Michalis Famelis,
* Rick Salay.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Alessio Di Sandro - Implementation.
*/
package edu.toronto.cs.se.mmint.mid.diagram.menu;
import java.net.URL;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.browser.IWebBrowser;
import org.eclipse.ui.browser.IWorkbenchBrowserSupport;
import edu.toronto.cs.se.mmint.MMINTException;
public class MMINTOpenWikiMenu extends AbstractHandler {
private final static String WIKI_WWW = "http://www.cs.toronto.edu:40404/modelepedia_local/index.php";
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
IWorkbenchBrowserSupport support = PlatformUI.getWorkbench().getBrowserSupport();
try {
IWebBrowser browser = support.createBrowser("MMINT Wiki");
browser.openURL(new URL(WIKI_WWW));
}
catch (Exception ex) {
MMINTException.print(IStatus.ERROR, "Error opening wiki page " + WIKI_WWW, ex);
}
return null;
}
}