Browse Source

Initial work on making web UI work again

Change-Id: I5756228bd66dd6d62c82ef89b9e3aab2bf9bb0cc
Reviewed-on: http://gerrit.dmdirc.com/1427
Automatic-Compile: DMDirc Local Commits <dmdirc@googlemail.com>
Reviewed-by: Gregory Holmes <greg@dmdirc.com>
tags/0.6.4
Chris Smith 14 years ago
parent
commit
2c5106dd96

+ 3
- 2
src/com/dmdirc/addons/ui_web/Client.java View File

44
 
44
 
45
     private final List<Event> events = new LinkedList<Event>();
45
     private final List<Event> events = new LinkedList<Event>();
46
 
46
 
47
-    public Client(final String ip) {
47
+    public Client(final WebInterfaceUI controller, final String ip) {
48
         events.add(new Event("statusbar", "Welcome to the DMDirc web interface"));
48
         events.add(new Event("statusbar", "Welcome to the DMDirc web interface"));
49
 
49
 
50
         this.ip = ip;
50
         this.ip = ip;
54
 
54
 
55
         while (!queued.isEmpty()) {
55
         while (!queued.isEmpty()) {
56
             final Window window = queued.remove(0);
56
             final Window window = queued.remove(0);
57
-            final Window parent = window.getContainer().getParent().getFrame();
57
+            final Window parent = controller.getWindowManager()
58
+                    .getWindow(window.getContainer().getParent());
58
 
59
 
59
             if (parent == null) {
60
             if (parent == null) {
60
                 events.add(new Event("newwindow", window));
61
                 events.add(new Event("newwindow", window));

+ 10
- 5
src/com/dmdirc/addons/ui_web/DynamicRequestHandler.java View File

67
     /** The last time each client was seen. */
67
     /** The last time each client was seen. */
68
     private static final Map<String, Client> CLIENTS = new HashMap<String, Client>();
68
     private static final Map<String, Client> CLIENTS = new HashMap<String, Client>();
69
 
69
 
70
+    /** The controller which owns this request handler. */
71
+    private final WebInterfaceUI controller;
72
+
70
     /**
73
     /**
71
      * Creates a new instance of DynamicRequestHandler. Registers object
74
      * Creates a new instance of DynamicRequestHandler. Registers object
72
      * convertors with the JSON serialiser.
75
      * convertors with the JSON serialiser.
73
      */
76
      */
74
-    public DynamicRequestHandler() {
77
+    public DynamicRequestHandler(final WebInterfaceUI controller) {
75
         super();
78
         super();
76
 
79
 
80
+        this.controller = controller;
81
+
77
         JSON.registerConvertor(Event.class, new JSONObjectConvertor());
82
         JSON.registerConvertor(Event.class, new JSONObjectConvertor());
78
         JSON.registerConvertor(WebWindow.class, new JSONObjectConvertor());
83
         JSON.registerConvertor(WebWindow.class, new JSONObjectConvertor());
79
         JSON.registerConvertor(Message.class, new JSONObjectConvertor());
84
         JSON.registerConvertor(Message.class, new JSONObjectConvertor());
108
             final String clientID = request.getParameter("clientID");
113
             final String clientID = request.getParameter("clientID");
109
             
114
             
110
             if (!CLIENTS.containsKey(clientID)) {
115
             if (!CLIENTS.containsKey(clientID)) {
111
-                CLIENTS.put(clientID, new Client(request.getRemoteHost()));
116
+                CLIENTS.put(clientID, new Client(controller, request.getRemoteHost()));
112
             }
117
             }
113
 
118
 
114
             synchronized (CLIENTS) {
119
             synchronized (CLIENTS) {
273
 
278
 
274
         nickEvents.add(new Event("clearnicklist", false));
279
         nickEvents.add(new Event("clearnicklist", false));
275
 
280
 
276
-        for (ChannelClientInfo cci : ((Channel) ((WebChannelWindow)
277
-                WebInterfaceUI.active).getContainer()).getChannelInfo()
278
-                .getChannelClients()) {
281
+        for (ChannelClientInfo cci : ((Channel) (WebWindow.getWindow(
282
+                request.getParameter("window"))).getContainer())
283
+                .getChannelInfo().getChannelClients()) {
279
             nickEvents.add(new Event("addnicklist",
284
             nickEvents.add(new Event("addnicklist",
280
                     cci.getClient().getNickname()));
285
                     cci.getClient().getNickname()));
281
         }
286
         }

+ 10
- 0
src/com/dmdirc/addons/ui_web/WebInterfacePlugin.java View File

24
 
24
 
25
 import com.dmdirc.Main;
25
 import com.dmdirc.Main;
26
 import com.dmdirc.plugins.Plugin;
26
 import com.dmdirc.plugins.Plugin;
27
+import com.dmdirc.ui.interfaces.UIController;
27
 
28
 
28
 import org.mortbay.jetty.Handler;
29
 import org.mortbay.jetty.Handler;
29
 
30
 
54
         Main.setUI(ui);
55
         Main.setUI(ui);
55
     }
56
     }
56
 
57
 
58
+    /**
59
+     * Returns the UI Controller for the web interface.
60
+     *
61
+     * @return The web interface's UI controller
62
+     */
63
+    public UIController getController() {
64
+        return ui;
65
+    }
66
+
57
     /** {@inheritDoc} */
67
     /** {@inheritDoc} */
58
     @Override
68
     @Override
59
     public void onUnload() {
69
     public void onUnload() {

+ 26
- 13
src/com/dmdirc/addons/ui_web/WebInterfaceUI.java View File

27
 import com.dmdirc.Query;
27
 import com.dmdirc.Query;
28
 import com.dmdirc.Server;
28
 import com.dmdirc.Server;
29
 import com.dmdirc.WritableFrameContainer;
29
 import com.dmdirc.WritableFrameContainer;
30
-import com.dmdirc.addons.ui_web.uicomponents.WebChannelWindow;
31
-import com.dmdirc.addons.ui_web.uicomponents.WebInputWindow;
32
 import com.dmdirc.addons.ui_web.uicomponents.WebMainWindow;
30
 import com.dmdirc.addons.ui_web.uicomponents.WebMainWindow;
33
-import com.dmdirc.addons.ui_web.uicomponents.WebQueryWindow;
34
-import com.dmdirc.addons.ui_web.uicomponents.WebServerWindow;
35
 import com.dmdirc.addons.ui_web.uicomponents.WebStatusBar;
31
 import com.dmdirc.addons.ui_web.uicomponents.WebStatusBar;
36
 import com.dmdirc.addons.ui_web.uicomponents.WebWindow;
32
 import com.dmdirc.addons.ui_web.uicomponents.WebWindow;
37
 import com.dmdirc.config.prefs.PreferencesInterface;
33
 import com.dmdirc.config.prefs.PreferencesInterface;
38
 import com.dmdirc.ui.core.dialogs.sslcertificate.SSLCertificateDialogModel;
34
 import com.dmdirc.ui.core.dialogs.sslcertificate.SSLCertificateDialogModel;
39
-import com.dmdirc.ui.interfaces.*;
35
+import com.dmdirc.ui.interfaces.ChannelWindow;
36
+import com.dmdirc.ui.interfaces.InputWindow;
37
+import com.dmdirc.ui.interfaces.MainWindow;
38
+import com.dmdirc.ui.interfaces.QueryWindow;
39
+import com.dmdirc.ui.interfaces.ServerWindow;
40
+import com.dmdirc.ui.interfaces.StatusBar;
41
+import com.dmdirc.ui.interfaces.UIController;
42
+import com.dmdirc.ui.interfaces.UpdaterDialog;
43
+import com.dmdirc.ui.interfaces.Window;
40
 import com.dmdirc.updater.Update;
44
 import com.dmdirc.updater.Update;
41
 
45
 
42
 import java.net.URI;
46
 import java.net.URI;
66
     /** The web server we're using. */
70
     /** The web server we're using. */
67
     private final org.mortbay.jetty.Server webServer;
71
     private final org.mortbay.jetty.Server webServer;
68
 
72
 
73
+    /** The window manager for this UI. */
74
+    private final WebWindowManager windowManager;
75
+
69
     /**
76
     /**
70
      * Creates a new WebInterfaceUI belonging to the specified plugin.
77
      * Creates a new WebInterfaceUI belonging to the specified plugin.
71
-     * 
78
+     *
72
      * @param plugin The plugin which owns this Web UI
79
      * @param plugin The plugin which owns this Web UI
73
      */
80
      */
74
     public WebInterfaceUI(final WebInterfacePlugin plugin) {       
81
     public WebInterfaceUI(final WebInterfacePlugin plugin) {       
93
             new RootRequestHandler(),
100
             new RootRequestHandler(),
94
             new StaticRequestHandler(),
101
             new StaticRequestHandler(),
95
             new DMDircRequestHandler(),
102
             new DMDircRequestHandler(),
96
-            new DynamicRequestHandler(),
103
+            new DynamicRequestHandler(this),
97
         });
104
         });
98
         
105
         
99
         try {
106
         try {
101
         } catch (Exception ex) {
108
         } catch (Exception ex) {
102
             // Break horribly!
109
             // Break horribly!
103
         }
110
         }
111
+
112
+        windowManager = new WebWindowManager(this);
113
+    }
114
+
115
+    public WebWindowManager getWindowManager() {
116
+        return windowManager;
104
     }
117
     }
105
     
118
     
106
     /**
119
     /**
107
      * Adds the specified handler to the webserver.
120
      * Adds the specified handler to the webserver.
108
-     * 
121
+     *
109
      * @param newHandler The handler to add.
122
      * @param newHandler The handler to add.
110
      */
123
      */
111
     public void addWebHandler(final Handler newHandler) {
124
     public void addWebHandler(final Handler newHandler) {
132
      */
145
      */
133
     @Override @Deprecated
146
     @Override @Deprecated
134
     public ChannelWindow getChannel(final Channel channel) {
147
     public ChannelWindow getChannel(final Channel channel) {
135
-        return new WebChannelWindow(channel);
148
+        throw new UnsupportedOperationException();
136
     }
149
     }
137
 
150
 
138
     /**
151
     /**
143
      */
156
      */
144
     @Override @Deprecated
157
     @Override @Deprecated
145
     public ServerWindow getServer(final Server server) {
158
     public ServerWindow getServer(final Server server) {
146
-        return new WebServerWindow(server);
159
+        throw new UnsupportedOperationException();
147
     }
160
     }
148
 
161
 
149
     /**
162
     /**
154
      */
167
      */
155
     @Override @Deprecated
168
     @Override @Deprecated
156
     public QueryWindow getQuery(final Query query) {
169
     public QueryWindow getQuery(final Query query) {
157
-        return new WebQueryWindow(query);
170
+        throw new UnsupportedOperationException();
158
     }
171
     }
159
 
172
 
160
     /**
173
     /**
165
      */
178
      */
166
     @Override @Deprecated
179
     @Override @Deprecated
167
     public Window getWindow(final FrameContainer<?> owner) {
180
     public Window getWindow(final FrameContainer<?> owner) {
168
-        return new WebWindow(owner);
181
+        throw new UnsupportedOperationException();
169
     }
182
     }
170
 
183
 
171
     /**
184
     /**
176
      */
189
      */
177
     @Override @Deprecated
190
     @Override @Deprecated
178
     public InputWindow getInputWindow(final WritableFrameContainer<?> owner) {
191
     public InputWindow getInputWindow(final WritableFrameContainer<?> owner) {
179
-        return new WebInputWindow(owner, owner.getCommandParser());
192
+        throw new UnsupportedOperationException();
180
     }
193
     }
181
 
194
 
182
     /** {@inheritDoc} */
195
     /** {@inheritDoc} */

+ 147
- 0
src/com/dmdirc/addons/ui_web/WebWindowManager.java View File

1
+/*
2
+ * Copyright (c) 2006-2010 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+
23
+package com.dmdirc.addons.ui_web;
24
+
25
+import com.dmdirc.FrameContainer;
26
+import com.dmdirc.addons.ui_web.uicomponents.WebChannelWindow;
27
+import com.dmdirc.addons.ui_web.uicomponents.WebInputWindow;
28
+import com.dmdirc.addons.ui_web.uicomponents.WebQueryWindow;
29
+import com.dmdirc.addons.ui_web.uicomponents.WebServerWindow;
30
+import com.dmdirc.addons.ui_web.uicomponents.WebWindow;
31
+import com.dmdirc.logger.ErrorLevel;
32
+import com.dmdirc.logger.Logger;
33
+import com.dmdirc.ui.WindowManager;
34
+import com.dmdirc.ui.interfaces.ChannelWindow;
35
+import com.dmdirc.ui.interfaces.FrameListener;
36
+import com.dmdirc.ui.interfaces.InputWindow;
37
+import com.dmdirc.ui.interfaces.QueryWindow;
38
+import com.dmdirc.ui.interfaces.ServerWindow;
39
+import com.dmdirc.ui.interfaces.Window;
40
+import java.util.HashMap;
41
+import java.util.Map;
42
+
43
+/**
44
+ * Manages WebUI windows.
45
+ *
46
+ * @author chris
47
+ */
48
+public class WebWindowManager implements FrameListener {
49
+
50
+    /** A map of known implementations of window interfaces. */
51
+    private static final Map<Class<? extends Window>, Class<? extends Window>> IMPLEMENTATIONS
52
+            = new HashMap<Class<? extends Window>, Class<? extends Window>>();
53
+
54
+    static {
55
+        IMPLEMENTATIONS.put(Window.class, WebWindow.class);
56
+        IMPLEMENTATIONS.put(InputWindow.class, WebInputWindow.class);
57
+        IMPLEMENTATIONS.put(ServerWindow.class, WebServerWindow.class);
58
+        IMPLEMENTATIONS.put(QueryWindow.class, WebQueryWindow.class);
59
+        IMPLEMENTATIONS.put(ChannelWindow.class, WebChannelWindow.class);
60
+    }
61
+
62
+    /** The controller that owns this manager. */
63
+    private final WebInterfaceUI controller;
64
+
65
+    /** Map of known windows. */
66
+    private final Map<FrameContainer<?>, Window> windows
67
+            = new HashMap<FrameContainer<?>, Window>();
68
+
69
+    public WebWindowManager(final WebInterfaceUI controller) {
70
+        this.controller = controller;
71
+        
72
+        WindowManager.addFrameListener(this);
73
+
74
+        for (FrameContainer<?> container : WindowManager.getRootWindows()) {
75
+            recursiveAdd(container);
76
+        }
77
+    }
78
+
79
+    public Window getWindow(final FrameContainer<?> window) {
80
+        return windows.get(window);
81
+    }
82
+
83
+    private void recursiveAdd(final FrameContainer<?> window) {
84
+        addWindow(window, false);
85
+
86
+        for (FrameContainer<?> child : window.getChildren()) {
87
+            recursiveAdd(child);
88
+        }
89
+    }
90
+
91
+    /** {@inheritDoc} */
92
+    @Override
93
+    public void addWindow(final FrameContainer<?> window, final boolean focus) {
94
+        windows.put(window, doAddWindow(window, focus));
95
+    }
96
+
97
+    /** {@inheritDoc} */
98
+    @Override
99
+    public void delWindow(final FrameContainer<?> window) {
100
+        windows.get(window).close();
101
+        windows.remove(window);
102
+    }
103
+
104
+    /** {@inheritDoc} */
105
+    @Override
106
+    public void addWindow(final FrameContainer<?> parent, final FrameContainer<?> window,
107
+            final boolean focus) {
108
+        addWindow(window, focus);
109
+    }
110
+
111
+    /** {@inheritDoc} */
112
+    @Override
113
+    public void delWindow(final FrameContainer<?> parent, final FrameContainer<?> window) {
114
+        delWindow(window);
115
+    }
116
+
117
+    /**
118
+     * Creates a new window for the specified container.
119
+     *
120
+     * @param <T> The type of window that should be created
121
+     * @param window The container that owns the window
122
+     * @param focus Whether the window should be focused initially
123
+     * @return The created window or null on error
124
+     */
125
+    @SuppressWarnings("unchecked")
126
+    protected <T extends Window> T doAddWindow(final FrameContainer<T> window,
127
+            final boolean focus) {
128
+        final Class<T> clazz;
129
+
130
+        if (IMPLEMENTATIONS.containsKey(window.getWindowClass())) {
131
+            clazz = (Class<T>) IMPLEMENTATIONS.get(window.getWindowClass());
132
+        } else {
133
+            clazz = window.getWindowClass();
134
+        }
135
+
136
+        try {
137
+            final T frame = (T) clazz.getConstructors()[0].newInstance(controller, window);
138
+            window.addWindow(frame);
139
+
140
+            return frame;
141
+        } catch (Exception ex) {
142
+            Logger.appError(ErrorLevel.HIGH, "Unable to create window", ex);
143
+            return null;
144
+        }
145
+    }
146
+
147
+}

+ 3
- 0
src/com/dmdirc/addons/ui_web/plugin.config View File

27
   id=29
27
   id=29
28
 
28
 
29
 defaults:
29
 defaults:
30
+
31
+exports:
32
+  getController in com.dmdirc.addons.ui_web.WebInterfacePlugin as getController

+ 5
- 4
src/com/dmdirc/addons/ui_web/res/javascript/dmdirc.js View File

46
     var wrapperNode = document.createElement('div');
46
     var wrapperNode = document.createElement('div');
47
     wrapperNode.innerHTML = name;
47
     wrapperNode.innerHTML = name;
48
     wrapperNode.style.cursor = 'pointer';
48
     wrapperNode.style.cursor = 'pointer';
49
-    wrapperNode.onclick = function() { treeview_click(newNode); };
49
+    wrapperNode.onclick = function() {treeview_click(newNode);};
50
     newNode.appendChild(wrapperNode);
50
     newNode.appendChild(wrapperNode);
51
 
51
 
52
     parentNode.appendChild(newNode);
52
     parentNode.appendChild(newNode);
92
     wus_open = true;
92
     wus_open = true;
93
     
93
     
94
     new Ajax.Updater('wus', '/static/webuistatus.html', {onSuccess:function() {
94
     new Ajax.Updater('wus', '/static/webuistatus.html', {onSuccess:function() {
95
-            setTimeout('wus_init()', 200); }});
95
+            setTimeout('wus_init()', 200);}});
96
     new Effect.Appear('wus');
96
     new Effect.Appear('wus');
97
     
97
     
98
     wus_query();
98
     wus_query();
193
     }
193
     }
194
 
194
 
195
     new Ajax.Updater('nsd', '/static/newserverdialog.html', {onSuccess:function() {
195
     new Ajax.Updater('nsd', '/static/newserverdialog.html', {onSuccess:function() {
196
-            setTimeout('draggable("nsd")', 200); }});
196
+            setTimeout('draggable("nsd")', 200);}});
197
     new Ajax.Request('/dynamic/getprofiles',
197
     new Ajax.Request('/dynamic/getprofiles',
198
     {onFailure:errFunc, onSuccess:handlerFunc, onException:excFunc});
198
     {onFailure:errFunc, onSuccess:handlerFunc, onException:excFunc});
199
     new Effect.Appear('nsd');
199
     new Effect.Appear('nsd');
267
         document.getElementById('content').style.right = '240px';
267
         document.getElementById('content').style.right = '240px';
268
         nicklist.style.display = 'block';
268
         nicklist.style.display = 'block';
269
         new Ajax.Request('/dynamic/nicklistrefresh',
269
         new Ajax.Request('/dynamic/nicklistrefresh',
270
-        {onFailure:errFunc})
270
+        {parameters: {window: activeWindow}, onFailure: errFunc,
271
+            onSuccess: handlerFunc})
271
     }
272
     }
272
 }
273
 }
273
 
274
 

+ 3
- 2
src/com/dmdirc/addons/ui_web/uicomponents/WebChannelWindow.java View File

25
 import com.dmdirc.Channel;
25
 import com.dmdirc.Channel;
26
 import com.dmdirc.addons.ui_web.DynamicRequestHandler;
26
 import com.dmdirc.addons.ui_web.DynamicRequestHandler;
27
 import com.dmdirc.addons.ui_web.Event;
27
 import com.dmdirc.addons.ui_web.Event;
28
+import com.dmdirc.addons.ui_web.WebInterfaceUI;
28
 import com.dmdirc.parser.interfaces.ChannelClientInfo;
29
 import com.dmdirc.parser.interfaces.ChannelClientInfo;
29
 import com.dmdirc.ui.interfaces.ChannelWindow;
30
 import com.dmdirc.ui.interfaces.ChannelWindow;
30
 
31
 
38
     
39
     
39
     private final Channel channel;
40
     private final Channel channel;
40
 
41
 
41
-    public WebChannelWindow(Channel channel) {
42
-        super(channel, channel.getCommandParser());
42
+    public WebChannelWindow(final WebInterfaceUI controller, Channel channel) {
43
+        super(controller, channel);
43
         this.channel = channel;
44
         this.channel = channel;
44
     }
45
     }
45
 
46
 

+ 4
- 3
src/com/dmdirc/addons/ui_web/uicomponents/WebInputWindow.java View File

23
 package com.dmdirc.addons.ui_web.uicomponents;
23
 package com.dmdirc.addons.ui_web.uicomponents;
24
 
24
 
25
 import com.dmdirc.WritableFrameContainer;
25
 import com.dmdirc.WritableFrameContainer;
26
+import com.dmdirc.addons.ui_web.WebInterfaceUI;
26
 import com.dmdirc.commandparser.parsers.CommandParser;
27
 import com.dmdirc.commandparser.parsers.CommandParser;
27
 import com.dmdirc.ui.input.InputHandler;
28
 import com.dmdirc.ui.input.InputHandler;
28
 import com.dmdirc.ui.interfaces.InputWindow;
29
 import com.dmdirc.ui.interfaces.InputWindow;
45
     private final Map<String, WebInputHandler> inputHandlers
46
     private final Map<String, WebInputHandler> inputHandlers
46
             = new HashMap<String, WebInputHandler>();
47
             = new HashMap<String, WebInputHandler>();
47
 
48
 
48
-    public WebInputWindow(WritableFrameContainer<?> parent, CommandParser parser) {
49
-        super(parent);
49
+    public WebInputWindow(WebInterfaceUI controller, WritableFrameContainer<?> parent) {
50
+        super(controller, parent);
50
         this.parent = parent;
51
         this.parent = parent;
51
-        this.commandparser = parser;
52
+        this.commandparser = parent.getCommandParser();
52
         this.inputhandler = new WebInputHandler(new WebInputField(), commandparser, this);
53
         this.inputhandler = new WebInputHandler(new WebInputField(), commandparser, this);
53
     }
54
     }
54
 
55
 

+ 3
- 2
src/com/dmdirc/addons/ui_web/uicomponents/WebQueryWindow.java View File

23
 package com.dmdirc.addons.ui_web.uicomponents;
23
 package com.dmdirc.addons.ui_web.uicomponents;
24
 
24
 
25
 import com.dmdirc.Query;
25
 import com.dmdirc.Query;
26
+import com.dmdirc.addons.ui_web.WebInterfaceUI;
26
 import com.dmdirc.ui.interfaces.QueryWindow;
27
 import com.dmdirc.ui.interfaces.QueryWindow;
27
 
28
 
28
 /**
29
 /**
33
     
34
     
34
     private final Query query;
35
     private final Query query;
35
 
36
 
36
-    public WebQueryWindow(final Query parent) {
37
-        super(parent, parent.getCommandParser());
37
+    public WebQueryWindow(final WebInterfaceUI controller, final Query parent) {
38
+        super(controller, parent);
38
         this.query = parent;
39
         this.query = parent;
39
     }
40
     }
40
 
41
 

+ 3
- 2
src/com/dmdirc/addons/ui_web/uicomponents/WebServerWindow.java View File

23
 package com.dmdirc.addons.ui_web.uicomponents;
23
 package com.dmdirc.addons.ui_web.uicomponents;
24
 
24
 
25
 import com.dmdirc.Server;
25
 import com.dmdirc.Server;
26
+import com.dmdirc.addons.ui_web.WebInterfaceUI;
26
 import com.dmdirc.ui.interfaces.ServerWindow;
27
 import com.dmdirc.ui.interfaces.ServerWindow;
27
 
28
 
28
 /**
29
 /**
33
  
34
  
34
     private final Server server;
35
     private final Server server;
35
 
36
 
36
-    public WebServerWindow(Server server) {
37
-        super(server, server.getCommandParser());
37
+    public WebServerWindow(WebInterfaceUI controller, Server server) {
38
+        super(controller, server);
38
         
39
         
39
         this.server = server;
40
         this.server = server;
40
     }
41
     }

+ 2
- 1
src/com/dmdirc/addons/ui_web/uicomponents/WebWindow.java View File

26
 import com.dmdirc.addons.ui_web.DynamicRequestHandler;
26
 import com.dmdirc.addons.ui_web.DynamicRequestHandler;
27
 import com.dmdirc.addons.ui_web.Event;
27
 import com.dmdirc.addons.ui_web.Event;
28
 import com.dmdirc.addons.ui_web.Message;
28
 import com.dmdirc.addons.ui_web.Message;
29
+import com.dmdirc.addons.ui_web.WebInterfaceUI;
29
 import com.dmdirc.config.ConfigManager;
30
 import com.dmdirc.config.ConfigManager;
30
 import com.dmdirc.ui.core.util.Utils;
31
 import com.dmdirc.ui.core.util.Utils;
31
 import com.dmdirc.ui.interfaces.UIController;
32
 import com.dmdirc.ui.interfaces.UIController;
66
 
67
 
67
     private String title;
68
     private String title;
68
 
69
 
69
-    public WebWindow(final FrameContainer<?> parent) {
70
+    public WebWindow(final WebInterfaceUI controller, final FrameContainer<?> parent) {
70
         super();
71
         super();
71
 
72
 
72
         this.parent = parent;
73
         this.parent = parent;

Loading…
Cancel
Save