本文整理汇总了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;
}
示例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;
}
示例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();
}
}
示例4: queryOverwrite
@Override
public String queryOverwrite(String pathString) {
return IOverwriteQuery.ALL;
}