Selaa lähdekoodia

Rename PreferencesManager to PreferencesDialogModel

Change-Id: Ied76e21fbf72039d47ec2b35b236149c13941645
Depends-On: Ia126a15b60e54c08c1e780676fe363821e9b7518
Reviewed-on: http://gerrit.dmdirc.com/1591
Reviewed-by: Greg Holmes <greg@dmdirc.com>
Automatic-Compile: DMDirc Local Commits <dmdirc@googlemail.com>
tags/0.6.5b1
Chris Smith 13 vuotta sitten
vanhempi
commit
33bae9d01d

+ 2
- 2
src/com/dmdirc/actions/metatypes/ClientEvents.java Näytä tiedosto

@@ -28,7 +28,7 @@ import com.dmdirc.commandparser.PopupMenu;
28 28
 import com.dmdirc.commandparser.PopupType;
29 29
 import com.dmdirc.config.ConfigManager;
30 30
 
31
-import com.dmdirc.config.prefs.PreferencesManager;
31
+import com.dmdirc.config.prefs.PreferencesDialogModel;
32 32
 import javax.swing.KeyStroke;
33 33
 import javax.swing.text.StyledDocument;
34 34
 
@@ -52,7 +52,7 @@ public enum ClientEvents implements ActionMetaType {
52 52
     /** Client event with an origin and editable buffer. */
53 53
     CLIENT_EVENT_WITH_BUFFER(new String[]{"origin", "buffer"}, FrameContainer.class, StringBuffer.class),
54 54
     /** Client event with preferences manager. */
55
-    CLIENT_EVENT_WITH_PREFS(new String[]{"preferences manager"}, PreferencesManager.class),
55
+    CLIENT_EVENT_WITH_PREFS(new String[]{"preferences manager"}, PreferencesDialogModel.class),
56 56
     /** Client event with a styled doc. */
57 57
     CLIENT_EVENT_WITH_STYLE(new String[]{"styled document", "start offset", "length"}, StyledDocument.class, Integer.class, Integer.class),
58 58
     /** Unknown command event type. */

src/com/dmdirc/config/prefs/PreferencesManager.java → src/com/dmdirc/config/prefs/PreferencesDialogModel.java Näytä tiedosto

@@ -42,7 +42,7 @@ import java.util.Map;
42 42
  *
43 43
  * @author chris
44 44
  */
45
-public class PreferencesManager {
45
+public class PreferencesDialogModel {
46 46
 
47 47
     /** The UI controller to use for custom categories. */
48 48
     private final UIController controller;
@@ -55,12 +55,12 @@ public class PreferencesManager {
55 55
     private final ListenerList listeners = new ListenerList();
56 56
 
57 57
     /**
58
-     * Creates a new instance of PreferencesManager.
58
+     * Creates a new instance of PreferencesDialogModel.
59 59
      *
60 60
      * @param controller The UI controller to use to retrieve custom UIs for
61 61
      * preferences panels.
62 62
      */
63
-    public PreferencesManager(final UIController controller) {
63
+    public PreferencesDialogModel(final UIController controller) {
64 64
         this.controller = controller;
65 65
 
66 66
         addDefaultCategories();

+ 2
- 2
src/com/dmdirc/plugins/Plugin.java Näytä tiedosto

@@ -22,7 +22,7 @@
22 22
 
23 23
 package com.dmdirc.plugins;
24 24
 
25
-import com.dmdirc.config.prefs.PreferencesManager;
25
+import com.dmdirc.config.prefs.PreferencesDialogModel;
26 26
 import com.dmdirc.util.validators.ValidationResponse;
27 27
 import java.io.File;
28 28
 
@@ -154,7 +154,7 @@ public abstract class Plugin implements Comparable<Plugin> {
154 154
      * @param manager The preferences manager that configuration options
155 155
      * need to be added to.
156 156
      */
157
-    public void showConfig(final PreferencesManager manager) {
157
+    public void showConfig(final PreferencesDialogModel manager) {
158 158
     }
159 159
 
160 160
     /**

+ 2
- 2
src/com/dmdirc/plugins/PluginManager.java Näytä tiedosto

@@ -27,7 +27,7 @@ import com.dmdirc.actions.ActionManager;
27 27
 import com.dmdirc.actions.CoreActionType;
28 28
 import com.dmdirc.actions.interfaces.ActionType;
29 29
 import com.dmdirc.config.IdentityManager;
30
-import com.dmdirc.config.prefs.PreferencesManager;
30
+import com.dmdirc.config.prefs.PreferencesDialogModel;
31 31
 import com.dmdirc.interfaces.ActionListener;
32 32
 import com.dmdirc.logger.ErrorLevel;
33 33
 import com.dmdirc.logger.Logger;
@@ -488,7 +488,7 @@ public class PluginManager implements ActionListener {
488 488
                 }
489 489
                 if (pi.isLoaded() || pi.isTempLoaded()) {
490 490
                     try {
491
-                        pi.getPlugin().showConfig((PreferencesManager) arguments[0]);
491
+                        pi.getPlugin().showConfig((PreferencesDialogModel) arguments[0]);
492 492
                     } catch (LinkageError le) {
493 493
                         Logger.userError(ErrorLevel.MEDIUM, "Error with plugin (" + pi.getNiceName() + "), unable to show config (" + le + ")", le);
494 494
                     } catch (Exception ex) {

+ 9
- 9
test/com/dmdirc/config/prefs/PreferencesManagerTest.java Näytä tiedosto

@@ -50,7 +50,7 @@ public class PreferencesManagerTest {
50 50
 
51 51
     @Test
52 52
     public void testDefaults() {
53
-        final PreferencesManager pm = new PreferencesManager(controller);
53
+        final PreferencesDialogModel pm = new PreferencesDialogModel(controller);
54 54
         assertNotNull(pm.getCategory("General"));
55 55
         assertNotNull(pm.getCategory("Connection"));
56 56
         assertNotNull(pm.getCategory("Messages"));
@@ -64,7 +64,7 @@ public class PreferencesManagerTest {
64 64
     @Test
65 65
     public void testDismiss() {
66 66
         final PreferencesCategory category = mock(PreferencesCategory.class);
67
-        final PreferencesManager pm = new PreferencesManager(controller);
67
+        final PreferencesDialogModel pm = new PreferencesDialogModel(controller);
68 68
         pm.addCategory(category);
69 69
         pm.dismiss();
70 70
 
@@ -76,7 +76,7 @@ public class PreferencesManagerTest {
76 76
         final PreferencesCategory category = mock(PreferencesCategory.class);
77 77
         when(category.save()).thenReturn(false);
78 78
 
79
-        final PreferencesManager pm = new PreferencesManager(controller);
79
+        final PreferencesDialogModel pm = new PreferencesDialogModel(controller);
80 80
         pm.addCategory(category);
81 81
         assertFalse(pm.save());
82 82
 
@@ -88,7 +88,7 @@ public class PreferencesManagerTest {
88 88
         final PreferencesCategory category = mock(PreferencesCategory.class);
89 89
         when(category.save()).thenReturn(true);
90 90
 
91
-        final PreferencesManager pm = new PreferencesManager(controller);
91
+        final PreferencesDialogModel pm = new PreferencesDialogModel(controller);
92 92
         pm.addCategory(category);
93 93
         assertTrue(pm.save());
94 94
 
@@ -97,13 +97,13 @@ public class PreferencesManagerTest {
97 97
 
98 98
     @Test
99 99
     public void testGetCategory() {
100
-        final PreferencesManager pm = new PreferencesManager(controller);
100
+        final PreferencesDialogModel pm = new PreferencesDialogModel(controller);
101 101
         assertNull(pm.getCategory("unittest123"));
102 102
     }
103 103
 
104 104
     @Test
105 105
     public void testGetCategories() {
106
-        final PreferencesManager pm = new PreferencesManager(controller);
106
+        final PreferencesDialogModel pm = new PreferencesDialogModel(controller);
107 107
         assertNotNull(pm.getCategories());
108 108
         assertFalse(pm.getCategories().isEmpty());
109 109
 
@@ -114,7 +114,7 @@ public class PreferencesManagerTest {
114 114
 
115 115
     @Test
116 116
     public void testSaveListener() {
117
-        final PreferencesManager pm = new PreferencesManager(controller);
117
+        final PreferencesDialogModel pm = new PreferencesDialogModel(controller);
118 118
         final PreferencesInterface tpi = mock(PreferencesInterface.class);
119 119
 
120 120
         pm.registerSaveListener(tpi);
@@ -129,7 +129,7 @@ public class PreferencesManagerTest {
129 129
         ActionManager.init();
130 130
         ActionManager.addListener(tal, CoreActionType.CLIENT_PREFS_OPENED);
131 131
 
132
-        final PreferencesManager pm = new PreferencesManager(controller);
132
+        final PreferencesDialogModel pm = new PreferencesDialogModel(controller);
133 133
 
134 134
         verify(tal).processEvent(eq(CoreActionType.CLIENT_PREFS_OPENED),
135 135
                 (StringBuffer) same(null), same(pm));
@@ -142,7 +142,7 @@ public class PreferencesManagerTest {
142 142
         ActionManager.init();
143 143
         ActionManager.addListener(tal, CoreActionType.CLIENT_PREFS_CLOSED);
144 144
 
145
-        final PreferencesManager pm = new PreferencesManager(controller);
145
+        final PreferencesDialogModel pm = new PreferencesDialogModel(controller);
146 146
         pm.close();
147 147
 
148 148
         verify(tal).processEvent(eq(CoreActionType.CLIENT_PREFS_CLOSED),

Loading…
Peruuta
Tallenna