Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial idea for plug interfaces #8

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions orchestration-interfaces/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
<version>${komet.version}</version>
<scope>compile</scope>
</dependency>


</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package dev.ikm.orchestration.interfaces.plugin;

import java.util.UUID;

public interface Plugin {


}
Empty file added plugin-impl/.mvn/jvm.config
Empty file.
Empty file added plugin-impl/.mvn/maven.config
Empty file.
24 changes: 24 additions & 0 deletions plugin-impl/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" 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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>dev.ikm</groupId>
<artifactId>ikm-framework</artifactId>
<version>3.0.1-SNAPSHOT</version>
</parent>

<artifactId>plugin-impl</artifactId>

<name>plugin-impl</name>
<!-- FIXME change it to the project's website -->
<url>http://www.example.com</url>

<dependencies>
<dependency>
<groupId>dev.ikm.komet</groupId>
<artifactId>framework</artifactId>
<version>1.37.0-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
25 changes: 25 additions & 0 deletions plugin-impl/src/main/java/dev/ikm/tinkar/plugin/Plugin.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package dev.ikm.tinkar.plugin;

import dev.ikm.komet.framework.events.EvtBus;
import dev.ikm.komet.framework.events.EvtType;
import dev.ikm.komet.preferences.KometPreferences;

import java.util.List;
import java.util.UUID;


public interface Plugin {

UUID getId();

String getName();

void reconstruct(KometPreferences kometPreferences);

void register(EvtBus evtBus);

void registerTopics(EvtBus evtBus);

void unregister(EvtBus evtBus);

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package dev.ikm.tinkar.plugin.impl;

import dev.ikm.tinkar.plugin.type.Widget;

@Widget
public class AbstractConceptDetailWidget {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package dev.ikm.tinkar.plugin.interaction;

public @interface ApplicationMenuBar {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package dev.ikm.tinkar.plugin.interaction;

public @interface BumpOut {
String iconPath() default "";
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package dev.ikm.tinkar.plugin.interaction;

public @interface DoubleClick {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package dev.ikm.tinkar.plugin.interaction;

public @interface DragAndDrop {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package dev.ikm.tinkar.plugin.interaction;

public @interface JournalCreateMenu {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package dev.ikm.tinkar.plugin.interaction;

public @interface JournalMenuBar {
String iconPath() default "";

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package dev.ikm.tinkar.plugin.interaction;

public @interface RightClick {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package dev.ikm.tinkar.plugin.type;

public @interface Field {
String fxml() default "";

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package dev.ikm.tinkar.plugin.type;

public @interface Menu {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package dev.ikm.tinkar.plugin.type;

public @interface Style {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package dev.ikm.tinkar.plugin.type;

public @interface Task {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package dev.ikm.tinkar.plugin.type;

public @interface Widget {
String icon() default "";

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package dev.ikm.tinkar.plugin.type;

public @interface Window {
String icon() default "";

}
9 changes: 9 additions & 0 deletions plugin-impl/src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module dev.ikm.tinkar.plugin {
requires dev.ikm.komet.framework;

exports dev.ikm.tinkar.plugin;
exports dev.ikm.tinkar.plugin.interaction;
exports dev.ikm.tinkar.plugin.impl;
exports dev.ikm.tinkar.plugin.type;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package dev.ikm.tinkar.plugin.test;

import dev.ikm.komet.framework.events.EvtBus;
import dev.ikm.komet.framework.events.EvtType;
import dev.ikm.komet.preferences.KometPreferences;
import dev.ikm.tinkar.plugin.Plugin;
import dev.ikm.tinkar.plugin.interaction.ApplicationMenuBar;
import dev.ikm.tinkar.plugin.interaction.BumpOut;
import dev.ikm.tinkar.plugin.type.Widget;

import java.util.List;
import java.util.UUID;

@Widget
@BumpOut
@ApplicationMenuBar //TODO - with menu bar are we owning interconnection of plugins (i think no)
public class SimplePlugin implements Plugin {

private static final String PLUGIN_NAME = "SimplePlugin";
private static final UUID PLUGIN_ID = UUID.randomUUID();

@Override
public UUID getId() {
return PLUGIN_ID;
}

@Override
public String getName() {
return PLUGIN_NAME;
}

@Override
public void reconstruct(KometPreferences kometPreferences) {

}

@Override
public void register(EvtBus evtBus) {
evtBus.subscribe(null, null, null);
}

@Override
public void unregister(EvtBus evtBus) {
evtBus.unsubscribe(null, null, null);
}

@Override
public void registerTopics(EvtBus evtBus) {

}
}
6 changes: 6 additions & 0 deletions plugin-impl/src/test/java/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module dev.ikm.tinkar.plugin.test {

requires dev.ikm.tinkar.plugin;
requires dev.ikm.komet.framework;

}
2 changes: 2 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,7 @@
to modules that are plugins, but not dependencies (plugins are
transparent to the build order) -->
<module>komet-orchestrator</module>
<module>plugin-impl</module>

</modules>
</project>