|
@@ -34,6 +34,7 @@ import com.dmdirc.addons.ui_swing.events.SwingEventBus;
|
34
|
34
|
import com.dmdirc.addons.ui_swing.events.SwingWindowAddedEvent;
|
35
|
35
|
import com.dmdirc.addons.ui_swing.events.SwingWindowDeletedEvent;
|
36
|
36
|
import com.dmdirc.events.UserErrorEvent;
|
|
37
|
+import com.dmdirc.interfaces.WindowModel;
|
37
|
38
|
import com.dmdirc.interfaces.ui.FrameListener;
|
38
|
39
|
import com.dmdirc.logger.ErrorLevel;
|
39
|
40
|
|
|
@@ -104,16 +105,16 @@ public class SwingWindowFactory implements FrameListener {
|
104
|
105
|
}
|
105
|
106
|
|
106
|
107
|
@Override
|
107
|
|
- public void addWindow(final FrameContainer window, final boolean focus) {
|
|
108
|
+ public void addWindow(final WindowModel window, final boolean focus) {
|
108
|
109
|
addWindow(null, window, focus);
|
109
|
110
|
}
|
110
|
111
|
|
111
|
112
|
@Override
|
112
|
|
- public void addWindow(final FrameContainer parent, final FrameContainer window,
|
|
113
|
+ public void addWindow(final WindowModel parent, final WindowModel window,
|
113
|
114
|
final boolean focus) {
|
114
|
115
|
UIUtilities.invokeLater(() -> {
|
115
|
|
- final TextFrame parentWindow = getSwingWindow(parent);
|
116
|
|
- final TextFrame childWindow = doAddWindow(window);
|
|
116
|
+ final TextFrame parentWindow = getSwingWindow((FrameContainer) parent);
|
|
117
|
+ final TextFrame childWindow = doAddWindow((FrameContainer) window);
|
117
|
118
|
|
118
|
119
|
if (childWindow == null) {
|
119
|
120
|
return;
|
|
@@ -152,14 +153,14 @@ public class SwingWindowFactory implements FrameListener {
|
152
|
153
|
}
|
153
|
154
|
|
154
|
155
|
@Override
|
155
|
|
- public void delWindow(final FrameContainer window) {
|
|
156
|
+ public void delWindow(final WindowModel window) {
|
156
|
157
|
delWindow(null, window);
|
157
|
158
|
}
|
158
|
159
|
|
159
|
160
|
@Override
|
160
|
|
- public void delWindow(final FrameContainer parent, final FrameContainer window) {
|
161
|
|
- final TextFrame parentWindow = getSwingWindow(parent);
|
162
|
|
- final TextFrame childWindow = getSwingWindow(window);
|
|
161
|
+ public void delWindow(final WindowModel parent, final WindowModel window) {
|
|
162
|
+ final TextFrame parentWindow = getSwingWindow((FrameContainer) parent);
|
|
163
|
+ final TextFrame childWindow = getSwingWindow((FrameContainer) window);
|
163
|
164
|
windows.remove(window);
|
164
|
165
|
UIUtilities.invokeLater(() -> swingEventBus.publish(new SwingWindowDeletedEvent(
|
165
|
166
|
Optional.ofNullable(parentWindow), childWindow)));
|