From: Debayan Sutradhar Date: Tue, 01 Jun 2021 00:36:08 +0530 Subject: [Website Action] - Cleanup and updated to use new Action API --- [Website Action] - Cleanup and updated to use new Action API --- --- 'a/websiteaction/pom.xml' +++ b/websiteaction/pom.xml @@ -6,7 +6,7 @@ com.stream-pi websiteaction - 1.0.0 + 1.0.1 @@ -40,14 +40,9 @@ 1.0.0-SNAPSHOT 1.0.0-SNAPSHOT - 16-ea+6 - UTF-8 11 11 - - 11.5.0 - 11.5.0 @@ -62,17 +57,5 @@ action-api ${ActionAPIVersion} - - - org.kordamp.ikonli - ikonli-fontawesome5-pack - ${IkonliFA5PackVersion} - - - - org.kordamp.ikonli - ikonli-javafx - ${IkonliVersion} - \ No newline at end of file --- 'a/websiteaction/src/main/java/com/stream_pi/websiteaction/WebsiteAction.java' +++ b/websiteaction/src/main/java/com/stream_pi/websiteaction/WebsiteAction.java @@ -11,7 +11,6 @@ import java.net.URI; public class WebsiteAction extends NormalAction { - public WebsiteAction() { setName("Website"); @@ -19,11 +18,12 @@ public class WebsiteAction extends Norma setAuthor("rnayabed"); setServerButtonGraphic("fas-globe"); setHelpLink("https://github.com/stream-pi/essentialactions"); - setVersion(new Version(1,0,0)); + setVersion(new Version(1,0,1)); } @Override - public void initProperties() throws Exception { + public void initProperties() throws MinorException + { Property websiteUrl = new Property("websiteURL", Type.STRING); websiteUrl.setDisplayName("Website URL"); websiteUrl.setDefaultValueStr("https://stream-pi.com/"); @@ -32,14 +32,9 @@ public class WebsiteAction extends Norma addClientProperties(websiteUrl); } - - @Override - public void initAction() throws Exception { - - } - @Override - public void onActionClicked() throws Exception { + public void onActionClicked() throws MinorException + { Property website = getClientProperties().getSingleProperty("websiteURL"); String urlToOpen = website.getStringValue(); @@ -58,10 +53,4 @@ public class WebsiteAction extends Norma throw new MinorException("Unable to open URL '"+urlToOpen+"'. Check if its correct."); } } - - @Override - public void onShutDown() throws Exception { - // TODO Auto-generated method stub - - } } --- 'a/websiteaction/src/main/java/module-info.java' +++ b/websiteaction/src/main/java/module-info.java @@ -1,4 +1,5 @@ -module com.stream_pi.websiteaction { +module com.stream_pi.websiteaction +{ requires com.stream_pi.action_api; requires com.stream_pi.util; @@ -8,5 +9,4 @@ module com.stream_pi.websiteaction { requires java.desktop; provides com.stream_pi.action_api.externalplugin.ExternalPlugin with com.stream_pi.websiteaction.WebsiteAction; - } \ No newline at end of file