Implement InsertListener interface in CoreImpl.
[jSite2.git] / src / net / pterodactylus / jsite / main / Main.java
index f2fa92b..cf31c07 100644 (file)
@@ -28,6 +28,7 @@ import javax.swing.UIManager;
 import javax.swing.UIManager.LookAndFeelInfo;
 
 import net.pterodactylus.jsite.core.CoreImpl;
+import net.pterodactylus.jsite.core.InsertManager;
 import net.pterodactylus.jsite.core.NodeManager;
 import net.pterodactylus.jsite.core.ProjectManager;
 import net.pterodactylus.jsite.core.RequestManager;
@@ -36,14 +37,14 @@ import net.pterodactylus.util.logging.Logging;
 
 /**
  * Main class that is called by the VM.
- * 
+ *
  * @author David ‘Bombe’ Roden <bombe@freenetproject.org>
  */
 public class Main {
 
        /**
         * Main entry method for the VM.
-        * 
+        *
         * @param args
         *            The command-line arguments
         */
@@ -69,6 +70,10 @@ public class Main {
                core.setProjectManager(projectManager);
                projectManager.setNodeManager(nodeManager);
 
+               InsertManager insertManager = new InsertManager();
+               core.setInsertManager(insertManager);
+               insertManager.addInsertListener(core);
+
                RequestManager requestManager = new RequestManager();
                core.setRequestManager(requestManager);
                nodeManager.addNodeListener(requestManager);
@@ -85,7 +90,7 @@ public class Main {
        /**
         * Tries to load the class with the given name and includes the look & feel
         * in the UIManager, if it exists.
-        * 
+        *
         * @param name
         *            The name of the look & feel
         * @param className
@@ -97,16 +102,16 @@ public class Main {
        }
 
        /**
-        * Tries to load each look & feel and adds it to the list of installed look &
-        * feels.
-        * 
+        * Tries to load each look & feel and adds it to the list of installed look
+        * feels.
+        *
         * @see UIManager#setInstalledLookAndFeels(LookAndFeelInfo[])
         * @param lookAndFeelInfos
         *            The look & feels to add
         */
        private void addLookAndFeels(LookAndFeelInfo... lookAndFeelInfos) {
                List<LookAndFeelInfo> allLookAndFeelInfos = new ArrayList<LookAndFeelInfo>(Arrays.asList(UIManager.getInstalledLookAndFeels()));
-               for (LookAndFeelInfo lookAndFeelInfo: lookAndFeelInfos) {
+               for (LookAndFeelInfo lookAndFeelInfo : lookAndFeelInfos) {
                        try {
                                Class.forName(lookAndFeelInfo.getClassName());
                                allLookAndFeelInfos.add(lookAndFeelInfo);