Merge commit '42b2e5ca519766e37ce6941ba4faecc9691cc403' into upstream
[debian/openrocket] / core / src / net / sf / openrocket / plugin / SwingConfigurator.java
diff --git a/core/src/net/sf/openrocket/plugin/SwingConfigurator.java b/core/src/net/sf/openrocket/plugin/SwingConfigurator.java
new file mode 100644 (file)
index 0000000..86ba323
--- /dev/null
@@ -0,0 +1,37 @@
+package net.sf.openrocket.plugin;
+
+import java.awt.Component;
+
+import net.xeoh.plugins.base.Plugin;
+
+/**
+ * Interface that defined a Swing configurator for a plugin.
+ * The implemeting class should be a plugin that provides the
+ * capability "<pluginID>:config" where <pluginID> is the
+ * plugin ID of the plugin to configure.
+ * <p>
+ * 
+ * @param <P> The plugin class that is being configured
+ * @author Sampo Niskanen <sampo.niskanen@iki.fi>
+ */
+public interface SwingConfigurator<P> extends Plugin {
+       
+       /**
+        * Return whether this plugin is configurable or not.
+        * 
+        * @param plugin        the plugin to test.
+        * @return                      whether the plugin has a configuration component.
+        */
+       public boolean isConfigurable(P plugin);
+       
+       /**
+        * Return the configuration component for configuring the
+        * provided plugin.
+        * 
+        * @param plugin        the plugin to configure.
+        * @return                      a Swing component for configuring the plugin.
+        */
+       public Component getConfigurationComponent(P plugin);
+       
+       
+}