mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-12 20:52:50 -06:00
Added Eclipse project stuff for the GWT library. Some refactoring of the GWT code.
This commit is contained in:
@@ -10,7 +10,10 @@ gwt:
|
|||||||
gwt/Translate-compile
|
gwt/Translate-compile
|
||||||
|
|
||||||
gf-gwt.jar:
|
gf-gwt.jar:
|
||||||
|
mkdir -p gwt/bin/se/chalmers/cs/gf/gwt/client
|
||||||
|
javac -classpath $(GWT_CLASSPATH) -sourcepath gwt/src -d gwt/bin gwt/src/se/chalmers/cs/gf/gwt/client/*.java
|
||||||
jar -cf $@ -C gwt/src se
|
jar -cf $@ -C gwt/src se
|
||||||
|
jar -uf $@ -C gwt/bin se
|
||||||
cp $@ ../../lib/java
|
cp $@ ../../lib/java
|
||||||
|
|
||||||
food.pgf:
|
food.pgf:
|
||||||
|
|||||||
8
src/server/gwt/.classpath
Normal file
8
src/server/gwt/.classpath
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<classpath>
|
||||||
|
<classpathentry kind="src" path="src"/>
|
||||||
|
<classpathentry kind="src" path="test"/>
|
||||||
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||||
|
<classpathentry kind="lib" path="/Users/bringert/src/gwt-mac-1.5.3/gwt-user.jar"/>
|
||||||
|
<classpathentry kind="output" path="bin"/>
|
||||||
|
</classpath>
|
||||||
15
src/server/gwt/.project
Normal file
15
src/server/gwt/.project
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<projectDescription>
|
||||||
|
<name>GF-GWT</name>
|
||||||
|
<comment>GF-GWT project</comment>
|
||||||
|
<projects/>
|
||||||
|
<buildSpec>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||||
|
<arguments/>
|
||||||
|
</buildCommand>
|
||||||
|
</buildSpec>
|
||||||
|
<natures>
|
||||||
|
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||||
|
</natures>
|
||||||
|
</projectDescription>
|
||||||
16
src/server/gwt/TranslateApp.launch
Normal file
16
src/server/gwt/TranslateApp.launch
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
|
||||||
|
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
|
||||||
|
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.google.gwt.dev.GWTShell"/>
|
||||||
|
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
|
||||||
|
<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry containerPath="org.eclipse.jdt.launching.JRE_CONTAINER" javaProject="GF-GWT" path="1" type="4"/> "/>
|
||||||
|
<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry internalArchive="/GF-GWT/src" path="3" type="2"/> "/>
|
||||||
|
<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry id="org.eclipse.jdt.launching.classpathentry.defaultClasspath"> <memento project="GF-GWT"/> </runtimeClasspathEntry> "/>
|
||||||
|
<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry externalArchive="/Users/bringert/src/gwt-mac-1.5.3/gwt-dev-mac.jar" path="3" type="2"/> "/>
|
||||||
|
|
||||||
|
</listAttribute>
|
||||||
|
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-XstartOnFirstThread -Xmx256M"/>
|
||||||
|
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-out www -noserver http://localhost:41296/gwt/www/se.chalmers.cs.gf.gwt.TranslateApp/Translate.html"/>
|
||||||
|
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="GF-GWT"/>
|
||||||
|
<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
|
||||||
|
</launchConfiguration>
|
||||||
13
src/server/gwt/src/se/chalmers/cs/gf/gwt/client/Arg.java
Normal file
13
src/server/gwt/src/se/chalmers/cs/gf/gwt/client/Arg.java
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
package se.chalmers.cs.gf.gwt.client;
|
||||||
|
|
||||||
|
public class Arg {
|
||||||
|
public final String name;
|
||||||
|
public final String value;
|
||||||
|
public Arg (String name, String value) {
|
||||||
|
this.name = name;
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
public Arg (String name, int value) {
|
||||||
|
this(name, Integer.toString(value));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,8 +2,6 @@ package se.chalmers.cs.gf.gwt.client;
|
|||||||
|
|
||||||
import com.google.gwt.user.client.ui.SuggestOracle;
|
import com.google.gwt.user.client.ui.SuggestOracle;
|
||||||
|
|
||||||
import com.google.gwt.core.client.GWT;
|
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
public class CompletionOracle extends SuggestOracle {
|
public class CompletionOracle extends SuggestOracle {
|
||||||
@@ -14,7 +12,7 @@ public class CompletionOracle extends SuggestOracle {
|
|||||||
|
|
||||||
private List<String> inputLangs = null;
|
private List<String> inputLangs = null;
|
||||||
|
|
||||||
private PGFRequest pgfRequest = null;
|
private JSONRequest JSONRequest = null;
|
||||||
|
|
||||||
|
|
||||||
public CompletionOracle (PGF pgf) {
|
public CompletionOracle (PGF pgf) {
|
||||||
@@ -60,10 +58,10 @@ public class CompletionOracle extends SuggestOracle {
|
|||||||
public void requestSuggestions(final SuggestOracle.Request request, final SuggestOracle.Callback callback) {
|
public void requestSuggestions(final SuggestOracle.Request request, final SuggestOracle.Callback callback) {
|
||||||
|
|
||||||
// only allow a single completion request at a time
|
// only allow a single completion request at a time
|
||||||
if (pgfRequest != null)
|
if (JSONRequest != null)
|
||||||
pgfRequest.cancel();
|
JSONRequest.cancel();
|
||||||
|
|
||||||
pgfRequest = pgf.complete(request.getQuery(), getInputLangs(), null, request.getLimit(),
|
JSONRequest = pgf.complete(request.getQuery(), getInputLangs(), null, request.getLimit(),
|
||||||
new PGF.CompleteCallback() {
|
new PGF.CompleteCallback() {
|
||||||
public void onResult(PGF.Completions completions) {
|
public void onResult(PGF.Completions completions) {
|
||||||
Collection<CompletionSuggestion> suggestions = new ArrayList<CompletionSuggestion>();
|
Collection<CompletionSuggestion> suggestions = new ArrayList<CompletionSuggestion>();
|
||||||
|
|||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package se.chalmers.cs.gf.gwt.client;
|
||||||
|
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.NoSuchElementException;
|
||||||
|
|
||||||
|
import com.google.gwt.core.client.JavaScriptObject;
|
||||||
|
import com.google.gwt.core.client.JsArray;
|
||||||
|
|
||||||
|
public class IterableJsArray<T extends JavaScriptObject> extends JsArray<T> {
|
||||||
|
|
||||||
|
protected IterableJsArray() {}
|
||||||
|
|
||||||
|
public final Iterable<T> iterable() {
|
||||||
|
return new Iterable<T>() {
|
||||||
|
public Iterator<T> iterator() {
|
||||||
|
return new Iterator<T>() {
|
||||||
|
private int i = 0;
|
||||||
|
public boolean hasNext() {
|
||||||
|
return i < length();
|
||||||
|
}
|
||||||
|
public T next() {
|
||||||
|
if (!hasNext()) {
|
||||||
|
throw new NoSuchElementException();
|
||||||
|
}
|
||||||
|
return get(i++);
|
||||||
|
}
|
||||||
|
public void remove() {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
package se.chalmers.cs.gf.gwt.client;
|
||||||
|
|
||||||
|
import com.google.gwt.core.client.JavaScriptObject;
|
||||||
|
|
||||||
|
public interface JSONCallback<T extends JavaScriptObject> {
|
||||||
|
public void onResult (T result) ;
|
||||||
|
public void onError (Throwable e) ;
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package se.chalmers.cs.gf.gwt.client;
|
||||||
|
|
||||||
|
import com.google.gwt.http.client.*;
|
||||||
|
|
||||||
|
public class JSONRequest {
|
||||||
|
|
||||||
|
private Request httpRequest;
|
||||||
|
|
||||||
|
JSONRequest (Request httpRequest) {
|
||||||
|
this.httpRequest = httpRequest;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void cancel() {
|
||||||
|
if (httpRequest != null) {
|
||||||
|
httpRequest.cancel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
package se.chalmers.cs.gf.gwt.client;
|
||||||
|
|
||||||
|
import com.google.gwt.core.client.JavaScriptObject;
|
||||||
|
import com.google.gwt.http.client.Request;
|
||||||
|
import com.google.gwt.http.client.RequestBuilder;
|
||||||
|
import com.google.gwt.http.client.RequestCallback;
|
||||||
|
import com.google.gwt.http.client.RequestException;
|
||||||
|
import com.google.gwt.http.client.Response;
|
||||||
|
import com.google.gwt.http.client.URL;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class JSONRequestBuilder {
|
||||||
|
|
||||||
|
public static <T extends JavaScriptObject> JSONRequest sendRequest (String base, List<Arg> vars, final JSONCallback<T> callback) {
|
||||||
|
String url = base + "?" + buildQueryString(vars);
|
||||||
|
RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, url);
|
||||||
|
builder.setTimeoutMillis(30000);
|
||||||
|
builder.setHeader("Accept","text/plain, text/html;q=0.5, */*;q=0.1");
|
||||||
|
Request request = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
request = builder.sendRequest(null, new RequestCallback() {
|
||||||
|
public void onError(Request request, Throwable e) {
|
||||||
|
callback.onError(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onResponseReceived(Request request, Response response) {
|
||||||
|
if (200 == response.getStatusCode()) {
|
||||||
|
callback.onResult((T)eval(response.getText()).cast());
|
||||||
|
} else {
|
||||||
|
RequestException e = new RequestException("Response not OK: " + response.getStatusCode() + ". " + response.getText());
|
||||||
|
callback.onError(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} catch (RequestException e) {
|
||||||
|
callback.onError(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return new JSONRequest(request);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static native JavaScriptObject eval(String json) /*-{
|
||||||
|
return eval('(' + json + ')');
|
||||||
|
}-*/;
|
||||||
|
|
||||||
|
private static String buildQueryString(List<Arg> args) {
|
||||||
|
StringBuffer sb = new StringBuffer();
|
||||||
|
if (args != null) {
|
||||||
|
for (Arg arg : args) {
|
||||||
|
if (arg.value != null) {
|
||||||
|
if (sb.length() > 0) {
|
||||||
|
sb.append("&");
|
||||||
|
}
|
||||||
|
sb.append(URL.encodeComponent(arg.name));
|
||||||
|
sb.append("=");
|
||||||
|
sb.append(URL.encodeComponent(arg.value));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,18 +1,8 @@
|
|||||||
package se.chalmers.cs.gf.gwt.client;
|
package se.chalmers.cs.gf.gwt.client;
|
||||||
|
|
||||||
import com.google.gwt.http.client.*;
|
|
||||||
import com.google.gwt.core.client.GWT;
|
|
||||||
import com.google.gwt.core.client.JsArray;
|
|
||||||
import com.google.gwt.core.client.JavaScriptObject;
|
import com.google.gwt.core.client.JavaScriptObject;
|
||||||
|
|
||||||
import com.google.gwt.json.client.JSONValue;
|
|
||||||
import com.google.gwt.json.client.JSONObject;
|
|
||||||
import com.google.gwt.json.client.JSONParser;
|
|
||||||
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.NoSuchElementException;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
public class PGF {
|
public class PGF {
|
||||||
@@ -25,44 +15,13 @@ public class PGF {
|
|||||||
this.pgfName = pgfName;
|
this.pgfName = pgfName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static interface GFCallback<T extends JavaScriptObject> {
|
|
||||||
public void onResult (T result) ;
|
|
||||||
public void onError (Throwable e) ;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class IterableJsArray<T extends JavaScriptObject> extends JsArray<T> {
|
|
||||||
protected IterableJsArray() {}
|
|
||||||
|
|
||||||
public final Iterable<T> iterable() {
|
|
||||||
return new Iterable<T>() {
|
|
||||||
public Iterator<T> iterator() {
|
|
||||||
return new Iterator<T>() {
|
|
||||||
private int i = 0;
|
|
||||||
public boolean hasNext() {
|
|
||||||
return i < length();
|
|
||||||
}
|
|
||||||
public T next() {
|
|
||||||
if (!hasNext()) {
|
|
||||||
throw new NoSuchElementException();
|
|
||||||
}
|
|
||||||
return get(i++);
|
|
||||||
}
|
|
||||||
public void remove() {
|
|
||||||
throw new UnsupportedOperationException();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Grammar */
|
/* Grammar */
|
||||||
|
|
||||||
public PGFRequest grammar (final GrammarCallback callback) {
|
public JSONRequest grammar (final GrammarCallback callback) {
|
||||||
return sendRequest("grammar", null, callback);
|
return sendRequest("grammar", null, callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface GrammarCallback extends GFCallback<Grammar> { }
|
public interface GrammarCallback extends JSONCallback<Grammar> { }
|
||||||
|
|
||||||
public static class Grammar extends JavaScriptObject {
|
public static class Grammar extends JavaScriptObject {
|
||||||
protected Grammar() { }
|
protected Grammar() { }
|
||||||
@@ -94,7 +53,7 @@ public class PGF {
|
|||||||
|
|
||||||
/* Translation */
|
/* Translation */
|
||||||
|
|
||||||
public PGFRequest translate (String input, List<String> fromLangs, String cat, List<String> toLangs,
|
public JSONRequest translate (String input, List<String> fromLangs, String cat, List<String> toLangs,
|
||||||
final TranslateCallback callback) {
|
final TranslateCallback callback) {
|
||||||
List<Arg> args = new ArrayList<Arg>();
|
List<Arg> args = new ArrayList<Arg>();
|
||||||
args.add(new Arg("input", input));
|
args.add(new Arg("input", input));
|
||||||
@@ -112,7 +71,7 @@ public class PGF {
|
|||||||
return sendRequest("translate", args, callback);
|
return sendRequest("translate", args, callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface TranslateCallback extends GFCallback<Translations> { }
|
public interface TranslateCallback extends JSONCallback<Translations> { }
|
||||||
|
|
||||||
public static class Translations extends IterableJsArray<Translation> {
|
public static class Translations extends IterableJsArray<Translation> {
|
||||||
protected Translations() { }
|
protected Translations() { }
|
||||||
@@ -128,7 +87,7 @@ public class PGF {
|
|||||||
|
|
||||||
/* Completion */
|
/* Completion */
|
||||||
|
|
||||||
public PGFRequest complete (String input, List<String> fromLangs, String cat, int limit, final CompleteCallback callback) {
|
public JSONRequest complete (String input, List<String> fromLangs, String cat, int limit, final CompleteCallback callback) {
|
||||||
List<Arg> args = new ArrayList<Arg>();
|
List<Arg> args = new ArrayList<Arg>();
|
||||||
args.add(new Arg("input", input));
|
args.add(new Arg("input", input));
|
||||||
if (fromLangs != null) {
|
if (fromLangs != null) {
|
||||||
@@ -141,7 +100,7 @@ public class PGF {
|
|||||||
return sendRequest("complete", args, callback);
|
return sendRequest("complete", args, callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface CompleteCallback extends GFCallback<Completions> { }
|
public interface CompleteCallback extends JSONCallback<Completions> { }
|
||||||
|
|
||||||
public static class Completions extends IterableJsArray<Translation> {
|
public static class Completions extends IterableJsArray<Translation> {
|
||||||
protected Completions() { }
|
protected Completions() { }
|
||||||
@@ -156,7 +115,7 @@ public class PGF {
|
|||||||
|
|
||||||
/* Parsing */
|
/* Parsing */
|
||||||
|
|
||||||
public PGFRequest parse (String input, List<String> fromLangs, String cat, final ParseCallback callback) {
|
public JSONRequest parse (String input, List<String> fromLangs, String cat, final ParseCallback callback) {
|
||||||
List<Arg> args = new ArrayList<Arg>();
|
List<Arg> args = new ArrayList<Arg>();
|
||||||
args.add(new Arg("input", input));
|
args.add(new Arg("input", input));
|
||||||
if (fromLangs != null) {
|
if (fromLangs != null) {
|
||||||
@@ -168,7 +127,7 @@ public class PGF {
|
|||||||
return sendRequest("parse", args, callback);
|
return sendRequest("parse", args, callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface ParseCallback extends GFCallback<ParseResults> { }
|
public interface ParseCallback extends JSONCallback<ParseResults> { }
|
||||||
|
|
||||||
public static class ParseResults extends IterableJsArray<ParseResult> {
|
public static class ParseResults extends IterableJsArray<ParseResult> {
|
||||||
protected ParseResults() { }
|
protected ParseResults() { }
|
||||||
@@ -181,68 +140,10 @@ public class PGF {
|
|||||||
public final native String getTree() /*-{ return this.tree; }-*/;
|
public final native String getTree() /*-{ return this.tree; }-*/;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Utilities */
|
/* Common */
|
||||||
|
|
||||||
private <T extends JavaScriptObject> PGFRequest sendRequest (String resource, List<Arg> vars, final GFCallback<T> callback) {
|
public <T extends JavaScriptObject> JSONRequest sendRequest(String resource, List<Arg> args, final JSONCallback<T> callback) {
|
||||||
String url = baseURL + "/" + pgfName + "/" + resource + "?" + buildQueryString(vars);
|
return JSONRequestBuilder.sendRequest(baseURL + "/" + pgfName + "/" + resource, args, callback);
|
||||||
RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, url);
|
|
||||||
builder.setTimeoutMillis(30000);
|
|
||||||
builder.setHeader("Accept","text/plain, text/html;q=0.5, */*;q=0.1");
|
|
||||||
Request request = null;
|
|
||||||
|
|
||||||
try {
|
|
||||||
request = builder.sendRequest(null, new RequestCallback() {
|
|
||||||
public void onError(Request request, Throwable e) {
|
|
||||||
callback.onError(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onResponseReceived(Request request, Response response) {
|
|
||||||
if (200 == response.getStatusCode()) {
|
|
||||||
callback.onResult((T)eval(response.getText()).cast());
|
|
||||||
} else {
|
|
||||||
RequestException e = new RequestException("Response not OK: " + response.getStatusCode() + ". " + response.getText());
|
|
||||||
callback.onError(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} catch (RequestException e) {
|
|
||||||
callback.onError(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
return new PGFRequest(request);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static native JavaScriptObject eval(String json) /*-{
|
|
||||||
return eval('(' + json + ')');
|
|
||||||
}-*/;
|
|
||||||
|
|
||||||
private static class Arg {
|
|
||||||
public final String name;
|
|
||||||
public final String value;
|
|
||||||
public Arg (String name, String value) {
|
|
||||||
this.name = name;
|
|
||||||
this.value = value;
|
|
||||||
}
|
|
||||||
public Arg (String name, int value) {
|
|
||||||
this(name, Integer.toString(value));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static String buildQueryString(List<Arg> args) {
|
|
||||||
StringBuffer sb = new StringBuffer();
|
|
||||||
if (args != null) {
|
|
||||||
for (Arg arg : args) {
|
|
||||||
if (arg.value != null) {
|
|
||||||
if (sb.length() > 0) {
|
|
||||||
sb.append("&");
|
|
||||||
}
|
|
||||||
sb.append(URL.encodeComponent(arg.name));
|
|
||||||
sb.append("=");
|
|
||||||
sb.append(URL.encodeComponent(arg.value));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return sb.toString();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
package se.chalmers.cs.gf.gwt.client;
|
|
||||||
|
|
||||||
import com.google.gwt.http.client.*;
|
|
||||||
|
|
||||||
public class PGFRequest {
|
|
||||||
|
|
||||||
private Request httpRequest;
|
|
||||||
|
|
||||||
PGFRequest (Request httpRequest) {
|
|
||||||
this.httpRequest = httpRequest;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void cancel() {
|
|
||||||
if (httpRequest != null) {
|
|
||||||
httpRequest.cancel();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -4,13 +4,8 @@ import com.google.gwt.core.client.EntryPoint;
|
|||||||
import com.google.gwt.user.client.ui.Button;
|
import com.google.gwt.user.client.ui.Button;
|
||||||
import com.google.gwt.user.client.ui.ChangeListener;
|
import com.google.gwt.user.client.ui.ChangeListener;
|
||||||
import com.google.gwt.user.client.ui.ClickListener;
|
import com.google.gwt.user.client.ui.ClickListener;
|
||||||
import com.google.gwt.user.client.ui.DockPanel;
|
|
||||||
import com.google.gwt.user.client.ui.DialogBox;
|
|
||||||
import com.google.gwt.user.client.ui.Grid;
|
|
||||||
import com.google.gwt.user.client.ui.Image;
|
|
||||||
import com.google.gwt.user.client.ui.HorizontalPanel;
|
import com.google.gwt.user.client.ui.HorizontalPanel;
|
||||||
import com.google.gwt.user.client.ui.Label;
|
import com.google.gwt.user.client.ui.Label;
|
||||||
import com.google.gwt.user.client.ui.ListBox;
|
|
||||||
import com.google.gwt.user.client.ui.PopupPanel;
|
import com.google.gwt.user.client.ui.PopupPanel;
|
||||||
import com.google.gwt.user.client.ui.RootPanel;
|
import com.google.gwt.user.client.ui.RootPanel;
|
||||||
import com.google.gwt.user.client.ui.SuggestBox;
|
import com.google.gwt.user.client.ui.SuggestBox;
|
||||||
@@ -20,13 +15,6 @@ import com.google.gwt.user.client.ui.KeyboardListenerAdapter;
|
|||||||
|
|
||||||
import com.google.gwt.core.client.GWT;
|
import com.google.gwt.core.client.GWT;
|
||||||
|
|
||||||
import com.google.gwt.user.client.Window;
|
|
||||||
|
|
||||||
import com.google.gwt.i18n.client.LocaleInfo;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
public class TranslateApp implements EntryPoint {
|
public class TranslateApp implements EntryPoint {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user