本文整理汇总了Java中org.eclipse.core.resources.IProjectDescription.setLocationURI方法的典型用法代码示例。如果您正苦于以下问题:Java IProjectDescription.setLocationURI方法的具体用法?Java IProjectDescription.setLocationURI怎么用?Java IProjectDescription.setLocationURI使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.core.resources.IProjectDescription
的用法示例。
在下文中一共展示了IProjectDescription.setLocationURI方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createBaseProject
import org.eclipse.core.resources.IProjectDescription; //导入方法依赖的package包/类
private static IProject createBaseProject(String projectName, URI location) {
IProject newProject = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
if (!newProject.exists()) {
URI projectLocation = location;
IProjectDescription description = newProject.getWorkspace().newProjectDescription(newProject.getName());
if (location != null && ResourcesPlugin.getWorkspace().getRoot().getLocationURI().equals(location)) {
projectLocation = null;
}
description.setLocationURI(projectLocation);
try {
newProject.create(description, null);
if (!newProject.isOpen()) {
newProject.open(null);
}
} catch (CoreException e) {
e.printStackTrace();
}
}
return newProject;
}
示例2: createBaseProject
import org.eclipse.core.resources.IProjectDescription; //导入方法依赖的package包/类
private static IProject createBaseProject(String projectName, URI location) {
IProject newProject = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
if (!newProject.exists()) {
URI projectLocation = location;
IProjectDescription desc =
newProject.getWorkspace().newProjectDescription(newProject.getName());
if (location != null
&& ResourcesPlugin.getWorkspace().getRoot().getLocationURI().equals(location)) {
projectLocation = null;
}
desc.setLocationURI(projectLocation);
try {
newProject.create(desc, null);
if (!newProject.isOpen()) {
newProject.open(null);
}
} catch (CoreException e) {
e.printStackTrace();
}
}
return newProject;
}
示例3: createPgDbProject
import org.eclipse.core.resources.IProjectDescription; //导入方法依赖的package包/类
public static PgDbProject createPgDbProject(IProject newProject, URI location)
throws CoreException {
if (!newProject.exists()) {
IProjectDescription desc = newProject.getWorkspace()
.newProjectDescription(newProject.getName());
desc.setLocationURI(location);
desc.setNatureIds(new String[] {NATURE.ID});
newProject.create(desc, null);
newProject.open(IResource.BACKGROUND_REFRESH, null);
newProject.getNature(NATURE.ID).configure();
}
return new PgDbProject(newProject);
}
示例4: createTheProjectAtSpecifiedLocation
import org.eclipse.core.resources.IProjectDescription; //导入方法依赖的package包/类
private IProject createTheProjectAtSpecifiedLocation(String projectName,
URI location) throws CoreException {
IProject newProject;
newProject = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
if(!newProject.exists()){
IProjectDescription desc = newProject.getWorkspace().newProjectDescription(newProject.getName());
if (location != null && ResourcesPlugin.getWorkspace().getRoot().getLocationURI().equals(location)) {
desc.setLocationURI(null);
}
else{
desc.setLocationURI(location);
}
try {
newProject.create(desc, null);
if (!newProject.isOpen()) {
newProject.open(null);
}
logger.debug("Project base structure created");
} catch (CoreException exception) {
logger.debug("Project base structure creation failed");
throw exception;
}
}
return newProject;
}
示例5: execute
import org.eclipse.core.resources.IProjectDescription; //导入方法依赖的package包/类
@Override
public void execute(IProgressMonitor monitor) throws InvocationTargetException, CoreException {
IWorkspace workspace = ResourcesPlugin.getWorkspace();
IProject newProject = config.getProject();
URI location = config.getEclipseProjectLocationUri();
String name = newProject.getName();
IProjectDescription description = workspace.newProjectDescription(name);
description.setLocationURI(location);
String operationLabel = getDescription();
SubMonitor subMonitor = SubMonitor.convert(monitor, operationLabel, 120);
CreateProjectOperation operation = new CreateProjectOperation(description, operationLabel);
try {
operation.execute(subMonitor.newChild(10), uiInfoAdapter);
mostImportant = createAndConfigureProjectContent(newProject, config, subMonitor.newChild(80));
} catch (ExecutionException ex) {
throw new InvocationTargetException(ex);
}
IFacetedProject facetedProject = ProjectFacetsManager.create(
newProject, true /* convertIfNecessary */, subMonitor.newChild(5));
addAppEngineFacet(facetedProject, subMonitor.newChild(6));
addAdditionalDependencies(newProject, config, subMonitor.newChild(20));
fixTestSourceDirectorySettings(newProject, subMonitor.newChild(5));
}
示例6: createBaseProject
import org.eclipse.core.resources.IProjectDescription; //导入方法依赖的package包/类
/**
* Just do the basics: create a basic project.
*
* @param location
* @param projectName
*/
private static IProject createBaseProject(String projectName, URI location) {
// it is acceptable to use the ResourcesPlugin class
IProject newProject = ResourcesPlugin.getWorkspace().getRoot()
.getProject(projectName);
if (!newProject.exists()) {
URI projectLocation = location;
IProjectDescription desc = newProject.getWorkspace()
.newProjectDescription(newProject.getName());
if (location != null
&& ResourcesPlugin.getWorkspace().getRoot()
.getLocationURI().equals(location)) {
projectLocation = null;
}
desc.setLocationURI(projectLocation);
try {
newProject.create(desc, null);
if (!newProject.isOpen()) {
newProject.open(null);
}
} catch (CoreException e) {
e.printStackTrace();
}
}
return newProject;
}