essential-actions
Clone or download
Modified Files
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<modelVersion>4.0.0</modelVersion>
<groupId>com.stream-pi</groupId>
<groupId>com.stream-pi</groupId>
<artifactId>websiteaction</artifactId>
<artifactId>websiteaction</artifactId>
<version>1.0.0</version>
<version>1.0.1</version>
<build>
<build>
<plugins>
<plugins>
<plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.0</version>
<version>3.1.0</version>
<executions>
<executions>
<execution>
<execution>
<id>test-jar</id>
<id>test-jar</id>
<phase>package</phase>
<phase>package</phase>
<goals>
<goals>
<goal>test-jar</goal>
<goal>test-jar</goal>
</goals>
</goals>
</execution>
</execution>
</executions>
</executions>
</plugin>
</plugin>
<plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<version>3.8.1</version>
<configuration>
<configuration>
<release>11</release>
<release>11</release>
</configuration>
</configuration>
</plugin>
</plugin>
</plugins>
</plugins>
</build>
</build>
<properties>
<properties>
<ActionAPIVersion>1.0.0-SNAPSHOT</ActionAPIVersion>
<ActionAPIVersion>1.0.0-SNAPSHOT</ActionAPIVersion>
<UtilVersion>1.0.0-SNAPSHOT</UtilVersion>
<UtilVersion>1.0.0-SNAPSHOT</UtilVersion>
<JavaFXVersion>16-ea+6</JavaFXVersion>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.target>11</maven.compiler.target>
<IkonliVersion>11.5.0</IkonliVersion>
<IkonliFA5PackVersion>11.5.0</IkonliFA5PackVersion>
</properties>
</properties>
<dependencies>
<dependencies>
<dependency>
<dependency>
<groupId>com.stream-pi</groupId>
<groupId>com.stream-pi</groupId>
<artifactId>util</artifactId>
<artifactId>util</artifactId>
<version>${UtilVersion}</version>
<version>${UtilVersion}</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>com.stream-pi</groupId>
<groupId>com.stream-pi</groupId>
<artifactId>action-api</artifactId>
<artifactId>action-api</artifactId>
<version>${ActionAPIVersion}</version>
<version>${ActionAPIVersion}</version>
</dependency>
</dependency>
<dependency>
<groupId>org.kordamp.ikonli</groupId>
<artifactId>ikonli-fontawesome5-pack</artifactId>
<version>${IkonliFA5PackVersion}</version>
</dependency>
<dependency>
<groupId>org.kordamp.ikonli</groupId>
<artifactId>ikonli-javafx</artifactId>
<version>${IkonliVersion}</version>
</dependency>
</dependencies>
</dependencies>
</project>
</project>
package com.stream_pi.websiteaction;
package com.stream_pi.websiteaction;
import com.stream_pi.action_api.actionproperty.property.Property;
import com.stream_pi.action_api.actionproperty.property.Property;
import com.stream_pi.action_api.actionproperty.property.Type;
import com.stream_pi.action_api.actionproperty.property.Type;
import com.stream_pi.action_api.externalplugin.NormalAction;
import com.stream_pi.action_api.externalplugin.NormalAction;
import com.stream_pi.util.exception.MinorException;
import com.stream_pi.util.exception.MinorException;
import com.stream_pi.util.version.Version;
import com.stream_pi.util.version.Version;
import java.awt.*;
import java.awt.*;
import java.net.URI;
import java.net.URI;
public class WebsiteAction extends NormalAction
public class WebsiteAction extends NormalAction
{
{
public WebsiteAction()
public WebsiteAction()
{
{
setName("Website");
setName("Website");
setCategory("Essentials");
setCategory("Essentials");
setAuthor("rnayabed");
setAuthor("rnayabed");
setServerButtonGraphic("fas-globe");
setServerButtonGraphic("fas-globe");
setHelpLink("https://github.com/stream-pi/essentialactions");
setHelpLink("https://github.com/stream-pi/essentialactions");
setVersion(new Version(1,0,0));
setVersion(new Version(1,0,1));
}
}
@Override
@Override
public void initProperties() throws Exception {
public void initProperties() throws MinorException
{
Property websiteUrl = new Property("websiteURL", Type.STRING);
Property websiteUrl = new Property("websiteURL", Type.STRING);
websiteUrl.setDisplayName("Website URL");
websiteUrl.setDisplayName("Website URL");
websiteUrl.setDefaultValueStr("https://stream-pi.com/");
websiteUrl.setDefaultValueStr("https://stream-pi.com/");
websiteUrl.setCanBeBlank(false);
websiteUrl.setCanBeBlank(false);
addClientProperties(websiteUrl);
addClientProperties(websiteUrl);
}
}
@Override
public void initAction() throws Exception {
}
@Override
@Override
public void onActionClicked() throws Exception {
public void onActionClicked() throws MinorException
{
Property website = getClientProperties().getSingleProperty("websiteURL");
Property website = getClientProperties().getSingleProperty("websiteURL");
String urlToOpen = website.getStringValue();
String urlToOpen = website.getStringValue();
if(!urlToOpen.startsWith("https://") && !urlToOpen.startsWith("http://"))
if(!urlToOpen.startsWith("https://") && !urlToOpen.startsWith("http://"))
{
{
urlToOpen = "https://" + urlToOpen;
urlToOpen = "https://" + urlToOpen;
}
}
try
try
{
{
Desktop.getDesktop().browse(new URI(urlToOpen));
Desktop.getDesktop().browse(new URI(urlToOpen));
}
}
catch (Exception e)
catch (Exception e)
{
{
throw new MinorException("Unable to open URL '"+urlToOpen+"'. Check if its correct.");
throw new MinorException("Unable to open URL '"+urlToOpen+"'. Check if its correct.");
}
}
}
}
@Override
public void onShutDown() throws Exception {
// TODO Auto-generated method stub
}
}
}
module com.stream_pi.websiteaction {
module com.stream_pi.websiteaction
{
requires com.stream_pi.action_api;
requires com.stream_pi.action_api;
requires com.stream_pi.util;
requires com.stream_pi.util;
requires org.kordamp.ikonli.javafx;
requires org.kordamp.ikonli.javafx;
requires org.kordamp.ikonli.fontawesome5;
requires org.kordamp.ikonli.fontawesome5;
requires java.desktop;
requires java.desktop;
provides com.stream_pi.action_api.externalplugin.ExternalPlugin with com.stream_pi.websiteaction.WebsiteAction;
provides com.stream_pi.action_api.externalplugin.ExternalPlugin with com.stream_pi.websiteaction.WebsiteAction;
}
}