Selaa lähdekoodia

Remove input methods from WindowModel.

Migrate all users to using the InputModel.
pull/457/head
Chris Smith 8 vuotta sitten
vanhempi
commit
e579fda440

+ 5
- 2
conditional_execute/src/com/dmdirc/addons/conditional_execute/ConditionalExecuteCommand.java Näytä tiedosto

28
 import com.dmdirc.commandparser.commands.Command;
28
 import com.dmdirc.commandparser.commands.Command;
29
 import com.dmdirc.commandparser.commands.context.CommandContext;
29
 import com.dmdirc.commandparser.commands.context.CommandContext;
30
 import com.dmdirc.interfaces.CommandController;
30
 import com.dmdirc.interfaces.CommandController;
31
+import com.dmdirc.interfaces.InputModel;
31
 import com.dmdirc.interfaces.WindowModel;
32
 import com.dmdirc.interfaces.WindowModel;
32
 
33
 
33
 import java.util.HashMap;
34
 import java.util.HashMap;
231
                         "You can't run commands and manipulate the namespace at the same time, ignored.");
232
                         "You can't run commands and manipulate the namespace at the same time, ignored.");
232
             } else {
233
             } else {
233
                 // Command to run!
234
                 // Command to run!
234
-                if (namespace.canRun(inverse) && origin.isWritable()) {
235
-                    origin.getCommandParser().parseCommand(origin, args.getArgumentsAsString(i));
235
+                if (namespace.canRun(inverse)) {
236
+                    final String command = args.getArgumentsAsString(i);
237
+                    origin.getInputModel().map(InputModel::getCommandParser)
238
+                            .ifPresent(cp -> cp.parseCommand(origin, command));
236
                 }
239
                 }
237
                 return;
240
                 return;
238
             }
241
             }

+ 6
- 2
conditional_execute/test/com/dmdirc/addons/conditional_execute/ConditionalExecuteCommandTest.java Näytä tiedosto

28
 import com.dmdirc.commandparser.parsers.CommandParser;
28
 import com.dmdirc.commandparser.parsers.CommandParser;
29
 import com.dmdirc.events.CommandErrorEvent;
29
 import com.dmdirc.events.CommandErrorEvent;
30
 import com.dmdirc.interfaces.CommandController;
30
 import com.dmdirc.interfaces.CommandController;
31
+import com.dmdirc.interfaces.InputModel;
31
 import com.dmdirc.interfaces.WindowModel;
32
 import com.dmdirc.interfaces.WindowModel;
32
 
33
 
34
+import java.util.Optional;
35
+
33
 import org.junit.Before;
36
 import org.junit.Before;
34
 import org.junit.Test;
37
 import org.junit.Test;
35
 import org.junit.runner.RunWith;
38
 import org.junit.runner.RunWith;
52
     @Mock private CommandController commandController;
55
     @Mock private CommandController commandController;
53
     @Mock private CommandParser commandParser;
56
     @Mock private CommandParser commandParser;
54
     @Mock private WindowModel container;
57
     @Mock private WindowModel container;
58
+    @Mock private InputModel inputModel;
55
     @Mock private CommandContext context;
59
     @Mock private CommandContext context;
56
     @Mock private DMDircMBassador eventbus;
60
     @Mock private DMDircMBassador eventbus;
57
     @Captor private ArgumentCaptor<CommandErrorEvent> errorEventCaptor;
61
     @Captor private ArgumentCaptor<CommandErrorEvent> errorEventCaptor;
61
     public void setup() {
65
     public void setup() {
62
         when(commandController.getCommandChar()).thenReturn('/');
66
         when(commandController.getCommandChar()).thenReturn('/');
63
         when(commandController.getSilenceChar()).thenReturn('/');
67
         when(commandController.getSilenceChar()).thenReturn('/');
64
-        when(container.getCommandParser()).thenReturn(commandParser);
65
-        when(container.isWritable()).thenReturn(true);
68
+        when(container.getInputModel()).thenReturn(Optional.of(inputModel));
69
+        when(inputModel.getCommandParser()).thenReturn(commandParser);
66
         when(container.getEventBus()).thenReturn(eventbus);
70
         when(container.getEventBus()).thenReturn(eventbus);
67
 
71
 
68
         command = new ConditionalExecuteCommand(commandController);
72
         command = new ConditionalExecuteCommand(commandController);

+ 1
- 1
dcc/src/com/dmdirc/addons/dcc/DCCCommandParser.java Näytä tiedosto

59
      */
59
      */
60
     @Override
60
     @Override
61
     protected void handleNonCommand(final WindowModel origin, final String line) {
61
     protected void handleNonCommand(final WindowModel origin, final String line) {
62
-        origin.sendLine(line);
62
+        origin.getInputModel().ifPresent(im -> im.sendLine(line));
63
     }
63
     }
64
 
64
 
65
 }
65
 }

+ 2
- 1
debug/src/com/dmdirc/addons/debug/RawWindow.java Näytä tiedosto

52
         super("raw", "Raw", "(Raw log)",
52
         super("raw", "Raw", "(Raw log)",
53
                 connection.getWindowModel().getConfigManager(),
53
                 connection.getWindowModel().getConfigManager(),
54
                 backBufferFactory,
54
                 backBufferFactory,
55
-                tabCompleterFactory.getTabCompleter(connection.getWindowModel().getTabCompleter(),
55
+                tabCompleterFactory.getTabCompleter(
56
+                        connection.getWindowModel().getInputModel().get().getTabCompleter(),
56
                         connection.getWindowModel().getConfigManager(),
57
                         connection.getWindowModel().getConfigManager(),
57
                         CommandType.TYPE_QUERY, CommandType.TYPE_CHAT),
58
                         CommandType.TYPE_QUERY, CommandType.TYPE_CHAT),
58
                 connection.getWindowModel().getEventBus(),
59
                 connection.getWindowModel().getEventBus(),

+ 8
- 2
debug/src/com/dmdirc/addons/debug/commands/Time.java Näytä tiedosto

27
 import com.dmdirc.commandparser.CommandArguments;
27
 import com.dmdirc.commandparser.CommandArguments;
28
 import com.dmdirc.commandparser.commands.IntelligentCommand;
28
 import com.dmdirc.commandparser.commands.IntelligentCommand;
29
 import com.dmdirc.commandparser.commands.context.CommandContext;
29
 import com.dmdirc.commandparser.commands.context.CommandContext;
30
+import com.dmdirc.commandparser.parsers.CommandParser;
31
+import com.dmdirc.interfaces.InputModel;
30
 import com.dmdirc.interfaces.WindowModel;
32
 import com.dmdirc.interfaces.WindowModel;
31
 import com.dmdirc.ui.input.AdditionalTabTargets;
33
 import com.dmdirc.ui.input.AdditionalTabTargets;
32
 import com.dmdirc.ui.input.TabCompletionType;
34
 import com.dmdirc.ui.input.TabCompletionType;
33
 
35
 
36
+import java.util.Optional;
37
+
34
 import javax.annotation.Nonnull;
38
 import javax.annotation.Nonnull;
35
 import javax.inject.Inject;
39
 import javax.inject.Inject;
36
 import javax.inject.Provider;
40
 import javax.inject.Provider;
79
             return;
83
             return;
80
         }
84
         }
81
 
85
 
82
-        if (origin.isWritable()) {
86
+        final Optional<CommandParser> parser =
87
+                origin.getInputModel().map(InputModel::getCommandParser);
88
+        if (parser.isPresent()) {
83
             final long start = System.currentTimeMillis();
89
             final long start = System.currentTimeMillis();
84
-            origin.getCommandParser().parseCommand(origin, args.getArgumentsAsString(0));
90
+            parser.get().parseCommand(origin, args.getArgumentsAsString(0));
85
             final long end = System.currentTimeMillis();
91
             final long end = System.currentTimeMillis();
86
             showOutput(origin, args.isSilent(),
92
             showOutput(origin, args.isSilent(),
87
                     "Command executed in " + (end - start) + " milliseconds.");
93
                     "Command executed in " + (end - start) + " milliseconds.");

+ 8
- 5
nowplaying/src/com/dmdirc/addons/nowplaying/NowPlayingCommand.java Näytä tiedosto

33
 import com.dmdirc.commandparser.commands.context.CommandContext;
33
 import com.dmdirc.commandparser.commands.context.CommandContext;
34
 import com.dmdirc.interfaces.Chat;
34
 import com.dmdirc.interfaces.Chat;
35
 import com.dmdirc.interfaces.CommandController;
35
 import com.dmdirc.interfaces.CommandController;
36
+import com.dmdirc.interfaces.InputModel;
36
 import com.dmdirc.interfaces.WindowModel;
37
 import com.dmdirc.interfaces.WindowModel;
37
 import com.dmdirc.interfaces.config.AggregateConfigProvider;
38
 import com.dmdirc.interfaces.config.AggregateConfigProvider;
38
 import com.dmdirc.plugins.PluginDomain;
39
 import com.dmdirc.plugins.PluginDomain;
106
                     if (source.getState() == MediaSourceState.CLOSED) {
107
                     if (source.getState() == MediaSourceState.CLOSED) {
107
                         showError(origin, args.isSilent(), "Source is not running.");
108
                         showError(origin, args.isSilent(), "Source is not running.");
108
                     } else {
109
                     } else {
109
-                        target.getWindowModel().getCommandParser().parseCommand(origin,
110
-                                getInformation(source, args.getArgumentsAsString(2)));
110
+                        target.getWindowModel().getInputModel().map(InputModel::getCommandParser)
111
+                                .ifPresent(cp -> cp.parseCommand(origin,
112
+                                        getInformation(source, args.getArgumentsAsString(2))));
111
                     }
113
                     }
112
                 }
114
                 }
113
             } else {
115
             } else {
116
             }
118
             }
117
         } else {
119
         } else {
118
             if (manager.hasRunningSource()) {
120
             if (manager.hasRunningSource()) {
119
-                target.getWindowModel().getCommandParser().parseCommand(origin,
120
-                        getInformation(manager.getBestSource(), args.
121
-                                getArgumentsAsString(0)));
121
+                target.getWindowModel().getInputModel().map(InputModel::getCommandParser)
122
+                        .ifPresent(cp -> cp.parseCommand(origin,
123
+                                getInformation(manager.getBestSource(),
124
+                                        args.getArgumentsAsString(0))));
122
             } else {
125
             } else {
123
                 showError(origin, args.isSilent(), "No running media sources available.");
126
                 showError(origin, args.isSilent(), "No running media sources available.");
124
             }
127
             }

+ 5
- 4
redirect/src/com/dmdirc/addons/redirect/FakeWriteableFrameContainer.java Näytä tiedosto

48
             final BackBufferFactory backBufferFactory) {
48
             final BackBufferFactory backBufferFactory) {
49
         super(target.getIcon(), target.getName(), target.getTitle(),
49
         super(target.getIcon(), target.getName(), target.getTitle(),
50
                 target.getConfigManager(), backBufferFactory,
50
                 target.getConfigManager(), backBufferFactory,
51
-                target.getTabCompleter(), eventBus, Collections.<String>emptyList());
51
+                target.getInputModel().get().getTabCompleter(), eventBus,
52
+                Collections.<String>emptyList());
52
         this.target = target;
53
         this.target = target;
53
         initBackBuffer();
54
         initBackBuffer();
54
-        setCommandParser(target.getCommandParser());
55
+        setCommandParser(target.getInputModel().get().getCommandParser());
55
     }
56
     }
56
 
57
 
57
     @Override
58
     @Override
58
     public void sendLine(final String line) {
59
     public void sendLine(final String line) {
59
-        target.sendLine(line);
60
+        target.getInputModel().ifPresent(im -> im.sendLine(line));
60
     }
61
     }
61
 
62
 
62
     @Override
63
     @Override
63
     public int getMaxLineLength() {
64
     public int getMaxLineLength() {
64
-        return target.getMaxLineLength();
65
+        return target.getInputModel().get().getMaxLineLength();
65
     }
66
     }
66
 
67
 
67
     @Override
68
     @Override

+ 6
- 4
redirect/src/com/dmdirc/addons/redirect/RedirectCommand.java Näytä tiedosto

32
 import com.dmdirc.commandparser.commands.context.CommandContext;
32
 import com.dmdirc.commandparser.commands.context.CommandContext;
33
 import com.dmdirc.interfaces.Chat;
33
 import com.dmdirc.interfaces.Chat;
34
 import com.dmdirc.interfaces.CommandController;
34
 import com.dmdirc.interfaces.CommandController;
35
+import com.dmdirc.interfaces.InputModel;
35
 import com.dmdirc.interfaces.WindowModel;
36
 import com.dmdirc.interfaces.WindowModel;
36
 import com.dmdirc.ui.input.AdditionalTabTargets;
37
 import com.dmdirc.ui.input.AdditionalTabTargets;
37
 import com.dmdirc.ui.input.TabCompleterUtils;
38
 import com.dmdirc.ui.input.TabCompleterUtils;
76
     public void execute(@Nonnull final WindowModel origin,
77
     public void execute(@Nonnull final WindowModel origin,
77
             final CommandArguments args, final CommandContext context) {
78
             final CommandArguments args, final CommandContext context) {
78
         final Chat target = ((ChatCommandContext) context).getChat();
79
         final Chat target = ((ChatCommandContext) context).getChat();
79
-        target.getWindowModel().getCommandParser().parseCommand(
80
-                new FakeWriteableFrameContainer(target.getWindowModel(),
81
-                        eventBus, backBufferFactory),
82
-                args.getArgumentsAsString());
80
+        target.getWindowModel().getInputModel().map(InputModel::getCommandParser).
81
+                ifPresent(cp -> cp.parseCommand(
82
+                        new FakeWriteableFrameContainer(target.getWindowModel(),
83
+                                eventBus, backBufferFactory),
84
+                        args.getArgumentsAsString()));
83
     }
85
     }
84
 
86
 
85
     @Override
87
     @Override

+ 1
- 1
time/src/com/dmdirc/addons/time/TimedCommand.java Näytä tiedosto

101
         if (timer == null) {
101
         if (timer == null) {
102
             return;
102
             return;
103
         }
103
         }
104
-        origin.getCommandParser().parseCommand(origin, command);
104
+        origin.getInputModel().get().getCommandParser().parseCommand(origin, command);
105
 
105
 
106
         if (--repetitions <= 0) {
106
         if (--repetitions <= 0) {
107
             manager.removeTimer(timerKey);
107
             manager.removeTimer(timerKey);

+ 5
- 1
time/test/com/dmdirc/addons/time/TimedCommandTest.java Näytä tiedosto

23
 package com.dmdirc.addons.time;
23
 package com.dmdirc.addons.time;
24
 
24
 
25
 import com.dmdirc.commandparser.parsers.CommandParser;
25
 import com.dmdirc.commandparser.parsers.CommandParser;
26
+import com.dmdirc.interfaces.InputModel;
26
 import com.dmdirc.interfaces.WindowModel;
27
 import com.dmdirc.interfaces.WindowModel;
27
 
28
 
29
+import java.util.Optional;
28
 import java.util.Timer;
30
 import java.util.Timer;
29
 
31
 
30
 import org.junit.Before;
32
 import org.junit.Before;
45
 
47
 
46
     @Mock private TimerManager timerManager;
48
     @Mock private TimerManager timerManager;
47
     @Mock private WindowModel origin;
49
     @Mock private WindowModel origin;
50
+    @Mock private InputModel inputModel;
48
     @Mock private CommandParser commandParser;
51
     @Mock private CommandParser commandParser;
49
     @Mock private TimerFactory timerFactory;
52
     @Mock private TimerFactory timerFactory;
50
     @Mock private Timer timer;
53
     @Mock private Timer timer;
54
     @Before
57
     @Before
55
     public void setUp() throws Exception {
58
     public void setUp() throws Exception {
56
         when(timerFactory.getTimer(anyString())).thenReturn(timer);
59
         when(timerFactory.getTimer(anyString())).thenReturn(timer);
57
-        when(origin.getCommandParser()).thenReturn(commandParser);
60
+        when(origin.getInputModel()).thenReturn(Optional.of(inputModel));
61
+        when(inputModel.getCommandParser()).thenReturn(commandParser);
58
         instance = new TimedCommand(timerManager, 1, 2, 3, "command", origin);
62
         instance = new TimedCommand(timerManager, 1, 2, 3, "command", origin);
59
     }
63
     }
60
 
64
 

+ 3
- 3
ui_swing/src/com/dmdirc/addons/ui_swing/components/TopicBar.java Näytä tiedosto

122
      * @param channel           The channel that this topic bar is for.
122
      * @param channel           The channel that this topic bar is for.
123
      * @param window            The window this topic bar is for.
123
      * @param window            The window this topic bar is for.
124
      * @param iconManager       The icon manager to use for this bar's icons.
124
      * @param iconManager       The icon manager to use for this bar's icons.
125
-     * @param eventBus          The event bus to post errors to
126
      */
125
      */
127
     public TopicBar(
126
     public TopicBar(
128
             final Window parentWindow,
127
             final Window parentWindow,
159
 
158
 
160
         final SwingInputHandler handler = new SwingInputHandler(
159
         final SwingInputHandler handler = new SwingInputHandler(
161
                 serviceManager, topicText, commandController,
160
                 serviceManager, topicText, commandController,
162
-                channel.getWindowModel().getCommandParser(), channel.getWindowModel(),
161
+                channel.getWindowModel().getInputModel().get().getCommandParser(),
162
+                channel.getWindowModel(),
163
                 tabCompleterUtils, channel.getEventBus());
163
                 tabCompleterUtils, channel.getEventBus());
164
         handler.setTypes(true, false, true, false);
164
         handler.setTypes(true, false, true, false);
165
-        handler.setTabCompleter(channel.getWindowModel().getTabCompleter());
165
+        handler.setTabCompleter(channel.getWindowModel().getInputModel().get().getTabCompleter());
166
 
166
 
167
         final JScrollPane sp = new JScrollPane(topicText);
167
         final JScrollPane sp = new JScrollPane(topicText);
168
         sp.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
168
         sp.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);

+ 4
- 3
ui_swing/src/com/dmdirc/addons/ui_swing/components/frames/InputTextFrame.java Näytä tiedosto

96
             final Provider<SwingInputField> inputFieldProvider,
96
             final Provider<SwingInputField> inputFieldProvider,
97
             final InputTextFramePasteActionFactory inputTextFramePasteActionFactory,
97
             final InputTextFramePasteActionFactory inputTextFramePasteActionFactory,
98
             final WindowModel owner) {
98
             final WindowModel owner) {
99
-        super(owner, owner.getCommandParser(), deps);
99
+        super(owner, owner.getInputModel().get().getCommandParser(), deps);
100
 
100
 
101
         serviceManager = deps.serviceManager;
101
         serviceManager = deps.serviceManager;
102
         commandController = deps.commandController;
102
         commandController = deps.commandController;
135
             final TabCompleterUtils tabCompleterUtils) {
135
             final TabCompleterUtils tabCompleterUtils) {
136
         inputField = inputFieldProvider.get();
136
         inputField = inputFieldProvider.get();
137
         inputHandler = new SwingInputHandler(serviceManager, inputField, commandController,
137
         inputHandler = new SwingInputHandler(serviceManager, inputField, commandController,
138
-                getContainer().getCommandParser(), getContainer(), tabCompleterUtils, eventBus);
138
+                getContainer().getInputModel().get().getCommandParser(), getContainer(),
139
+                tabCompleterUtils, eventBus);
139
         inputHandler.addValidationListener(inputField);
140
         inputHandler.addValidationListener(inputField);
140
-        inputHandler.setTabCompleter(frameParent.getTabCompleter());
141
+        inputHandler.setTabCompleter(frameParent.getInputModel().get().getTabCompleter());
141
 
142
 
142
         initPopupMenu();
143
         initPopupMenu();
143
         nickPopup = new JPopupMenu();
144
         nickPopup = new JPopupMenu();

+ 4
- 2
ui_swing/src/com/dmdirc/addons/ui_swing/components/frames/InputTextFramePasteAction.java Näytä tiedosto

137
             final Integer pasteTrigger = container.getConfigManager().
137
             final Integer pasteTrigger = container.getConfigManager().
138
                     getOptionInt("ui", "pasteProtectionLimit", false);
138
                     getOptionInt("ui", "pasteProtectionLimit", false);
139
             //check whether the number of lines is over the limit
139
             //check whether the number of lines is over the limit
140
-            if (pasteTrigger != null && container.getNumLines(text) > pasteTrigger) {
140
+            if (pasteTrigger != null && container.getInputModel().get().getNumLines(text) >
141
+                    pasteTrigger) {
141
                 //show the multi line paste dialog
142
                 //show the multi line paste dialog
142
                 pasteDialogFactory.getPasteDialog(inputFrame, text, window).displayOrRequestFocus();
143
                 pasteDialogFactory.getPasteDialog(inputFrame, text, window).displayOrRequestFocus();
143
             } else {
144
             } else {
144
                 //send the lines
145
                 //send the lines
145
                 for (final String clipboardLine : clipboardLines) {
146
                 for (final String clipboardLine : clipboardLines) {
146
-                    inputFrame.getContainer().sendLine(clipboardLine);
147
+                    inputFrame.getContainer().getInputModel()
148
+                            .ifPresent(im -> im.sendLine(clipboardLine));
147
                 }
149
                 }
148
             }
150
             }
149
         } else {
151
         } else {

+ 3
- 2
ui_swing/src/com/dmdirc/addons/ui_swing/dialogs/channelsetting/TopicDisplayPane.java Näytä tiedosto

125
         topicText.setRows(5);
125
         topicText.setRows(5);
126
         topicText.setColumns(30);
126
         topicText.setColumns(30);
127
         final SwingInputHandler handler = new SwingInputHandler(serviceManager, topicText,
127
         final SwingInputHandler handler = new SwingInputHandler(serviceManager, topicText,
128
-                commandController, groupChat.getWindowModel().getCommandParser(),
128
+                commandController,
129
+                groupChat.getWindowModel().getInputModel().get().getCommandParser(),
129
                 channelWindow.getContainer(), tabCompleterUtils, groupChat.getEventBus());
130
                 channelWindow.getContainer(), tabCompleterUtils, groupChat.getEventBus());
130
         handler.setTypes(true, false, true, false);
131
         handler.setTypes(true, false, true, false);
131
-        handler.setTabCompleter(groupChat.getWindowModel().getTabCompleter());
132
+        handler.setTabCompleter(groupChat.getWindowModel().getInputModel().get().getTabCompleter());
132
 
133
 
133
         topicText.getActionMap().put("paste-from-clipboard",
134
         topicText.getActionMap().put("paste-from-clipboard",
134
                 new ReplacePasteAction(clipboard, "(\r\n|\n|\r)", " "));
135
                 new ReplacePasteAction(clipboard, "(\r\n|\n|\r)", " "));

+ 5
- 5
ui_swing/src/com/dmdirc/addons/ui_swing/dialogs/paste/PasteDialog.java Näytä tiedosto

147
         setResizable(false);
147
         setResizable(false);
148
 
148
 
149
         infoLabel.setText("This will be sent as "
149
         infoLabel.setText("This will be sent as "
150
-                + parent.getContainer().getNumLines(textField.getText())
150
+                + parent.getContainer().getInputModel().get().getNumLines(textField.getText())
151
                 + " lines. Are you sure you want to continue?");
151
                 + " lines. Are you sure you want to continue?");
152
 
152
 
153
         textField.setColumns(50);
153
         textField.setColumns(50);
154
         textField.setRows(10);
154
         textField.setRows(10);
155
 
155
 
156
         new SwingInputHandler(serviceManager, textField, commandController,
156
         new SwingInputHandler(serviceManager, textField, commandController,
157
-                parent.getContainer().getCommandParser(),
157
+                parent.getContainer().getInputModel().get().getCommandParser(),
158
                 parent.getContainer(), tabCompleterUtils, eventBus)
158
                 parent.getContainer(), tabCompleterUtils, eventBus)
159
                 .setTypes(false, false, true,false);
159
                 .setTypes(false, false, true,false);
160
 
160
 
218
                         Integer.MAX_VALUE);
218
                         Integer.MAX_VALUE);
219
                 for (final String line : lines) {
219
                 for (final String line : lines) {
220
                     if (!line.isEmpty()) {
220
                     if (!line.isEmpty()) {
221
-                        parent.getContainer().sendLine(line);
221
+                        parent.getContainer().getInputModel().ifPresent(im -> im.sendLine(line));
222
                         parent.getInputHandler().addToBuffer(line);
222
                         parent.getInputHandler().addToBuffer(line);
223
                     }
223
                     }
224
                 }
224
                 }
229
             setResizable(true);
229
             setResizable(true);
230
             scrollPane.setVisible(true);
230
             scrollPane.setVisible(true);
231
             infoLabel.setText("This will be sent as "
231
             infoLabel.setText("This will be sent as "
232
-                    + parent.getContainer().getNumLines(textField.getText())
232
+                    + parent.getContainer().getInputModel().get().getNumLines(textField.getText())
233
                     + " lines.");
233
                     + " lines.");
234
             setResizable(true);
234
             setResizable(true);
235
             pack();
235
             pack();
242
     @Override
242
     @Override
243
     public void keyTyped(final KeyEvent e) {
243
     public void keyTyped(final KeyEvent e) {
244
         infoLabel.setText("This will be sent as "
244
         infoLabel.setText("This will be sent as "
245
-                + parent.getContainer().getNumLines(textField.getText())
245
+                + parent.getContainer().getInputModel().get().getNumLines(textField.getText())
246
                 + " lines.");
246
                 + " lines.");
247
     }
247
     }
248
 
248
 

+ 1
- 1
ui_web2/src/com/dmdirc/addons/ui_web2/serialisers/WindowModelSerialiser.java Näytä tiedosto

53
         res.addProperty("name", src.getName());
53
         res.addProperty("name", src.getName());
54
         res.addProperty("icon", src.getIcon());
54
         res.addProperty("icon", src.getIcon());
55
         res.addProperty("title", src.getTitle());
55
         res.addProperty("title", src.getTitle());
56
-        res.addProperty("writable", src.isWritable());
56
+        res.addProperty("writable", src.getInputModel().isPresent());
57
         res.add("children", context.serialize(windowManager.getChildren(src)));
57
         res.add("children", context.serialize(windowManager.getChildren(src)));
58
         res.add("components", context.serialize(src.getComponents()));
58
         res.add("components", context.serialize(src.getComponents()));
59
         res.add("backbuffer", context.serialize(src.getBackBuffer()));
59
         res.add("backbuffer", context.serialize(src.getBackBuffer()));

Loading…
Peruuta
Tallenna