Skip to content
Snippets Groups Projects
Commit 31e63eaa authored by dgelessus's avatar dgelessus
Browse files

Remove all of the website opening menu items

They just take up menu space and probably nobody will miss them.
parent ad91466c
Branches
No related tags found
No related merge requests found
...@@ -73,13 +73,6 @@ ...@@ -73,13 +73,6 @@
</visibleWhen> </visibleWhen>
</command> </command>
</menuContribution> </menuContribution>
<menuContribution locationURI="menu:help">
<command
commandId="de.bmotionstudio.gef.editor.command.openBMotionStudioWebsite"
label="BMotion Studio website"
style="push">
</command>
</menuContribution>
<menuContribution <menuContribution
locationURI="toolbar:org.eclipse.ui.main.toolbar"> locationURI="toolbar:org.eclipse.ui.main.toolbar">
<toolbar <toolbar
...@@ -104,11 +97,6 @@ ...@@ -104,11 +97,6 @@
</extension> </extension>
<extension <extension
point="org.eclipse.ui.commands"> point="org.eclipse.ui.commands">
<command
defaultHandler="de.bmotionstudio.gef.editor.handler.OpenWebsiteHandler"
id="de.bmotionstudio.gef.editor.command.openBMotionStudioWebsite"
name="Open website">
</command>
<command <command
id="de.bmotionstudio.command.startVisualizationFromEditor" id="de.bmotionstudio.command.startVisualizationFromEditor"
name="Start Visualization from Editor"> name="Start Visualization from Editor">
......
/**
* (c) 2009 Lehrstuhl fuer Softwaretechnik und Programmiersprachen,
* Heinrich Heine Universitaet Duesseldorf
* This software is licenced under EPL 1.0 (http://www.eclipse.org/org/documents/epl-v10.html)
* */
package de.bmotionstudio.gef.editor.handler;
import java.net.MalformedURLException;
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.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import de.prob.logging.Logger;
public class OpenWebsiteHandler extends AbstractHandler {
private static final String URL = "https://prob.hhu.de/w/index.php/BMotion_Studio";
public Object execute(ExecutionEvent event) throws ExecutionException {
try {
PlatformUI.getWorkbench().getBrowserSupport().getExternalBrowser()
.openURL(new URL(URL));
} catch (PartInitException e) {
final String message = "Part init exception occurred\n"
+ e.getLocalizedMessage();
Logger.notifyUser(message, e);
} catch (MalformedURLException e) {
final String message = "This really should never happen unless the http protocol changes";
Logger.notifyUser(message, e);
}
return null;
}
}
...@@ -13,25 +13,6 @@ ...@@ -13,25 +13,6 @@
<extension <extension
point="org.eclipse.ui.menus"> point="org.eclipse.ui.menus">
<menuContribution
locationURI="menu:org.eclipse.ui.main.menu">
<menu
id="prob"
label="ProB"
mnemonic="P">
<menu
id="contact"
label="Contact"
mnemonic="C">
<separator
name="bugs">
</separator>
<separator
name="contact">
</separator>
</menu>
</menu>
</menuContribution>
<menuContribution <menuContribution
locationURI="toolbar:org.eclipse.ui.main.toolbar"> locationURI="toolbar:org.eclipse.ui.main.toolbar">
<toolbar <toolbar
......
...@@ -101,37 +101,6 @@ ...@@ -101,37 +101,6 @@
name="ProB"> name="ProB">
</page> </page>
</extension> </extension>
<!--
<extension
point="org.eclipse.ui.actionSets">
<actionSet
description="Web Action Set"
id="de.prob.core.ticket.actionSet"
label="Web Action Set"
visible="true">
<menu
id="probMenu"
label="ProB">
<separator
name="bugReport">
</separator>
</menu>
<action
class="de.prob.ui.ticket.OpenBugReportWebsite"
id="OpenBugReportWebsite"
label="Open Bugreport Website"
menubarPath="probMenu/bugReport">
</action>
<action
class="de.prob.ui.ticket.NewBugReportAction"
id="NewBugReportAction"
label="Submit Bugreport"
menubarPath="probMenu/bugReport">
</action>
</actionSet>
</extension>
-->
<extension <extension
point="org.eclipse.ui.commands"> point="org.eclipse.ui.commands">
...@@ -140,21 +109,6 @@ ...@@ -140,21 +109,6 @@
id="de.prob.ui.commands.category" id="de.prob.ui.commands.category"
name="ProB"> name="ProB">
</category> </category>
<command
categoryId="de.prob.ui.commands.category"
id="de.prob.ui.openWebsite"
name="Open Website">
<commandParameter
id="de.prob.ui.openwebsite.url"
name="URL"
optional="false">
</commandParameter>
</command>
<command
categoryId="de.prob.ui.commands.category"
id="de.prob.ui.bugreport"
name="Submit Bugreport">
</command>
<command <command
categoryId="de.prob.ui.commands.category" categoryId="de.prob.ui.commands.category"
id="de.prob.ui.probconfiguration" id="de.prob.ui.probconfiguration"
...@@ -360,18 +314,6 @@ ...@@ -360,18 +314,6 @@
</extension> </extension>
<extension <extension
point="org.eclipse.ui.handlers"> point="org.eclipse.ui.handlers">
<handler
commandId="de.prob.ui.openWebsite">
<class
class="de.prob.ui.internal.OpenWebsiteCommand">
</class>
</handler>
<handler
commandId="de.prob.ui.bugreport">
<class
class="de.prob.ui.ticket.SubmitBugreportCommand">
</class>
</handler>
<handler <handler
commandId="de.prob.ui.probconfiguration"> commandId="de.prob.ui.probconfiguration">
<class <class
...@@ -818,26 +760,6 @@ ...@@ -818,26 +760,6 @@
</extension> </extension>
<extension <extension
point="org.eclipse.ui.menus"> point="org.eclipse.ui.menus">
<menuContribution
locationURI="menu:contact">
<command
commandId="de.prob.ui.openWebsite"
label="Open ProB Website"
mnemonic="W"
style="push">
<parameter
name="de.prob.ui.openwebsite.url"
value="http://www.stups.uni-duesseldorf.de/ProB">
</parameter>
</command>
<command
commandId="de.prob.ui.bugreport"
label="Open Bugtracker Website"
mnemonic="W"
style="push">
</command>
</menuContribution>
<menuContribution <menuContribution
locationURI="toolbar:de.prob.ui.StateView"> locationURI="toolbar:de.prob.ui.StateView">
<command <command
......
package de.prob.ui.internal;
import java.net.MalformedURLException;
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.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.browser.IWorkbenchBrowserSupport;
import de.prob.logging.Logger;
public class OpenWebsiteCommand extends AbstractHandler {
public Object execute(final ExecutionEvent event) throws ExecutionException {
String url = event.getParameter("de.prob.ui.openwebsite.url");
URL websiteurl = null;
try {
websiteurl = new URL(url);
} catch (MalformedURLException e1) {
// File a bug report!
String message = "Internal error. Malformed website URL (" + url
+ "). Please file a bug report.";
Logger.notifyUser(message, e1);
return null;
}
IWorkbenchBrowserSupport browserSupport = PlatformUI.getWorkbench()
.getBrowserSupport();
try {
browserSupport.getExternalBrowser().openURL(websiteurl);
} catch (PartInitException e1) {
String message = "Internal error. Cannt open external browser.";
Logger.notifyUser(message, e1);
return null;
}
return null;
}
}
package de.prob.ui.ticket;
import java.net.MalformedURLException;
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.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.browser.IWebBrowser;
public class SubmitBugreportCommand extends AbstractHandler {
public Object execute(final ExecutionEvent event) throws ExecutionException {
try {
IWebBrowser browser = PlatformUI.getWorkbench().getBrowserSupport().getExternalBrowser();
browser.openURL(new URL("https://github.com/hhu-stups/prob-issues/issues/new/choose"));
} catch (MalformedURLException | PartInitException e) {
throw new ExecutionException(e.getMessage(), e);
}
return null;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment