Procházet zdrojové kódy

Fix fallout from the title change

Change-Id: I89bd5b3c39bd5e8edc6550f8f6dd04eadfa2b8b3
Reviewed-on: http://gerrit.dmdirc.com/1119
Automatic-Compile: Gregory Holmes <greg@dmdirc.com>
Reviewed-by: Gregory Holmes <greg@dmdirc.com>
tags/0.6.4
Chris Smith před 14 roky
rodič
revize
d7eb1e57ae

+ 1
- 1
src/com/dmdirc/addons/dcc/DCCChatWindow.java Zobrazit soubor

@@ -62,7 +62,7 @@ public class DCCChatWindow extends DCCFrame implements DCCChatHandler {
62 62
         myWindow = Main.getUI().getInputWindow(this, DCCCommandParser.getDCCCommandParser());
63 63
         plugin.addWindow(this);
64 64
 
65
-        myWindow.setTitle(title);
65
+        setTitle(title);
66 66
         myWindow.open();
67 67
     }
68 68
 

+ 2
- 2
src/com/dmdirc/addons/dcc/DCCFrame.java Zobrazit soubor

@@ -138,7 +138,7 @@ public abstract class DCCFrame extends WritableFrameContainer {
138 138
      * @param icon The icon to use
139 139
      */
140 140
     public DCCFrame(final DCCPlugin plugin, final String title, final String icon, final boolean defaultWindow) {
141
-        super(icon, title, IdentityManager.getGlobalConfig());
141
+        super(icon, title, title, IdentityManager.getGlobalConfig());
142 142
         this.plugin = plugin;
143 143
 
144 144
         if (defaultWindow) {
@@ -148,7 +148,7 @@ public abstract class DCCFrame extends WritableFrameContainer {
148 148
                 @Override
149 149
                 public void run() {
150 150
                     final EmptyFrame frame = new EmptyFrame(DCCFrame.this);
151
-                    frame.setTitle(title);
151
+                    setTitle(title);
152 152
                     setObject(frame);
153 153
                 }
154 154
 

+ 2
- 2
src/com/dmdirc/addons/dcc/DCCTransferWindow.java Zobrazit soubor

@@ -292,8 +292,8 @@ public class DCCTransferWindow extends DCCFrame implements DCCTransferHandler,
292 292
             title.append(dcc.getType() == DCCTransfer.TransferType.SEND ? "Sending: " : "Recieving: ");
293 293
             title.append(otherNickname);
294 294
             title.append(" ("+ String.format("%.0f", Math.floor(percent)) +"%)");
295
-            this.setName(title.toString());
296
-            this.getFrame().setTitle(title.toString());
295
+            setName(title.toString());
296
+            setTitle(title.toString());
297 297
         }
298 298
 
299 299
         updateSpeedAndTime();

+ 1
- 2
src/com/dmdirc/addons/logging/HistoryWindow.java Zobrazit soubor

@@ -52,14 +52,13 @@ public class HistoryWindow extends FrameContainer {
52 52
      */
53 53
     public HistoryWindow(final String title, final ReverseFileReader reader,
54 54
                          final Window parent, final int numLines) {
55
-        super("raw", title, parent.getConfigManager());
55
+        super("raw", title, title, parent.getConfigManager());
56 56
 
57 57
         this.parent = parent;
58 58
 
59 59
         window = Main.getUI().getWindow(this);
60 60
 
61 61
         WindowManager.addWindow(parent, window);
62
-        window.setTitle(title);
63 62
         window.open();
64 63
         final int frameBufferSize = IdentityManager.getGlobalConfig().getOptionInt(
65 64
                 "ui", "frameBufferSize");

+ 0
- 2
src/com/dmdirc/addons/ui_swing/components/frames/CustomFrame.java Zobrazit soubor

@@ -59,8 +59,6 @@ public class CustomFrame extends TextFrame {
59 59
      * Initialises components in this frame.
60 60
      */
61 61
     private void initComponents() {
62
-        setTitle("Custom Frame");
63
-
64 62
         getContentPane().setLayout(new MigLayout("ins 0, fill, hidemode 3, wrap 1"));
65 63
         getContentPane().add(getTextPane(), "grow, push");
66 64
         getContentPane().add(getSearchBar(), "growx, pushx");

+ 0
- 2
src/com/dmdirc/addons/ui_swing/components/frames/CustomInputFrame.java Zobrazit soubor

@@ -76,8 +76,6 @@ public class CustomInputFrame extends InputTextFrame {
76 76
      * Initialises components in this frame.
77 77
      */
78 78
     private void initComponents() {
79
-        setTitle("Custom Input Frame");
80
-
81 79
         getContentPane().setLayout(new MigLayout("ins 0, fill, hidemode 3, wrap 1"));
82 80
         getContentPane().add(getTextPane(), "grow, push");
83 81
         getContentPane().add(getSearchBar(), "growx, pushx");

+ 0
- 2
src/com/dmdirc/addons/ui_swing/components/frames/QueryFrame.java Zobrazit soubor

@@ -77,8 +77,6 @@ public final class QueryFrame extends InputTextFrame implements QueryWindow {
77 77
      * Initialises components in this frame.
78 78
      */
79 79
     private void initComponents() {
80
-        setTitle("Query Frame");
81
-
82 80
         getContentPane().setLayout(new MigLayout("ins 0, fill, hidemode 3, wrap 1"));
83 81
         getContentPane().add(getTextPane(), "grow, push");
84 82
         getContentPane().add(getSearchBar(), "growx, pushx");

+ 0
- 2
src/com/dmdirc/addons/ui_swing/components/frames/ServerFrame.java Zobrazit soubor

@@ -89,8 +89,6 @@ public final class ServerFrame extends InputTextFrame implements ServerWindow,
89 89
         settingsMI = new JMenuItem("Settings");
90 90
         settingsMI.addActionListener(this);
91 91
 
92
-        setTitle("Server Frame");
93
-
94 92
         getContentPane().setLayout(new MigLayout("ins 0, fill, hidemode 3, wrap 1"));
95 93
         getContentPane().add(getTextPane(), "grow, push");
96 94
         getContentPane().add(getSearchBar(), "growx, pushx");

+ 20
- 7
src/com/dmdirc/addons/ui_swing/components/frames/TextFrame.java Zobrazit soubor

@@ -57,7 +57,6 @@ import com.dmdirc.logger.ErrorLevel;
57 57
 import com.dmdirc.logger.Logger;
58 58
 import com.dmdirc.parser.common.ChannelJoinRequest;
59 59
 import com.dmdirc.ui.IconManager;
60
-import com.dmdirc.ui.WindowManager;
61 60
 import com.dmdirc.ui.core.util.URLHandler;
62 61
 import com.dmdirc.ui.interfaces.InputWindow;
63 62
 import com.dmdirc.ui.interfaces.Window;
@@ -147,6 +146,7 @@ public abstract class TextFrame extends JInternalFrame implements Window,
147 146
         final ConfigManager config = owner.getConfigManager();
148 147
 
149 148
         setFrameIcon(IconManager.getIconManager().getIcon(owner.getIcon()));
149
+        setTitle(frameParent.getTitle());
150 150
 
151 151
         owner.addFrameInfoListener(this);
152 152
 
@@ -163,7 +163,7 @@ public abstract class TextFrame extends JInternalFrame implements Window,
163 163
 
164 164
         inputWindow = this;
165 165
         while (!(inputWindow instanceof InputWindow) && inputWindow != null) {
166
-            inputWindow = WindowManager.getParent(inputWindow.getContainer()).getFrame();
166
+            inputWindow = inputWindow.getContainer().getParent().getFrame();
167 167
         }
168 168
 
169 169
         initComponents();
@@ -212,6 +212,7 @@ public abstract class TextFrame extends JInternalFrame implements Window,
212 212
 
213 213
     /** {@inheritDoc} */
214 214
     @Override
215
+    @Deprecated
215 216
     public void setTitle(final String title) {
216 217
         UIUtilities.invokeLater(new Runnable() {
217 218
 
@@ -738,12 +739,9 @@ public abstract class TextFrame extends JInternalFrame implements Window,
738 739
         return textPane;
739 740
     }
740 741
 
741
-    /**
742
-     * Returns the transcoder for this frame.
743
-     *
744
-     * @return String transcoder for this frame
745
-     */
742
+    /** {@inheritDoc} */
746 743
     @Override
744
+    @Deprecated
747 745
     public StringTranscoder getTranscoder() {
748 746
         return transcoder;
749 747
     }
@@ -1001,4 +999,19 @@ public abstract class TextFrame extends JInternalFrame implements Window,
1001 999
     public void nameChanged(final FrameContainer window, final String name) {
1002 1000
         //Ignore
1003 1001
     }
1002
+
1003
+    /** {@inheritDoc} */
1004
+    @Override
1005
+    public void titleChanged(final FrameContainer window, final String title) {
1006
+        UIUtilities.invokeLater(new Runnable() {
1007
+
1008
+            /** {@inheritDoc} */
1009
+            @Override
1010
+            public void run() {
1011
+                // TODO: Can be changed back to setTitle once the deprecated
1012
+                // method is removed
1013
+                TextFrame.super.setTitle(title);
1014
+            }
1015
+        });
1016
+    }
1004 1017
 }

+ 6
- 1
src/com/dmdirc/addons/ui_swing/framemanager/buttonbar/ButtonBar.java Zobrazit soubor

@@ -318,10 +318,15 @@ public final class ButtonBar implements FrameManager, ActionListener,
318 318
         buttons.get(window).setIcon(IconManager.getIconManager().getIcon(icon));
319 319
     }
320 320
 
321
-
322 321
     /** {@inheritDoc} */
323 322
     @Override
324 323
     public void nameChanged(final FrameContainer window, final String name) {
325 324
         buttons.get(window).setText(name);
326 325
     }
326
+
327
+    /** {@inheritDoc} */
328
+    @Override
329
+    public void titleChanged(final FrameContainer window, final String title) {
330
+        // Do nothing
331
+    }
327 332
 }

+ 6
- 0
src/com/dmdirc/addons/ui_swing/framemanager/tree/NodeLabel.java Zobrazit soubor

@@ -134,6 +134,12 @@ public class NodeLabel extends JLabel implements SelectionListener,
134 134
         }
135 135
     }
136 136
 
137
+    /** {@inheritDoc} */
138
+    @Override
139
+    public void titleChanged(final FrameContainer window, final String title) {
140
+        // Do nothing
141
+    }
142
+
137 143
     /** 
138 144
      * Sets the rollover state for the node.
139 145
      * 

+ 6
- 0
src/com/dmdirc/addons/ui_swing/framemanager/tree/TreeFrameManager.java Zobrazit soubor

@@ -417,4 +417,10 @@ public final class TreeFrameManager implements FrameManager,
417 417
             }
418 418
         });
419 419
     }
420
+
421
+    /** {@inheritDoc} */
422
+    @Override
423
+    public void titleChanged(final FrameContainer window, final String title) {
424
+        // Do nothing
425
+    }
420 426
 }

+ 6
- 0
src/com/dmdirc/addons/ui_swing/framemanager/windowmenu/FrameContainerMenu.java Zobrazit soubor

@@ -99,6 +99,12 @@ public class FrameContainerMenu extends JMenu implements FrameInfoListener,
99 99
         });
100 100
     }
101 101
 
102
+    /** {@inheritDoc} */
103
+    @Override
104
+    public void titleChanged(final FrameContainer window, final String title) {
105
+        // Do nothing
106
+    }
107
+
102 108
     /**
103 109
      * {@inheritDoc}
104 110
      *

+ 6
- 0
src/com/dmdirc/addons/ui_swing/framemanager/windowmenu/FrameContainerMenuItem.java Zobrazit soubor

@@ -100,6 +100,12 @@ public class FrameContainerMenuItem extends JMenuItem implements FrameInfoListen
100 100
         });
101 101
     }
102 102
 
103
+    /** {@inheritDoc} */
104
+    @Override
105
+    public void titleChanged(final FrameContainer window, final String title) {
106
+        // Do nothing
107
+    }
108
+
103 109
     /** 
104 110
      * {@inheritDoc}
105 111
      * 

+ 3
- 4
test/com/dmdirc/addons/ui_swing/components/frames/InputTextFrameTest.java Zobrazit soubor

@@ -89,7 +89,7 @@ public class InputTextFrameTest {
89 89
     public void tearDown() {
90 90
         window.close();
91 91
         owner.window.close();
92
-        WindowManager.removeWindow(owner.window);
92
+        WindowManager.removeWindow(owner);
93 93
     }
94 94
 
95 95
     @Test
@@ -152,11 +152,10 @@ public class InputTextFrameTest {
152 152
         final CustomInputFrame titf = new CustomInputFrame(owner,
153 153
                 GlobalCommandParser.getGlobalCommandParser(), controller);
154 154
 
155
-        titf.setTitle("testing123");
156
-
155
+        owner.setTitle("testing123");
157 156
         owner.window = titf;
158 157
 
159
-        WindowManager.addWindow(titf);
158
+        WindowManager.addWindow(owner);
160 159
 
161 160
         titf.open();
162 161
 

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