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


Java IOverwriteQuery.ALL属性代码示例

本文整理汇总了Java中org.eclipse.ui.dialogs.IOverwriteQuery.ALL属性的典型用法代码示例。如果您正苦于以下问题:Java IOverwriteQuery.ALL属性的具体用法?Java IOverwriteQuery.ALL怎么用?Java IOverwriteQuery.ALL使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.eclipse.ui.dialogs.IOverwriteQuery的用法示例。


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

示例1: unpackResourceProject

public static IProject unpackResourceProject(IProject project, Example.Resource resource) throws Exception
{
	if (resource.getType() == Type.ENVIRONMENT)
		CloudScaleProjectSupport.addProjectNature(project);

	ZipFile file = new ZipFile(resource.getArchive().getFile());
	ZipFileStructureProvider provider = new ZipFileStructureProvider(file);
	IPath containerPath = project.getFullPath();
	Object source = provider.getRoot();

	IOverwriteQuery query = new IOverwriteQuery()
	{
		@Override
		public String queryOverwrite(String path)
		{
			return IOverwriteQuery.ALL;
		};
	};
	ImportOperation operation = new ImportOperation(containerPath, source, provider, query);
	operation.run(null);

	return project;
}
 
开发者ID:CloudScale-Project,项目名称:Environment,代码行数:23,代码来源:ExampleService.java

示例2: createExampleProject

public static IProject createExampleProject(IProject project, Example.Resource resource)
{
	try
	{

		if (resource.getType() == Type.ENVIRONMENT)
			CloudScaleProjectSupport.addProjectNature(project);

		ZipFile file = new ZipFile(resource.getArchive().getFile());
		ZipFileStructureProvider provider = new ZipFileStructureProvider(file);
		IPath containerPath = project.getFullPath();
		Object source = provider.getRoot();

		IOverwriteQuery query = new IOverwriteQuery()
		{
			@Override
			public String queryOverwrite(String path)
			{
				return IOverwriteQuery.ALL;
			};
		};
		ImportOperation operation = new ImportOperation(containerPath, source, provider, query);
		try
		{
			operation.run(null);
		} catch (Exception ex)
		{
			ex.printStackTrace();
		}
	} catch (Exception e)
	{
		e.printStackTrace();
		project = null;
	}

	return project;
}
 
开发者ID:CloudScale-Project,项目名称:Environment,代码行数:37,代码来源:ExampleProjectWizard.java

示例3: importExample

@Override
public void importExample(ExampleData edata, IProgressMonitor monitor) {
	try {
		IProjectDescription original = ResourcesPlugin.getWorkspace()
				.loadProjectDescription(new Path(edata.getProjectDir().getAbsolutePath()).append("/.project"));
		IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(edata.getProjectDir().getName());

		IProjectDescription clone = ResourcesPlugin.getWorkspace()
				.newProjectDescription(original.getName());
		clone.setBuildSpec(original.getBuildSpec());
		clone.setComment(original.getComment());
		clone.setDynamicReferences(original
				.getDynamicReferences());
		clone.setNatureIds(original.getNatureIds());
		clone.setReferencedProjects(original
				.getReferencedProjects());
		if(project.exists()){
			return;
		}
		project.create(clone, monitor);
		project.open(monitor);
		
		@SuppressWarnings("unchecked")
		List<IFile> filesToImport = FileSystemStructureProvider.INSTANCE.getChildren(edata.getProjectDir());
		ImportOperation io = new ImportOperation(project.getFullPath(), edata.getProjectDir(),
				FileSystemStructureProvider.INSTANCE, new IOverwriteQuery() {

					@Override
					public String queryOverwrite(String pathString) {
						return IOverwriteQuery.ALL;
					}

				}, filesToImport);
		io.setOverwriteResources(true);
		io.setCreateContainerStructure(false);
		io.run(monitor);
		project.refreshLocal(IProject.DEPTH_INFINITE, monitor);
	} catch (Exception e) {
		e.printStackTrace();
	}
}
 
开发者ID:Yakindu,项目名称:statecharts,代码行数:41,代码来源:GitRepositoryExampleService.java

示例4: queryOverwrite

@Override
public String queryOverwrite(String pathString) {
	return IOverwriteQuery.ALL;
}
 
开发者ID:eclipse,项目名称:thym,代码行数:4,代码来源:HybridProjectImportPage.java


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