KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sslexplorer > agent > client > DummyGUI


1 package com.sslexplorer.agent.client;
2
3 import java.io.IOException JavaDoc;
4 import java.util.Enumeration JavaDoc;
5 import java.util.Vector JavaDoc;
6
7 import com.maverick.http.HttpAuthenticator;
8 import com.sslexplorer.agent.client.tunneling.AbstractPortItem;
9
10 public class DummyGUI implements AgentClientGUI {
11
12     public void init(Agent agent) {
13     }
14
15     public void showIdle() {
16     }
17
18     public void showDisconnected() {
19     }
20
21     public void showTx() {
22     }
23
24     public void showRx() {
25     }
26
27     public void showTxRx() {
28     }
29
30     public void setInfo(String JavaDoc info) {
31     }
32
33     public boolean confirm(int dialogType, String JavaDoc okText, String JavaDoc cancelText, String JavaDoc title, String JavaDoc message) {
34         return true;
35     }
36
37     public boolean error(String JavaDoc okText, String JavaDoc cancelText, String JavaDoc title, String JavaDoc message, Throwable JavaDoc ex) {
38         return true;
39     }
40
41     public void addFileMenuItem(AgentAction action) {
42     }
43
44     public void addFileMenuSeparator() {
45     }
46
47     public void popup(ActionCallback callback, String JavaDoc message, String JavaDoc title, String JavaDoc imageName, int timeout) {
48     }
49
50     public TaskProgress createTaskProgress(String JavaDoc message, String JavaDoc note, long maxValue, boolean allowCancel) {
51         return new DummyTaskProgress();
52     }
53
54     public PortMonitor getPortMonitor() {
55         return new DummyPortMonitor();
56     }
57
58     public Console getConsole() {
59         return new DummyConsole();
60     }
61
62     public boolean promptForCredentials(boolean proxy, HttpAuthenticator authenticator) {
63         return true;
64     }
65
66     public void dispose() {
67     }
68     
69     public boolean isMenuExists(String JavaDoc name) {
70         return false;
71     }
72
73     public void addMenu(String JavaDoc name) {
74     }
75     
76     public void clearMenu(String JavaDoc name) {
77     }
78
79     public void removeMenu(String JavaDoc menu) {
80     }
81
82     public void addMenuItem(String JavaDoc parentName, AgentAction action) {
83     }
84
85     public void addMenuSeperator(String JavaDoc name) {
86     }
87
88     public void openBrowser(String JavaDoc path) {
89     }
90     
91     class DummyConsole extends Console {
92
93         public void show() {
94         }
95
96         public void write(int b) throws IOException JavaDoc {
97         }
98
99         public void dispose() {
100         }
101         
102     }
103     
104     class DummyPortMonitor implements PortMonitor {
105         
106         private Vector JavaDoc portItems = new Vector JavaDoc();
107         private boolean visible;
108
109         public boolean isVisible() {
110             return visible;
111         }
112
113         public void setVisible(boolean visible) {
114             this.visible = visible;
115         }
116
117         public void addPortItem(AbstractPortItem portItem) {
118             portItems.addElement(portItem);
119         }
120
121         public synchronized int getIndexForId(int id) {
122             int idx = 0;
123             for(Enumeration JavaDoc e = portItems.elements(); e.hasMoreElements(); ) {
124                 AbstractPortItem api = ((AbstractPortItem)e.nextElement());
125                 if(api.getConfiguration().getId() == id) {
126                     return idx;
127                 }
128                 idx++;
129             }
130             return -1;
131         }
132
133         public AbstractPortItem getItemAt(int idx) {
134             return (AbstractPortItem)portItems.elementAt(idx);
135         }
136
137         public void removeItemAt(int idx) {
138             portItems.removeElementAt(idx);
139         }
140
141         public void updateItemAt(int idx) {
142         }
143
144         public void dispose() {
145         }
146         
147     }
148
149     class DummyTaskProgress implements TaskProgress {
150
151         public void updateValue(long value) {
152         }
153
154         public void setMessage(String JavaDoc string) {
155         }
156
157         public void dispose() {
158         }
159
160     }
161
162 }
163
Popular Tags