forked from JPMoresmau/eclipsefp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
NullBrowserServer.java
99 lines (81 loc) · 2.2 KB
/
NullBrowserServer.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
/**
* (c) 2011, Alejandro Serrano
* Released under the condidtions of the EPL.
*/
package net.sf.eclipsefp.haskell.browser.client;
import java.io.IOException;
import net.sf.eclipsefp.haskell.browser.BrowserServer;
import net.sf.eclipsefp.haskell.browser.DatabaseType;
import net.sf.eclipsefp.haskell.browser.items.Declaration;
import net.sf.eclipsefp.haskell.browser.items.HaskellPackage;
import net.sf.eclipsefp.haskell.browser.items.HoogleResult;
import net.sf.eclipsefp.haskell.browser.items.Module;
import net.sf.eclipsefp.haskell.browser.items.PackageIdentifier;
import net.sf.eclipsefp.haskell.browser.items.Packaged;
import org.json.JSONException;
/**
* A virtual connection to a server which gives no responses. Used at
* initialization time and when there is no scion-browser installed.
*
* @author serras
*/
public class NullBrowserServer extends BrowserServer {
public NullBrowserServer() {
// Do nothing
}
@Override
public boolean isDatabaseLoaded() {
return true;
}
@Override
public boolean isHoogleLoaded() {
return true;
}
@Override
public void loadLocalDatabase(String path, boolean rebuild) throws IOException, JSONException {
// Do nothing
}
@Override
public void setCurrentDatabase(DatabaseType current, PackageIdentifier id) throws IOException,
JSONException {
// Do nothing
}
@Override
public HaskellPackage[] getPackages() throws IOException, JSONException {
// Return nothing
return new HaskellPackage[0];
}
@Override
public Module[] getAllModules() throws IOException, JSONException {
// Return nothing
return new Module[0];
}
@Override
public Module[] getModules(String module) throws IOException, JSONException {
// Return nothing
return new Module[0];
}
@Override
public Packaged<Declaration>[] getDeclarations(String module) throws Exception {
// Return nothing
return (Packaged<Declaration>[]) new Packaged[0];
}
@Override
public HoogleResult[] queryHoogle(String query) throws Exception {
// Return nothing
return new HoogleResult[0];
}
@Override
public void downloadHoogleData() {
// Do nothing
}
@Override
public boolean checkHoogle() {
// Do nothing
return true;
}
@Override
public void stop() {
// Do nothing
}
}