|
@@ -22,20 +22,20 @@
|
22
|
22
|
|
23
|
23
|
package com.dmdirc.addons.ui_swing.dialogs.channelsetting;
|
24
|
24
|
|
25
|
|
-import com.dmdirc.Channel;
|
26
|
25
|
import com.dmdirc.DMDircMBassador;
|
27
|
26
|
import com.dmdirc.Topic;
|
28
|
27
|
import com.dmdirc.addons.ui_swing.UIUtilities;
|
29
|
28
|
import com.dmdirc.addons.ui_swing.actions.ReplacePasteAction;
|
|
29
|
+import com.dmdirc.addons.ui_swing.components.IconManager;
|
30
|
30
|
import com.dmdirc.addons.ui_swing.components.inputfields.SwingInputHandler;
|
31
|
31
|
import com.dmdirc.addons.ui_swing.components.inputfields.TextAreaInputField;
|
32
|
32
|
import com.dmdirc.addons.ui_swing.components.text.TextLabel;
|
33
|
33
|
import com.dmdirc.interfaces.CommandController;
|
|
34
|
+import com.dmdirc.interfaces.GroupChat;
|
34
|
35
|
import com.dmdirc.interfaces.GroupChatUser;
|
35
|
36
|
import com.dmdirc.interfaces.config.AggregateConfigProvider;
|
36
|
37
|
import com.dmdirc.interfaces.ui.InputWindow;
|
37
|
38
|
import com.dmdirc.plugins.ServiceManager;
|
38
|
|
-import com.dmdirc.addons.ui_swing.components.IconManager;
|
39
|
39
|
import com.dmdirc.ui.input.TabCompleterUtils;
|
40
|
40
|
import com.dmdirc.ui.messages.ColourManagerFactory;
|
41
|
41
|
|
|
@@ -55,7 +55,7 @@ import javax.swing.event.DocumentListener;
|
55
|
55
|
import net.miginfocom.swing.MigLayout;
|
56
|
56
|
|
57
|
57
|
/**
|
58
|
|
- * Class to display a topic to an end user as part of the channel settings dialog.
|
|
58
|
+ * Class to display a topic to an end user as part of the groupChat settings dialog.
|
59
|
59
|
*/
|
60
|
60
|
public class TopicDisplayPane extends JPanel implements DocumentListener {
|
61
|
61
|
|
|
@@ -63,8 +63,8 @@ public class TopicDisplayPane extends JPanel implements DocumentListener {
|
63
|
63
|
private static final long serialVersionUID = 1;
|
64
|
64
|
/** Parent topic pane. */
|
65
|
65
|
private final ChannelSettingsDialog parent;
|
66
|
|
- /** Associated channel. */
|
67
|
|
- private final Channel channel;
|
|
66
|
+ /** Associated group chat. */
|
|
67
|
+ private final GroupChat groupChat;
|
68
|
68
|
/** Channel window. */
|
69
|
69
|
private final InputWindow channelWindow;
|
70
|
70
|
/** the maximum length allowed for a topic. */
|
|
@@ -84,34 +84,34 @@ public class TopicDisplayPane extends JPanel implements DocumentListener {
|
84
|
84
|
* Creates a new topic display panel. This panel shows an editable version of the current topic
|
85
|
85
|
* along with relating meta data and validates the length of the new input.
|
86
|
86
|
*
|
87
|
|
- * @param channel Associated channel
|
|
87
|
+ * @param groupChat Associated group chat
|
88
|
88
|
* @param iconManager Icon manager
|
89
|
89
|
* @param serviceManager Service manager
|
90
|
|
- * @param parent Parent channel settings dialog
|
|
90
|
+ * @param parent Parent settings dialog
|
91
|
91
|
* @param channelWindow Channel window
|
92
|
92
|
* @param clipboard Clipboard to copy and paste
|
93
|
93
|
* @param commandController The controller to use to retrieve command information.
|
94
|
94
|
* @param eventBus The event bus to post errors to.
|
95
|
95
|
*/
|
96
|
|
- public TopicDisplayPane(final Channel channel, final IconManager iconManager,
|
|
96
|
+ public TopicDisplayPane(final GroupChat groupChat, final IconManager iconManager,
|
97
|
97
|
final ServiceManager serviceManager, final ChannelSettingsDialog parent,
|
98
|
98
|
final InputWindow channelWindow, final Clipboard clipboard,
|
99
|
99
|
final CommandController commandController, final DMDircMBassador eventBus,
|
100
|
100
|
final ColourManagerFactory colourManagerFactory,
|
101
|
101
|
final TabCompleterUtils tabCompleterUtils) {
|
102
|
102
|
this.clipboard = clipboard;
|
103
|
|
- this.channel = channel;
|
|
103
|
+ this.groupChat = groupChat;
|
104
|
104
|
this.parent = parent;
|
105
|
|
- topicLengthMax = channel.getConnection().get().getParser().get().getMaxTopicLength();
|
|
105
|
+ topicLengthMax = groupChat.getConnection().get().getParser().get().getMaxTopicLength();
|
106
|
106
|
this.channelWindow = channelWindow;
|
107
|
107
|
this.eventBus = eventBus;
|
108
|
108
|
|
109
|
|
- initComponents(iconManager, channel.getConfigManager(), serviceManager, commandController,
|
110
|
|
- colourManagerFactory, tabCompleterUtils);
|
|
109
|
+ initComponents(iconManager, groupChat.getWindowModel().getConfigManager(), serviceManager,
|
|
110
|
+ commandController, colourManagerFactory, tabCompleterUtils);
|
111
|
111
|
addListeners();
|
112
|
112
|
layoutComponents();
|
113
|
113
|
|
114
|
|
- setTopic(channel.getCurrentTopic());
|
|
114
|
+ setTopic(groupChat.getCurrentTopic());
|
115
|
115
|
}
|
116
|
116
|
|
117
|
117
|
private void initComponents(
|
|
@@ -131,10 +131,10 @@ public class TopicDisplayPane extends JPanel implements DocumentListener {
|
131
|
131
|
topicText.setRows(5);
|
132
|
132
|
topicText.setColumns(30);
|
133
|
133
|
final SwingInputHandler handler = new SwingInputHandler(serviceManager, topicText,
|
134
|
|
- commandController, channel.getCommandParser(), channelWindow.getContainer(),
|
135
|
|
- tabCompleterUtils, channel.getEventBus());
|
|
134
|
+ commandController, groupChat.getWindowModel().getCommandParser(),
|
|
135
|
+ channelWindow.getContainer(), tabCompleterUtils, groupChat.getEventBus());
|
136
|
136
|
handler.setTypes(true, false, true, false);
|
137
|
|
- handler.setTabCompleter(channel.getTabCompleter());
|
|
137
|
+ handler.setTabCompleter(groupChat.getWindowModel().getTabCompleter());
|
138
|
138
|
|
139
|
139
|
topicText.getActionMap().put("paste-from-clipboard",
|
140
|
140
|
new ReplacePasteAction(eventBus, clipboard, "(\r\n|\n|\r)", " "));
|