Selaa lähdekoodia

Add base query text event class.

Change-Id: Ib39c4b2a6b6f6d9a225cf1630083c267ace0cc48
Reviewed-on: http://gerrit.dmdirc.com/3464
Reviewed-by: Chris Smith <chris@dmdirc.com>
Automatic-Compile: DMDirc Build Manager
pull/1/head
Greg Holmes 10 vuotta sitten
vanhempi
commit
2b1afbd1e2

+ 42
- 0
src/com/dmdirc/events/BaseQueryActionEvent.java Näytä tiedosto

@@ -0,0 +1,42 @@
1
+/*
2
+ * Copyright (c) 2006-2014 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.Query;
26
+import com.dmdirc.parser.interfaces.ClientInfo;
27
+
28
+/**
29
+ * Base class for query action events.
30
+ */
31
+public abstract class BaseQueryActionEvent extends BaseQueryTextEvent {
32
+
33
+    public BaseQueryActionEvent(final long timestamp, final Query query, final ClientInfo client,
34
+            final String message) {
35
+        super(timestamp, query, client, message);
36
+    }
37
+
38
+    public BaseQueryActionEvent(final Query query, final ClientInfo client, final String message) {
39
+        super(query, client, message);
40
+    }
41
+
42
+}

+ 42
- 0
src/com/dmdirc/events/BaseQueryMessageEvent.java Näytä tiedosto

@@ -0,0 +1,42 @@
1
+/*
2
+ * Copyright (c) 2006-2014 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.Query;
26
+import com.dmdirc.parser.interfaces.ClientInfo;
27
+
28
+/**
29
+ * Base class for query message events.
30
+ */
31
+public abstract class BaseQueryMessageEvent extends BaseQueryTextEvent {
32
+
33
+    public BaseQueryMessageEvent(final long timestamp, final Query query, final ClientInfo client,
34
+            final String message) {
35
+        super(timestamp, query, client, message);
36
+    }
37
+
38
+    public BaseQueryMessageEvent(final Query query, final ClientInfo client, final String message) {
39
+        super(query, client, message);
40
+    }
41
+
42
+}

+ 57
- 0
src/com/dmdirc/events/BaseQueryTextEvent.java Näytä tiedosto

@@ -0,0 +1,57 @@
1
+/*
2
+ * Copyright (c) 2006-2014 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.Query;
26
+import com.dmdirc.parser.interfaces.ClientInfo;
27
+
28
+/**
29
+ * Base class for query message and action events.
30
+ */
31
+public abstract class BaseQueryTextEvent extends QueryDisplayableEvent {
32
+
33
+    private final ClientInfo client;
34
+    private final String message;
35
+
36
+    public BaseQueryTextEvent(final long timestamp, final Query query, final ClientInfo client,
37
+            final String message) {
38
+        super(timestamp, query);
39
+        this.client = client;
40
+        this.message = message;
41
+    }
42
+
43
+    public BaseQueryTextEvent(final Query query, final ClientInfo client, final String message) {
44
+        super(query);
45
+        this.client = client;
46
+        this.message = message;
47
+    }
48
+
49
+    public ClientInfo getClient() {
50
+        return client;
51
+    }
52
+
53
+    public String getMessage() {
54
+        return message;
55
+    }
56
+
57
+}

+ 3
- 18
src/com/dmdirc/events/QueryActionEvent.java Näytä tiedosto

@@ -28,30 +28,15 @@ import com.dmdirc.parser.interfaces.ClientInfo;
28 28
 /**
29 29
  * Fired when an action occurs in a query.
30 30
  */
31
-public class QueryActionEvent extends QueryDisplayableEvent {
32
-
33
-    private final ClientInfo client;
34
-    private final String message;
31
+public class QueryActionEvent extends BaseQueryActionEvent {
35 32
 
36 33
     public QueryActionEvent(final long timestamp, final Query query, final ClientInfo client,
37 34
             final String message) {
38
-        super(timestamp, query);
39
-        this.client = client;
40
-        this.message = message;
35
+        super(timestamp, query, client, message);
41 36
     }
42 37
 
43 38
     public QueryActionEvent(final Query query, final ClientInfo client, final String message) {
44
-        super(query);
45
-        this.client = client;
46
-        this.message = message;
47
-    }
48
-
49
-    public ClientInfo getClient() {
50
-        return client;
51
-    }
52
-
53
-    public String getMessage() {
54
-        return message;
39
+        super(query, client, message);
55 40
     }
56 41
 
57 42
 }

+ 3
- 18
src/com/dmdirc/events/QueryMessageEvent.java Näytä tiedosto

@@ -28,30 +28,15 @@ import com.dmdirc.parser.interfaces.ClientInfo;
28 28
 /**
29 29
  * Fired when a message occurs in a query.
30 30
  */
31
-public class QueryMessageEvent extends QueryDisplayableEvent {
32
-
33
-    private final ClientInfo client;
34
-    private final String message;
31
+public class QueryMessageEvent extends BaseQueryMessageEvent {
35 32
 
36 33
     public QueryMessageEvent(final long timestamp, final Query query, final ClientInfo client,
37 34
             final String message) {
38
-        super(timestamp, query);
39
-        this.client = client;
40
-        this.message = message;
35
+        super(timestamp, query, client, message);
41 36
     }
42 37
 
43 38
     public QueryMessageEvent(final Query query, final ClientInfo client, final String message) {
44
-        super(query);
45
-        this.client = client;
46
-        this.message = message;
47
-    }
48
-
49
-    public ClientInfo getClient() {
50
-        return client;
51
-    }
52
-
53
-    public String getMessage() {
54
-        return message;
39
+        super(query, client, message);
55 40
     }
56 41
 
57 42
 }

+ 3
- 18
src/com/dmdirc/events/QuerySelfActionEvent.java Näytä tiedosto

@@ -28,30 +28,15 @@ import com.dmdirc.parser.interfaces.ClientInfo;
28 28
 /**
29 29
  * Fired when a self action is sent in query.
30 30
  */
31
-public class QuerySelfActionEvent extends QueryDisplayableEvent {
32
-
33
-    private final ClientInfo client;
34
-    private final String message;
31
+public class QuerySelfActionEvent extends BaseQueryActionEvent {
35 32
 
36 33
     public QuerySelfActionEvent(final long timestamp, final Query query, final ClientInfo client,
37 34
             final String message) {
38
-        super(timestamp, query);
39
-        this.client = client;
40
-        this.message = message;
35
+        super(timestamp, query, client, message);
41 36
     }
42 37
 
43 38
     public QuerySelfActionEvent(final Query query, final ClientInfo client, final String message) {
44
-        super(query);
45
-        this.client = client;
46
-        this.message = message;
47
-    }
48
-
49
-    public ClientInfo getClient() {
50
-        return client;
51
-    }
52
-
53
-    public String getMessage() {
54
-        return message;
39
+        super(query, client, message);
55 40
     }
56 41
 
57 42
 }

+ 3
- 19
src/com/dmdirc/events/QuerySelfMessageEvent.java Näytä tiedosto

@@ -28,30 +28,14 @@ import com.dmdirc.parser.interfaces.ClientInfo;
28 28
 /**
29 29
  * Fired when a self message happens in a query.
30 30
  */
31
-public class QuerySelfMessageEvent extends QueryDisplayableEvent {
32
-
33
-    private final ClientInfo client;
34
-    private final String message;
31
+public class QuerySelfMessageEvent extends BaseQueryMessageEvent {
35 32
 
36 33
     public QuerySelfMessageEvent(final long timestamp, final Query query, final ClientInfo client,
37 34
             final String message) {
38
-        super(timestamp, query);
39
-        this.client = client;
40
-        this.message = message;
35
+        super(timestamp, query, client, message);
41 36
     }
42 37
 
43 38
     public QuerySelfMessageEvent(final Query query, final ClientInfo client, final String message) {
44
-        super(query);
45
-        this.client = client;
46
-        this.message = message;
47
-    }
48
-
49
-    public ClientInfo getClient() {
50
-        return client;
39
+        super(query, client, message);
51 40
     }
52
-
53
-    public String getMessage() {
54
-        return message;
55
-    }
56
-
57 41
 }

Loading…
Peruuta
Tallenna