use of org.eclipse.titan.designer.properties.data.ProjectFileHandler in project titan.EclipsePlug-ins by eclipse.
the class WorkspaceHandlingLibrary method importProjectIntoWorkspace.
/**
* Imports a "source directory"and all sub elements into the workspace as a project.
* <p>
* The source directory should be a valid project.
* <p>
* Please note that the name of the project can be different from the name of the directory.
*
* @param projectName the name of the project to be created
* @param sourceLocation the location of the directory to be imported
*
* @return the imported project
*/
public static IProject importProjectIntoWorkspace(final String projectName, final URI sourceLocation) throws CoreException {
assertNotNull(projectName);
assertNotNull(sourceLocation);
IProject project = workspace.getRoot().getProject(projectName);
IProjectDescription description = workspace.newProjectDescription(projectName);
description.setLocationURI(sourceLocation);
project.create(description, null);
project.open(null);
ProjectFileHandler handler = new ProjectFileHandler(project);
handler.loadProjectSettings();
return project;
}
use of org.eclipse.titan.designer.properties.data.ProjectFileHandler in project titan.EclipsePlug-ins by eclipse.
the class ConfigurationManagerControl method changeActualConfiguration.
/**
* Changes the actually used configuration to the one being selected in
* the configuration selector. Also loads all of the settings of the new
* configuration into the project.
*/
public void changeActualConfiguration() {
IResourceRuleFactory ruleFactory = ResourcesPlugin.getWorkspace().getRuleFactory();
ISchedulingRule rule = ruleFactory.createRule(project);
try {
Job.getJobManager().beginRule(rule, new NullProgressMonitor());
actualConfiguration = configurations.getText();
final HashSet<IResource> changedResources = new HashSet<IResource>();
final Document document = ProjectDocumentHandlingUtility.getDocument(project);
Node configurationNode = ProjectFileHandler.findConfigurationNode(document.getDocumentElement(), actualConfiguration);
if (actualConfiguration == null) {
ErrorReporter.logError("The configuration `" + actualConfiguration + "' for project `" + project.getName() + "' does not exist.");
} else {
ProjectFileHandler fileHandler = new ProjectFileHandler(project);
fileHandler.loadProjectInfoFromNode(configurationNode, changedResources);
}
} finally {
Job.getJobManager().endRule(rule);
}
}
Aggregations