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


Java CreateProjectOperation类代码示例

本文整理汇总了Java中org.eclipse.ui.ide.undo.CreateProjectOperation的典型用法代码示例。如果您正苦于以下问题:Java CreateProjectOperation类的具体用法?Java CreateProjectOperation怎么用?Java CreateProjectOperation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


CreateProjectOperation类属于org.eclipse.ui.ide.undo包,在下文中一共展示了CreateProjectOperation类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: execute

import org.eclipse.ui.ide.undo.CreateProjectOperation; //导入依赖的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

示例2: createProject

import org.eclipse.ui.ide.undo.CreateProjectOperation; //导入依赖的package包/类
private IProject createProject( IProjectDescription projectDescription ) {
  String label = "Create project " + projectName;
  try {
    new CreateProjectOperation( projectDescription, label ).execute( newProgressMonitor(), null );
  } catch( ExecutionException ee ) {
    throw new RuntimeException( ee );
  }
  return ResourcesPlugin.getWorkspace().getRoot().getProject( projectName );
}
 
开发者ID:rherrmann,项目名称:eclipse-extras,代码行数:10,代码来源:ProjectHelper.java


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