当前位置: 首页>>代码示例>>Java>>正文


Java IProjectDescription.setLocationURI方法代码示例

本文整理汇总了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;
}
 
开发者ID:Imhotup,项目名称:LibertyEiffel-Eclipse-Plugin,代码行数:24,代码来源:LEProjectSupport.java

示例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;
}
 
开发者ID:bazelbuild,项目名称:eclipse,代码行数:26,代码来源:BazelProjectSupport.java

示例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);
}
 
开发者ID:pgcodekeeper,项目名称:pgcodekeeper,代码行数:15,代码来源:PgDbProject.java

示例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;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:28,代码来源:ProjectStructureCreator.java

示例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));
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:29,代码来源:CreateAppEngineWtpProject.java

示例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;
}
 
开发者ID:ncleclipse,项目名称:ncl30-eclipse,代码行数:35,代码来源:CustomProjectSupport.java


注:本文中的org.eclipse.core.resources.IProjectDescription.setLocationURI方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。