Переглянути джерело

Style fixes

Change-Id: Ic4b352f4e88a13423babf63543553f0da1b5ece5
Reviewed-on: http://gerrit.dmdirc.com/1576
Automatic-Compile: DMDirc Local Commits <dmdirc@googlemail.com>
Reviewed-by: Greg Holmes <greg@dmdirc.com>
tags/0.6.5
Chris Smith 13 роки тому
джерело
коміт
bb47b22b58
35 змінених файлів з 109 додано та 254 видалено
  1. 6
    8
      src/com/dmdirc/addons/dcc/PlaceholderContainer.java
  2. 2
    4
      src/com/dmdirc/addons/identd/IdentdServer.java
  3. 1
    1
      src/com/dmdirc/addons/logging/LoggingPlugin.java
  4. 4
    4
      src/com/dmdirc/addons/mediasource_dcop/AmarokSource.java
  5. 4
    4
      src/com/dmdirc/addons/mediasource_dcop/NoatunSource.java
  6. 0
    1
      src/com/dmdirc/addons/notifications/NotificationCommand.java
  7. 7
    7
      src/com/dmdirc/addons/nowplaying/NowPlayingCommand.java
  8. 0
    4
      src/com/dmdirc/addons/osd/OsdCommand.java
  9. 1
    1
      src/com/dmdirc/addons/parser_twitter/Twitter.java
  10. 2
    3
      src/com/dmdirc/addons/parser_twitter/TwitterChannelInfo.java
  11. 2
    1
      src/com/dmdirc/addons/parserdebug/DebugPlugin.java
  12. 3
    10
      src/com/dmdirc/addons/relaybot/RelayBotPlugin.java
  13. 4
    6
      src/com/dmdirc/addons/relaybot/RelayChannelHandler.java
  14. 0
    4
      src/com/dmdirc/addons/relaybot/RelayChannelPanel.java
  15. 0
    3
      src/com/dmdirc/addons/ui_dummy/DummyInputWindow.java
  16. 0
    5
      src/com/dmdirc/addons/ui_dummy/DummyServerWindow.java
  17. 2
    2
      src/com/dmdirc/addons/ui_swing/MainFrame.java
  18. 3
    4
      src/com/dmdirc/addons/ui_swing/UIUtilities.java
  19. 0
    109
      src/com/dmdirc/addons/ui_swing/components/ContainerToggleButton.java
  20. 1
    1
      src/com/dmdirc/addons/ui_swing/components/FontPicker.java
  21. 0
    3
      src/com/dmdirc/addons/ui_swing/components/PackingTable.java
  22. 0
    7
      src/com/dmdirc/addons/ui_swing/components/SplitPane.java
  23. 1
    4
      src/com/dmdirc/addons/ui_swing/components/URLProtocolPanel.java
  24. 1
    6
      src/com/dmdirc/addons/ui_swing/components/colours/ColourPickerDialog.java
  25. 26
    1
      src/com/dmdirc/addons/ui_swing/components/frames/AppleJFrame.java
  26. 2
    2
      src/com/dmdirc/addons/ui_swing/components/inputfields/SwingInputHandler.java
  27. 0
    7
      src/com/dmdirc/addons/ui_swing/components/statusbar/SwingStatusBar.java
  28. 0
    1
      src/com/dmdirc/addons/ui_swing/components/themepanel/ThemePanel.java
  29. 2
    2
      src/com/dmdirc/addons/ui_swing/dialogs/NewServerDialog.java
  30. 29
    26
      src/com/dmdirc/addons/ui_swing/dialogs/actioneditor/ActionConditionDisplayPanel.java
  31. 1
    1
      src/com/dmdirc/addons/ui_swing/dialogs/actionsmanager/ActionGroupInformationPanel.java
  32. 0
    3
      src/com/dmdirc/addons/ui_swing/dialogs/aliases/AliasPanel.java
  33. 1
    1
      src/com/dmdirc/addons/ui_swing/dialogs/prefs/PrefsCategoryLoader.java
  34. 0
    8
      src/com/dmdirc/addons/ui_web/WebInterfacePlugin.java
  35. 4
    0
      src/com/dmdirc/addons/ui_web/uicomponents/WebInputHandler.java

+ 6
- 8
src/com/dmdirc/addons/dcc/PlaceholderContainer.java Переглянути файл

@@ -58,14 +58,11 @@ public class PlaceholderContainer extends FrameContainer<PlaceholderWindow> {
58 58
     public void close() {
59 59
         int dccs = 0;
60 60
         for (FrameContainer<?> window : getChildren()) {
61
-            if (window instanceof TransferContainer) {
62
-                if (((TransferContainer) window).getDCC().isActive()) {
63
-                    dccs++;
64
-                }
65
-            } else if (window instanceof ChatContainer) {
66
-                if (((ChatContainer) window).getDCC().isActive()) {
67
-                    dccs++;
68
-                }
61
+            if ((window instanceof TransferContainer
62
+                    && ((TransferContainer) window).getDCC().isActive())
63
+                    || (window instanceof ChatContainer
64
+                    && ((ChatContainer) window).getDCC().isActive())) {
65
+                dccs++;
69 66
             }
70 67
         }
71 68
 
@@ -93,6 +90,7 @@ public class PlaceholderContainer extends FrameContainer<PlaceholderWindow> {
93 90
                 /** {@inheritDoc} */
94 91
                 @Override
95 92
                 public void cancelled() {
93
+                    // Don't close!
96 94
                 }
97 95
             }.display();
98 96
         } else {

+ 2
- 4
src/com/dmdirc/addons/identd/IdentdServer.java Переглянути файл

@@ -130,10 +130,8 @@ public final class IdentdServer implements Runnable {
130 130
                 Logger.userError(ErrorLevel.MEDIUM, "Unable to start identd server: " + e.getMessage());
131 131
                 if (e.getMessage().equals("Permission denied")) {
132 132
                     final PluginInfo plugin = PluginManager.getPluginManager().getPluginInfoByName("identd");
133
-                    if (plugin != null) {
134
-                        if (PluginManager.getPluginManager().delPlugin(plugin.getRelativeFilename())) {
135
-                            PluginManager.getPluginManager().updateAutoLoad(plugin);
136
-                        }
133
+                    if (plugin != null && PluginManager.getPluginManager().delPlugin(plugin.getRelativeFilename())) {
134
+                        PluginManager.getPluginManager().updateAutoLoad(plugin);
137 135
                     }
138 136
                 }
139 137
             }

+ 1
- 1
src/com/dmdirc/addons/logging/LoggingPlugin.java Переглянути файл

@@ -332,7 +332,7 @@ public class LoggingPlugin extends Plugin implements ActionListener,
332 332
         final String filename = getLogFile(channel);
333 333
 
334 334
         final ChannelClientInfo channelClient = (arguments.length > 1 && arguments[1] instanceof ChannelClientInfo) ? (ChannelClientInfo) arguments[1] : null;
335
-        final ClientInfo client = (channelClient != null) ? channelClient.getClient() : null;
335
+        final ClientInfo client = channelClient == null ? null : channelClient.getClient();
336 336
 
337 337
         final String message = (arguments.length > 2 && arguments[2] instanceof String) ? (String) arguments[2] : null;
338 338
 

+ 4
- 4
src/com/dmdirc/addons/mediasource_dcop/AmarokSource.java Переглянути файл

@@ -43,10 +43,12 @@ public class AmarokSource implements MediaSource {
43 43
     @Override
44 44
     public MediaSourceState getState() {
45 45
         final List<String> res = DcopMediaSourcePlugin.getDcopResult("dcop amarok player status");
46
-        if (res.size() > 0) {
46
+        if (res.isEmpty()) {
47
+            return MediaSourceState.CLOSED;
48
+        } else {
47 49
             final String result = res.get(0).trim();
48 50
             try {
49
-                final int status = (Integer.parseInt(result));
51
+                final int status = Integer.parseInt(result);
50 52
                 switch (status) {
51 53
                     case 0:
52 54
                         return MediaSourceState.STOPPED;
@@ -60,8 +62,6 @@ public class AmarokSource implements MediaSource {
60 62
             } catch (NumberFormatException nfe) {
61 63
                 return MediaSourceState.CLOSED;
62 64
             }
63
-        } else {
64
-            return MediaSourceState.CLOSED;
65 65
         }
66 66
     }
67 67
     

+ 4
- 4
src/com/dmdirc/addons/mediasource_dcop/NoatunSource.java Переглянути файл

@@ -43,10 +43,12 @@ public class NoatunSource implements MediaSource {
43 43
     @Override
44 44
     public MediaSourceState getState() {
45 45
         final List<String> res = DcopMediaSourcePlugin.getDcopResult("dcop noatun Noatun state");
46
-        if (res.size() > 0) {
46
+        if (res.isEmpty()) {
47
+            return MediaSourceState.CLOSED;
48
+        } else {
47 49
             final String result = res.get(0).trim();
48 50
             try {
49
-                final int status = (Integer.parseInt(result));
51
+                final int status = Integer.parseInt(result);
50 52
                 switch (status) {
51 53
                     case 0:
52 54
                         return MediaSourceState.STOPPED;
@@ -60,8 +62,6 @@ public class NoatunSource implements MediaSource {
60 62
             } catch (NumberFormatException nfe) {
61 63
                 return MediaSourceState.CLOSED;
62 64
             }
63
-        } else {
64
-            return MediaSourceState.CLOSED;
65 65
         }
66 66
     }
67 67
     

+ 0
- 1
src/com/dmdirc/addons/notifications/NotificationCommand.java Переглянути файл

@@ -32,7 +32,6 @@ import com.dmdirc.commandparser.commands.context.CommandContext;
32 32
 import com.dmdirc.plugins.ExportedService;
33 33
 import com.dmdirc.plugins.PluginInfo;
34 34
 import com.dmdirc.ui.input.AdditionalTabTargets;
35
-import com.dmdirc.ui.input.TabCompleter;
36 35
 
37 36
 import java.util.List;
38 37
 

+ 7
- 7
src/com/dmdirc/addons/nowplaying/NowPlayingCommand.java Переглянути файл

@@ -77,11 +77,11 @@ public final class NowPlayingCommand extends Command implements
77 77
                 if (source == null) {
78 78
                     sendLine(origin, args.isSilent(), FORMAT_ERROR, "Source not found.");
79 79
                 } else {
80
-                    if (source.getState() != MediaSourceState.CLOSED) {
80
+                    if (source.getState() == MediaSourceState.CLOSED) {
81
+                        sendLine(origin, args.isSilent(), FORMAT_ERROR, "Source is not running.");
82
+                    } else {
81 83
                         target.getCommandParser().parseCommand(origin, context.getSource(),
82 84
                                 getInformation(source, args.getArgumentsAsString(2)));
83
-                    } else {
84
-                        sendLine(origin, args.isSilent(), FORMAT_ERROR, "Source is not running.");
85 85
                     }
86 86
                 }
87 87
             } else {
@@ -120,12 +120,12 @@ public final class NowPlayingCommand extends Command implements
120 120
             for (MediaSource source : sources) {
121 121
                 data[i][0] = source.getAppName();
122 122
 
123
-                if (source.getState() != MediaSourceState.CLOSED) {
124
-                    data[i][1] = source.getState().getNiceName().toLowerCase();
125
-                    data[i][2] = getInformation(source, format);
126
-                } else {
123
+                if (source.getState() == MediaSourceState.CLOSED) {
127 124
                     data[i][1] = "not running";
128 125
                     data[i][2] = "-";
126
+                } else {
127
+                    data[i][1] = source.getState().getNiceName().toLowerCase();
128
+                    data[i][2] = getInformation(source, format);
129 129
                 }
130 130
 
131 131
                 i++;

+ 0
- 4
src/com/dmdirc/addons/osd/OsdCommand.java Переглянути файл

@@ -39,9 +39,6 @@ import com.dmdirc.ui.messages.Styliser;
39 39
 public final class OsdCommand extends Command implements 
40 40
         IntelligentCommand, CommandInfo {
41 41
 
42
-    /** The plugin that owns this command. */
43
-    private final OsdPlugin plugin;
44
-
45 42
     /** The OSDManager that this command should use. */
46 43
     private final OsdManager osdManager;
47 44
     
@@ -54,7 +51,6 @@ public final class OsdCommand extends Command implements
54 51
         super();
55 52
 
56 53
         this.osdManager = osdManager;
57
-        this.plugin = plugin;
58 54
     }
59 55
 
60 56
     /**

+ 1
- 1
src/com/dmdirc/addons/parser_twitter/Twitter.java Переглянути файл

@@ -1215,7 +1215,7 @@ public class Twitter implements Parser, TwitterErrorHandler, TwitterRawHandler,
1215 1215
                 long lastId = lastSearchIds.containsKey(channel) ? lastSearchIds.get(channel) : -1;
1216 1216
                 final List<TwitterStatus> statuses = api.getSearchResults(channel.getName(), lastId);
1217 1217
 
1218
-                foundItems = statuses.size() > 0;
1218
+                foundItems = !statuses.isEmpty();
1219 1219
                 for (final TwitterStatus status : statuses) {
1220 1220
                     final ChannelClientInfo cci = channel.getChannelClient(status.getUserName(), true);
1221 1221
                     sendChannelMessage(channel, new Date(status.getTime()), status.getText(), cci, status.getUserName());

+ 2
- 3
src/com/dmdirc/addons/parser_twitter/TwitterChannelInfo.java Переглянути файл

@@ -144,7 +144,7 @@ public class TwitterChannelInfo implements ChannelInfo {
144 144
     /** {@inheritDoc} */
145 145
     @Override
146 146
     public void sendWho() {
147
-        return;
147
+        // Ignore, twitter parser doesn't support WHOs
148 148
     }
149 149
 
150 150
     /** {@inheritDoc} */
@@ -158,13 +158,12 @@ public class TwitterChannelInfo implements ChannelInfo {
158 158
                 myParser.getApi().unblockUser(bits[0]);
159 159
             }
160 160
         }
161
-        return;
162 161
     }
163 162
 
164 163
     /** {@inheritDoc} */
165 164
     @Override
166 165
     public void flushModes() {
167
-        return;
166
+        // Ignore, all mode changes are instantaneous
168 167
     }
169 168
 
170 169
     /** {@inheritDoc} */

+ 2
- 1
src/com/dmdirc/addons/parserdebug/DebugPlugin.java Переглянути файл

@@ -35,6 +35,7 @@ import com.dmdirc.plugins.Plugin;
35 35
 import java.util.ArrayList;
36 36
 import java.util.Date;
37 37
 import java.util.HashMap;
38
+import java.util.Map;
38 39
 
39 40
 /**
40 41
  * This causes parser debugging to be spammed to the console.
@@ -47,7 +48,7 @@ public final class DebugPlugin extends Plugin implements DebugInfoListener, Acti
47 48
     private ParserDebugCommand command = null;
48 49
 
49 50
     /** Map of parsers registered. */
50
-    protected final HashMap<Parser, DebugWindow> registeredParsers
51
+    protected final Map<Parser, DebugWindow> registeredParsers
51 52
             = new HashMap<Parser, DebugWindow>();
52 53
 
53 54
     /**

+ 3
- 10
src/com/dmdirc/addons/relaybot/RelayBotPlugin.java Переглянути файл

@@ -45,7 +45,6 @@ import com.dmdirc.plugins.PluginManager;
45 45
 import com.dmdirc.util.ReturnableThread;
46 46
 
47 47
 import java.util.ArrayList;
48
-import java.util.Arrays;
49 48
 import java.util.Date;
50 49
 import java.util.HashMap;
51 50
 import java.util.Map;
@@ -84,9 +83,7 @@ public class RelayBotPlugin extends Plugin implements ActionListener, ConfigChan
84 83
                 new RelayCallbackManager(this, (IRCParser) parser);
85 84
             }
86 85
             for (String channel : server.getChannels()) {
87
-                final Channel chan = server.getChannel(channel);
88
-                final String channelName = chan.getServer().getParser().getStringConverter().toLowerCase(chan.getName());
89
-                getHandler(chan);
86
+                getHandler(server.getChannel(channel));
90 87
             }
91 88
         }
92 89
     }
@@ -123,13 +120,9 @@ public class RelayBotPlugin extends Plugin implements ActionListener, ConfigChan
123 120
     @Override
124 121
     public void processEvent(final ActionType type, final StringBuffer format, final Object... arguments) {
125 122
         if (type == CoreActionType.CHANNEL_OPENED) {
126
-            final Channel chan = (Channel) arguments[0];
127
-            
128
-            final String channelName = chan.getServer().getParser().getStringConverter().toLowerCase(chan.getName());
129
-            getHandler(chan);
123
+            getHandler((Channel) arguments[0]);
130 124
         } else if (type == CoreActionType.CHANNEL_CLOSED) {
131
-            final Channel chan = (Channel) arguments[0];
132
-            removeHandler(chan);
125
+            removeHandler((Channel) arguments[0]);
133 126
         } else if (type == CoreActionType.CHANNEL_QUIT) {
134 127
             final Channel chan = (Channel) arguments[0];
135 128
             final Parser parser = chan.getServer().getParser();

+ 4
- 6
src/com/dmdirc/addons/relaybot/RelayChannelHandler.java Переглянути файл

@@ -294,14 +294,12 @@ public class RelayChannelHandler implements ChannelMessageListener {
294 294
                         coreChannelHandler.onChannelKick(parser, date, channel, newChannelClient, kickingChannelClient, reason, "");
295 295
                         removeChannelClient(channel, newBits[0]);
296 296
                         return;
297
-                    } else if (newBits[2].equalsIgnoreCase("now")) {
297
+                    } else if (newBits[2].equalsIgnoreCase("now") && newBits.length > 3) {
298 298
                         // User changed their nickname in a relayed channel.
299
-                        if (newBits.length > 3) {
300
-                            renameChannelClient(newChannelClient, newBits[3]);
299
+                        renameChannelClient(newChannelClient, newBits[3]);
301 300
 
302
-                            coreChannelHandler.onChannelNickChanged(parser, date, channel, newChannelClient, newBits[0]);
303
-                            return;
304
-                        }
301
+                        coreChannelHandler.onChannelNickChanged(parser, date, channel, newChannelClient, newBits[0]);
302
+                        return;
305 303
                     }
306 304
                 }
307 305
             } else if (initial.charAt(0) == '*') {

+ 0
- 4
src/com/dmdirc/addons/relaybot/RelayChannelPanel.java Переглянути файл

@@ -22,13 +22,9 @@
22 22
 
23 23
 package com.dmdirc.addons.relaybot;
24 24
 
25
-import com.dmdirc.addons.ui_swing.SwingController;
26
-import com.dmdirc.addons.ui_swing.dialogs.StandardInputDialog;
27 25
 import com.dmdirc.config.IdentityManager;
28 26
 import com.dmdirc.config.prefs.PreferencesInterface;
29 27
 import com.dmdirc.plugins.Plugin;
30
-import com.dmdirc.plugins.PluginManager;
31
-import java.awt.Dialog.ModalityType;
32 28
 
33 29
 import java.awt.event.ActionEvent;
34 30
 import java.awt.event.ActionListener;

+ 0
- 3
src/com/dmdirc/addons/ui_dummy/DummyInputWindow.java Переглянути файл

@@ -46,8 +46,6 @@ public class DummyInputWindow implements InputWindow {
46 46
     private boolean maximised;
47 47
     /** Our container. */
48 48
     private final WritableFrameContainer<? extends InputWindow> container;
49
-    /** Our command parser. */
50
-    private final CommandParser commandParser;
51 49
 
52 50
     /**
53 51
      * Instantiates a new DummyInputWindow.
@@ -58,7 +56,6 @@ public class DummyInputWindow implements InputWindow {
58 56
     public DummyInputWindow(final WritableFrameContainer<? extends InputWindow> owner,
59 57
             final CommandParser commandParser) {
60 58
         this.container = owner;
61
-        this.commandParser = commandParser;
62 59
     }
63 60
 
64 61
     /** {@inheritDoc} */

+ 0
- 5
src/com/dmdirc/addons/ui_dummy/DummyServerWindow.java Переглянути файл

@@ -31,9 +31,6 @@ import com.dmdirc.ui.interfaces.ServerWindow;
31 31
  */
32 32
 public final class DummyServerWindow extends DummyInputWindow implements ServerWindow {
33 33
     
34
-    /** Parent server. */
35
-    private final Server parent;
36
-    
37 34
     /** 
38 35
      * Instantiates this DummyServerWindow. 
39 36
      *
@@ -41,8 +38,6 @@ public final class DummyServerWindow extends DummyInputWindow implements ServerW
41 38
      */
42 39
     public DummyServerWindow(final Server parent) {
43 40
         super(parent, new ServerCommandParser());
44
-        
45
-        this.parent = parent;
46 41
     }
47 42
     
48 43
 }

+ 2
- 2
src/com/dmdirc/addons/ui_swing/MainFrame.java Переглянути файл

@@ -524,7 +524,7 @@ public final class MainFrame extends JFrame implements WindowListener,
524 524
                 /** {@inheritDoc} */
525 525
                 @Override
526 526
                 public void cancelled() {
527
-                    return;
527
+                    // Do nothing
528 528
                 }
529 529
             }.display();
530 530
             return;
@@ -544,7 +544,7 @@ public final class MainFrame extends JFrame implements WindowListener,
544 544
 
545 545
             /** {@inheritDoc} */
546 546
             @Override
547
-            protected Object doInBackground() throws Exception {
547
+            protected Object doInBackground() {
548 548
                 ActionManager.processEvent(CoreActionType.CLIENT_CLOSING, null);
549 549
                 ServerManager.getServerManager().closeAll(IdentityManager.
550 550
                         getGlobalConfig().getOption("general", "closemessage"));

+ 3
- 4
src/com/dmdirc/addons/ui_swing/UIUtilities.java Переглянути файл

@@ -22,7 +22,6 @@
22 22
 
23 23
 package com.dmdirc.addons.ui_swing;
24 24
 
25
-import com.dmdirc.addons.ui_swing.TreeUI;
26 25
 import com.dmdirc.addons.ui_swing.actions.RedoAction;
27 26
 import com.dmdirc.addons.ui_swing.actions.UndoAction;
28 27
 import com.dmdirc.addons.ui_swing.components.DMDircUndoableEditListener;
@@ -374,7 +373,9 @@ public final class UIUtilities {
374 373
             final Rectangle bounds,
375 374
             final Image backgroundImage,
376 375
             final BackgroundOption backgroundOption) {
377
-        if (backgroundImage != null) {
376
+        if (backgroundImage == null) {
377
+            paintNoBackground(g, bounds);
378
+        } else {
378 379
             switch (backgroundOption) {
379 380
                 case TILED:
380 381
                     paintTiledBackground(g, bounds, backgroundImage);
@@ -391,8 +392,6 @@ public final class UIUtilities {
391 392
                 default:
392 393
                     break;
393 394
             }
394
-        } else {
395
-            paintNoBackground(g, bounds);
396 395
         }
397 396
     }
398 397
 

+ 0
- 109
src/com/dmdirc/addons/ui_swing/components/ContainerToggleButton.java Переглянути файл

@@ -1,109 +0,0 @@
1
-/*
2
- * Copyright (c) 2006-2010 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.addons.ui_swing.components;
24
-
25
-import javax.swing.Icon;
26
-import javax.swing.JToggleButton;
27
-
28
-/**
29
- * JButton that holds an object.
30
- * 
31
- * @param <T> Holds an object of this type
32
- */
33
-public class ContainerToggleButton<T> extends JToggleButton {
34
-
35
-    /**
36
-     * A version number for this class. It should be changed whenever the class
37
-     * structure is changed (or anything else that would prevent serialized
38
-     * objects being unserialized with the new class).
39
-     */
40
-    private static final long serialVersionUID = 1;
41
-    /** Contents. */
42
-    private T contents;
43
-
44
-    /**
45
-     * Instantiates a new container button.
46
-     * 
47
-     * @param contents Contents
48
-     * @param string Title
49
-     * @param icon Icon
50
-     */
51
-    public ContainerToggleButton(final T contents, final String string,
52
-            final Icon icon) {
53
-        super(string, icon);
54
-    }
55
-
56
-    /**
57
-     * Instantiates a new container button.
58
-     * 
59
-     * @param contents Contents
60
-     * @param string Title
61
-     */
62
-    public ContainerToggleButton(final T contents, final String string) {
63
-        super(string);
64
-    }
65
-
66
-    /**
67
-     * Instantiates a new container button.
68
-     * 
69
-     * @param contents Contents
70
-     * @param icon Icon
71
-     */
72
-    public ContainerToggleButton(final T contents, final Icon icon) {
73
-        super(icon);
74
-    }
75
-
76
-    /**
77
-     * Instantiates a new container button.
78
-     * 
79
-     * @param contents Contents
80
-     */
81
-    public ContainerToggleButton(final T contents) {
82
-        super();
83
-    }
84
-
85
-    /**
86
-     * Instantiates a new container button.
87
-     */
88
-    public ContainerToggleButton() {
89
-        super();
90
-    }
91
-
92
-    /**
93
-     * Gets the button's contents
94
-     * 
95
-     * @return Button contents
96
-     */
97
-    public T getContents() {
98
-        return contents;
99
-    }
100
-
101
-    /**
102
-     * Sets the button's contents
103
-     * 
104
-     * @param contents New contents
105
-     */
106
-    public void setValue(final T contents) {
107
-        this.contents = contents;
108
-    }
109
-}

+ 1
- 1
src/com/dmdirc/addons/ui_swing/components/FontPicker.java Переглянути файл

@@ -57,7 +57,7 @@ public class FontPicker extends JComboBox {
57 57
 
58 58
             /** {@inheritDoc} */
59 59
             @Override
60
-            protected String[] doInBackground() throws Exception {
60
+            protected String[] doInBackground() {
61 61
                 return GraphicsEnvironment.getLocalGraphicsEnvironment().
62 62
                         getAvailableFontFamilyNames();
63 63
             }

+ 0
- 3
src/com/dmdirc/addons/ui_swing/components/PackingTable.java Переглянути файл

@@ -44,8 +44,6 @@ public class PackingTable extends JTable {
44 44
      * objects being unserialized with the new class).
45 45
      */
46 46
     private static final long serialVersionUID = 1;
47
-    /** Whether the table should be editable. */
48
-    private final boolean editable;
49 47
     /** Scrollpane. */
50 48
     private final JScrollPane scrollPane;
51 49
     /** Should the last column fit text (true), or fit viewport (false). */
@@ -107,7 +105,6 @@ public class PackingTable extends JTable {
107 105
             final JScrollPane scrollPane, final boolean lastColumnFit) {
108 106
         super(tableModel);
109 107
 
110
-        this.editable = editable;
111 108
         this.scrollPane = scrollPane;
112 109
         this.lastColumnFit = lastColumnFit;
113 110
 

+ 0
- 7
src/com/dmdirc/addons/ui_swing/components/SplitPane.java Переглянути файл

@@ -43,10 +43,6 @@ public class SplitPane extends JSplitPane implements ConfigChangeListener {
43 43
      * objects being unserialized with the new class).
44 44
      */
45 45
     private static final long serialVersionUID = 2;
46
-    /** Snap distance. */
47
-    private final int snapDistance;
48
-    /** Component to snap to? */
49
-    private boolean leftComponentSnap = true;
50 46
     /** use one touch expandable? */
51 47
     private boolean useOneTouchExpandable;
52 48
     /** Global config manager. */
@@ -223,9 +219,6 @@ public class SplitPane extends JSplitPane implements ConfigChangeListener {
223 219
         super((orientation.equals(Orientation.HORIZONTAL)) ? HORIZONTAL_SPLIT : VERTICAL_SPLIT,
224 220
                 true, leftComponent, rightComponent);
225 221
 
226
-        this.leftComponentSnap = leftComponentSnap;
227
-        this.snapDistance = snapDistance;
228
-
229 222
         config = IdentityManager.getGlobalConfig();
230 223
         useOneTouchExpandable = config.getOptionBool("ui", "useOneTouchExpandable");
231 224
 

+ 1
- 4
src/com/dmdirc/addons/ui_swing/components/URLProtocolPanel.java Переглянути файл

@@ -81,8 +81,6 @@ public class URLProtocolPanel extends JPanel implements ActionListener,
81 81
     private final boolean useInsets;
82 82
     /** Substitutions panel. */
83 83
     private URLSubsitutionsPanel subsPanel;
84
-    /** The URL Handler to use to open links. */
85
-    private final URLHandler urlHandler;
86 84
 
87 85
     /**
88 86
      * Instantiates the URLDialog.
@@ -96,7 +94,6 @@ public class URLProtocolPanel extends JPanel implements ActionListener,
96 94
 
97 95
         this.uri = url;
98 96
         this.useInsets = useInsets;
99
-        this.urlHandler = urlHandler;
100 97
 
101 98
         initComponents();
102 99
         layoutComponents();
@@ -291,6 +288,6 @@ public class URLProtocolPanel extends JPanel implements ActionListener,
291 288
     /** {@inheritDoc} */
292 289
     @Override
293 290
     public void changedUpdate(final DocumentEvent e) {
294
-    //Ignore
291
+        //Ignore
295 292
     }
296 293
 }

+ 1
- 6
src/com/dmdirc/addons/ui_swing/components/colours/ColourPickerDialog.java Переглянути файл

@@ -44,8 +44,6 @@ public final class ColourPickerDialog extends StandardDialog {
44 44
     private static final long serialVersionUID = 1;
45 45
     /** Colour chooser panel. */
46 46
     private ColourPickerPanel colourChooser;
47
-    /** Parent window. */
48
-    private Window window;
49 47
 
50 48
     /**
51 49
      * Creates a new instance of ColourPickerDialog.
@@ -105,8 +103,7 @@ public final class ColourPickerDialog extends StandardDialog {
105 103
      * @return Colour picker dialog
106 104
      */
107 105
     public static ColourPickerDialog showColourPicker() {
108
-        final ColourPickerDialog cpd = showColourPicker(true, true);
109
-        return cpd;
106
+        return showColourPicker(true, true);
110 107
     }
111 108
 
112 109
     /** 
@@ -137,8 +134,6 @@ public final class ColourPickerDialog extends StandardDialog {
137 134
      * @param window Parent window
138 135
      */
139 136
     public void setWindow(final Window window) {
140
-        this.window = window;
141
-
142 137
         if (window != null) {
143 138
             window.addWindowListener(new WindowAdapter() {
144 139
 

+ 26
- 1
src/com/dmdirc/addons/ui_swing/components/frames/AppleJFrame.java Переглянути файл

@@ -1,7 +1,32 @@
1
+/*
2
+ * Copyright (c) 2006-2010 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
+
1 23
 package com.dmdirc.addons.ui_swing.components.frames;
2 24
 
3
-import com.dmdirc.addons.ui_swing.*;
25
+import com.dmdirc.addons.ui_swing.Apple;
26
+import com.dmdirc.addons.ui_swing.MainFrame;
27
+import com.dmdirc.addons.ui_swing.SwingController;
4 28
 import com.dmdirc.addons.ui_swing.components.MenuBar;
29
+
5 30
 import javax.swing.JFrame;
6 31
 
7 32
 /**

+ 2
- 2
src/com/dmdirc/addons/ui_swing/components/inputfields/SwingInputHandler.java Переглянути файл

@@ -157,7 +157,7 @@ public class SwingInputHandler extends InputHandler implements KeyListener {
157 157
 
158 158
                     /** {@inheritDoc} */
159 159
                     @Override
160
-                    protected Object doInBackground() throws Exception {
160
+                    protected Object doInBackground() {
161 161
                         localTarget.setEditable(false);
162 162
                         doTabCompletion(false);
163 163
                         return null;
@@ -187,7 +187,7 @@ public class SwingInputHandler extends InputHandler implements KeyListener {
187 187
 
188 188
                     /** {@inheritDoc} */
189 189
                     @Override
190
-                    protected Object doInBackground() throws Exception {
190
+                    protected Object doInBackground() {
191 191
                         localTarget.setEditable(false);
192 192
                         doTabCompletion(true);
193 193
                         return null;

+ 0
- 7
src/com/dmdirc/addons/ui_swing/components/statusbar/SwingStatusBar.java Переглянути файл

@@ -55,10 +55,6 @@ public final class SwingStatusBar extends JPanel implements StatusBar {
55 55
     private final UpdaterLabel updateLabel;
56 56
     /** Invite label. */
57 57
     private final InviteLabel inviteLabel;
58
-    /** Swing controller. */
59
-    private SwingController controller;
60
-    /** Main frame. */
61
-    private MainFrame mainFrame;
62 58
 
63 59
     /**
64 60
      * Creates a new instance of SwingStatusBar.
@@ -68,9 +64,6 @@ public final class SwingStatusBar extends JPanel implements StatusBar {
68 64
      */
69 65
     public SwingStatusBar(final SwingController controller, final MainFrame mainFrame) {
70 66
         super();
71
-        
72
-        this.controller = controller;
73
-        this.mainFrame = mainFrame;
74 67
 
75 68
         messageLabel = new MessageLabel();
76 69
         errorPanel = new ErrorPanel(controller, mainFrame, this);

+ 0
- 1
src/com/dmdirc/addons/ui_swing/components/themepanel/ThemePanel.java Переглянути файл

@@ -22,7 +22,6 @@
22 22
 
23 23
 package com.dmdirc.addons.ui_swing.components.themepanel;
24 24
 
25
-import com.dmdirc.addons.ui_swing.SwingController;
26 25
 import com.dmdirc.addons.ui_swing.UIUtilities;
27 26
 import com.dmdirc.addons.ui_swing.components.LoggingSwingWorker;
28 27
 import com.dmdirc.addons.ui_swing.components.renderers.AddonCellRenderer;

+ 2
- 2
src/com/dmdirc/addons/ui_swing/dialogs/NewServerDialog.java Переглянути файл

@@ -293,7 +293,7 @@ public final class NewServerDialog extends StandardDialog implements
293 293
 
294 294
                 new LoggingSwingWorker() {
295 295
                     @Override
296
-                    protected Object doInBackground() throws Exception {
296
+                    protected Object doInBackground() {
297 297
                         final Server server = new Server(address, profile);
298 298
                         server.connect();
299 299
                         return null;
@@ -306,7 +306,7 @@ public final class NewServerDialog extends StandardDialog implements
306 306
 
307 307
                     /** {@inheritDoc} */
308 308
                     @Override
309
-                    protected Object doInBackground() throws Exception {
309
+                    protected Object doInBackground() {
310 310
                         if (server == null) {
311 311
                             final Server newServer = new Server(address, profile);
312 312
                             newServer.connect();

+ 29
- 26
src/com/dmdirc/addons/ui_swing/dialogs/actioneditor/ActionConditionDisplayPanel.java Переглянути файл

@@ -1,16 +1,16 @@
1 1
 /*
2 2
  * Copyright (c) 2006-2010 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
- * 
3
+ *
4 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal
6 6
  * in the Software without restriction, including without limitation the rights
7 7
  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 8
  * copies of the Software, and to permit persons to whom the Software is
9 9
  * furnished to do so, subject to the following conditions:
10
- * 
10
+ *
11 11
  * The above copyright notice and this permission notice shall be included in
12 12
  * all copies or substantial portions of the Software.
13
- * 
13
+ *
14 14
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 15
  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 16
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -67,9 +67,9 @@ public class ActionConditionDisplayPanel extends JPanel implements ActionListene
67 67
     /** Action trigger. */
68 68
     private ActionType trigger;
69 69
 
70
-    /** 
70
+    /**
71 71
      * Instantiates the panel.
72
-     * 
72
+     *
73 73
      * @param condition Action condition
74 74
      * @param trigger Action trigger
75 75
      */
@@ -98,7 +98,7 @@ public class ActionConditionDisplayPanel extends JPanel implements ActionListene
98 98
 
99 99
     /**
100 100
      * Sets the action trigger.
101
-     * 
101
+     *
102 102
      * @param trigger new trigger
103 103
      */
104 104
     void setTrigger(final ActionType trigger) {
@@ -157,9 +157,9 @@ public class ActionConditionDisplayPanel extends JPanel implements ActionListene
157 157
         add(editPanel, "alignx right");
158 158
     }
159 159
 
160
-    /** 
160
+    /**
161 161
      * {@inheritDoc}
162
-     * 
162
+     *
163 163
      * @param e Action event
164 164
      */
165 165
     @Override
@@ -214,42 +214,45 @@ public class ActionConditionDisplayPanel extends JPanel implements ActionListene
214 214
 
215 215
     /**
216 216
      * Updates the condition sentence.
217
-     * 
217
+     *
218 218
      * @return Updated sentence
219 219
      */
220 220
     private String updateSentence() {
221 221
         if (trigger == null) {
222 222
             return "...";
223 223
         } else {
224
-            final StringBuilder sb = new StringBuilder();
225
-            sb.append("The ");
226
-            if (condition.getArg() != -1) {
227
-                sb.append(trigger.getType().getArgNames()[condition.getArg()]);
228
-            } else {
224
+            final StringBuilder sb = new StringBuilder("The ");
225
+
226
+            if (condition.getArg() == -1) {
229 227
                 sb.append(" ...");
230 228
                 return sb.toString();
231 229
             }
230
+
231
+            sb.append(trigger.getType().getArgNames()[condition.getArg()]);
232 232
             sb.append("'s ");
233
-            if (condition.getComponent() != null) {
234
-                sb.append(condition.getComponent().getName());
235
-            } else {
233
+
234
+            if (condition.getComponent() == null) {
236 235
                 sb.append(" ...");
237 236
                 return sb.toString();
238 237
             }
238
+
239
+            sb.append(condition.getComponent().getName());
239 240
             sb.append(" ");
240
-            if (condition.getComparison() != null) {
241
-                sb.append(condition.getComparison().getName());
242
-            } else {
241
+
242
+            if (condition.getComparison() == null) {
243 243
                 sb.append(" ...");
244 244
                 return sb.toString();
245 245
             }
246
+
247
+            sb.append(condition.getComparison().getName());
246 248
             sb.append(" '");
247
-            if (condition.getTarget() != null) {
248
-                sb.append(condition.getTarget().replace("<", "&lt;"));
249
-            } else {
249
+
250
+            if (condition.getTarget() == null) {
250 251
                 sb.append(" ...");
251 252
                 return sb.toString();
252 253
             }
254
+
255
+            sb.append(condition.getTarget().replace("<", "&lt;"));
253 256
             sb.append("'");
254 257
             return sb.toString();
255 258
         }
@@ -257,7 +260,7 @@ public class ActionConditionDisplayPanel extends JPanel implements ActionListene
257 260
 
258 261
     /**
259 262
      * Returns the action condition represented by this panel.
260
-     * 
263
+     *
261 264
      * @return Action condition
262 265
      */
263 266
     public ActionCondition getCondition() {
@@ -274,10 +277,10 @@ public class ActionConditionDisplayPanel extends JPanel implements ActionListene
274 277
                     evt.getNewValue());
275 278
         }
276 279
     }
277
-    
280
+
278 281
     /**
279 282
      * Checks if this editor panel has errored.
280
-     * 
283
+     *
281 284
      * @return true iif the content it valid
282 285
      */
283 286
     public boolean checkError() {

+ 1
- 1
src/com/dmdirc/addons/ui_swing/dialogs/actionsmanager/ActionGroupInformationPanel.java Переглянути файл

@@ -24,7 +24,7 @@ package com.dmdirc.addons.ui_swing.dialogs.actionsmanager;
24 24
 import com.dmdirc.actions.ActionGroup;
25 25
 
26 26
 import com.dmdirc.addons.ui_swing.components.text.TextLabel;
27
-import javax.swing.Box;
27
+
28 28
 import javax.swing.JLabel;
29 29
 import javax.swing.JPanel;
30 30
 

+ 0
- 3
src/com/dmdirc/addons/ui_swing/dialogs/aliases/AliasPanel.java Переглянути файл

@@ -27,11 +27,8 @@ import com.dmdirc.actions.CoreActionComparison;
27 27
 import com.dmdirc.actions.CoreActionComponent;
28 28
 import com.dmdirc.actions.wrappers.Alias;
29 29
 import com.dmdirc.addons.ui_swing.UIUtilities;
30
-import com.dmdirc.addons.ui_swing.components.inputfields.SwingInputHandler;
31 30
 import com.dmdirc.addons.ui_swing.components.inputfields.ValidatingTextFieldInputField;
32 31
 import com.dmdirc.addons.ui_swing.components.renderers.ActionComparisonCellRenderer;
33
-import com.dmdirc.commandparser.parsers.CommandParser;
34
-import com.dmdirc.commandparser.parsers.GlobalCommandParser;
35 32
 import com.dmdirc.commandparser.validators.CommandNameValidator;
36 33
 import com.dmdirc.util.validators.FileNameValidator;
37 34
 import com.dmdirc.util.validators.ValidatorChain;

+ 1
- 1
src/com/dmdirc/addons/ui_swing/dialogs/prefs/PrefsCategoryLoader.java Переглянути файл

@@ -95,7 +95,7 @@ public class PrefsCategoryLoader extends LoggingSwingWorker<JPanel, Object> {
95 95
      * @throws Exception if unable to compute a result
96 96
      */
97 97
     @Override
98
-    protected JPanel doInBackground() throws Exception {
98
+    protected JPanel doInBackground() {
99 99
         return addCategory(category);
100 100
     }
101 101
 

+ 0
- 8
src/com/dmdirc/addons/ui_web/WebInterfacePlugin.java Переглянути файл

@@ -22,7 +22,6 @@
22 22
 
23 23
 package com.dmdirc.addons.ui_web;
24 24
 
25
-import com.dmdirc.Main;
26 25
 import com.dmdirc.plugins.Plugin;
27 26
 import com.dmdirc.ui.interfaces.UIController;
28 27
 
@@ -38,13 +37,6 @@ public class WebInterfacePlugin extends Plugin {
38 37
     /** The UI that we're using. */
39 38
     private WebInterfaceUI ui;
40 39
 
41
-    /**
42
-     * Creates a new WebInterfacePlugin, and registers the web UI as the
43
-     * main client UI.
44
-     */
45
-    public WebInterfacePlugin() {
46
-    }
47
-
48 40
     /** {@inheritDoc} */
49 41
     @Override
50 42
     public void onLoad() {   

+ 4
- 0
src/com/dmdirc/addons/ui_web/uicomponents/WebInputHandler.java Переглянути файл

@@ -79,24 +79,28 @@ public class WebInputHandler extends InputHandler {
79 79
 
80 80
     /** {@inheritDoc} */
81 81
     @Override
82
+    @SuppressWarnings("PMD")
82 83
     public void doTabCompletion(boolean shiftPressed) {
83 84
         super.doTabCompletion(shiftPressed);
84 85
     }
85 86
 
86 87
     /** {@inheritDoc} */
87 88
     @Override
89
+    @SuppressWarnings("PMD")
88 90
     public void doBufferDown() {
89 91
         super.doBufferDown();
90 92
     }
91 93
 
92 94
     /** {@inheritDoc} */
93 95
     @Override
96
+    @SuppressWarnings("PMD")
94 97
     public void doBufferUp() {
95 98
         super.doBufferUp();
96 99
     }
97 100
 
98 101
     /** {@inheritDoc} */
99 102
     @Override
103
+    @SuppressWarnings("PMD")
100 104
     public void handleKeyPressed(final String line, final int keyCode,
101 105
             final boolean shiftPressed, final boolean ctrlPressed) {
102 106
         super.handleKeyPressed(line, keyCode, shiftPressed, ctrlPressed);

Завантаження…
Відмінити
Зберегти