Parcourir la source

Add events for link clicking.

Change-Id: I7fc1dbbccda16b4c4e51f828f9192bab6a1867ff
Reviewed-on: http://gerrit.dmdirc.com/3277
Reviewed-by: Greg Holmes <greg@dmdirc.com>
Automatic-Compile: DMDirc Build Manager
pull/1/head
Chris Smith il y a 10 ans
Parent
révision
34bd31d728

+ 3
- 0
src/com/dmdirc/actions/CoreActionType.java Voir le fichier

@@ -225,10 +225,13 @@ public enum CoreActionType implements ActionType {
225 225
     /** Action deleted. */
226 226
     ACTION_DELETED(ActionEvents.ACTION_DELETED, "Action deleted"),
227 227
     /** Channel clicked. */
228
+    @Deprecated
228 229
     LINK_CHANNEL_CLICKED(LinkEvents.CHANNEL_CLICKED, "A channel link was clicked"),
229 230
     /** Channel clicked. */
231
+    @Deprecated
230 232
     LINK_NICKNAME_CLICKED(LinkEvents.NICKNAME_CLICKED, "A nickname link was clicked"),
231 233
     /** Link clicked. */
234
+    @Deprecated
232 235
     LINK_URL_CLICKED(LinkEvents.LINK_CLICKED, "A Link was clicked");
233 236
     /** The type of this action. */
234 237
     private final ActionMetaType type;

+ 36
- 0
src/com/dmdirc/events/LinkChannelClickedEvent.java Voir le fichier

@@ -0,0 +1,36 @@
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.interfaces.ui.Window;
26
+
27
+/**
28
+ * Raised when a channel link has been clicked.
29
+ */
30
+public class LinkChannelClickedEvent extends LinkEvent {
31
+
32
+    public LinkChannelClickedEvent(final Window window, final String target) {
33
+        super(window, target);
34
+    }
35
+
36
+}

+ 48
- 0
src/com/dmdirc/events/LinkEvent.java Voir le fichier

@@ -0,0 +1,48 @@
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.interfaces.ui.Window;
26
+
27
+/**
28
+ * Common properties of link events.
29
+ */
30
+public abstract class LinkEvent extends DMDircEvent {
31
+
32
+    private final Window window;
33
+    private final String target;
34
+
35
+    public LinkEvent(final Window window, final String target) {
36
+        this.window = window;
37
+        this.target = target;
38
+    }
39
+
40
+    public Window getWindow() {
41
+        return window;
42
+    }
43
+
44
+    public String getTarget() {
45
+        return target;
46
+    }
47
+
48
+}

+ 36
- 0
src/com/dmdirc/events/LinkNicknameClickedEvent.java Voir le fichier

@@ -0,0 +1,36 @@
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.interfaces.ui.Window;
26
+
27
+/**
28
+ * Raised when a nickname link has been clicked.
29
+ */
30
+public class LinkNicknameClickedEvent extends LinkEvent {
31
+
32
+    public LinkNicknameClickedEvent(final Window window, final String target) {
33
+        super(window, target);
34
+    }
35
+
36
+}

+ 36
- 0
src/com/dmdirc/events/LinkUrlClickedEvent.java Voir le fichier

@@ -0,0 +1,36 @@
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.interfaces.ui.Window;
26
+
27
+/**
28
+ * Raised when a URL link has been clicked.
29
+ */
30
+public class LinkUrlClickedEvent extends LinkEvent {
31
+
32
+    public LinkUrlClickedEvent(final Window window, final String target) {
33
+        super(window, target);
34
+    }
35
+
36
+}

Chargement…
Annuler
Enregistrer