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.

DummyController.java 6.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. /*
  2. * Copyright (c) 2006-2010 Chris Smith, Shane Mc Cormack, Gregory Holmes
  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_dummy;
  23. import com.dmdirc.Channel;
  24. import com.dmdirc.FrameContainer;
  25. import com.dmdirc.Main;
  26. import com.dmdirc.Query;
  27. import com.dmdirc.Server;
  28. import com.dmdirc.WritableFrameContainer;
  29. import com.dmdirc.commandparser.parsers.CommandParser;
  30. import com.dmdirc.config.prefs.PreferencesInterface;
  31. import com.dmdirc.plugins.Plugin;
  32. import com.dmdirc.ui.core.dialogs.sslcertificate.SSLCertificateDialogModel;
  33. import com.dmdirc.ui.interfaces.ChannelWindow;
  34. import com.dmdirc.ui.interfaces.InputWindow;
  35. import com.dmdirc.ui.interfaces.MainWindow;
  36. import com.dmdirc.ui.interfaces.QueryWindow;
  37. import com.dmdirc.ui.interfaces.ServerWindow;
  38. import com.dmdirc.ui.interfaces.StatusBar;
  39. import com.dmdirc.ui.interfaces.UIController;
  40. import com.dmdirc.ui.interfaces.UpdaterDialog;
  41. import com.dmdirc.ui.interfaces.Window;
  42. import com.dmdirc.updater.Update;
  43. import java.net.URI;
  44. import java.util.List;
  45. /**
  46. * Implements a dummy UI controller.
  47. */
  48. public final class DummyController extends Plugin implements UIController {
  49. /** Main window. */
  50. private final MainWindow mainWindow = new DummyMainWindow();
  51. /**
  52. * Creates a new instance of DummyController.
  53. */
  54. public DummyController() {
  55. // Do nothing
  56. }
  57. /** {@inheritDoc} */
  58. @Override
  59. public MainWindow getMainWindow() {
  60. return mainWindow;
  61. }
  62. /** {@inheritDoc} */
  63. @Override
  64. public StatusBar getStatusBar() {
  65. return new DummyStatusBar();
  66. }
  67. /** {@inheritDoc} */
  68. @Override
  69. public ChannelWindow getChannel(final Channel channel) {
  70. return new DummyChannelWindow(channel);
  71. }
  72. /** {@inheritDoc} */
  73. @Override
  74. public ServerWindow getServer(final Server server) {
  75. return new DummyServerWindow(server);
  76. }
  77. /** {@inheritDoc} */
  78. @Override
  79. public QueryWindow getQuery(final Query query) {
  80. return new DummyQueryWindow(query);
  81. }
  82. /** {@inheritDoc} */
  83. @Override
  84. public Window getWindow(final FrameContainer owner) {
  85. throw new UnsupportedOperationException("Not supported yet.");
  86. }
  87. /** {@inheritDoc} */
  88. @Override
  89. public InputWindow getInputWindow(final WritableFrameContainer owner,
  90. final CommandParser commandParser) {
  91. return new DummyInputWindow(owner, commandParser);
  92. }
  93. /** {@inheritDoc} */
  94. @Override
  95. public UpdaterDialog getUpdaterDialog(final List<Update> updates) {
  96. throw new UnsupportedOperationException("Not supported yet.");
  97. }
  98. /** {@inheritDoc} */
  99. @Override
  100. public void showFirstRunWizard() {
  101. System.out.println("DummyController.showFirstRunWizard()");
  102. }
  103. /** {@inheritDoc} */
  104. @Override
  105. public void showMigrationWizard() {
  106. System.out.println("DummyController.showMigrationWizard()");
  107. }
  108. /** {@inheritDoc} */
  109. @Override
  110. public void showChannelSettingsDialog(final Channel channel) {
  111. throw new UnsupportedOperationException("Not supported yet.");
  112. }
  113. /** {@inheritDoc} */
  114. @Override
  115. public void showServerSettingsDialog(final Server server) {
  116. throw new UnsupportedOperationException("Not supported yet.");
  117. }
  118. /** {@inheritDoc} */
  119. @Override
  120. public void initUISettings() {
  121. // Do nothing
  122. }
  123. /** {@inheritDoc} */
  124. @Override
  125. @Deprecated
  126. public Window getActiveWindow() {
  127. return null;
  128. }
  129. /** {@inheritDoc} */
  130. @Override
  131. public Server getActiveServer() {
  132. throw new UnsupportedOperationException("Not supported yet.");
  133. }
  134. /** {@inheritDoc} */
  135. @Override
  136. public void showURLDialog(final URI url) {
  137. throw new UnsupportedOperationException("Not supported yet.");
  138. }
  139. /** {@inheritDoc} */
  140. @Override
  141. public void showFeedbackNag() {
  142. throw new UnsupportedOperationException("Not supported yet.");
  143. }
  144. /** {@inheritDoc} */
  145. @Override
  146. public void showMessageDialog(final String title, final String message) {
  147. System.out.println(message);
  148. }
  149. /** {@inheritDoc} */
  150. @Override
  151. public String getUserInput(final String prompt) {
  152. throw new UnsupportedOperationException("Not supported yet.");
  153. }
  154. /** {@inheritDoc} */
  155. @Override
  156. public void showSSLCertificateDialog(final SSLCertificateDialogModel model) {
  157. throw new UnsupportedOperationException("Not supported yet.");
  158. }
  159. /** {@inheritDoc} */
  160. @Override
  161. public void onLoad() {
  162. Main.setUI(this);
  163. }
  164. /** {@inheritDoc} */
  165. @Override
  166. public void onUnload() {
  167. // Do nothing?
  168. }
  169. /** {@inheritDoc} */
  170. @Override
  171. public PreferencesInterface getPluginPrefsPanel() {
  172. throw new UnsupportedOperationException("Not supported yet.");
  173. }
  174. /** {@inheritDoc} */
  175. @Override
  176. public PreferencesInterface getUpdatesPrefsPanel() {
  177. throw new UnsupportedOperationException("Not supported yet.");
  178. }
  179. /** {@inheritDoc} */
  180. @Override
  181. public PreferencesInterface getUrlHandlersPrefsPanel() {
  182. throw new UnsupportedOperationException("Not supported yet.");
  183. }
  184. /** {@inheritDoc} */
  185. @Override
  186. public PreferencesInterface getThemesPrefsPanel() {
  187. throw new UnsupportedOperationException("Not supported yet.");
  188. }
  189. }