1
0
forked from GitHub/gf-core

remove the canParse flag from the GWT applications

This commit is contained in:
krasimir
2010-08-24 14:59:59 +00:00
parent 4d1dea1b40
commit fae3df9d1f
3 changed files with 3 additions and 15 deletions

View File

@@ -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);
}
}
}

View File

@@ -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 {
}
}
}
}

View File

@@ -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);