Explorar el Código

Merge pull request #612 from csmith/tidying

Move some more formats over to events.
pull/613/head
Greg Holmes hace 8 años
padre
commit
abf3a6bac1

+ 29
- 12
res/com/dmdirc/ui/messages/format.yml Ver fichero

@@ -8,6 +8,8 @@ ServerCtcpEvent:
8 8
 ServerCtcpReplyEvent:
9 9
   format: "-!- CTCP {{type}} reply from {{user.nickname}}: {{content}}."
10 10
   colour: 4
11
+ServerConnectingEvent:
12
+  format: "Connecting to {{uri.host}}:{{uri.port}}..."
11 13
 ServerDisconnectedEvent:
12 14
   format: "-!- You have been disconnected from the server."
13 15
   colour: 2
@@ -41,9 +43,18 @@ ServerAuthNoticeEvent:
41 43
 ServerInviteReceivedEvent:
42 44
   format: "* You have been invited to {{channel}} by {{user.nickname}}."
43 45
   colour: 2
46
+ServerUserModesEvent:
47
+  format: "* User modes are: {{modes}}."
48
+  colour: 3
49
+ServerNickChangeEvent:
50
+  format: "* You are now known as {{newNick}}."
51
+  colour: 3
44 52
 ServerErrorEvent:
45 53
   format: "ERROR: {{reason}}"
46 54
   colour: 4
55
+ServerUnknownProtocolEvent:
56
+  format: "Unknown protocol '{{protocol}}'. Unable to connect."
57
+  colour: 4
47 58
 
48 59
 ################## Server messaging events #########################################################
49 60
 
@@ -53,6 +64,24 @@ ServerNoticeEvent:
53 64
 ServerServerNoticeEvent:
54 65
   format: "-{{user.nickname}}- {{message}}"
55 66
   colour: 5
67
+ServerUnknownMessageEvent:
68
+  format: "<[{{sender}}:{{target}}]> {{message}}"
69
+  colour: 5
70
+ServerUnknownNoticeEvent:
71
+  format: "-[{{sender}}:{{target}}]- {{message}}"
72
+  colour: 5
73
+ServerUnknownActionEvent:
74
+  format: "* [{{sender}}:{{target}}] {{message}}"
75
+  colour: 5
76
+ServerWallopsEvent:
77
+  format: "${{user.nickname}}$ {{message}}"
78
+  colour: 5
79
+ServerWallusersEvent:
80
+  format: "!{{user.nickname}}! {{message}}"
81
+  colour: 5
82
+ServerWalldesyncEvent:
83
+  format: "/{{user.nickname}}/ {{message}}"
84
+  colour: 5
56 85
 
57 86
 ################## Channel join/part/quit events ###################################################
58 87
 
@@ -178,16 +207,9 @@ CommandOutputEvent:
178 207
   format: "{{message}}"
179 208
 
180 209
 ################## TODO ############################################################################
181
-#  userModeChanged=3* %1$s sets user mode: %4$s.
182
-#  userNoModes=3* No user modes.
183
-#  userModeDiscovered=3* User modes are: %4$s.
184
-#  walluser=5!%1$s! %4$s
185
-#  wallop=5$%1$s$ %4$s
186
-#  walldesync=5/%1$s/ %4$s
187 210
 #  selfCTCP=4->- [%1$s] %2$s
188 211
 #  selfNotice=5>%1$s> %2$s
189 212
 #  selfMessage=>[%1$s]> %2$s
190
-#  serverConnecting=Connecting to %1$s:%2$s...
191 213
 #  serverDisconnectInProgress=A disconnection attempt is in progress, please wait...
192 214
 #  serverConnectInProgress=A connection attempt is in progress, please wait...
193 215
 #  rawCommand=10>>> %1$s
@@ -195,11 +217,6 @@ CommandOutputEvent:
195 217
 #  commandOutput=%1$s
196 218
 #  actionTooLong=Warning: action too long to be sent
197 219
 #  tabCompletion=14Multiple possibilities: %1$s
198
-#  serverUnknownProtocol=4Unknown protocol '%1$s'. Unable to connect.
199
-#  selfNickChange=3* You are now known as %2$s.
200
-#  unknownNotice=5-[%1$s:%2$s]- %3$s
201
-#  unknownMessage=5<[%1$s:%2$s]> %3$s
202
-#  unknownNotice=5* [%1$s:%2$s] %3$s
203 220
 #  commandUsage=7Usage: %1$s%2$s %3$s
204 221
 #  numeric_006=%4$s
205 222
 #  numeric_007=%4$s

+ 0
- 39
src/com/dmdirc/Channel.java Ver fichero

@@ -413,45 +413,6 @@ public class Channel extends FrameContainer implements GroupChat {
413 413
         return res;
414 414
     }
415 415
 
416
-    @Override
417
-    protected boolean processNotificationArg(final Object arg, final List<Object> args) {
418
-        if (arg instanceof User) {
419
-            final User clientInfo = (User) arg;
420
-            args.add(clientInfo.getNickname());
421
-            args.add(clientInfo.getUsername());
422
-            args.add(clientInfo.getHostname());
423
-
424
-            return true;
425
-        } else if (arg instanceof GroupChatUser) {
426
-            final GroupChatUser clientInfo = (GroupChatUser) arg;
427
-
428
-            args.addAll(Arrays.asList(getDetails(clientInfo)));
429
-
430
-            return true;
431
-        } else if (arg instanceof Topic) {
432
-            // Format topics
433
-            final Topic topic = (Topic) arg;
434
-            args.add("");
435
-            args.add(topic.getClient().map(GroupChatUser::getNickname).orElse("Unknown"));
436
-            args.add(topic.getClient().flatMap(GroupChatUser::getUsername).orElse(""));
437
-            args.add(topic.getClient().flatMap(GroupChatUser::getHostname).orElse(""));
438
-            args.add(topic.getTopic());
439
-            args.add(topic.getDate().getTime());
440
-
441
-            return true;
442
-        } else {
443
-            // Everything else - default formatting
444
-
445
-            return super.processNotificationArg(arg, args);
446
-        }
447
-    }
448
-
449
-    @Override
450
-    protected void modifyNotificationArgs(final List<Object> actionArgs,
451
-            final List<Object> messageArgs) {
452
-        messageArgs.add(channelInfo.getName());
453
-    }
454
-
455 416
     // ---------------------------------------------------- TOPIC HANDLING -----
456 417
     /**
457 418
      * Adds the specified topic to this channel's topic list.

+ 0
- 70
src/com/dmdirc/FrameContainer.java Ver fichero

@@ -319,24 +319,6 @@ public abstract class FrameContainer implements WindowModel {
319 319
         addLine(type, new Date(), args);
320 320
     }
321 321
 
322
-    @Override
323
-    public void addLine(final StringBuffer type, final Date timestamp, final Object... args) {
324
-        if (type != null) {
325
-            addLine(type.toString(), timestamp, args);
326
-        }
327
-    }
328
-
329
-    @Override
330
-    public void addLine(final StringBuffer type, final Object... args) {
331
-        addLine(type, new Date(), args);
332
-    }
333
-
334
-    @Override
335
-    @Deprecated
336
-    public void addLine(final String line, final boolean timestamp) {
337
-        addLine(line, new Date());
338
-    }
339
-
340 322
     @Override
341 323
     public void addLine(final String line, final Date timestamp) {
342 324
         for (final String myLine : line.split("\n")) {
@@ -421,58 +403,6 @@ public abstract class FrameContainer implements WindowModel {
421 403
         return lines;
422 404
     }
423 405
 
424
-    /**
425
-     * Processes and displays a notification.
426
-     *
427
-     * @param messageType The name of the formatter to be used for the message
428
-     * @param args        The arguments for the message
429
-     *
430
-     * @return True if any further behaviour should be executed, false otherwise
431
-     */
432
-    public boolean doNotification(final String messageType, final Object... args) {
433
-        final List<Object> messageArgs = new ArrayList<>();
434
-        final List<Object> actionArgs = new ArrayList<>();
435
-
436
-        actionArgs.add(this);
437
-
438
-        for (Object arg : args) {
439
-            actionArgs.add(arg);
440
-
441
-            if (!processNotificationArg(arg, messageArgs)) {
442
-                messageArgs.add(arg);
443
-            }
444
-        }
445
-
446
-        modifyNotificationArgs(actionArgs, messageArgs);
447
-
448
-        handleNotification(new Date(), messageType, messageArgs.toArray());
449
-
450
-        return true;
451
-    }
452
-
453
-    /**
454
-     * Allows subclasses to modify the lists of arguments for notifications.
455
-     *
456
-     * @param actionArgs  The list of arguments to be passed to the actions system
457
-     * @param messageArgs The list of arguments to be passed to the formatter
458
-     */
459
-    protected void modifyNotificationArgs(final List<Object> actionArgs,
460
-            final List<Object> messageArgs) {
461
-        // Do nothing
462
-    }
463
-
464
-    /**
465
-     * Allows subclasses to process specific types of notification arguments.
466
-     *
467
-     * @param arg  The argument to be processed
468
-     * @param args The list of arguments that any data should be appended to
469
-     *
470
-     * @return True if the arg has been processed, false otherwise
471
-     */
472
-    protected boolean processNotificationArg(final Object arg, final List<Object> args) {
473
-        return false;
474
-    }
475
-
476 406
     /**
477 407
      * Handles general server notifications (i.e., ones not tied to a specific window). The user can
478 408
      * select where the notifications should go in their config.

+ 0
- 14
src/com/dmdirc/Query.java Ver fichero

@@ -51,7 +51,6 @@ import com.dmdirc.ui.messages.sink.MessageSinkManager;
51 51
 
52 52
 import java.awt.Toolkit;
53 53
 import java.util.Arrays;
54
-import java.util.List;
55 54
 import java.util.Optional;
56 55
 
57 56
 import net.engio.mbassy.listener.Handler;
@@ -113,19 +112,6 @@ public class Query extends FrameContainer implements PrivateChat {
113 112
         });
114 113
     }
115 114
 
116
-    @Override
117
-    protected boolean processNotificationArg(final Object arg, final List<Object> args) {
118
-        if (arg instanceof User) {
119
-            final User clientInfo = (User) arg;
120
-            args.add(clientInfo.getNickname());
121
-            args.add(clientInfo.getUsername());
122
-            args.add(clientInfo.getHostname());
123
-            return true;
124
-        } else {
125
-            return super.processNotificationArg(arg, args);
126
-        }
127
-    }
128
-
129 115
     @Override
130 116
     public int getMaxLineLength() {
131 117
         // TODO: The parser layer should abstract this

+ 4
- 18
src/com/dmdirc/Server.java Ver fichero

@@ -29,6 +29,7 @@ import com.dmdirc.events.ServerConnectedEvent;
29 29
 import com.dmdirc.events.ServerConnectingEvent;
30 30
 import com.dmdirc.events.ServerDisconnectedEvent;
31 31
 import com.dmdirc.events.ServerReconnectScheduledEvent;
32
+import com.dmdirc.events.ServerUnknownProtocolEvent;
32 33
 import com.dmdirc.interfaces.Connection;
33 34
 import com.dmdirc.interfaces.GroupChatManager;
34 35
 import com.dmdirc.interfaces.InviteManager;
@@ -69,7 +70,6 @@ import java.util.Arrays;
69 70
 import java.util.Collection;
70 71
 import java.util.Collections;
71 72
 import java.util.Date;
72
-import java.util.List;
73 73
 import java.util.Map;
74 74
 import java.util.Optional;
75 75
 import java.util.concurrent.ConcurrentSkipListMap;
@@ -322,7 +322,8 @@ public class Server extends FrameContainer implements Connection {
322 322
                 parser = Optional.ofNullable(buildParser());
323 323
 
324 324
                 if (!parser.isPresent()) {
325
-                    addLine("serverUnknownProtocol", address.getScheme());
325
+                    getEventBus().publishAsync(
326
+                            new ServerUnknownProtocolEvent(this, address.getScheme()));
326 327
                     return;
327 328
                 }
328 329
 
@@ -332,8 +333,6 @@ public class Server extends FrameContainer implements Connection {
332 333
                 parserLock.writeLock().unlock();
333 334
             }
334 335
 
335
-            addLine("serverConnecting", connectAddress.getHost(), connectAddress.getPort());
336
-
337 336
             myState.transition(ServerState.CONNECTING);
338 337
 
339 338
             doCallbacks();
@@ -348,7 +347,7 @@ public class Server extends FrameContainer implements Connection {
348 347
             }
349 348
         }
350 349
 
351
-        getEventBus().publish(new ServerConnectingEvent(this));
350
+        getEventBus().publish(new ServerConnectingEvent(this, address));
352 351
     }
353 352
 
354 353
     @Override
@@ -792,19 +791,6 @@ public class Server extends FrameContainer implements Connection {
792 791
         return Optional.of(this);
793 792
     }
794 793
 
795
-    @Override
796
-    protected boolean processNotificationArg(final Object arg, final List<Object> args) {
797
-        if (arg instanceof User) {
798
-            final User clientInfo = (User) arg;
799
-            args.add(clientInfo.getNickname());
800
-            args.add(clientInfo.getUsername());
801
-            args.add(clientInfo.getHostname());
802
-            return true;
803
-        } else {
804
-            return super.processNotificationArg(arg, args);
805
-        }
806
-    }
807
-
808 794
     @Override
809 795
     public void updateTitle() {
810 796
         synchronized (myStateLock) {

+ 18
- 39
src/com/dmdirc/ServerEventHandler.java Ver fichero

@@ -347,11 +347,8 @@ public class ServerEventHandler extends EventHandler {
347 347
 
348 348
     @Handler
349 349
     public void onUnknownNotice(final UnknownNoticeEvent event) {
350
-        final ServerUnknownNoticeEvent
351
-                coreEvent = new ServerUnknownNoticeEvent(owner, event.getHost(), event.getTarget(),
352
-                event.getMessage());
353
-        final String format = EventUtils.postDisplayable(eventBus, coreEvent, "unknownNotice");
354
-        owner.doNotification(format, event.getHost(), event.getTarget(), event.getMessage());
350
+        eventBus.publishAsync(new ServerUnknownNoticeEvent(
351
+                owner, event.getHost(), event.getTarget(),event.getMessage()));
355 352
     }
356 353
 
357 354
     @Handler
@@ -362,10 +359,8 @@ public class ServerEventHandler extends EventHandler {
362 359
                     new QuerySelfMessageEvent(owner.getQuery(event.getTarget()), owner.getLocalUser().get(),
363 360
                             event.getMessage()));
364 361
         } else {
365
-            final ServerUnknownMessageEvent coreEvent
366
-                    = new ServerUnknownMessageEvent(owner, event.getHost(), event.getTarget(), event.getMessage());
367
-            final String format = EventUtils.postDisplayable(eventBus, coreEvent, "unknownMessage");
368
-            owner.doNotification(format, event.getHost(), event.getTarget(), event.getMessage());
362
+            eventBus.publishAsync(new ServerUnknownMessageEvent(
363
+                    owner, event.getHost(), event.getTarget(), event.getMessage()));
369 364
         }
370 365
     }
371 366
 
@@ -377,28 +372,21 @@ public class ServerEventHandler extends EventHandler {
377 372
                     new QuerySelfActionEvent(owner.getQuery(event.getTarget()), owner.getLocalUser().get(),
378 373
                             event.getMessage()));
379 374
         } else {
380
-            final ServerUnknownActionEvent coreEvent
381
-                    = new ServerUnknownActionEvent(owner, event.getHost(), event.getTarget(), event.getMessage());
382
-            final String format = EventUtils.postDisplayable(eventBus, coreEvent, "unknownAction");
383
-            owner.doNotification(format, event.getHost(), event.getTarget(), event.getMessage());
375
+            eventBus.publishAsync(new ServerUnknownActionEvent(
376
+                    owner, event.getHost(), event.getTarget(), event.getMessage()));
384 377
         }
385 378
     }
386 379
 
387 380
     @Handler
388 381
     public void onUserModeChanged(final UserModeChangeEvent event) {
389
-        final ServerUserModesEvent coreEvent = new ServerUserModesEvent(owner,
390
-                owner.getUser(event.getClient().getHostname()), event.getModes());
391
-        final String format = EventUtils.postDisplayable(eventBus, coreEvent, "userModeChanged");
392
-        owner.doNotification(format, owner.getUser(event.getClient().getHostname()), event.getModes());
382
+        eventBus.publishAsync(new ServerUserModesEvent(
383
+                owner, owner.getUser(event.getClient().getHostname()), event.getModes()));
393 384
     }
394 385
 
395 386
     @Handler
396 387
     public void onUserModeDiscovered(final UserModeDiscoveryEvent event) {
397
-        final ServerUserModesEvent coreEvent = new ServerUserModesEvent(owner,
398
-                owner.getUser(event.getClient().getHostname()), event.getModes());
399
-        final String format = EventUtils.postDisplayable(eventBus, coreEvent,
400
-                event.getModes().isEmpty() || "+".equals(event.getModes()) ? "userNoModes" : "userModeDiscovered");
401
-        owner.doNotification(format, owner.getUser(event.getClient().getHostname()), event.getModes());
388
+        eventBus.publishAsync(new ServerUserModesEvent(
389
+                owner, owner.getUser(event.getClient().getHostname()), event.getModes()));
402 390
     }
403 391
 
404 392
     @Handler
@@ -412,36 +400,27 @@ public class ServerEventHandler extends EventHandler {
412 400
 
413 401
     @Handler
414 402
     public void onWallop(final WallopEvent event) {
415
-        final ServerWallopsEvent coreEvent = new ServerWallopsEvent(owner,
416
-                owner.getUser(event.getHost()), event.getMessage());
417
-        final String format = EventUtils.postDisplayable(eventBus, coreEvent, "wallop");
418
-        owner.doNotification(format, owner.getUser(event.getHost()), event.getMessage());
419
-
403
+        eventBus.publishAsync(new ServerWallopsEvent(owner,
404
+                owner.getUser(event.getHost()), event.getMessage()));
420 405
     }
421 406
 
422 407
     @Handler
423 408
     public void onWalluser(final WalluserEvent event) {
424
-        final ServerWallusersEvent coreEvent = new ServerWallusersEvent(owner,
425
-                owner.getLocalUser().get(), event.getMessage());
426
-        final String format = EventUtils.postDisplayable(eventBus, coreEvent, "walluser");
427
-        owner.doNotification(format, owner.getUser(event.getHost()), event.getMessage());
409
+        eventBus.publishAsync(new ServerWallusersEvent(owner,
410
+                owner.getLocalUser().get(), event.getMessage()));
428 411
     }
429 412
 
430 413
     @Handler
431 414
     public void onWallDesync(final WallDesyncEvent event) {
432
-        final ServerWalldesyncEvent coreEvent = new ServerWalldesyncEvent(owner,
433
-                owner.getLocalUser().get(), event.getMessage());
434
-        final String format = EventUtils.postDisplayable(eventBus, coreEvent, "walldesync");
435
-        owner.doNotification(format, owner.getUser(event.getHost()), event.getMessage());
415
+        eventBus.publishAsync(new ServerWalldesyncEvent(owner,
416
+                owner.getLocalUser().get(), event.getMessage()));
436 417
     }
437 418
 
438 419
     @Handler
439 420
     public void onNickChanged(final NickChangeEvent event) {
440 421
         if (event.getClient().equals(owner.getParser().get().getLocalClient())) {
441
-            final ServerNickChangeEvent coreEvent = new ServerNickChangeEvent(owner,
442
-                    event.getOldNick(), event.getClient().getNickname());
443
-            final String format = EventUtils.postDisplayable(eventBus, coreEvent, "selfNickChange");
444
-            owner.doNotification(format, event.getOldNick(), event.getClient().getNickname());
422
+            eventBus.publishAsync(new ServerNickChangeEvent(owner,
423
+                    event.getOldNick(), event.getClient().getNickname()));
445 424
             owner.updateTitle();
446 425
         }
447 426
     }

+ 13
- 3
src/com/dmdirc/events/ServerConnectingEvent.java Ver fichero

@@ -24,17 +24,27 @@ package com.dmdirc.events;
24 24
 
25 25
 import com.dmdirc.interfaces.Connection;
26 26
 
27
+import java.net.URI;
28
+
27 29
 /**
28 30
  * Fire when a server is connecting.
29 31
  */
30
-public class ServerConnectingEvent extends ServerEvent {
32
+public class ServerConnectingEvent extends ServerDisplayableEvent {
33
+
34
+    private final URI uri;
31 35
 
32
-    public ServerConnectingEvent(final Connection connection) {
36
+    public ServerConnectingEvent(final Connection connection, final URI uri) {
33 37
         super(connection);
38
+        this.uri = uri;
34 39
     }
35 40
 
36
-    public ServerConnectingEvent(final long timestamp, final Connection connection) {
41
+    public ServerConnectingEvent(final long timestamp, final Connection connection, final URI uri) {
37 42
         super(timestamp, connection);
43
+        this.uri = uri;
44
+    }
45
+
46
+    public URI getUri() {
47
+        return uri;
38 48
     }
39 49
 
40 50
 }

+ 48
- 0
src/com/dmdirc/events/ServerUnknownProtocolEvent.java Ver fichero

@@ -0,0 +1,48 @@
1
+/*
2
+ * Copyright (c) 2006-2015 DMDirc Developers
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.events;
24
+
25
+import com.dmdirc.interfaces.Connection;
26
+
27
+/**
28
+ * Raised when a server attempts to connect to an unknown protocol.
29
+ */
30
+public class ServerUnknownProtocolEvent extends ServerDisplayableEvent {
31
+
32
+    private final String protocol;
33
+
34
+    public ServerUnknownProtocolEvent(final long timestamp, final Connection connection, final String protocol) {
35
+        super(timestamp, connection);
36
+        this.protocol = protocol;
37
+    }
38
+
39
+    public ServerUnknownProtocolEvent(final Connection connection, final String protocol) {
40
+        super(connection);
41
+        this.protocol = protocol;
42
+    }
43
+
44
+    public String getProtocol() {
45
+        return protocol;
46
+    }
47
+
48
+}

+ 7
- 8
src/com/dmdirc/events/ServerUserModesEvent.java Ver fichero

@@ -31,28 +31,27 @@ import com.dmdirc.interfaces.User;
31 31
 public class ServerUserModesEvent extends ServerDisplayableEvent {
32 32
 
33 33
     private final User user;
34
-    private final String message;
34
+    private final String modes;
35 35
 
36 36
     public ServerUserModesEvent(final long timestamp, final Connection connection, final User user,
37
-            final String message) {
37
+            final String modes) {
38 38
         super(timestamp, connection);
39 39
         this.user = user;
40
-        this.message = message;
40
+        this.modes = modes;
41 41
     }
42 42
 
43
-    public ServerUserModesEvent(final Connection connection, final User user, final String
44
-            message) {
43
+    public ServerUserModesEvent(final Connection connection, final User user, final String modes) {
45 44
         super(connection);
46 45
         this.user = user;
47
-        this.message = message;
46
+        this.modes = modes;
48 47
     }
49 48
 
50 49
     public User getUser() {
51 50
         return user;
52 51
     }
53 52
 
54
-    public String getMessage() {
55
-        return message;
53
+    public String getModes() {
54
+        return modes;
56 55
     }
57 56
 
58 57
 }

+ 0
- 31
src/com/dmdirc/interfaces/WindowModel.java Ver fichero

@@ -161,37 +161,6 @@ public interface WindowModel {
161 161
      */
162 162
     void addLine(String type, Object... args);
163 163
 
164
-    /**
165
-     * Adds a line to this container's window. If the window is null for some reason, the line is
166
-     * silently discarded.
167
-     *
168
-     * @param type      The message type to use
169
-     * @param timestamp The timestamp to use for this line
170
-     * @param args      The message's arguments
171
-     *
172
-     * @since 0.6.4
173
-     */
174
-    void addLine(StringBuffer type, Date timestamp, Object... args);
175
-
176
-    /**
177
-     * Adds a line to this container's window. If the window is null for some reason, the line is
178
-     * silently discarded.
179
-     *
180
-     * @param type The message type to use
181
-     * @param args The message's arguments
182
-     */
183
-    void addLine(StringBuffer type, Object... args);
184
-
185
-    /**
186
-     * Adds the specified raw line to the window, without using a formatter.
187
-     *
188
-     * @param line      The line to be added
189
-     * @param timestamp Whether or not to display the timestamp for this line
190
-     * @deprecated Timestamps are always displayed.
191
-     */
192
-    @Deprecated
193
-    void addLine(String line, boolean timestamp);
194
-
195 164
     /**
196 165
      * Adds the specified raw line to the window, without using a formatter, and using the specified
197 166
      * timestamp. If the timestamp is <code>null</code>, no timestamp is added.

Loading…
Cancelar
Guardar