mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-09 04:59:31 -06:00
remove the canParse flag from the GWT applications
This commit is contained in:
@@ -38,7 +38,6 @@ public class PGF {
|
||||
|
||||
public final native String getName() /*-{ return this.name; }-*/;
|
||||
public final native String getLanguageCode() /*-{ return this.languageCode; }-*/;
|
||||
public final native boolean canParse() /*-{ return this.canParse; }-*/;
|
||||
}
|
||||
|
||||
/* Translation */
|
||||
@@ -209,4 +208,4 @@ public class PGF {
|
||||
return JSONRequestBuilder.sendRequest(pgfURL, args, callback);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,8 +35,6 @@ public class PGFWrapper {
|
||||
|
||||
private LinkedHashMap<String,PGF.Language> languages;
|
||||
|
||||
private List<String> parseableLanguages;
|
||||
|
||||
private JsArrayString categories;
|
||||
private JsArrayString functions;
|
||||
|
||||
@@ -107,13 +105,9 @@ public class PGFWrapper {
|
||||
public void onResult(PGF.Grammar grammar) {
|
||||
userLanguage = grammar.getUserLanguage();
|
||||
languages = new LinkedHashMap<String,PGF.Language>();
|
||||
parseableLanguages = new ArrayList<String>();
|
||||
for (PGF.Language l : grammar.getLanguages().iterable()) {
|
||||
String name = l.getName();
|
||||
languages.put(name, l);
|
||||
if (l.canParse()) {
|
||||
parseableLanguages.add(name);
|
||||
}
|
||||
}
|
||||
|
||||
categories = grammar.getCategories();
|
||||
@@ -238,7 +232,6 @@ public class PGFWrapper {
|
||||
//
|
||||
private void clearCachedInfo () {
|
||||
languages = null;
|
||||
parseableLanguages = null;
|
||||
}
|
||||
|
||||
public String getUserLanguage () {
|
||||
@@ -249,10 +242,6 @@ public class PGFWrapper {
|
||||
PGF.Language l = languages.get(language);
|
||||
return l == null ? null : l.getLanguageCode();
|
||||
}
|
||||
|
||||
public Collection<String> getParseableLanguages() {
|
||||
return parseableLanguages;
|
||||
}
|
||||
|
||||
public Collection<String> getAllLanguages() {
|
||||
return languages.keySet();
|
||||
@@ -320,4 +309,4 @@ public class PGFWrapper {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ public class SettingsPanel extends Composite {
|
||||
if (fromLangBox != null) {
|
||||
fromLangBox.clear();
|
||||
fromLangBox.addItem("Any language", "");
|
||||
fromLangBox.addItems(pgf.getParseableLanguages());
|
||||
fromLangBox.addItems(pgf.getAllLanguages());
|
||||
String inputLanguage = pgf.getInputLanguage();
|
||||
if (inputLanguage != null) {
|
||||
fromLangBox.setSelectedValue(inputLanguage);
|
||||
|
||||
Reference in New Issue
Block a user