Pārlūkot izejas kodu

Add a source to displayable events.

Need this to figure out where to display them, for now.
pull/249/head
Chris Smith 9 gadus atpakaļ
vecāks
revīzija
f229cba704

+ 6
- 0
src/com/dmdirc/events/ChannelDisplayableEvent.java Parādīt failu

@@ -23,6 +23,7 @@
23 23
 package com.dmdirc.events;
24 24
 
25 25
 import com.dmdirc.Channel;
26
+import com.dmdirc.FrameContainer;
26 27
 
27 28
 import java.util.Optional;
28 29
 import java.util.concurrent.atomic.AtomicReference;
@@ -70,4 +71,9 @@ public abstract class ChannelDisplayableEvent extends ChannelEvent implements Di
70 71
         return properties;
71 72
     }
72 73
 
74
+    @Override
75
+    public FrameContainer getSource() {
76
+        return getChannel();
77
+    }
78
+
73 79
 }

+ 8
- 0
src/com/dmdirc/events/DisplayableEvent.java Parādīt failu

@@ -22,6 +22,8 @@
22 22
 
23 23
 package com.dmdirc.events;
24 24
 
25
+import com.dmdirc.FrameContainer;
26
+
25 27
 import java.util.Optional;
26 28
 
27 29
 /**
@@ -74,4 +76,10 @@ public interface DisplayableEvent {
74 76
      * @return The timestamp the event occurred at.
75 77
      */
76 78
     long getTimestamp();
79
+
80
+    /**
81
+     * Gets the source of the displayable event.
82
+     */
83
+    FrameContainer getSource();
84
+
77 85
 }

+ 7
- 0
src/com/dmdirc/events/QueryDisplayableEvent.java Parādīt failu

@@ -22,6 +22,7 @@
22 22
 
23 23
 package com.dmdirc.events;
24 24
 
25
+import com.dmdirc.FrameContainer;
25 26
 import com.dmdirc.Query;
26 27
 
27 28
 import java.util.Optional;
@@ -70,4 +71,10 @@ public abstract class QueryDisplayableEvent extends QueryEvent implements
70 71
     public DisplayPropertyMap getDisplayProperties() {
71 72
         return properties;
72 73
     }
74
+
75
+    @Override
76
+    public FrameContainer getSource() {
77
+        return getQuery();
78
+    }
79
+
73 80
 }

+ 6
- 0
src/com/dmdirc/events/ServerDisplayableEvent.java Parādīt failu

@@ -22,6 +22,7 @@
22 22
 
23 23
 package com.dmdirc.events;
24 24
 
25
+import com.dmdirc.FrameContainer;
25 26
 import com.dmdirc.interfaces.Connection;
26 27
 
27 28
 import java.util.Optional;
@@ -71,4 +72,9 @@ public abstract class ServerDisplayableEvent extends ServerEvent implements Disp
71 72
         return properties;
72 73
     }
73 74
 
75
+    @Override
76
+    public FrameContainer getSource() {
77
+        return getConnection().getWindowModel();
78
+    }
79
+
74 80
 }

+ 7
- 7
src/com/dmdirc/events/ServerUnknownactionEvent.java Parādīt failu

@@ -29,28 +29,28 @@ import com.dmdirc.interfaces.Connection;
29 29
  */
30 30
 public class ServerUnknownactionEvent extends ServerDisplayableEvent {
31 31
 
32
-    private final String source;
32
+    private final String sender;
33 33
     private final String target;
34 34
     private final String message;
35 35
 
36 36
     public ServerUnknownactionEvent(final long timestamp, final Connection connection,
37
-            final String source, final String target, final String message) {
37
+            final String sender, final String target, final String message) {
38 38
         super(timestamp, connection);
39
-        this.source = source;
39
+        this.sender = sender;
40 40
         this.target = target;
41 41
         this.message = message;
42 42
     }
43 43
 
44
-    public ServerUnknownactionEvent(final Connection connection, final String source,
44
+    public ServerUnknownactionEvent(final Connection connection, final String sender,
45 45
             final String target, final String message) {
46 46
         super(connection);
47
-        this.source = source;
47
+        this.sender = sender;
48 48
         this.target = target;
49 49
         this.message = message;
50 50
     }
51 51
 
52
-    public String getSource() {
53
-        return source;
52
+    public String getSender() {
53
+        return sender;
54 54
     }
55 55
 
56 56
     public String getTarget() {

+ 7
- 7
src/com/dmdirc/events/ServerUnknownmessageEvent.java Parādīt failu

@@ -29,28 +29,28 @@ import com.dmdirc.interfaces.Connection;
29 29
  */
30 30
 public class ServerUnknownmessageEvent extends ServerDisplayableEvent {
31 31
 
32
-    private final String source;
32
+    private final String sender;
33 33
     private final String target;
34 34
     private final String message;
35 35
 
36 36
     public ServerUnknownmessageEvent(final long timestamp, final Connection connection,
37
-            final String source, final String target, final String message) {
37
+            final String sender, final String target, final String message) {
38 38
         super(timestamp, connection);
39
-        this.source = source;
39
+        this.sender = sender;
40 40
         this.target = target;
41 41
         this.message = message;
42 42
     }
43 43
 
44
-    public ServerUnknownmessageEvent(final Connection connection, final String source,
44
+    public ServerUnknownmessageEvent(final Connection connection, final String sender,
45 45
             final String target, final String message) {
46 46
         super(connection);
47
-        this.source = source;
47
+        this.sender = sender;
48 48
         this.target = target;
49 49
         this.message = message;
50 50
     }
51 51
 
52
-    public String getSource() {
53
-        return source;
52
+    public String getSender() {
53
+        return sender;
54 54
     }
55 55
 
56 56
     public String getTarget() {

+ 7
- 7
src/com/dmdirc/events/ServerUnknownnoticeEvent.java Parādīt failu

@@ -29,28 +29,28 @@ import com.dmdirc.interfaces.Connection;
29 29
  */
30 30
 public class ServerUnknownnoticeEvent extends ServerDisplayableEvent {
31 31
 
32
-    private final String source;
32
+    private final String sender;
33 33
     private final String target;
34 34
     private final String message;
35 35
 
36 36
     public ServerUnknownnoticeEvent(final long timestamp, final Connection connection,
37
-            final String source, final String target, final String message) {
37
+            final String sender, final String target, final String message) {
38 38
         super(timestamp, connection);
39
-        this.source = source;
39
+        this.sender = sender;
40 40
         this.target = target;
41 41
         this.message = message;
42 42
     }
43 43
 
44
-    public ServerUnknownnoticeEvent(final Connection connection, final String source,
44
+    public ServerUnknownnoticeEvent(final Connection connection, final String sender,
45 45
             final String target, final String message) {
46 46
         super(connection);
47
-        this.source = source;
47
+        this.sender = sender;
48 48
         this.target = target;
49 49
         this.message = message;
50 50
     }
51 51
 
52
-    public String getSource() {
53
-        return source;
52
+    public String getSender() {
53
+        return sender;
54 54
     }
55 55
 
56 56
     public String getTarget() {

Notiek ielāde…
Atcelt
Saglabāt