Browse Source

Remove some deprecated methods

git-svn-id: http://svn.dmdirc.com/trunk@3120 00569f92-eb28-0410-84fd-f71c24880f
tags/0.6
Chris Smith 16 years ago
parent
commit
a57f0f14f0

+ 2
- 30
src/com/dmdirc/commandparser/CommandManager.java View File

65
     /** A list of command parsers that have been instansiated. */
65
     /** A list of command parsers that have been instansiated. */
66
     private static final MapList<CommandType, CommandParser> parsers
66
     private static final MapList<CommandType, CommandParser> parsers
67
             = new MapList<CommandType, CommandParser>();
67
             = new MapList<CommandType, CommandParser>();
68
-           
69
-    /**
70
-     * Channel commands that have been registered to appear in the nicklist
71
-     * popup.
72
-     */
73
-    private static List<Command> channelPopupCommands = new WeakList<Command>();
74
     
68
     
75
     /** The command char we're using. */
69
     /** The command char we're using. */
76
     private static char commandChar = IdentityManager.getGlobalConfig()
70
     private static char commandChar = IdentityManager.getGlobalConfig()
229
             completer.removeEntry(name);
223
             completer.removeEntry(name);
230
         }
224
         }
231
     }
225
     }
232
-    
233
-    /**
234
-     * Registers a command for use in the nicklist popup.
235
-     * 
236
-     * @param command The command to be registered
237
-     * @deprecated Should be done via the new popup config instead
238
-     */
239
-    @Deprecated
240
-    public static void registerPopupCommand(final Command command) {
241
-        channelPopupCommands.add(command);
242
-    }
243
-    
244
-    /**
245
-     * Retrieves the commands for use in the nicklist popup.
246
-     * 
247
-     * @return A list of commands suitable for use in the nicklist popup
248
-     * @deprecated Should be done via the new popup config instead
249
-     */
250
-    @Deprecated
251
-    public static List<Command> getNicklistCommands() {
252
-        return channelPopupCommands;
253
-    }
254
-    
226
+        
255
     /**
227
     /**
256
      * Instansiates the default commands.
228
      * Instansiates the default commands.
257
      */
229
      */
293
         new RawServerCommand("map");
265
         new RawServerCommand("map");
294
         new RawServerCommand("motd");
266
         new RawServerCommand("motd");
295
         new RawServerCommand("oper");
267
         new RawServerCommand("oper");
296
-        registerPopupCommand(new RawServerCommand("whois"));
268
+        new RawServerCommand("whois");
297
         new RawServerCommand("who");
269
         new RawServerCommand("who");
298
         
270
         
299
         // Query commands
271
         // Query commands

+ 0
- 47
src/com/dmdirc/commandparser/PopupManager.java View File

45
         // Shouldn't be instansiated.
45
         // Shouldn't be instansiated.
46
     }
46
     }
47
     
47
     
48
-    /**
49
-     * Retrieves a map of the menu items that should be in a certain menu type.
50
-     * If the command is equal to "-", the entry should be treated as a divider.
51
-     *
52
-     * @param menuType The type of menu that is being built
53
-     * @param configManager The config manager for the current context
54
-     * @param arguments Any arguments appropriate for the menuType
55
-     * @deprecated in favour of getMenu
56
-     * 
57
-     * @return A map of "friendly names" to commands (without command characters)
58
-     */
59
-    @Precondition({
60
-        "The specified PopupType is not null",
61
-        "The specified ConfigManager is not null"
62
-    })
63
-    @Deprecated
64
-    public static Map<String, String> getMenuItems(final PopupType menuType,
65
-            final ConfigManager configManager, final Object ... arguments) {
66
-        assert(menuType != null);
67
-        assert(configManager != null);
68
-        
69
-        final Map<String, String> res = new LinkedHashMap<String, String>();
70
-        
71
-        int dividerCount = 0;
72
-        
73
-        for (String domain : menuType.getDomains()) {
74
-            final List<String> commands = configManager.getOptionList("popups", domain);
75
-            
76
-            for (String command : commands) {
77
-                if ("-".equals(command)) {
78
-                    res.put("divider" + (++dividerCount), "-");
79
-                } else if (command.indexOf(':') > 0) {
80
-                    final String name = command.substring(0, command.indexOf(':'));
81
-                    final String value = command.substring(command.indexOf(':') + 1);
82
-                    
83
-                    res.put(name, String.format(value, arguments));
84
-                } else if (!command.isEmpty()) {
85
-                    Logger.userError(ErrorLevel.LOW, "Invalid command in "
86
-                            + "popup menu configuration. Menu: " + domain
87
-                            + ", Command: " + command);
88
-                }
89
-            }
90
-        }
91
-        
92
-        return res;
93
-    }
94
-    
95
     /**
48
     /**
96
      * Returns the popup menu that should be used for the specified type.
49
      * Returns the popup menu that should be used for the specified type.
97
      * Configuration data is read from the specified config manager.
50
      * Configuration data is read from the specified config manager.

+ 9
- 12
src/com/dmdirc/commandparser/commands/channel/Ban.java View File

31
 
31
 
32
 /**
32
 /**
33
  * The kick command bans a specified user or host from the channel.
33
  * The kick command bans a specified user or host from the channel.
34
+ * 
34
  * @author chris
35
  * @author chris
35
  */
36
  */
36
 public final class Ban extends ChannelCommand {
37
 public final class Ban extends ChannelCommand {
40
         super();
41
         super();
41
         
42
         
42
         CommandManager.registerCommand(this);
43
         CommandManager.registerCommand(this);
43
-        CommandManager.registerPopupCommand(this);
44
     }
44
     }
45
     
45
     
46
-    /**
47
-     * Executes this command.
48
-     * @param origin The frame in which this command was issued
49
-     * @param server The server object that this command is associated with
50
-     * @param channel The channel object that this command is associated with
51
-     * @param isSilent Whether this command is silenced or not
52
-     * @param args The user supplied arguments
53
-     */
46
+    /** {@inheritDoc} */
47
+    @Override
54
     public void execute(final InputWindow origin, final Server server,
48
     public void execute(final InputWindow origin, final Server server,
55
             final Channel channel, final boolean isSilent, final String... args) {
49
             final Channel channel, final boolean isSilent, final String... args) {
56
         if (args.length == 0) {
50
         if (args.length == 0) {
68
         server.getParser().sendLine("MODE " + channel + " +b " + host);
62
         server.getParser().sendLine("MODE " + channel + " +b " + host);
69
     }
63
     }
70
     
64
     
71
-    /** {@inheritDoc}. */
65
+    /** {@inheritDoc} */
66
+    @Override
72
     public String getName() {
67
     public String getName() {
73
         return "ban";
68
         return "ban";
74
     }
69
     }
75
     
70
     
76
-    /** {@inheritDoc}. */
71
+    /** {@inheritDoc} */
72
+    @Override
77
     public boolean showInHelp() {
73
     public boolean showInHelp() {
78
         return true;
74
         return true;
79
     }
75
     }
80
     
76
     
81
-    /** {@inheritDoc}. */
77
+    /** {@inheritDoc} */
78
+    @Override
82
     public String getHelp() {
79
     public String getHelp() {
83
         return "ban <user|host> - bans the specified user or host from the channel.";
80
         return "ban <user|host> - bans the specified user or host from the channel.";
84
     }
81
     }

+ 0
- 1
src/com/dmdirc/commandparser/commands/server/OpenQuery.java View File

40
         super();
40
         super();
41
         
41
         
42
         CommandManager.registerCommand(this);
42
         CommandManager.registerCommand(this);
43
-        CommandManager.registerPopupCommand(this);
44
     }
43
     }
45
     
44
     
46
     /** {@inheritDoc} */
45
     /** {@inheritDoc} */

+ 2
- 18
src/com/dmdirc/plugins/PluginManager.java View File

159
 	 * Reload all plugins.
159
 	 * Reload all plugins.
160
 	 */
160
 	 */
161
 	public void reloadAllPlugins() {
161
 	public void reloadAllPlugins() {
162
-		for (String pluginName : getFilenames()) {
163
-			reloadPlugin(pluginName);
162
+		for (PluginInfo pluginInfo : getPluginInfos()) {
163
+			reloadPlugin(pluginInfo.getFilename());
164
 		}
164
 		}
165
 	}
165
 	}
166
 
166
 
198
 		return myDir;
198
 		return myDir;
199
 	}
199
 	}
200
 
200
 
201
-	/**
202
-	 * Get string[] of known plugin file names.
203
-	 *
204
-	 * @return string[] of known plugin file names.
205
-	 * @deprecated Pointless method. Iterate getPluginInfos instead.
206
-	 */
207
-	@Deprecated
208
-	public String[] getFilenames() {
209
-		final String[] result = new String[knownPlugins.size()];
210
-		int i = 0;
211
-		for (String name : knownPlugins.keySet()) {
212
-			result[i++] = knownPlugins.get(name).getFilename();
213
-		}
214
-		return result;
215
-	}
216
-
217
 	/**
201
 	/**
218
 	 * Retrieves a list of all installed plugins.
202
 	 * Retrieves a list of all installed plugins.
219
 	 * Any file under the main plugin directory (~/.DMDirc/plugins or similar)
203
 	 * Any file under the main plugin directory (~/.DMDirc/plugins or similar)

Loading…
Cancel
Save