eclipse plugin: Rename 'ConfigFile' to 'WMLConfig'

This commit is contained in:
Timotei Dolean 2011-07-15 21:05:08 +00:00
parent d7289ab78d
commit df0bc04176
5 changed files with 27 additions and 28 deletions

View file

@ -38,7 +38,7 @@ import org.wesnoth.utils.StringUtils;
import org.wesnoth.utils.WMLGrammarUtils;
import org.wesnoth.wml.WMLKey;
import org.wesnoth.wml.WMLTag;
import org.wesnoth.wml.core.ConfigFile;
import org.wesnoth.wml.core.WMLConfig;
public class WMLProposalProvider extends AbstractWMLProposalProvider
{
@ -181,7 +181,7 @@ public class WMLProposalProvider extends AbstractWMLProposalProvider
if ( keyName.equals("next_scenario") || //$NON-NLS-1$
keyName.equals("first_scenario")) //$NON-NLS-1$
{
for(ConfigFile config : projectCache_.getConfigs().values())
for(WMLConfig config : projectCache_.getWMLConfigs().values())
{
if (StringUtils.isNullOrEmpty( config.ScenarioId ))
continue;

View file

@ -27,8 +27,8 @@ import org.wesnoth.preprocessor.Define;
import org.wesnoth.preprocessor.PreprocessorUtils;
import org.wesnoth.utils.ResourceUtils;
import org.wesnoth.utils.WorkspaceUtils;
import org.wesnoth.wml.core.ConfigFile;
import org.wesnoth.wml.core.Variable;
import org.wesnoth.wml.core.WMLConfig;
/**
* A class that stores some project specific infos
@ -47,7 +47,7 @@ public class ProjectCache
private File definesFile_;
private File treeCacheFile_;
private Map< String, ConfigFile > configFiles_;
private Map< String, WMLConfig > configFiles_;
private Map< String, Define > defines_;
private DependencyListBuilder dependTree_;
@ -57,7 +57,7 @@ public class ProjectCache
{
project_ = project;
configFiles_ = new HashMap<String, ConfigFile>();
configFiles_ = new HashMap<String, WMLConfig>();
defines_ = new HashMap<String, Define>(0);
dependTree_ = new DependencyListBuilder( project_ );
@ -111,7 +111,7 @@ public class ProjectCache
if (config.getName().startsWith("config") == false) //$NON-NLS-1$
continue;
ConfigFile tmp = new ConfigFile(config.get("filename")); //$NON-NLS-1$
WMLConfig tmp = new WMLConfig(config.get("filename")); //$NON-NLS-1$
tmp.ScenarioId = config.get( "scenario_id" ); //$NON-NLS-1$
tmp.CampaignId = config.get( "campaign_id" ); //$NON-NLS-1$
@ -157,28 +157,28 @@ public class ProjectCache
}
/**
* Gets the map with the Configs
* Gets the map with the WMLConfigs
* The key represent the filenames of the files
* and the value the scenarioId from that file
* @return
* @return A map with key the file path and value the WMLConfig
*/
public Map<String, ConfigFile> getConfigs()
public Map<String, WMLConfig> getWMLConfigs()
{
return configFiles_;
}
/**
* Gets the Config by it's filename.
* If the Config doesn't exist it will be created
* @param name
* Gets the WMLConfig by the specified file project-relative path.
* If the WMLConfig doesn't exist it will be created
* @param path The project-relative path for the file.
* @return
*/
public ConfigFile getConfig(String name)
public WMLConfig getWMLConfig( String path )
{
ConfigFile config = configFiles_.get( name );
WMLConfig config = configFiles_.get( path );
if ( config == null ){
config = new ConfigFile( name );
configFiles_.put( name, config );
config = new WMLConfig( path );
configFiles_.put( path, config );
}
return config;
@ -199,7 +199,7 @@ public class ProjectCache
// save config files info
int configCnt = 0;
IDialogSettings configsSection = properties_.addNewSection("configs"); //$NON-NLS-1$
for(ConfigFile config : configFiles_.values())
for(WMLConfig config : configFiles_.values())
{
IDialogSettings configSection = configsSection.addNewSection("config" + configCnt); //$NON-NLS-1$
configSection.put("scenario_id", config.ScenarioId); //$NON-NLS-1$

View file

@ -71,11 +71,11 @@ public class GameUtils
String scenarioId = null;
campaignId = ProjectUtils.getCacheForProject(selectedResource.getProject()).
getConfig("_main.cfg").CampaignId; //$NON-NLS-1$
getWMLConfig("_main.cfg").CampaignId; //$NON-NLS-1$
if (scenario == true && selectedResource instanceof IFile)
scenarioId = ProjectUtils.getCacheForProject(selectedResource.getProject()).
getConfig(selectedResource.getProjectRelativePath( ).toString( )).ScenarioId;
getWMLConfig(selectedResource.getProjectRelativePath( ).toString( )).ScenarioId;
if (campaignId == null)
{

View file

@ -10,7 +10,7 @@ package org.wesnoth.utils;
import java.util.Stack;
import org.wesnoth.wml.core.ConfigFile;
import org.wesnoth.wml.core.WMLConfig;
import org.wesnoth.wml.core.Variable;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
@ -25,7 +25,7 @@ public class WMLSaxHandler extends DefaultHandler
private Stack<String> stack_;
private Variable tmpVar_;
private String filePath_;
private ConfigFile cfg_;
private WMLConfig cfg_;
private int STATUS = 0;
/** states list */
@ -39,7 +39,7 @@ public class WMLSaxHandler extends DefaultHandler
{
stack_ = new Stack<String>();
filePath_ = filePath;
cfg_ = new ConfigFile(filePath);
cfg_ = new WMLConfig(filePath);
}
@Override
@ -131,7 +131,7 @@ public class WMLSaxHandler extends DefaultHandler
* Gets the Config resulted by parsing the file
* @return
*/
public ConfigFile getConfigFile()
public WMLConfig getConfigFile()
{
return cfg_;
}

View file

@ -14,14 +14,13 @@ import java.util.List;
/**
* A class that stores WML config file specific information
*/
public class ConfigFile
public class WMLConfig
{
public String ScenarioId;
/**
* True if there was a [scenario] tag present in the file.
*
* However The {@link ConfigFile#ScenarioId} may be null
* However The {@link WMLConfig#ScenarioId} may be null
*/
public boolean IsScenario;
@ -29,14 +28,14 @@ public class ConfigFile
/**
* True if there was a [campaign] tag present in the file.
*
* However The {@link ConfigFile#CampaignId} may be null
* However The {@link WMLConfig#CampaignId} may be null
*/
public boolean IsCampaign;
private List<Variable> variables_;
private String filename_;
public ConfigFile(String filename)
public WMLConfig(String filename)
{
variables_ = new ArrayList<Variable>();
filename_ = filename;