From 31e63eaaafc9602cec5f24bf151c3fab951ee32a Mon Sep 17 00:00:00 2001 From: dgelessus <dgelessus@users.noreply.github.com> Date: Tue, 27 Feb 2024 16:49:10 +0100 Subject: [PATCH] Remove all of the website opening menu items They just take up menu space and probably nobody will miss them. --- de.bmotionstudio.gef.editor/plugin.xml | 12 --- .../editor/handler/OpenWebsiteHandler.java | 39 ---------- de.prob.plugin/fragment.xml | 19 ----- de.prob.ui/plugin.xml | 78 ------------------- .../prob/ui/internal/OpenWebsiteCommand.java | 46 ----------- .../ui/ticket/SubmitBugreportCommand.java | 25 ------ 6 files changed, 219 deletions(-) delete mode 100644 de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/handler/OpenWebsiteHandler.java delete mode 100644 de.prob.ui/src/de/prob/ui/internal/OpenWebsiteCommand.java delete mode 100644 de.prob.ui/src/de/prob/ui/ticket/SubmitBugreportCommand.java diff --git a/de.bmotionstudio.gef.editor/plugin.xml b/de.bmotionstudio.gef.editor/plugin.xml index cf91ea19..f08929a7 100644 --- a/de.bmotionstudio.gef.editor/plugin.xml +++ b/de.bmotionstudio.gef.editor/plugin.xml @@ -73,13 +73,6 @@ </visibleWhen> </command> </menuContribution> - <menuContribution locationURI="menu:help"> - <command - commandId="de.bmotionstudio.gef.editor.command.openBMotionStudioWebsite" - label="BMotion Studio website" - style="push"> - </command> - </menuContribution> <menuContribution locationURI="toolbar:org.eclipse.ui.main.toolbar"> <toolbar @@ -104,11 +97,6 @@ </extension> <extension 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 id="de.bmotionstudio.command.startVisualizationFromEditor" name="Start Visualization from Editor"> diff --git a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/handler/OpenWebsiteHandler.java b/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/handler/OpenWebsiteHandler.java deleted file mode 100644 index 5a956e44..00000000 --- a/de.bmotionstudio.gef.editor/src/de/bmotionstudio/gef/editor/handler/OpenWebsiteHandler.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * (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; - } - -} diff --git a/de.prob.plugin/fragment.xml b/de.prob.plugin/fragment.xml index 003705c9..a6ecb8c3 100644 --- a/de.prob.plugin/fragment.xml +++ b/de.prob.plugin/fragment.xml @@ -13,25 +13,6 @@ <extension 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 locationURI="toolbar:org.eclipse.ui.main.toolbar"> <toolbar diff --git a/de.prob.ui/plugin.xml b/de.prob.ui/plugin.xml index 8074de3f..ea19fd95 100644 --- a/de.prob.ui/plugin.xml +++ b/de.prob.ui/plugin.xml @@ -101,37 +101,6 @@ name="ProB"> </page> </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 point="org.eclipse.ui.commands"> @@ -140,21 +109,6 @@ id="de.prob.ui.commands.category" name="ProB"> </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 categoryId="de.prob.ui.commands.category" id="de.prob.ui.probconfiguration" @@ -360,18 +314,6 @@ </extension> <extension 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 commandId="de.prob.ui.probconfiguration"> <class @@ -818,26 +760,6 @@ </extension> <extension 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 locationURI="toolbar:de.prob.ui.StateView"> <command diff --git a/de.prob.ui/src/de/prob/ui/internal/OpenWebsiteCommand.java b/de.prob.ui/src/de/prob/ui/internal/OpenWebsiteCommand.java deleted file mode 100644 index 8eb13950..00000000 --- a/de.prob.ui/src/de/prob/ui/internal/OpenWebsiteCommand.java +++ /dev/null @@ -1,46 +0,0 @@ -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; - } - -} diff --git a/de.prob.ui/src/de/prob/ui/ticket/SubmitBugreportCommand.java b/de.prob.ui/src/de/prob/ui/ticket/SubmitBugreportCommand.java deleted file mode 100644 index 45c1bcf0..00000000 --- a/de.prob.ui/src/de/prob/ui/ticket/SubmitBugreportCommand.java +++ /dev/null @@ -1,25 +0,0 @@ -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; - } - -} -- GitLab