Procházet zdrojové kódy

Deprecation/mass deletion

Depends-On: I65a4cbe48f772dc7e400d585b1bfab15521fdd12
Change-Id: Ib499b44b594fa6dd85ac65fba5b95f16beb23c48
Reviewed-on: http://gerrit.dmdirc.com/1872
Automatic-Compile: DMDirc Local Commits <dmdirc@googlemail.com>
Reviewed-by: Shane Mc Cormack <shane@dmdirc.com>
tags/0.6.6b1
Chris Smith před 13 roky
rodič
revize
cc979023da

+ 0
- 11
src/com/dmdirc/FrameContainer.java Zobrazit soubor

@@ -120,17 +120,6 @@ public abstract class FrameContainer<T extends Window> {
120 120
         setIcon(icon);
121 121
     }
122 122
 
123
-    /**
124
-     * Returns the internal frame associated with this object.
125
-     *
126
-     * @return The internal frame associated with this object
127
-     * @deprecated Use {@link #getWindows()} instead
128
-     */
129
-    @Deprecated
130
-    public final T getFrame() {
131
-        return getWindows().isEmpty() ? null : getWindows().iterator().next();
132
-    }
133
-
134 123
     /**
135 124
      * Returns a collection of direct children of this frame.
136 125
      *

+ 1
- 11
src/com/dmdirc/Main.java Zobrazit soubor

@@ -299,17 +299,7 @@ public final class Main {
299 299
 
300 300
                 final Object export = provider.getExportedService("getController").execute();
301 301
 
302
-                if (export == null) {
303
-                    if (provider instanceof PluginInfo
304
-                            && ((PluginInfo) provider).getPlugin() instanceof UIController) {
305
-                        // @Deprecated - remove post 0.6.4
306
-                        // Hack for compatibility with older plugins
307
-                        CONTROLLERS.add((UIController) ((PluginInfo) provider).getPlugin());
308
-                        Logger.appError(ErrorLevel.LOW,
309
-                                "UI plugin doesn't export getController: "
310
-                                + provider.getProviderName(), new UnsupportedOperationException());
311
-                    }
312
-                } else {
302
+                if (export != null) {
313 303
                     CONTROLLERS.add((UIController) export);
314 304
                 }
315 305
             }

+ 11
- 9
src/com/dmdirc/actions/ActionModel.java Zobrazit soubor

@@ -34,6 +34,7 @@ import com.dmdirc.ui.interfaces.Window;
34 34
 
35 35
 import java.util.ArrayList;
36 36
 import java.util.Arrays;
37
+import java.util.Collection;
37 38
 import java.util.List;
38 39
 
39 40
 /**
@@ -133,32 +134,33 @@ public class ActionModel {
133 134
 
134 135
         final FrameContainer<?> active = WindowManager.getActiveWindow();
135 136
         Window window = null;
136
-        WritableFrameContainer<?> cw = null;
137
+        WritableFrameContainer<? extends Window> container = null;
137 138
         CommandParser cp = null;
138 139
 
139 140
         if (arguments.length > 0
140 141
                 && arguments[0] instanceof WritableFrameContainer<?>) {
141
-            cw = (WritableFrameContainer<?>) arguments[0];
142
+            container = (WritableFrameContainer<?>) arguments[0];
142 143
         } else if (active instanceof WritableFrameContainer<?>) {
143
-            cw = (WritableFrameContainer<?>) active;
144
+            container = (WritableFrameContainer<?>) active;
144 145
         } else if (ServerManager.getServerManager().numServers() > 0) {
145
-            cw = ServerManager.getServerManager().getServers().get(0);
146
+            container = ServerManager.getServerManager().getServers().get(0);
146 147
         }
147 148
 
148 149
         if (arguments.length > 0 && arguments[0] instanceof Window) {
149 150
             window = (Window) arguments[0];
150
-        } else if (cw != null) {
151
-            window = cw.getFrame();
151
+        } else if (container != null) {
152
+            final Collection<? extends Window> windows = container.getWindows();
153
+            window = windows.isEmpty() ? null : windows.iterator().next();
152 154
         }
153 155
 
154
-        if (cw == null) {
156
+        if (container == null) {
155 157
             cp = GlobalCommandParser.getGlobalCommandParser();
156 158
         } else {
157
-            cp = cw.getCommandParser();
159
+            cp = container.getCommandParser();
158 160
         }
159 161
 
160 162
         for (String command : response) {
161
-            cp.parseCommand(cw, window, sub.doSubstitution(command, arguments));
163
+            cp.parseCommand(container, window, sub.doSubstitution(command, arguments));
162 164
         }
163 165
 
164 166
         if (newFormat != null && format != null) {

+ 0
- 152
src/com/dmdirc/actions/wrappers/PerformWrapper.java Zobrazit soubor

@@ -22,7 +22,6 @@
22 22
 
23 23
 package com.dmdirc.actions.wrappers;
24 24
 
25
-import com.dmdirc.Precondition;
26 25
 import com.dmdirc.Server;
27 26
 import com.dmdirc.actions.Action;
28 27
 import com.dmdirc.actions.ActionComponentChain;
@@ -41,8 +40,6 @@ import java.util.List;
41 40
 
42 41
 /**
43 42
  * An action wrapper for performs.
44
- *
45
- * @author Chris
46 43
  */
47 44
 public class PerformWrapper extends ActionGroup {
48 45
 
@@ -315,155 +312,6 @@ public class PerformWrapper extends ActionGroup {
315 312
         return target || profile;
316 313
     }
317 314
 
318
-    /**
319
-     * Determines if the specified action is a per-profile perform, as opposed
320
-     * to a generic perform.
321
-     *
322
-     * @param action The action to be tested
323
-     * @return True if the action is per-profile, false otherwise
324
-     * @since 0.6.3
325
-     * @deprecated Actions shouldn't be used directly
326
-     */
327
-    @Deprecated
328
-    public boolean isPerProfilePerform(final Action action) {
329
-        return contains(action) && action.getConditions().size() == 2;
330
-    }
331
-
332
-    /**
333
-     * Retrieves the name of the profile that is targetted by the specified
334
-     * per-profile perform action.
335
-     *
336
-     * @param action The action whose perform should be retrieved
337
-     * @return The action's targetted profile name
338
-     * @since 0.6.3
339
-     * @deprecated Actions shouldn't be used directly
340
-     */
341
-    @Deprecated
342
-    @Precondition("The action is a per-profile perform")
343
-    public String getProfileName(final Action action) {
344
-        Logger.assertTrue(isPerProfilePerform(action));
345
-
346
-        for (ActionCondition condition : action.getConditions()) {
347
-            if (PP_COMP_NAME.equals(condition.getComponent().toString())) {
348
-                return condition.getTarget();
349
-            }
350
-        }
351
-
352
-        throw new IllegalStateException("Profile component not found in action");
353
-    }
354
-
355
-    /**
356
-     * Retrieve the action that handles the perform for the specified server,
357
-     * or null if no such action exists.
358
-     *
359
-     * @param server The server to look for
360
-     * @return The action that handles the server's perform, or null
361
-     * @deprecated Actions shouldn't be used directly, use get/setPerform instead
362
-     */
363
-    @Deprecated
364
-    public Action getActionForServer(final String server) {
365
-        return getActionForServer(server, null);
366
-    }
367
-
368
-    /**
369
-     * Retrieve the action that handles the perform for the specified server,
370
-     * or null if no such action exists.
371
-     *
372
-     * @param server The server to look for
373
-     * @param profile The name of the profile the perform works for
374
-     * @return The action that handles the servers's perform for the specified
375
-     * profile, or null
376
-     * @since 0.6.3
377
-     * @deprecated Actions shouldn't be used directly, use get/setPerform instead
378
-     */
379
-    @Deprecated
380
-    public Action getActionForServer(final String server, final String profile) {
381
-        return getAction(CoreActionComponent.SERVER_NAME, server, profile);
382
-    }
383
-
384
-    /**
385
-     * Retrieve the action that handles the perform for the specified network,
386
-     * or null if no such action exists.
387
-     *
388
-     * @param network The network to look for
389
-     * @return The action that handles the network's perform, or null
390
-     * @deprecated Actions shouldn't be used directly, use get/setPerform instead
391
-     */
392
-    @Deprecated
393
-    public Action getActionForNetwork(final String network) {
394
-        return getActionForNetwork(network, null);
395
-    }
396
-
397
-    /**
398
-     * Retrieve the action that handles the perform for the specified network,
399
-     * or null if no such action exists.
400
-     *
401
-     * @param network The network to look for
402
-     * @param profile The name of the profile the perform works for
403
-     * @return The action that handles the network's perform for the specified
404
-     * profile, or null
405
-     * @since 0.6.3
406
-     * @deprecated Actions shouldn't be used directly, use get/setPerform instead
407
-     */
408
-    @Deprecated
409
-    public Action getActionForNetwork(final String network, final String profile) {
410
-        return getAction(CoreActionComponent.SERVER_NETWORK, network, profile);
411
-    }
412
-
413
-    /**
414
-     * Creates a new, empty, perform wrapper for the specified server.
415
-     *
416
-     * @param server The server to create the action for
417
-     * @return The new perform wrapper action
418
-     * @deprecated Actions shouldn't be used directly, use get/setPerform instead
419
-     */
420
-    @Deprecated
421
-    public Action createActionForServer(final String server) {
422
-        return createActionForServer(server, null);
423
-    }
424
-
425
-    /**
426
-     * Creates a new, empty, perform wrapper for the specified server, which
427
-     * is only applicable when the specified profile is in use.
428
-     *
429
-     * @param server The server to create the action for
430
-     * @param profile The name of the profile which must be in use
431
-     * @return The new perform wrapper action
432
-     * @since 0.6.3
433
-     * @deprecated Actions shouldn't be used directly, use get/setPerform instead
434
-     */
435
-    @Deprecated
436
-    public Action createActionForServer(final String server, final String profile) {
437
-        return createAction(server, "", profile);
438
-    }
439
-
440
-    /**
441
-     * Creates a new, empty, perform wrapper for the specified network.
442
-     *
443
-     * @param network The network to create the action for
444
-     * @return The new perform wrapper action
445
-     * @deprecated Actions shouldn't be used directly, use get/setPerform instead
446
-     */
447
-    @Deprecated
448
-    public Action createActionForNetwork(final String network) {
449
-        return createActionForNetwork(network, null);
450
-    }
451
-
452
-    /**
453
-     * Creates a new, empty, perform wrapper for the specified network, which
454
-     * is only applicable when the specified profile is in use.
455
-     *
456
-     * @param network The network to create the action for
457
-     * @param profile The name of the profile which must be in use
458
-     * @return The new perform wrapper action
459
-     * @since 0.6.3
460
-     * @deprecated Actions shouldn't be used directly, use get/setPerform instead
461
-     */
462
-    @Deprecated
463
-    public Action createActionForNetwork(final String network, final String profile) {
464
-        return createAction("", network, profile);
465
-    }
466
-
467 315
     /**
468 316
      * Creates a new, empty, perform wrapper for the specified server or
469 317
      * network. Note that both server and network must be specified, and

+ 2
- 27
src/com/dmdirc/config/CipherUtils.java Zobrazit soubor

@@ -22,7 +22,6 @@
22 22
 
23 23
 package com.dmdirc.config;
24 24
 
25
-import com.dmdirc.Main;
26 25
 import com.dmdirc.logger.ErrorLevel;
27 26
 import com.dmdirc.logger.Logger;
28 27
 
@@ -51,7 +50,7 @@ import net.miginfocom.Base64;
51 50
 /**
52 51
  * Helper class to encrypt and decrypt strings, requests passwords if needed.
53 52
  */
54
-public class CipherUtils {
53
+public abstract class CipherUtils {
55 54
 
56 55
     /** Singleton instance. */
57 56
     private static CipherUtils me;
@@ -77,28 +76,6 @@ public class CipherUtils {
77 76
     /** User password. */
78 77
     private String password;
79 78
 
80
-    /**
81
-     * Prevents creation of a new instance of Encipher.
82
-     */
83
-    protected CipherUtils() {
84
-        // Do nothing
85
-    }
86
-
87
-    /**
88
-     * Retrieves a singleton instance of CipherUtils.
89
-     *
90
-     * @return A singleton cipher utils instance.
91
-     */
92
-    public static CipherUtils getCipherUtils() {
93
-        synchronized(CipherUtils.class) {
94
-            if (me == null) {
95
-                me = new CipherUtils();
96
-            }
97
-
98
-            return me;
99
-        }
100
-    }
101
-
102 79
     /**
103 80
      * Encrypts a string using the stored settings. Will return null if the
104 81
      * automatic user authentication fails - use checkauth and auth.
@@ -259,7 +236,5 @@ public class CipherUtils {
259 236
      * @param prompt The prompt to show
260 237
      * @return The user-specified password
261 238
      */
262
-    protected String getPassword(final String prompt) {
263
-        return Main.getUI().getUserInput(prompt);
264
-    }
239
+    protected abstract String getPassword(final String prompt);
265 240
 }

+ 0
- 60
src/com/dmdirc/ui/interfaces/ChannelWindow.java Zobrazit soubor

@@ -22,69 +22,9 @@
22 22
 
23 23
 package com.dmdirc.ui.interfaces;
24 24
 
25
-import com.dmdirc.Channel;
26
-import com.dmdirc.interfaces.NicklistListener;
27
-import com.dmdirc.parser.interfaces.ChannelClientInfo;
28
-
29
-import java.util.Collection;
30
-
31 25
 /**
32 26
  * Specifies the standard interface for a channel window.
33
- * 
34
- * @author Chris
35 27
  */
36 28
 public interface ChannelWindow extends InputWindow {
37
-    
38
-    /**
39
-     * Updates the channel's name list to the specified list of clients.
40
-     * 
41
-     * @param clients The new list of clients for this channel
42
-     * @deprecated Use a {@link NicklistListener}
43
-     */
44
-    @Deprecated
45
-    void updateNames(Collection<ChannelClientInfo> clients);
46
-    
47
-    /**
48
-     * Adds the specified client to this channel's name list.
49
-     * 
50
-     * @param client The new client to be added
51
-     * @deprecated Use a {@link NicklistListener}
52
-     */
53
-    @Deprecated
54
-    void addName(ChannelClientInfo client);
55
-    
56
-    /**
57
-     * Removes the specified client from this channel's name list.
58
-     * 
59
-     * @param client The client to be removed
60
-     * @deprecated Use a {@link NicklistListener}
61
-     */
62
-    @Deprecated
63
-    void removeName(ChannelClientInfo client);
64
-    
65
-    /**
66
-     * Requests that the channel window updates the displayed list of channel
67
-     * clients, to take into account mode or nickname changes.
68
-     * @deprecated Use a {@link NicklistListener}
69
-     */
70
-    @Deprecated
71
-    void updateNames();
72
-    
73
-    /**
74
-     * Returns the channel associated with this window.
75
-     * 
76
-     * @return Associated Channel
77
-     * @deprecated Use {@link #getContainer()}
78
-     */
79
-    @Deprecated
80
-    Channel getChannel();
81
-    
82
-    /**
83
-     * Redraws the nicklist belonging to this channel.
84
-     *
85
-     * @deprecated Use a {@link NicklistListener}
86
-     */
87
-    @Deprecated
88
-    void redrawNicklist();
89 29
 
90 30
 }

+ 0
- 2
src/com/dmdirc/ui/interfaces/FrameListener.java Zobrazit soubor

@@ -27,8 +27,6 @@ import com.dmdirc.FrameContainer;
27 27
 /**
28 28
  * FrameListeners are registered with the {@link com.dmdirc.ui.WindowManager}
29 29
  * to receive events pertaining to frames.
30
- *
31
- * @author chris
32 30
  */
33 31
 public interface FrameListener {
34 32
 

+ 0
- 2
src/com/dmdirc/ui/interfaces/InputValidationListener.java Zobrazit soubor

@@ -24,8 +24,6 @@ package com.dmdirc.ui.interfaces;
24 24
 
25 25
 /**
26 26
  * Defines methods that need to be implemented by validation listeners.
27
- * 
28
- * @author chris
29 27
  */
30 28
 public interface InputValidationListener {
31 29
     

+ 0
- 2
src/com/dmdirc/ui/interfaces/InputWindow.java Zobrazit soubor

@@ -28,8 +28,6 @@ import com.dmdirc.ui.input.InputHandler;
28 28
 /**
29 29
  * The Input Window interface specifies additional methods that windows should
30 30
  * implement if they have an input field.
31
- *
32
- * @author chris
33 31
  */
34 32
 public interface InputWindow extends Window {
35 33
 

+ 0
- 66
src/com/dmdirc/ui/interfaces/MainWindow.java Zobrazit soubor

@@ -1,66 +0,0 @@
1
-/*
2
- * Copyright (c) 2006-2011 Chris Smith, Shane Mc Cormack, Gregory Holmes
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.ui.interfaces;
24
-
25
-import javax.swing.ImageIcon;
26
-
27
-/**
28
- * Main window interface.
29
- */
30
-public interface MainWindow {
31
-
32
-    /**
33
-     * Retrieves the application icon.
34
-     *
35
-     * @return The application icon
36
-     */
37
-    ImageIcon getIcon();
38
-
39
-    /**
40
-     * Quits the client.
41
-     */
42
-    void quit();
43
-
44
-    /**
45
-     * Returns a prefix for use in the titlebar. Includes the version number
46
-     * if the config option is set.
47
-     *
48
-     * @return Titlebar prefix
49
-     */
50
-    String getTitlePrefix();
51
-
52
-    /**
53
-     * Shows or hides the main window.
54
-     *
55
-     * @param visible The new visibility of the main window
56
-     */
57
-    void setVisible(final boolean visible);
58
-
59
-    /**
60
-     * Returns whether the window is visible.
61
-     *
62
-     * @return Whether the main window is visible
63
-     */
64
-    boolean isVisible();
65
-
66
-}

+ 0
- 2
src/com/dmdirc/ui/interfaces/QueryWindow.java Zobrazit soubor

@@ -24,8 +24,6 @@ package com.dmdirc.ui.interfaces;
24 24
 
25 25
 /**
26 26
  * Defines the standard interface for a query window.
27
- *
28
- * @author Chris
29 27
  */
30 28
 public interface QueryWindow extends InputWindow {
31 29
 

+ 0
- 2
src/com/dmdirc/ui/interfaces/ServerWindow.java Zobrazit soubor

@@ -24,8 +24,6 @@ package com.dmdirc.ui.interfaces;
24 24
 
25 25
 /**
26 26
  * Lists the standard methods that should be implemented by any server window.
27
- * 
28
- * @author chris
29 27
  */
30 28
 public interface ServerWindow extends InputWindow {
31 29
     

+ 0
- 33
src/com/dmdirc/ui/interfaces/StatusErrorNotifier.java Zobrazit soubor

@@ -1,33 +0,0 @@
1
-/*
2
- * Copyright (c) 2006-2011 Chris Smith, Shane Mc Cormack, Gregory Holmes
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.ui.interfaces;
24
-
25
-/**
26
- * Methods required to be implemented by classes wanting to respond to statusbar
27
- * error events.
28
- */
29
-public interface StatusErrorNotifier {
30
-    
31
-    /** Called when a click event is received on the error component. */
32
-    void clickReceived();
33
-}

+ 0
- 34
src/com/dmdirc/ui/interfaces/UIController.java Zobrazit soubor

@@ -26,35 +26,15 @@ import com.dmdirc.Channel;
26 26
 import com.dmdirc.Server;
27 27
 import com.dmdirc.config.prefs.PreferencesInterface;
28 28
 import com.dmdirc.ui.core.dialogs.sslcertificate.SSLCertificateDialogModel;
29
-import com.dmdirc.updater.Update;
30 29
 
31 30
 import java.net.URI;
32
-import java.util.List;
33 31
 
34 32
 /**
35 33
  * Defines the methods that should be implemented by UI controllers. Controllers
36 34
  * handle the various aspects of a UI implementation.
37
- *
38
- * @author Chris
39 35
  */
40 36
 public interface UIController {
41 37
 
42
-    /**
43
-     * Retrieves the main window used by this UI.
44
-     *
45
-     * @return This UI's main window
46
-     */
47
-    MainWindow getMainWindow();
48
-
49
-    /**
50
-     * Returns an updater dialog for the specified updates.
51
-     *
52
-     * @param updates Updates available
53
-     *
54
-     * @return UpdaterDialog
55
-     */
56
-    UpdaterDialog getUpdaterDialog(List<Update> updates);
57
-
58 38
     /**
59 39
      * Shows the first run wizard for the ui.
60 40
      */
@@ -81,12 +61,6 @@ public interface UIController {
81 61
      */
82 62
     void showServerSettingsDialog(Server server);
83 63
 
84
-    /**
85
-     * Initialises any settings required by this UI (this is always called
86
-     * before any aspect of the UI is instansiated).
87
-     */
88
-    void initUISettings();
89
-
90 64
     /**
91 65
      * Shows the unknown URL protocol handling dialog for a URL.
92 66
      *
@@ -107,14 +81,6 @@ public interface UIController {
107 81
      */
108 82
     void showMessageDialog(final String title, final String message);
109 83
 
110
-    /**
111
-     * Requests user input.
112
-     *
113
-     * @param prompt The prompt to display
114
-     * @return The user-inputted string
115
-     */
116
-    String getUserInput(final String prompt);
117
-
118 84
     /**
119 85
      * Retrieves the object used to display the plugin preferences panel.
120 86
      *

+ 0
- 32
src/com/dmdirc/ui/interfaces/UpdaterDialog.java Zobrazit soubor

@@ -1,32 +0,0 @@
1
-/*
2
- * Copyright (c) 2006-2011 Chris Smith, Shane Mc Cormack, Gregory Holmes
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.ui.interfaces;
24
-
25
-/**
26
- * Updater dialog.
27
- */
28
-public interface UpdaterDialog {
29
-
30
-    /** Displays the dialog. */
31
-    void display();
32
-}

+ 0
- 76
src/com/dmdirc/util/StringTranscoder.java Zobrazit soubor

@@ -1,76 +0,0 @@
1
-/*
2
- * Copyright (c) 2006-2011 Chris Smith, Shane Mc Cormack, Gregory Holmes
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.util;
24
-
25
-import java.nio.charset.Charset;
26
-
27
-/**
28
- * Facilitates easy transcoding of strings.
29
- *
30
- * @deprecated This kind of transcoding is not technically possible. This class
31
- * should not be used and now makes no attempt to transcode.
32
- * @author Chris
33
- */
34
-@Deprecated
35
-public class StringTranscoder {
36
-
37
-    /** The charset that is used by this transcoder. */
38
-    private final Charset charset;
39
-
40
-    /**
41
-     * Creates a new StringTranscoder that will transcode strings from the
42
-     * system's default character set into the specified charset.
43
-     *
44
-     * @param charset The target character set
45
-     */
46
-    public StringTranscoder(final Charset charset) {
47
-        this.charset = charset;
48
-    }
49
-
50
-    /**
51
-     * Transcodes the specified string from the system's default charset to
52
-     * this transcoder's charset.
53
-     *
54
-     * @param string The string to be transcoded
55
-     * @return A new string of the appropriate charset
56
-     * @deprecated Does not function. Do not use this class.
57
-     */
58
-    @Deprecated
59
-    public String encode(final String string) {
60
-        return string;
61
-    }
62
-
63
-    /**
64
-     * Transcodes the specified string from this transcoder's charset to the
65
-     * system's default charset
66
-     *
67
-     * @param string The string to be transcoded
68
-     * @return A new string of the appropriate charset
69
-     * @deprecated Does not function. Do not use this class.
70
-     */
71
-    @Deprecated
72
-    public String decode(final String string) {
73
-        return string;
74
-    }
75
-
76
-}

+ 0
- 47
test/com/dmdirc/StringTranscoderTest.java Zobrazit soubor

@@ -1,47 +0,0 @@
1
-/*
2
- * Copyright (c) 2006-2011 Chris Smith, Shane Mc Cormack, Gregory Holmes
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;
24
-
25
-import com.dmdirc.util.StringTranscoder;
26
-
27
-import java.nio.charset.Charset;
28
-
29
-import org.junit.Test;
30
-import static org.junit.Assert.*;
31
-
32
-public class StringTranscoderTest {
33
-
34
-    @Test
35
-    public void testTranscode() {
36
-        String string = new String(new byte[]{(byte) 0xCA, (byte) 0xAE});
37
-        
38
-        StringTranscoder instance = new StringTranscoder(Charset.forName("UTF-8"));
39
-        
40
-        String res = instance.encode(string);
41
-
42
-        byte[] result = res.getBytes();
43
-        
44
-        assertEquals(string, instance.decode(new String(result)));
45
-    }
46
-    
47
-}

Načítá se…
Zrušit
Uložit