|
@@ -31,6 +31,7 @@ import com.dmdirc.addons.ui_swing.UIUtilities;
|
31
|
31
|
import com.dmdirc.addons.ui_swing.actions.InputFieldCopyAction;
|
32
|
32
|
import com.dmdirc.addons.ui_swing.actions.SearchAction;
|
33
|
33
|
import com.dmdirc.addons.ui_swing.components.SwingSearchBar;
|
|
34
|
+import com.dmdirc.addons.ui_swing.components.SwingSearchBarFactory;
|
34
|
35
|
import com.dmdirc.addons.ui_swing.dialogs.paste.PasteDialogFactory;
|
35
|
36
|
import com.dmdirc.addons.ui_swing.events.SwingActiveWindowChangeRequestEvent;
|
36
|
37
|
import com.dmdirc.addons.ui_swing.events.SwingEventBus;
|
|
@@ -120,8 +121,6 @@ public abstract class TextFrame extends JPanel implements Window, TextPaneListen
|
120
|
121
|
private DesktopWindowFrame popoutFrame;
|
121
|
122
|
/** Desktop place holder object used if this frame is popped out. */
|
122
|
123
|
private DesktopPlaceHolderFrame popoutPlaceholder;
|
123
|
|
- /** Icon manager to retrieve icons from. */
|
124
|
|
- private final IconManager iconManager;
|
125
|
124
|
|
126
|
125
|
/**
|
127
|
126
|
* Creates a new instance of Frame.
|
|
@@ -137,13 +136,12 @@ public abstract class TextFrame extends JPanel implements Window, TextPaneListen
|
137
|
136
|
this.swingEventBus = deps.swingEventBus;
|
138
|
137
|
this.popupManager = deps.popupManager;
|
139
|
138
|
this.frameParent = owner;
|
140
|
|
- this.iconManager = deps.iconManager;
|
141
|
139
|
this.eventBus = deps.eventBus;
|
142
|
140
|
this.commandParser = commandParser;
|
143
|
141
|
this.clipboard = deps.clipboard;
|
144
|
142
|
this.colourManager = deps.colourManagerFactory.getColourManager(owner.getConfigManager());
|
145
|
143
|
|
146
|
|
- initComponents(deps.textPaneFactory, colourManager);
|
|
144
|
+ initComponents(deps.textPaneFactory, deps.searchBarFactory);
|
147
|
145
|
setFocusable(true);
|
148
|
146
|
setLayout(new MigLayout("fill"));
|
149
|
147
|
}
|
|
@@ -224,10 +222,10 @@ public abstract class TextFrame extends JPanel implements Window, TextPaneListen
|
224
|
222
|
* Initialises the components for this frame.
|
225
|
223
|
*/
|
226
|
224
|
private void initComponents(final TextPaneFactory textPaneFactory,
|
227
|
|
- final ColourManager colourManager) {
|
|
225
|
+ final SwingSearchBarFactory searchBarFactory) {
|
228
|
226
|
setTextPane(textPaneFactory.getTextPane(this));
|
229
|
227
|
|
230
|
|
- searchBar = new SwingSearchBar(this, iconManager, colourManager);
|
|
228
|
+ searchBar = searchBarFactory.create(this);
|
231
|
229
|
searchBar.setVisible(false);
|
232
|
230
|
|
233
|
231
|
getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).
|
|
@@ -535,6 +533,7 @@ public abstract class TextFrame extends JPanel implements Window, TextPaneListen
|
535
|
533
|
final ColourManagerFactory colourManagerFactory;
|
536
|
534
|
final SwingEventBus swingEventBus;
|
537
|
535
|
final TabCompleterUtils tabCompleterUtils;
|
|
536
|
+ final SwingSearchBarFactory searchBarFactory;
|
538
|
537
|
|
539
|
538
|
@Inject
|
540
|
539
|
public TextFrameDependencies(
|
|
@@ -552,7 +551,8 @@ public abstract class TextFrame extends JPanel implements Window, TextPaneListen
|
552
|
551
|
final CommandController commandController,
|
553
|
552
|
final ColourManagerFactory colourManagerFactory,
|
554
|
553
|
final SwingEventBus swingEventBus,
|
555
|
|
- final TabCompleterUtils tabCompleterUtils) {
|
|
554
|
+ final TabCompleterUtils tabCompleterUtils,
|
|
555
|
+ final SwingSearchBarFactory searchBarFactory) {
|
556
|
556
|
this.textPaneFactory = textPaneFactory;
|
557
|
557
|
this.controller = controller;
|
558
|
558
|
this.mainWindow = mainWindow;
|
|
@@ -568,6 +568,7 @@ public abstract class TextFrame extends JPanel implements Window, TextPaneListen
|
568
|
568
|
this.colourManagerFactory = colourManagerFactory;
|
569
|
569
|
this.swingEventBus = swingEventBus;
|
570
|
570
|
this.tabCompleterUtils = tabCompleterUtils;
|
|
571
|
+ this.searchBarFactory = searchBarFactory;
|
571
|
572
|
}
|
572
|
573
|
|
573
|
574
|
}
|