File Source: DummyController.java
/*
P/P * Method: com.dmdirc.addons.ui_dummy.DummyController__static_init
*/
1 /*
2 * Copyright (c) 2006-2009 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
23 package com.dmdirc.addons.ui_dummy;
24
25 import com.dmdirc.Channel;
26 import com.dmdirc.FrameContainer;
27 import com.dmdirc.Main;
28 import com.dmdirc.Query;
29 import com.dmdirc.Server;
30 import com.dmdirc.WritableFrameContainer;
31 import com.dmdirc.commandparser.parsers.CommandParser;
32 import com.dmdirc.config.prefs.PreferencesInterface;
33 import com.dmdirc.plugins.Plugin;
34 import com.dmdirc.ui.core.dialogs.sslcertificate.SSLCertificateDialogModel;
35 import com.dmdirc.ui.interfaces.ChannelWindow;
36 import com.dmdirc.ui.interfaces.InputWindow;
37 import com.dmdirc.ui.interfaces.MainWindow;
38 import com.dmdirc.ui.interfaces.QueryWindow;
39 import com.dmdirc.ui.interfaces.ServerWindow;
40 import com.dmdirc.ui.interfaces.StatusBar;
41 import com.dmdirc.ui.interfaces.UIController;
42 import com.dmdirc.ui.interfaces.UpdaterDialog;
43 import com.dmdirc.ui.interfaces.Window;
44 import com.dmdirc.updater.Update;
45
46 import java.net.URI;
47 import java.util.List;
48
49 /**
50 * Implements a dummy UI controller.
51 */
52 public final class DummyController extends Plugin implements UIController {
53
54 /** Main window. */
55 private final MainWindow mainWindow = new DummyMainWindow();
56
57 /**
58 * Creates a new instance of DummyController.
59 */
/*
P/P * Method: void com.dmdirc.addons.ui_dummy.DummyController()
*
* Postconditions:
* this.mainWindow == &new DummyMainWindow(DummyController#1)
* new DummyMainWindow(DummyController#1) num objects == 1
* this.mainWindow.visible == 1
*/
60 public DummyController() {
61 // Do nothing
62 }
63
64 /** {@inheritDoc} */
65 @Override
66 public MainWindow getMainWindow() {
/*
P/P * Method: MainWindow getMainWindow()
*
* Postconditions:
* return_value == this.mainWindow
* init'ed(return_value)
*/
67 return mainWindow;
68 }
69
70 /** {@inheritDoc} */
71 @Override
72 public StatusBar getStatusBar() {
/*
P/P * Method: StatusBar getStatusBar()
*
* Postconditions:
* return_value == &new DummyStatusBar(getStatusBar#1)
* new DummyStatusBar(getStatusBar#1) num objects == 1
*/
73 return new DummyStatusBar();
74 }
75
76 /** {@inheritDoc} */
77 @Override
78 public ChannelWindow getChannel(final Channel channel) {
/*
P/P * Method: ChannelWindow getChannel(Channel)
*
* Preconditions:
* channel != null
*
* Postconditions:
* return_value == &new DummyChannelWindow(getChannel#1)
* new ChannelCommandParser(DummyChannelWindow#1) num objects == 1
* new DummyChannelWindow(getChannel#1) num objects == 1
* return_value.commandParser == &new ChannelCommandParser(DummyChannelWindow#1)
* return_value.container == channel
* return_value.container != null
* return_value.parent == return_value.container
*/
79 return new DummyChannelWindow(channel);
80 }
81
82 /** {@inheritDoc} */
83 @Override
84 public ServerWindow getServer(final Server server) {
/*
P/P * Method: ServerWindow getServer(Server)
*
* Postconditions:
* return_value == &new DummyServerWindow(getServer#1)
* new DummyServerWindow(getServer#1) num objects == 1
* new ServerCommandParser(DummyServerWindow#1) num objects == 1
* return_value.commandParser == &new ServerCommandParser(DummyServerWindow#1)
* return_value.container == server
* init'ed(return_value.container)
* return_value.parent == return_value.container
*/
85 return new DummyServerWindow(server);
86 }
87
88 /** {@inheritDoc} */
89 @Override
90 public QueryWindow getQuery(final Query query) {
/*
P/P * Method: QueryWindow getQuery(Query)
*
* Preconditions:
* query != null
*
* Postconditions:
* return_value == &new DummyQueryWindow(getQuery#1)
* new DummyQueryWindow(getQuery#1) num objects == 1
* init'ed(return_value.commandParser)
* return_value.container == query
* return_value.container != null
*/
91 return new DummyQueryWindow(query);
92 }
93
94 /** {@inheritDoc} */
95 @Override
96 public Window getWindow(final FrameContainer owner) {
/*
P/P * Method: Window getWindow(FrameContainer)
* getWindow fails for all possible inputs
*/
97 throw new UnsupportedOperationException("Not supported yet.");
98 }
99
100 /** {@inheritDoc} */
101 @Override
102 public InputWindow getInputWindow(final WritableFrameContainer owner,
103 final CommandParser commandParser) {
/*
P/P * Method: InputWindow getInputWindow(WritableFrameContainer, CommandParser)
*
* Postconditions:
* return_value == &new DummyInputWindow(getInputWindow#1)
* new DummyInputWindow(getInputWindow#1) num objects == 1
* return_value.commandParser == commandParser
* init'ed(return_value.commandParser)
* return_value.container == owner
* init'ed(return_value.container)
*/
104 return new DummyInputWindow(owner, commandParser);
105 }
106
107 /** {@inheritDoc} */
108 @Override
109 public UpdaterDialog getUpdaterDialog(final List<Update> updates) {
/*
P/P * Method: UpdaterDialog getUpdaterDialog(List)
* getUpdaterDialog fails for all possible inputs
*/
110 throw new UnsupportedOperationException("Not supported yet.");
111 }
112
113 /** {@inheritDoc} */
114 @Override
115 public void showFirstRunWizard() {
/*
P/P * Method: void showFirstRunWizard()
*
* Presumptions:
* java.lang.System.out != null
*/
116 System.out.println("DummyController.showFirstRunWizard()");
117 }
118
119 /** {@inheritDoc} */
120 @Override
121 public void showMigrationWizard() {
/*
P/P * Method: void showMigrationWizard()
*
* Presumptions:
* java.lang.System.out != null
*/
122 System.out.println("DummyController.showMigrationWizard()");
123 }
124
125 /** {@inheritDoc} */
126 @Override
127 public void showChannelSettingsDialog(final Channel channel) {
/*
P/P * Method: void showChannelSettingsDialog(Channel)
* showChannelSettingsDialog fails for all possible inputs
*/
128 throw new UnsupportedOperationException("Not supported yet.");
129 }
130
131 /** {@inheritDoc} */
132 @Override
133 public void showServerSettingsDialog(final Server server) {
/*
P/P * Method: void showServerSettingsDialog(Server)
* showServerSettingsDialog fails for all possible inputs
*/
134 throw new UnsupportedOperationException("Not supported yet.");
135 }
136
137 /** {@inheritDoc} */
138 @Override
139 public void initUISettings() {
140 // Do nothing
/*
P/P * Method: void initUISettings()
*/
141 }
142
143 /** {@inheritDoc} */
144 @Override
145 public Window getActiveWindow() {
/*
P/P * Method: Window getActiveWindow()
*
* Postconditions:
* return_value == null
*/
146 return null;
147 }
148
149 /** {@inheritDoc} */
150 @Override
151 public Server getActiveServer() {
/*
P/P * Method: Server getActiveServer()
* getActiveServer fails for all possible inputs
*/
152 throw new UnsupportedOperationException("Not supported yet.");
153 }
154
155 /** {@inheritDoc} */
156 @Override
157 public void showURLDialog(final URI url) {
/*
P/P * Method: void showURLDialog(URI)
* showURLDialog fails for all possible inputs
*/
158 throw new UnsupportedOperationException("Not supported yet.");
159 }
160
161 /** {@inheritDoc} */
162 @Override
163 public void showFeedbackNag() {
/*
P/P * Method: void showFeedbackNag()
* showFeedbackNag fails for all possible inputs
*/
164 throw new UnsupportedOperationException("Not supported yet.");
165 }
166
167 /** {@inheritDoc} */
168 @Override
169 public void showMessageDialog(final String title, final String message) {
/*
P/P * Method: void showMessageDialog(String, String)
*
* Presumptions:
* java.lang.System.out != null
*/
170 System.out.println(message);
171 }
172
173 /** {@inheritDoc} */
174 @Override
175 public String getUserInput(final String prompt) {
/*
P/P * Method: String getUserInput(String)
* getUserInput fails for all possible inputs
*/
176 throw new UnsupportedOperationException("Not supported yet.");
177 }
178
179 /** {@inheritDoc} */
180 @Override
181 public void showSSLCertificateDialog(final SSLCertificateDialogModel model) {
/*
P/P * Method: void showSSLCertificateDialog(SSLCertificateDialogModel)
* showSSLCertificateDialog fails for all possible inputs
*/
182 throw new UnsupportedOperationException("Not supported yet.");
183 }
184
185 /** {@inheritDoc} */
186 @Override
187 public void onLoad() {
/*
P/P * Method: void onLoad()
*/
188 Main.setUI(this);
189 }
190
191 /** {@inheritDoc} */
192 @Override
193 public void onUnload() {
194 // Do nothing?
/*
P/P * Method: void onUnload()
*/
195 }
196
197 /** {@inheritDoc} */
198 @Override
199 public PreferencesInterface getPluginPrefsPanel() {
/*
P/P * Method: PreferencesInterface getPluginPrefsPanel()
* getPluginPrefsPanel fails for all possible inputs
*/
200 throw new UnsupportedOperationException("Not supported yet.");
201 }
202
203 /** {@inheritDoc} */
204 @Override
205 public PreferencesInterface getUpdatesPrefsPanel() {
/*
P/P * Method: PreferencesInterface getUpdatesPrefsPanel()
* getUpdatesPrefsPanel fails for all possible inputs
*/
206 throw new UnsupportedOperationException("Not supported yet.");
207 }
208
209 /** {@inheritDoc} */
210 @Override
211 public PreferencesInterface getUrlHandlersPrefsPanel() {
/*
P/P * Method: PreferencesInterface getUrlHandlersPrefsPanel()
* getUrlHandlersPrefsPanel fails for all possible inputs
*/
212 throw new UnsupportedOperationException("Not supported yet.");
213 }
214
215 /** {@inheritDoc} */
216 @Override
217 public PreferencesInterface getThemesPrefsPanel() {
/*
P/P * Method: PreferencesInterface getThemesPrefsPanel()
* getThemesPrefsPanel fails for all possible inputs
*/
218 throw new UnsupportedOperationException("Not supported yet.");
219 }
220
221 }
SofCheck Inspector Build Version : 2.17854
| DummyController.java |
2009-Jun-25 01:54:24 |
| DummyController.class |
2009-Sep-02 17:04:15 |