選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

TextFrame.java 22KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604
  1. /*
  2. * Copyright (c) 2006-2014 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. package com.dmdirc.addons.ui_swing.components.frames;
  23. import com.dmdirc.ClientModule.GlobalConfig;
  24. import com.dmdirc.DMDircMBassador;
  25. import com.dmdirc.FrameContainer;
  26. import com.dmdirc.addons.ui_swing.EdtHandlerInvocation;
  27. import com.dmdirc.addons.ui_swing.SwingController;
  28. import com.dmdirc.addons.ui_swing.UIUtilities;
  29. import com.dmdirc.addons.ui_swing.actions.InputFieldCopyAction;
  30. import com.dmdirc.addons.ui_swing.actions.SearchAction;
  31. import com.dmdirc.addons.ui_swing.components.SwingSearchBar;
  32. import com.dmdirc.addons.ui_swing.dialogs.paste.PasteDialogFactory;
  33. import com.dmdirc.addons.ui_swing.events.SwingActiveWindowChangeRequestEvent;
  34. import com.dmdirc.addons.ui_swing.events.SwingEventBus;
  35. import com.dmdirc.addons.ui_swing.injection.MainWindow;
  36. import com.dmdirc.addons.ui_swing.interfaces.ActiveFrameManager;
  37. import com.dmdirc.addons.ui_swing.textpane.ClickTypeValue;
  38. import com.dmdirc.addons.ui_swing.textpane.MouseEventType;
  39. import com.dmdirc.addons.ui_swing.textpane.TextPane;
  40. import com.dmdirc.addons.ui_swing.textpane.TextPaneControlCodeCopyAction;
  41. import com.dmdirc.addons.ui_swing.textpane.TextPaneCopyAction;
  42. import com.dmdirc.addons.ui_swing.textpane.TextPaneEndAction;
  43. import com.dmdirc.addons.ui_swing.textpane.TextPaneFactory;
  44. import com.dmdirc.addons.ui_swing.textpane.TextPaneHomeAction;
  45. import com.dmdirc.addons.ui_swing.textpane.TextPaneListener;
  46. import com.dmdirc.addons.ui_swing.textpane.TextPanePageDownAction;
  47. import com.dmdirc.addons.ui_swing.textpane.TextPanePageUpAction;
  48. import com.dmdirc.commandparser.PopupManager;
  49. import com.dmdirc.commandparser.PopupMenu;
  50. import com.dmdirc.commandparser.PopupMenuItem;
  51. import com.dmdirc.commandparser.PopupType;
  52. import com.dmdirc.commandparser.parsers.CommandParser;
  53. import com.dmdirc.events.FrameClosingEvent;
  54. import com.dmdirc.events.LinkChannelClickedEvent;
  55. import com.dmdirc.events.LinkNicknameClickedEvent;
  56. import com.dmdirc.events.LinkUrlClickedEvent;
  57. import com.dmdirc.interfaces.CommandController;
  58. import com.dmdirc.interfaces.config.AggregateConfigProvider;
  59. import com.dmdirc.interfaces.config.ConfigChangeListener;
  60. import com.dmdirc.plugins.PluginManager;
  61. import com.dmdirc.ui.IconManager;
  62. import com.dmdirc.ui.input.TabCompleterUtils;
  63. import com.dmdirc.ui.messages.ColourManager;
  64. import com.dmdirc.ui.messages.ColourManagerFactory;
  65. import java.awt.Point;
  66. import java.awt.Window;
  67. import java.awt.datatransfer.Clipboard;
  68. import java.awt.event.KeyEvent;
  69. import java.awt.event.MouseEvent;
  70. import java.awt.event.WindowAdapter;
  71. import java.awt.event.WindowEvent;
  72. import java.util.Optional;
  73. import javax.inject.Inject;
  74. import javax.inject.Provider;
  75. import javax.swing.JComponent;
  76. import javax.swing.JMenu;
  77. import javax.swing.JMenuItem;
  78. import javax.swing.JPanel;
  79. import javax.swing.JPopupMenu;
  80. import javax.swing.JSeparator;
  81. import javax.swing.KeyStroke;
  82. import javax.swing.SwingUtilities;
  83. import net.miginfocom.swing.MigLayout;
  84. import net.engio.mbassy.listener.Handler;
  85. /**
  86. * Implements a generic (internal) frame.
  87. */
  88. public abstract class TextFrame extends JPanel implements com.dmdirc.interfaces.ui.Window,
  89. ConfigChangeListener, TextPaneListener {
  90. /** A version number for this class. */
  91. private static final long serialVersionUID = 5;
  92. /** The channel object that owns this frame. */
  93. protected final FrameContainer frameParent;
  94. /** Colour manager. */
  95. protected final ColourManager colourManager;
  96. /** Frame output pane. */
  97. private TextPane textPane;
  98. /** search bar. */
  99. private SwingSearchBar searchBar;
  100. /** Command parser for popup commands. */
  101. private final CommandParser commandParser;
  102. /** Swing event bus to post events to. */
  103. private final SwingEventBus swingEventBus;
  104. /** Manager to use for building popups. */
  105. private final PopupManager popupManager;
  106. /** Bus to despatch events on. */
  107. private final DMDircMBassador eventBus;
  108. /** Clipboard to copy and paste from. */
  109. private final Clipboard clipboard;
  110. /** Boolean to determine if this frame should be popped out of main client. */
  111. private boolean popout;
  112. /** DesktopWindowFrame to use for this TextFrame if it is to be popped out of the client. */
  113. private DesktopWindowFrame popoutFrame;
  114. /** Desktop place holder object used if this frame is popped out. */
  115. private DesktopPlaceHolderFrame popoutPlaceholder;
  116. /** Icon manager to retrieve icons from. */
  117. private final IconManager iconManager;
  118. /**
  119. * Creates a new instance of Frame.
  120. *
  121. * @param owner FrameContainer owning this frame.
  122. * @param commandParser The command parser to use for this frame.
  123. * @param deps Collection of TextPane dependencies.
  124. */
  125. protected TextFrame(
  126. final FrameContainer owner,
  127. final CommandParser commandParser,
  128. final TextFrameDependencies deps) {
  129. this.swingEventBus = deps.swingEventBus;
  130. this.popupManager = deps.popupManager;
  131. this.frameParent = owner;
  132. this.iconManager = deps.iconManager;
  133. this.eventBus = deps.eventBus;
  134. this.commandParser = commandParser;
  135. this.clipboard = deps.clipboard;
  136. this.colourManager = deps.colourManagerFactory.getColourManager(owner.getConfigManager());
  137. final AggregateConfigProvider config = owner.getConfigManager();
  138. initComponents(deps.textPaneFactory, colourManager);
  139. setFocusable(true);
  140. getTextPane().addTextPaneListener(this);
  141. config.addChangeListener("ui", "foregroundcolour", this);
  142. config.addChangeListener("ui", "backgroundcolour", this);
  143. config.addChangeListener("ui", "frameBufferSize", this);
  144. updateColours();
  145. setLayout(new MigLayout("fill"));
  146. }
  147. /**
  148. * Determines if this frame should be popped out of the client or not. Once this is set to true
  149. * it will pop out of the client as a free floating Desktop window.
  150. *
  151. * If this is set to false then the desktop window for this frame is disposed of and this frame
  152. * is returned to the client.
  153. *
  154. * @param popout Should this frame pop out?
  155. */
  156. public void setPopout(final boolean popout) {
  157. this.popout = popout;
  158. if (popout) {
  159. popoutPlaceholder = new DesktopPlaceHolderFrame();
  160. popoutFrame = new DesktopWindowFrame(this);
  161. eventBus.subscribe(popoutFrame);
  162. popoutFrame.addWindowListener(new WindowAdapter() {
  163. @Override
  164. public void windowClosing(final WindowEvent e) {
  165. setPopout(false);
  166. }
  167. });
  168. popoutFrame.display();
  169. } else if (popoutFrame != null) {
  170. popoutPlaceholder = null;
  171. popoutFrame.dispose();
  172. eventBus.unsubscribe(popoutFrame);
  173. popoutFrame = null;
  174. // TODO: This is a horrible hack really.
  175. swingEventBus.publishAsync(new SwingActiveWindowChangeRequestEvent(Optional.of(this)));
  176. }
  177. }
  178. /**
  179. * Returns the frame for the free floating desktop window associated with this TextFrame. If one
  180. * does not exist then null is returned.
  181. *
  182. * @return Desktop window frame or null if does not exist
  183. */
  184. public DesktopWindowFrame getPopoutFrame() {
  185. return popoutFrame;
  186. }
  187. /**
  188. * Checks if this frame should be popped out of the client or not. Returns our place holder
  189. * frame if it is to be used or this TextFrame if it is not to be popped out.
  190. *
  191. * @return JPanel to use by the client in the window pane
  192. */
  193. public JPanel getDisplayFrame() {
  194. if (popout) {
  195. return popoutPlaceholder;
  196. } else {
  197. return this;
  198. }
  199. }
  200. /**
  201. * Called when the frame has been selected in the UI.
  202. */
  203. public void activateFrame() {
  204. UIUtilities.invokeLater(frameParent::clearNotification);
  205. }
  206. /**
  207. * Initialises the components for this frame.
  208. */
  209. private void initComponents(final TextPaneFactory textPaneFactory,
  210. final ColourManager colourManager) {
  211. setTextPane(textPaneFactory.getTextPane(this));
  212. searchBar = new SwingSearchBar(this, iconManager, colourManager);
  213. searchBar.setVisible(false);
  214. getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).
  215. put(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, 0),
  216. "pageUpAction");
  217. getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).
  218. put(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0),
  219. "pageDownAction");
  220. getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).
  221. put(KeyStroke.getKeyStroke(KeyEvent.VK_F3, 0), "searchAction");
  222. getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).
  223. put(KeyStroke.getKeyStroke(KeyEvent.VK_F,
  224. UIUtilities.getCtrlDownMask()), "searchAction");
  225. getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).
  226. put(KeyStroke.getKeyStroke(KeyEvent.VK_HOME,
  227. UIUtilities.getCtrlDownMask()), "homeAction");
  228. getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).
  229. put(KeyStroke.getKeyStroke(KeyEvent.VK_END,
  230. UIUtilities.getCtrlDownMask()), "endAction");
  231. getSearchBar().getTextField().getInputMap().put(KeyStroke.getKeyStroke(
  232. KeyEvent.VK_C, UIUtilities.getCtrlMask()), "textpaneCopy");
  233. getSearchBar().getTextField().getInputMap().put(KeyStroke.getKeyStroke(
  234. KeyEvent.VK_C, UIUtilities.getCtrlMask()
  235. & KeyEvent.SHIFT_DOWN_MASK), "textpaneCopy");
  236. getSearchBar().getTextField().getActionMap().put("textpaneCopy",
  237. new InputFieldCopyAction(getTextPane(),
  238. getSearchBar().getTextField()));
  239. getActionMap().put("pageUpAction",
  240. new TextPanePageUpAction(getTextPane()));
  241. getActionMap().put("pageDownAction",
  242. new TextPanePageDownAction(getTextPane()));
  243. getActionMap().put("searchAction", new SearchAction(searchBar));
  244. getActionMap().put("homeAction", new TextPaneHomeAction(getTextPane()));
  245. getActionMap().put("endAction", new TextPaneEndAction(getTextPane()));
  246. }
  247. @Override
  248. public FrameContainer getContainer() {
  249. return frameParent;
  250. }
  251. /**
  252. * Returns the text pane for this frame.
  253. *
  254. * @return Text pane for this frame
  255. */
  256. public final TextPane getTextPane() {
  257. return textPane;
  258. }
  259. @Override
  260. public final String getName() {
  261. if (frameParent == null) {
  262. return "";
  263. }
  264. return frameParent.getName();
  265. }
  266. /**
  267. * Sets the frames text pane.
  268. *
  269. * @param newTextPane new text pane to use
  270. */
  271. protected final void setTextPane(final TextPane newTextPane) {
  272. textPane = newTextPane;
  273. }
  274. @Override
  275. public void mouseClicked(final ClickTypeValue clicktype,
  276. final MouseEventType eventType, final MouseEvent event) {
  277. if (event.isPopupTrigger()) {
  278. showPopupMenuInternal(clicktype, event.getPoint());
  279. }
  280. if (eventType == MouseEventType.CLICK && event.getButton() == MouseEvent.BUTTON1) {
  281. switch (clicktype.getType()) {
  282. case CHANNEL:
  283. eventBus.publishAsync(new LinkChannelClickedEvent(this, clicktype.getValue()));
  284. break;
  285. case NICKNAME:
  286. eventBus.publishAsync(new LinkNicknameClickedEvent(this, clicktype.getValue()));
  287. break;
  288. case HYPERLINK:
  289. eventBus.publishAsync(new LinkUrlClickedEvent(this, clicktype.getValue()));
  290. break;
  291. case NORMAL:
  292. //Ignore normal clicks
  293. break;
  294. }
  295. }
  296. }
  297. /**
  298. * What popup type should be used for popup menus for nicknames.
  299. *
  300. * @return Appropriate popuptype for this frame
  301. */
  302. public abstract PopupType getNicknamePopupType();
  303. /**
  304. * What popup type should be used for popup menus for channels.
  305. *
  306. * @return Appropriate popuptype for this frame
  307. */
  308. public abstract PopupType getChannelPopupType();
  309. /**
  310. * What popup type should be used for popup menus for hyperlinks.
  311. *
  312. * @return Appropriate popuptype for this frame
  313. */
  314. public abstract PopupType getHyperlinkPopupType();
  315. /**
  316. * What popup type should be used for popup menus for normal clicks.
  317. *
  318. * @return Appropriate popuptype for this frame
  319. */
  320. public abstract PopupType getNormalPopupType();
  321. /**
  322. * A method called to add custom popup items.
  323. *
  324. * @param popupMenu Popup menu to add popup items to
  325. */
  326. public abstract void addCustomPopupItems(final JPopupMenu popupMenu);
  327. /**
  328. * Shows a popup menu at the specified point for the specified click type.
  329. *
  330. * @param type ClickType Click type
  331. * @param point Point Point of the click
  332. */
  333. private void showPopupMenuInternal(final ClickTypeValue type,
  334. final Point point) {
  335. final JPopupMenu popupMenu;
  336. final String[] parts = type.getValue().split("\n");
  337. final Object[][] arguments = new Object[parts.length][1];
  338. int i = 0;
  339. for (final String part : parts) {
  340. arguments[i++][0] = part;
  341. }
  342. switch (type.getType()) {
  343. case CHANNEL:
  344. popupMenu = getPopupMenu(getChannelPopupType(), arguments);
  345. popupMenu.add(new ChannelCopyAction(clipboard, type.getValue()));
  346. if (popupMenu.getComponentCount() > 1) {
  347. popupMenu.addSeparator();
  348. }
  349. break;
  350. case HYPERLINK:
  351. popupMenu = getPopupMenu(getHyperlinkPopupType(), arguments);
  352. popupMenu.add(new HyperlinkCopyAction(clipboard, type.getValue()));
  353. if (popupMenu.getComponentCount() > 1) {
  354. popupMenu.addSeparator();
  355. }
  356. break;
  357. case NICKNAME:
  358. popupMenu = getPopupMenu(getNicknamePopupType(), arguments);
  359. if (popupMenu.getComponentCount() > 0) {
  360. popupMenu.addSeparator();
  361. }
  362. popupMenu.add(new NicknameCopyAction(clipboard, type.getValue()));
  363. break;
  364. default:
  365. popupMenu = getPopupMenu(null, arguments);
  366. break;
  367. }
  368. popupMenu.add(new TextPaneCopyAction(getTextPane()));
  369. popupMenu.add(new TextPaneControlCodeCopyAction(textPane));
  370. addCustomPopupItems(popupMenu);
  371. popupMenu.show(this, (int) point.getX(), (int) point.getY());
  372. }
  373. /**
  374. * Shows a popup menu at the specified point for the specified click type.
  375. *
  376. * @param type ClickType Click type
  377. * @param point Point Point of the click (Must be screen coords)
  378. */
  379. public void showPopupMenu(final ClickTypeValue type,
  380. final Point point) {
  381. SwingUtilities.convertPointFromScreen(point, this);
  382. showPopupMenuInternal(type, point);
  383. }
  384. /**
  385. * Builds a popup menu of a specified type.
  386. *
  387. * @param type type of menu to build
  388. * @param arguments Arguments for the command
  389. *
  390. * @return PopupMenu
  391. */
  392. public JPopupMenu getPopupMenu(final PopupType type,
  393. final Object[][] arguments) {
  394. JPopupMenu popupMenu = new JPopupMenu();
  395. if (type != null) {
  396. popupMenu = (JPopupMenu) populatePopupMenu(popupMenu,
  397. popupManager.getMenu(type, getContainer().getConfigManager()), arguments);
  398. }
  399. return popupMenu;
  400. }
  401. /**
  402. * Populates the specified popupmenu.
  403. *
  404. * @param menu Menu component
  405. * @param popup Popup to get info from
  406. * @param arguments Arguments for the command
  407. *
  408. * @return Populated popup
  409. */
  410. private JComponent populatePopupMenu(final JComponent menu,
  411. final PopupMenu popup,
  412. final Object[][] arguments) {
  413. for (final PopupMenuItem menuItem : popup.getItems()) {
  414. if (menuItem.isDivider()) {
  415. menu.add(new JSeparator());
  416. } else if (menuItem.isSubMenu()) {
  417. menu.add(populatePopupMenu(new JMenu(menuItem.getName()),
  418. menuItem.getSubMenu(), arguments));
  419. } else {
  420. menu.add(new JMenuItem(new CommandAction(commandParser, this,
  421. menuItem.getName(), menuItem.getCommand(arguments))));
  422. }
  423. }
  424. return menu;
  425. }
  426. /**
  427. * Gets the search bar.
  428. *
  429. * @return the frames search bar
  430. */
  431. public final SwingSearchBar getSearchBar() {
  432. return searchBar;
  433. }
  434. @Override
  435. public void configChanged(final String domain, final String key) {
  436. if (getContainer().getConfigManager() == null || getTextPane() == null) {
  437. return;
  438. }
  439. if ("ui".equals(domain) && ("foregroundcolour".equals(key)
  440. || "backgroundcolour".equals(key))) {
  441. updateColours();
  442. }
  443. }
  444. @Handler(invocation = EdtHandlerInvocation.class)
  445. public void windowClosing(final FrameClosingEvent event) {
  446. if (event.getContainer().equals(getContainer())) {
  447. if (popout) {
  448. setPopout(false);
  449. }
  450. setVisible(false);
  451. getTextPane().close();
  452. }
  453. }
  454. /**
  455. * Returns the IconManager for this frame.
  456. *
  457. * @return This frame's IconManager
  458. */
  459. public IconManager getIconManager() {
  460. return getContainer().getIconManager();
  461. }
  462. /**
  463. * Updates colour settings from their config values.
  464. */
  465. private void updateColours() {
  466. getTextPane().setForeground(UIUtilities.convertColour(
  467. colourManager.getColourFromString(
  468. getContainer().getConfigManager().getOptionString(
  469. "ui", "foregroundcolour"), null)));
  470. getTextPane().setBackground(UIUtilities.convertColour(
  471. colourManager.getColourFromString(
  472. getContainer().getConfigManager().getOptionString(
  473. "ui", "backgroundcolour"), null)));
  474. }
  475. /** Disposes of this window, removing any listeners. */
  476. public void dispose() {
  477. frameParent.getConfigManager().removeListener(this);
  478. }
  479. /**
  480. * Bundle of dependencies required by {@link TextFrame}.
  481. *
  482. * <p>
  483. * Because of the number of dependencies and the amount of subclassing, collect the dependencies
  484. * together here so they can be easily modified without having to modify all subclasses.
  485. */
  486. public static class TextFrameDependencies {
  487. final TextPaneFactory textPaneFactory;
  488. final SwingController controller;
  489. final Provider<Window> mainWindow;
  490. final PopupManager popupManager;
  491. final DMDircMBassador eventBus;
  492. final AggregateConfigProvider globalConfig;
  493. final PasteDialogFactory pasteDialog;
  494. final PluginManager pluginManager;
  495. final IconManager iconManager;
  496. final ActiveFrameManager activeFrameManager;
  497. final Clipboard clipboard;
  498. final CommandController commandController;
  499. final ColourManagerFactory colourManagerFactory;
  500. final SwingEventBus swingEventBus;
  501. final TabCompleterUtils tabCompleterUtils;
  502. @Inject
  503. public TextFrameDependencies(
  504. final TextPaneFactory textPaneFactory,
  505. final SwingController controller,
  506. @MainWindow final Provider<Window> mainWindow,
  507. final PopupManager popupManager,
  508. final DMDircMBassador eventBus,
  509. final PasteDialogFactory pasteDialog,
  510. final PluginManager pluginManager,
  511. @GlobalConfig final IconManager iconManager,
  512. @GlobalConfig final AggregateConfigProvider globalConfig,
  513. final ActiveFrameManager activeFrameManager,
  514. final Clipboard clipboard,
  515. final CommandController commandController,
  516. final ColourManagerFactory colourManagerFactory,
  517. final SwingEventBus swingEventBus,
  518. final TabCompleterUtils tabCompleterUtils) {
  519. this.textPaneFactory = textPaneFactory;
  520. this.controller = controller;
  521. this.mainWindow = mainWindow;
  522. this.popupManager = popupManager;
  523. this.eventBus = eventBus;
  524. this.globalConfig = globalConfig;
  525. this.pasteDialog = pasteDialog;
  526. this.pluginManager = pluginManager;
  527. this.iconManager = iconManager;
  528. this.activeFrameManager = activeFrameManager;
  529. this.clipboard = clipboard;
  530. this.commandController = commandController;
  531. this.colourManagerFactory = colourManagerFactory;
  532. this.swingEventBus = swingEventBus;
  533. this.tabCompleterUtils = tabCompleterUtils;
  534. }
  535. }
  536. }