eclipse plugin: enable the schema parsing from a specified file

This commit is contained in:
Timotei Dolean 2010-07-24 16:26:42 +00:00
parent 8d56f6c1d3
commit 9dfc4d6e74

View file

@ -42,6 +42,17 @@ public class SchemaParser
* @param force True to force parsing the schema, skipping the existing cache
*/
public void parseSchema(boolean force)
{
parseSchema(force, Preferences.getString(
Constants.P_WESNOTH_WORKING_DIR) + "/data/schema.cfg");
}
/**
* Parses the schema
* @param force True to force parsing the schema, skipping the existing cache
* @param schemaPath The path to the 'schema.cfg' file
*/
public void parseSchema(boolean force, String schemaPath)
{
if (parsingDone_ && !force)
{
@ -57,8 +68,7 @@ public class SchemaParser
}
Logger.getInstance().log("parsing schema " + (force == true ? "forced" : ""));
File schemaFile = new File(Preferences.getString(
Constants.P_WESNOTH_WORKING_DIR) + "/data/schema.cfg");
File schemaFile = new File(schemaPath);
String res = ResourceUtils.getFileContents(schemaFile);
String[] lines = StringUtils.getLines(res);
Stack<String> tagStack = new Stack<String>();