本文整理匯總了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;
}