You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

PreferencesDialogModel.java 24KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563
  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. package com.dmdirc.config.prefs;
  23. import com.dmdirc.actions.ActionManager;
  24. import com.dmdirc.actions.CoreActionType;
  25. import com.dmdirc.plugins.PluginManager;
  26. import com.dmdirc.plugins.Service;
  27. import com.dmdirc.ui.interfaces.UIController;
  28. import com.dmdirc.util.ListenerList;
  29. import com.dmdirc.util.validators.NumericalValidator;
  30. import com.dmdirc.util.validators.OptionalValidator;
  31. import java.util.ArrayList;
  32. import java.util.Collections;
  33. import java.util.HashMap;
  34. import java.util.List;
  35. import java.util.Map;
  36. /**
  37. * Manages categories that should appear in the preferences dialog.
  38. */
  39. public class PreferencesDialogModel {
  40. /** The UI controller to use for custom categories. */
  41. private final UIController controller;
  42. /** A list of categories. */
  43. private final List<PreferencesCategory> categories
  44. = new ArrayList<PreferencesCategory>();
  45. /** A list of listeners. */
  46. private final ListenerList listeners = new ListenerList();
  47. /**
  48. * Creates a new instance of PreferencesDialogModel.
  49. *
  50. * @param controller The UI controller to use to retrieve custom UIs for
  51. * preferences panels.
  52. */
  53. public PreferencesDialogModel(final UIController controller) {
  54. this.controller = controller;
  55. addDefaultCategories();
  56. ActionManager.getActionManager().triggerEvent(
  57. CoreActionType.CLIENT_PREFS_OPENED, null, this);
  58. }
  59. /**
  60. * Adds the specified category to the preferences manager.
  61. *
  62. * @param category The category to be added
  63. */
  64. public void addCategory(final PreferencesCategory category) {
  65. categories.add(category);
  66. }
  67. /**
  68. * Retrieves a list of categories registered with the preferences manager.
  69. *
  70. * @return An ordered list of categories
  71. */
  72. public List<PreferencesCategory> getCategories() {
  73. return Collections.unmodifiableList(categories);
  74. }
  75. /**
  76. * Finds and retrieves the category with the specified name.
  77. *
  78. * @param name The name (title) of the category to find.
  79. * @return The appropriate category, or null if none was found
  80. */
  81. public PreferencesCategory getCategory(final String name) {
  82. for (PreferencesCategory category : categories) {
  83. if (category.getTitle().equals(name)) {
  84. return category;
  85. }
  86. }
  87. return null;
  88. }
  89. /**
  90. * Saves all the settings in this manager.
  91. *
  92. * @return Is a restart needed after saving?
  93. */
  94. public boolean save() {
  95. fireSaveListeners();
  96. boolean restart = false;
  97. for (PreferencesCategory category : categories) {
  98. if (category.save()) {
  99. restart |= true;
  100. }
  101. }
  102. return restart;
  103. }
  104. /**
  105. * Dismisses all the settings in this manager.
  106. */
  107. public void dismiss() {
  108. for (PreferencesCategory category : categories) {
  109. category.dismiss();
  110. }
  111. }
  112. /**
  113. * Adds the default categories to this preferences manager.
  114. */
  115. private void addDefaultCategories() {
  116. addGeneralCategory();
  117. addConnectionCategory();
  118. addMessagesCategory();
  119. addGuiCategory();
  120. addPluginsCategory();
  121. addUrlHandlerCategory();
  122. addUpdatesCategory();
  123. addAdvancedCategory();
  124. }
  125. /**
  126. * Creates and adds the "General" category.
  127. */
  128. private void addGeneralCategory() {
  129. final PreferencesCategory category = new PreferencesCategory("General", "");
  130. category.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
  131. "ui", "confirmQuit", "Confirm quit",
  132. "Show a confirmation message when you try to close the client"));
  133. category.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
  134. "channel", "splitusermodes", "Split user modes",
  135. "Show individual mode lines for each mode change that affects"
  136. + " a user (e.g. op, devoice)"));
  137. category.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
  138. "channel", "sendwho", "Send channel WHOs",
  139. "Request information (away state, hostname, etc) on channel "
  140. + "users automatically"));
  141. category.addSetting(new PreferencesSetting(PreferencesType.DURATION,
  142. "general", "whotime", "Who request interval",
  143. "How often to send WHO requests for a channel (if enabled)"));
  144. category.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
  145. "channel", "showmodeprefix", "Show mode prefix",
  146. "Prefix users' names with their mode (e.g. @) in channels"));
  147. category.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
  148. "ui", "awayindicator", "Away indicator",
  149. "Show an indicator in windows when you are marked as away"));
  150. category.addSetting(new PreferencesSetting(PreferencesType.OPTIONALINTEGER,
  151. new OptionalValidator(new NumericalValidator(0, 100)), "ui", "pasteProtectionLimit",
  152. "Paste protection trigger", "Confirm pasting of text that "
  153. + "contains more than this many lines."));
  154. addTabCompletionCategory(category);
  155. addCategory(category.setInlineAfter());
  156. }
  157. /**
  158. * Creates and adds the "Tab Completion" category.
  159. *
  160. * @param parent Parent category to add this category to
  161. * @since 0.6.4
  162. */
  163. private void addTabCompletionCategory(final PreferencesCategory parent) {
  164. final PreferencesCategory category = new PreferencesCategory("Tab Completion", "");
  165. final Map<String, String> taboptions = new HashMap<String, String>();
  166. for (Service service : PluginManager.getPluginManager()
  167. .getServicesByType("tabcompletion")) {
  168. taboptions.put(service.getName(), service.getName());
  169. }
  170. category.addSetting(new PreferencesSetting("tabcompletion", "style",
  171. "Tab completion style", "Determines the behaviour of "
  172. + "the tab completer when there are multiple matches", taboptions));
  173. category.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
  174. "tabcompletion", "casesensitive", "Case-sensitive tab completion",
  175. "Respect case when tab completing"));
  176. category.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
  177. "tabcompletion", "allowempty", "Allow empty tab completion",
  178. "Attempt to tab complete when the Tab key is pressed even "
  179. + "if there is nothing to complete"));
  180. parent.addSubCategory(category.setInline());
  181. }
  182. /**
  183. * Creates and adds the "Connection" category.
  184. */
  185. private void addConnectionCategory() {
  186. final PreferencesCategory category = new PreferencesCategory("Connection",
  187. "", "category-connection");
  188. category.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
  189. "general", "closechannelsonquit", "Close channels on quit",
  190. "Close channel windows when you manually disconnect from the server"));
  191. category.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
  192. "general", "closechannelsondisconnect",
  193. "Close channels on disconnect", "Close channel windows when "
  194. + "the server is disconnected (because of an error)"));
  195. category.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
  196. "general", "closequeriesonquit", "Close queries on quit",
  197. "Close query windows when you manually disconnect from the server"));
  198. category.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
  199. "general", "closequeriesondisconnect",
  200. "Close queries on disconnect", "Close query windows when "
  201. + "the server is disconnected (because of an error)"));
  202. category.addSetting(new PreferencesSetting(PreferencesType.DURATION,
  203. "server", "pingtimer", "Ping warning time",
  204. "How long to wait after a ping reply is sent before showing "
  205. + "a warning message"));
  206. category.addSetting(new PreferencesSetting(PreferencesType.DURATION,
  207. "server", "pingtimeout", "Ping timeout",
  208. "How long to wait for a server to reply to a PING request "
  209. + "before assuming the server has died"));
  210. category.addSetting(new PreferencesSetting(PreferencesType.DURATION,
  211. "server", "pingfrequency", "Ping frequency",
  212. "How often a PING request should be sent to the server (to "
  213. + "check that it is still alive)"));
  214. category.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
  215. "general", "reconnectonconnectfailure", "Reconnect on failure",
  216. "Attempt to reconnect if there is an error when connecting"));
  217. category.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
  218. "general", "reconnectondisconnect", "Reconnect on disconnect",
  219. "Attempt to reconnect if the server is disconnected"));
  220. category.addSetting(new PreferencesSetting(PreferencesType.DURATION,
  221. "general", "reconnectdelay", "Reconnect delay",
  222. "How long to wait before attempting to reconnect to a server"));
  223. category.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
  224. "general", "rejoinchannels", "Rejoin open channels",
  225. "Rejoin open channels when reconnecting to a server"));
  226. addSSLCategory(category);
  227. addCategory(category);
  228. }
  229. /**
  230. * Creates and adds the "SSL" category.
  231. *
  232. * @param parent Parent category to add this category to
  233. */
  234. private void addSSLCategory(final PreferencesCategory parent) {
  235. final PreferencesCategory category = new PreferencesCategory("SSL",
  236. "Options relating to encrypted (SSL) connections", "secure-server");
  237. category.addSetting(new PreferencesSetting(PreferencesType.FILE, "ssl",
  238. "clientcert.file", "Client certificate", "Path to PKCS12 client "
  239. + "certificate to send when connecting to servers using SSL"));
  240. category.addSetting(new PreferencesSetting(PreferencesType.TEXT, "ssl",
  241. "clientcert.pass", "Client password", "Password for client "
  242. + "certificate file"));
  243. parent.addSubCategory(category);
  244. }
  245. /**
  246. * Creates and adds the "Messages" category.
  247. */
  248. private void addMessagesCategory() {
  249. final PreferencesCategory category = new PreferencesCategory("Messages",
  250. "", "category-messages");
  251. category.addSetting(new PreferencesSetting(PreferencesType.TEXT,
  252. "general", "closemessage",
  253. "Close message", "Default quit message to use when closing DMDirc"));
  254. category.addSetting(new PreferencesSetting(PreferencesType.TEXT,
  255. "general", "partmessage",
  256. "Part message", "Default part message to use when leaving channels"));
  257. category.addSetting(new PreferencesSetting(PreferencesType.TEXT,
  258. "general", "quitmessage",
  259. "Quit message", "Default quit message to use when disconnecting"));
  260. category.addSetting(new PreferencesSetting(PreferencesType.TEXT,
  261. "general", "cyclemessage",
  262. "Cycle message", "Default part message to use when cycling channels"));
  263. category.addSetting(new PreferencesSetting(PreferencesType.TEXT,
  264. "general", "kickmessage",
  265. "Kick message", "Default message to use when kicking people"));
  266. category.addSetting(new PreferencesSetting(PreferencesType.TEXT,
  267. "general", "reconnectmessage",
  268. "Reconnect message", "Default quit message to use when reconnecting"));
  269. addNotificationsCategory(category);
  270. addCategory(category);
  271. }
  272. /**
  273. * Creates and adds the "Notifications" category.
  274. *
  275. * @param parent The parent category.
  276. */
  277. private void addNotificationsCategory(final PreferencesCategory parent) {
  278. final PreferencesCategory category = new PreferencesCategory("Notifications",
  279. "", "input-error");
  280. final Map<String, String> options = new HashMap<String, String>();
  281. final Map<String, String> commonOptions = new HashMap<String, String>();
  282. final Map<String, String> whoisOptions = new HashMap<String, String>();
  283. final Map<String, String> ctcprOptions = new HashMap<String, String>();
  284. final Map<String, String> mapOptions = new HashMap<String, String>();
  285. options.put("all", "All windows");
  286. options.put("active", "Active window");
  287. options.put("server", "Server window");
  288. options.put("none", "Nowhere");
  289. commonOptions.putAll(options);
  290. commonOptions.put("comchans:%1$s server", "Common channels");
  291. whoisOptions.putAll(options);
  292. whoisOptions.put("lastcommand:(raw )?whois %4$s( %4$s)?", "Source of whois command");
  293. whoisOptions.put("comchans:%4$s server", "Common channels");
  294. ctcprOptions.putAll(commonOptions);
  295. ctcprOptions.put("lastcommand:ctcp %1$s %4$S", "Source of ctcp command");
  296. mapOptions.putAll(options);
  297. mapOptions.put("window:Network Map", "Map window");
  298. category.addSetting(new PreferencesSetting("notifications", "socketClosed",
  299. "Socket closed", "Where to display socket closed notifications",
  300. options));
  301. category.addSetting(new PreferencesSetting("notifications", "privateNotice",
  302. "Private notice", "Where to display private notices",
  303. commonOptions));
  304. category.addSetting(new PreferencesSetting("notifications", "serverNotice",
  305. "Server notice", "Where to display server notices",
  306. options));
  307. category.addSetting(new PreferencesSetting("notifications", "privateCTCP",
  308. "CTCP request", "Where to display CTCP request notifications",
  309. commonOptions));
  310. category.addSetting(new PreferencesSetting("notifications", "privateCTCPreply",
  311. "CTCP reply", "Where to display CTCP replies",
  312. ctcprOptions));
  313. category.addSetting(new PreferencesSetting("notifications", "connectError",
  314. "Connect error", "Where to display connect error notifications",
  315. options));
  316. category.addSetting(new PreferencesSetting("notifications", "connectRetry",
  317. "Connect retry", "Where to display connect retry notifications",
  318. options));
  319. category.addSetting(new PreferencesSetting("notifications", "stonedServer",
  320. "Stoned server", "Where to display stoned server notifications",
  321. options));
  322. category.addSetting(new PreferencesSetting("notifications", "whois",
  323. "Whois output", "Where to display /whois output",
  324. whoisOptions));
  325. category.addSetting(new PreferencesSetting("notifications", "lusers",
  326. "Lusers output", "Where to display /lusers output",
  327. options));
  328. category.addSetting(new PreferencesSetting("notifications", "map",
  329. "Map output", "Where to display /map output",
  330. mapOptions));
  331. category.addSetting(new PreferencesSetting("notifications", "away",
  332. "Away notification", "Where to display /away output",
  333. options));
  334. category.addSetting(new PreferencesSetting("notifications", "back",
  335. "Back notification", "Where to display /away output",
  336. options));
  337. parent.addSubCategory(category);
  338. }
  339. /**
  340. * Creates and adds the "Advanced" category.
  341. */
  342. private void addAdvancedCategory() {
  343. final PreferencesCategory category = new PreferencesCategory("Advanced",
  344. "", "category-advanced");
  345. category.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
  346. "browser", "uselaunchdelay", "Use browser launch delay",
  347. "Enable delay between browser launches (to prevent mistakenly"
  348. + " double clicking)"));
  349. category.addSetting(new PreferencesSetting(PreferencesType.DURATION,
  350. "browser", "launchdelay", "Browser launch delay",
  351. "Minimum time between opening of URLs if enabled"));
  352. category.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
  353. "general", "submitErrors", "Automatically submit errors",
  354. "Automatically submit client errors to the developers"));
  355. category.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
  356. "general", "logerrors", "Log errors to disk",
  357. "Save copies of all client errors to disk"));
  358. category.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
  359. "ui", "quickCopy", "Quick copy", "Automatically copy"
  360. + " text that's selected when the mouse button is released"));
  361. category.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
  362. "ui", "showversion", "Show version",
  363. "Show the current DMDirc version in the titlebar"));
  364. category.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
  365. "general", "showglobalwindow", "Show global window",
  366. "Show a global window which can be used to enter commands"));
  367. addCategory(category);
  368. }
  369. /**
  370. * Creates and adds the "GUI" category.
  371. */
  372. private void addGuiCategory() {
  373. final PreferencesCategory category = new PreferencesCategory("GUI", "",
  374. "category-gui");
  375. category.addSetting(new PreferencesSetting(PreferencesType.COLOUR,
  376. "ui", "backgroundcolour", "Background colour", "Default "
  377. + "background colour to use"));
  378. category.addSetting(new PreferencesSetting(PreferencesType.COLOUR,
  379. "ui", "foregroundcolour", "Foreground colour", "Default "
  380. + "foreground colour to use"));
  381. category.addSetting(new PreferencesSetting(PreferencesType.OPTIONALCOLOUR,
  382. "ui", "inputbackgroundcolour", "Input background colour",
  383. "Default background colour to use for input fields"));
  384. category.addSetting(new PreferencesSetting(PreferencesType.OPTIONALCOLOUR,
  385. "ui", "inputforegroundcolour", "Input foreground colour",
  386. "Default foreground colour to use for input fields"));
  387. category.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
  388. "general", "showcolourdialog", "Show colour dialog",
  389. "Show colour picker dialog when using colour control codes"));
  390. category.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
  391. "ui", "antialias", "System anti-alias",
  392. "Anti-alias all fonts").setRestartNeeded());
  393. category.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
  394. "ui", "maximisewindows", "Auto-maximise windows",
  395. "Automatically maximise newly opened windows"));
  396. category.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
  397. "ui", "shownickcoloursintext", "Show nick colours in text area",
  398. "Show nickname colours (if set) in text areas"));
  399. category.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
  400. "ui", "shownickcoloursinnicklist", "Show nick colours in nicklists",
  401. "Show nickname colours (if set) in channel nicklists"));
  402. addThemesCategory(category);
  403. addStyleSubCategory(category);
  404. addCategory(category.setInlineAfter());
  405. }
  406. /**
  407. * Creates the Style subcategory in "GUI".
  408. *
  409. * @since 0.6.4
  410. * @param parent Parent category to add this category to
  411. */
  412. private void addStyleSubCategory(final PreferencesCategory parent) {
  413. final PreferencesCategory category = new PreferencesCategory("Link styles"
  414. + " and colours", "");
  415. category.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
  416. "ui", "stylelinks", "Style hyperlinks", "Style hyperlinks in "
  417. + "text areas with underlines"));
  418. category.addSetting(new PreferencesSetting(PreferencesType.OPTIONALCOLOUR,
  419. "ui", "linkcolour", "Hyperlink colour", "Default colour to use "
  420. + "for hyperlinks in the text area"));
  421. category.addSetting(new PreferencesSetting(PreferencesType.BOOLEAN,
  422. "ui", "stylechannels", "Style channel links", "Styles channel "
  423. + "links in text areas with underlines"));
  424. category.addSetting(new PreferencesSetting(PreferencesType.OPTIONALCOLOUR,
  425. "ui", "channelcolour", "Channel link colour", "Default colour to use "
  426. + "for channel links in the text area"));
  427. parent.addSubCategory(category.setInline());
  428. }
  429. /**
  430. * Creates and adds the "Themes" category.
  431. *
  432. * @param parent The parent category
  433. */
  434. private void addThemesCategory(final PreferencesCategory parent) {
  435. parent.addSubCategory(new PreferencesCategory("Themes", "",
  436. "category-addons", controller.getThemesPrefsPanel()));
  437. }
  438. /**
  439. * Creates and adds the "Plugins" category.
  440. */
  441. private void addPluginsCategory() {
  442. addCategory(new PreferencesCategory("Plugins", "", "category-addons",
  443. controller.getPluginPrefsPanel()));
  444. }
  445. /**
  446. * Creates and adds the "Updates" category.
  447. */
  448. private void addUpdatesCategory() {
  449. addCategory(new PreferencesCategory("Updates", "", "category-updates",
  450. controller.getUpdatesPrefsPanel()));
  451. }
  452. /**
  453. * Creates and adds the "URL Handlers" category.
  454. */
  455. private void addUrlHandlerCategory() {
  456. addCategory(new PreferencesCategory("URL Handlers",
  457. "Configure how DMDirc handles different types of URLs",
  458. "category-urlhandlers", controller.getUrlHandlersPrefsPanel()));
  459. }
  460. /**
  461. * Registers the specified save listener with this manager.
  462. *
  463. * @param listener The listener to be registered
  464. */
  465. public void registerSaveListener(final PreferencesInterface listener) {
  466. listeners.add(PreferencesInterface.class, listener);
  467. }
  468. /**
  469. * Fires the "save" methods of all registered listeners.
  470. */
  471. public void fireSaveListeners() {
  472. for (PreferencesInterface iface : listeners.get(PreferencesInterface.class)) {
  473. iface.save();
  474. }
  475. for (PreferencesCategory category : categories) {
  476. fireSaveListener(category);
  477. }
  478. }
  479. /**
  480. * Fires the save listener for any objects within the specified category.
  481. *
  482. * @param category The category to check
  483. */
  484. private void fireSaveListener(final PreferencesCategory category) {
  485. if (category.hasObject()) {
  486. category.getObject().save();
  487. }
  488. for (PreferencesCategory subcategory : category.getSubcats()) {
  489. fireSaveListener(subcategory);
  490. }
  491. }
  492. /**
  493. * Fires the CLIENT_PREFS_CLOSED action.
  494. *
  495. * @since 0.6
  496. */
  497. public void close() {
  498. ActionManager.getActionManager().triggerEvent(
  499. CoreActionType.CLIENT_PREFS_CLOSED, null);
  500. }
  501. }