ソースを参照

Switch popin/out commands to use new style info objects

Change-Id: Ic1af964f7f363ddc9fe686c35f4f7ed934726cfe
Reviewed-on: http://gerrit.dmdirc.com/2091
Automatic-Compile: DMDirc Build Manager
Reviewed-by: Chris Smith <chris@dmdirc.com>
tags/0.7rc1
Greg Holmes 13年前
コミット
41c074792d

+ 2
- 2
src/com/dmdirc/addons/ui_swing/SwingController.java ファイルの表示

@@ -124,8 +124,8 @@ public class SwingController extends BasePlugin implements UIController {
124 124
         registerCommand(new ServerSettings(), ServerSettings.INFO);
125 125
         registerCommand(new ChannelSettings(), ChannelSettings.INFO);
126 126
         registerCommand(new Input(windowFactory), Input.INFO);
127
-        registerCommand(new PopOutCommand(this), new PopOutCommandInfo());
128
-        registerCommand(new PopInCommand(this), new PopInCommandInfo());
127
+        registerCommand(new PopOutCommand(this), PopOutCommand.INFO);
128
+        registerCommand(new PopInCommand(this), PopInCommand.INFO);
129 129
     }
130 130
 
131 131
     /**

+ 8
- 0
src/com/dmdirc/addons/ui_swing/commands/PopInCommand.java ファイルの表示

@@ -26,7 +26,10 @@ import com.dmdirc.FrameContainer;
26 26
 import com.dmdirc.addons.ui_swing.SwingController;
27 27
 import com.dmdirc.addons.ui_swing.UIUtilities;
28 28
 import com.dmdirc.addons.ui_swing.components.frames.TextFrame;
29
+import com.dmdirc.commandparser.BaseCommandInfo;
29 30
 import com.dmdirc.commandparser.CommandArguments;
31
+import com.dmdirc.commandparser.CommandInfo;
32
+import com.dmdirc.commandparser.CommandType;
30 33
 import com.dmdirc.commandparser.commands.Command;
31 34
 import com.dmdirc.commandparser.commands.context.CommandContext;
32 35
 
@@ -35,6 +38,11 @@ import com.dmdirc.commandparser.commands.context.CommandContext;
35 38
  */
36 39
 public class PopInCommand extends Command {
37 40
 
41
+    /** A command info object for this command. */
42
+    public static final CommandInfo INFO = new BaseCommandInfo("popin",
43
+            "popin - Reattaches the current window to the main client if it"
44
+                + " has been detached via the popin command.",
45
+            CommandType.TYPE_GLOBAL);
38 46
     /** SwingController associated with this popin Command. */
39 47
     private final SwingController controller;
40 48
 

+ 0
- 58
src/com/dmdirc/addons/ui_swing/commands/PopInCommandInfo.java ファイルの表示

@@ -1,58 +0,0 @@
1
-/*
2
- * Copyright (c) 2006-2011 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.addons.ui_swing.commands;
24
-
25
-import com.dmdirc.commandparser.CommandInfo;
26
-import com.dmdirc.commandparser.CommandType;
27
-
28
-/**
29
- * Command to pop out windows.
30
- */
31
-public class PopInCommandInfo implements CommandInfo {
32
-
33
-    /** {@inheritDoc} */
34
-    @Override
35
-    public String getName() {
36
-        return "popin";
37
-    }
38
-
39
-    /** {@inheritDoc} */
40
-    @Override
41
-    public boolean showInHelp() {
42
-        return true;
43
-    }
44
-
45
-    /** {@inheritDoc} */
46
-    @Override
47
-    public String getHelp() {
48
-        return "popin - Reattaches the current window to the main client if it"
49
-                + " has been detached via the popin command.";
50
-    }
51
-
52
-    /** {@inheritDoc} */
53
-    @Override
54
-    public CommandType getType() {
55
-        return CommandType.TYPE_GLOBAL;
56
-    }
57
-
58
-}

+ 8
- 0
src/com/dmdirc/addons/ui_swing/commands/PopOutCommand.java ファイルの表示

@@ -26,7 +26,10 @@ import com.dmdirc.FrameContainer;
26 26
 import com.dmdirc.addons.ui_swing.SwingController;
27 27
 import com.dmdirc.addons.ui_swing.UIUtilities;
28 28
 import com.dmdirc.addons.ui_swing.components.frames.TextFrame;
29
+import com.dmdirc.commandparser.BaseCommandInfo;
29 30
 import com.dmdirc.commandparser.CommandArguments;
31
+import com.dmdirc.commandparser.CommandInfo;
32
+import com.dmdirc.commandparser.CommandType;
30 33
 import com.dmdirc.commandparser.commands.Command;
31 34
 import com.dmdirc.commandparser.commands.context.CommandContext;
32 35
 
@@ -35,6 +38,11 @@ import com.dmdirc.commandparser.commands.context.CommandContext;
35 38
  */
36 39
 public class PopOutCommand extends Command {
37 40
 
41
+    /** A command info object for this command. */
42
+    public static final CommandInfo INFO = new BaseCommandInfo("popout",
43
+            "popout - Makes the current window pop out of the client as a "
44
+                + "free floating window on your desktop.",
45
+            CommandType.TYPE_GLOBAL);
38 46
     /** SwingController associated with this popout Command. */
39 47
     private final SwingController controller;
40 48
 

+ 0
- 58
src/com/dmdirc/addons/ui_swing/commands/PopOutCommandInfo.java ファイルの表示

@@ -1,58 +0,0 @@
1
-/*
2
- * Copyright (c) 2006-2011 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.addons.ui_swing.commands;
24
-
25
-import com.dmdirc.commandparser.CommandInfo;
26
-import com.dmdirc.commandparser.CommandType;
27
-
28
-/**
29
- * Command to pop out windows.
30
- */
31
-public class PopOutCommandInfo implements CommandInfo {
32
-
33
-    /** {@inheritDoc} */
34
-    @Override
35
-    public String getName() {
36
-        return "popout";
37
-    }
38
-
39
-    /** {@inheritDoc} */
40
-    @Override
41
-    public boolean showInHelp() {
42
-        return true;
43
-    }
44
-
45
-    /** {@inheritDoc} */
46
-    @Override
47
-    public String getHelp() {
48
-        return "popout - Makes the current window pop out of the client as a "
49
-                + "free floating window on your desktop.";
50
-    }
51
-
52
-    /** {@inheritDoc} */
53
-    @Override
54
-    public CommandType getType() {
55
-        return CommandType.TYPE_GLOBAL;
56
-    }
57
-
58
-}

読み込み中…
キャンセル
保存