Extend java.util.EventListener.
[jSite2.git] / src / net / pterodactylus / jsite / core / CoreListener.java
index d4a522e..8cfeea4 100644 (file)
 
 package net.pterodactylus.jsite.core;
 
-import net.pterodactylus.jsite.project.Project;
+import java.util.EventListener;
 
 /**
  * Interface definition for user interfaces.
- * 
+ *
  * @author David ‘Bombe’ Roden <bombe@freenetproject.org>
  */
-public interface CoreListener {
+public interface CoreListener extends EventListener {
 
        //
        // project configuration
@@ -34,7 +34,7 @@ public interface CoreListener {
 
        /**
         * Notifies a listener that loading the projects finished successfully.
-        * 
+        *
         * @param directory
         *            The directory the nodes were loaded from
         */
@@ -42,7 +42,7 @@ public interface CoreListener {
 
        /**
         * Notifies all listeners that loading the projects has failed.
-        * 
+        *
         * @param directory
         *            The directory the projects were tried to load from
         * @param throwable
@@ -53,7 +53,7 @@ public interface CoreListener {
        /**
         * Notifies a listener that the projects were successfully saved to the
         * given directory.
-        * 
+        *
         * @param directory
         *            The directory the projects were saved to
         */
@@ -61,7 +61,7 @@ public interface CoreListener {
 
        /**
         * Notifies a listener that saving the projects has failed.
-        * 
+        *
         * @param directory
         *            The directory the projects were to be saved to
         * @param throwable
@@ -69,13 +69,39 @@ public interface CoreListener {
         */
        public void savingProjectsFailed(String directory, Throwable throwable);
 
+       /**
+        * Notifies a listener that the given project was added.
+        *
+        * @param project
+        *            The project that was added.
+        */
+       public void projectAdded(Project project);
+
+       /**
+        * Notifies a listener that a project was cloned.
+        *
+        * @param clonedProject
+        *            The clones project
+        * @param projectClone
+        *            The clone of the project
+        */
+       public void projectCloned(Project clonedProject, Project projectClone);
+
+       /**
+        * Notifies a listener that the given project was removed.
+        *
+        * @param project
+        *            The project that was removed.
+        */
+       public void projectRemoved(Project project);
+
        //
        // node configuration
        //
 
        /**
         * Notifies a listener that the nodes were successfully loaded.
-        * 
+        *
         * @param directory
         *            The directory the nodes were loaded from
         */
@@ -83,7 +109,7 @@ public interface CoreListener {
 
        /**
         * Notifies a listener that loading the nodes has failed.
-        * 
+        *
         * @param directory
         *            The directory the nodes were loaded from
         * @param throwable
@@ -93,7 +119,7 @@ public interface CoreListener {
 
        /**
         * Notifies a listener that the nodes were successfully saved.
-        * 
+        *
         * @param directory
         *            The directory the nodes were saved to
         */
@@ -101,7 +127,7 @@ public interface CoreListener {
 
        /**
         * Notifies a listener that saving the nodes has failed.
-        * 
+        *
         * @param directory
         *            The directory the nodes were saved to
         * @param throwable
@@ -129,7 +155,7 @@ public interface CoreListener {
 
        /**
         * Notifies a listener that a node was added to the core.
-        * 
+        *
         * @param node
         *            The node that was added.
         */
@@ -139,7 +165,7 @@ public interface CoreListener {
         * Notifies a listener that a node was removed from the core. Before a node
         * is removed, it will be disconnected (and
         * {@link #nodeDisconnected(Node, Throwable)} will be called).
-        * 
+        *
         * @param node
         *            The node that was removed
         */
@@ -149,7 +175,7 @@ public interface CoreListener {
         * Notifies all listeners that the core started connecting to the given
         * node. Before a node is connected, it will be added (and
         * {@link #nodeAdded(Node)} will be called).
-        * 
+        *
         * @param node
         *            The node that is being connected
         */
@@ -157,7 +183,7 @@ public interface CoreListener {
 
        /**
         * Notifies all listeners that the core connected to the given node.
-        * 
+        *
         * @param node
         *            The node that is connected
         */
@@ -165,7 +191,7 @@ public interface CoreListener {
 
        /**
         * Notifies a listener that a connection to a node has failed.
-        * 
+        *
         * @param node
         *            The node that could not be connected
         * @param cause
@@ -175,7 +201,7 @@ public interface CoreListener {
 
        /**
         * Notifies all listeners that the core disconnected from the given node.
-        * 
+        *
         * @param node
         *            The node that was diconnected
         * @param throwable
@@ -190,7 +216,7 @@ public interface CoreListener {
 
        /**
         * Notifies a listener that a project insert started.
-        * 
+        *
         * @param project
         *            The project that is now inserting
         */
@@ -198,7 +224,7 @@ public interface CoreListener {
 
        /**
         * Notifies a listener that a project insert made progress.
-        * 
+        *
         * @param project
         *            The project that made progress
         * @param totalBlocks
@@ -220,7 +246,7 @@ public interface CoreListener {
 
        /**
         * Notifies a listener that a project insert has generated a URI.
-        * 
+        *
         * @param project
         *            The project that generated a URI
         * @param uri
@@ -230,7 +256,7 @@ public interface CoreListener {
 
        /**
         * Notifies a listener that a project insert has finished.
-        * 
+        *
         * @param project
         *            The project that has finished
         * @param success