|
@@ -56,10 +56,11 @@ import javax.swing.JComponent;
|
56
|
56
|
import javax.swing.JLabel;
|
57
|
57
|
import javax.swing.JScrollPane;
|
58
|
58
|
import javax.swing.KeyStroke;
|
|
59
|
+import javax.swing.ScrollPaneConstants;
|
59
|
60
|
import javax.swing.SwingUtilities;
|
60
|
61
|
import javax.swing.event.DocumentEvent;
|
61
|
62
|
import javax.swing.event.DocumentListener;
|
62
|
|
-import javax.swing.text.DefaultStyledDocument;
|
|
63
|
+import javax.swing.text.AbstractDocument;
|
63
|
64
|
import javax.swing.text.SimpleAttributeSet;
|
64
|
65
|
import javax.swing.text.StyleConstants;
|
65
|
66
|
import javax.swing.text.StyledDocument;
|
|
@@ -141,7 +142,7 @@ public class TopicBar extends JComponent implements ActionListener, ConfigChange
|
141
|
142
|
updateOptions();
|
142
|
143
|
errorIcon = new JLabel(iconManager.getIcon("input-error"));
|
143
|
144
|
topicText.setEditorKit(new WrapEditorKit(showFull, channel.getEventBus(), window));
|
144
|
|
- ((DefaultStyledDocument) topicText.getDocument()).setDocumentFilter(
|
|
145
|
+ ((AbstractDocument) topicText.getDocument()).setDocumentFilter(
|
145
|
146
|
new NewlinesDocumentFilter());
|
146
|
147
|
|
147
|
148
|
topicText.getActionMap().put("paste-from-clipboard",
|
|
@@ -160,8 +161,8 @@ public class TopicBar extends JComponent implements ActionListener, ConfigChange
|
160
|
161
|
handler.setTabCompleter(channel.getTabCompleter());
|
161
|
162
|
|
162
|
163
|
final JScrollPane sp = new JScrollPane(topicText);
|
163
|
|
- sp.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
|
164
|
|
- sp.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_NEVER);
|
|
164
|
+ sp.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
|
|
165
|
+ sp.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
|
165
|
166
|
|
166
|
167
|
setLayout(new MigLayout("fillx, ins 0, hidemode 3"));
|
167
|
168
|
add(sp, "growx, pushx");
|
|
@@ -367,7 +368,7 @@ public class TopicBar extends JComponent implements ActionListener, ConfigChange
|
367
|
368
|
*/
|
368
|
369
|
private void applyAttributes() {
|
369
|
370
|
setAttributes();
|
370
|
|
- ((DefaultStyledDocument) topicText.getDocument())
|
|
371
|
+ ((StyledDocument) topicText.getDocument())
|
371
|
372
|
.setCharacterAttributes(0, Integer.MAX_VALUE, as, true);
|
372
|
373
|
}
|
373
|
374
|
|
|
@@ -445,7 +446,7 @@ public class TopicBar extends JComponent implements ActionListener, ConfigChange
|
445
|
446
|
cancelTopicEdit();
|
446
|
447
|
if ("showfulltopic".equals(key)) {
|
447
|
448
|
topicText.setEditorKit(new WrapEditorKit(showFull, channel.getEventBus(), window));
|
448
|
|
- ((DefaultStyledDocument) topicText.getDocument()).setDocumentFilter(
|
|
449
|
+ ((AbstractDocument) topicText.getDocument()).setDocumentFilter(
|
449
|
450
|
new NewlinesDocumentFilter());
|
450
|
451
|
topicChanged(channel, null);
|
451
|
452
|
}
|