本文整理汇总了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));
}
示例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 );
}