本文整理了Java中org.eclipse.ui.wizards.datatransfer.ZipFileStructureProvider.getRoot()
方法的一些代码示例,展示了ZipFileStructureProvider.getRoot()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZipFileStructureProvider.getRoot()
方法的具体详情如下:
包路径:org.eclipse.ui.wizards.datatransfer.ZipFileStructureProvider
类名称:ZipFileStructureProvider
方法名:getRoot
[英]Returns the entry that this importer uses as the root sentinel.
[中]返回此导入程序用作根sentinel的条目。
代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui
public Image getImage(Object element) {
if (element == fProvider.getRoot()) {
return IMG_JAR;
} else {
return IMG_FOLDER;
}
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui
@Override
public Image getImage(Object element) {
if (element == fProvider.getRoot()) {
return IMG_JAR;
} else {
return IMG_FOLDER;
}
}
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui
@Override
public Object[] getElements(Object element) {
return new Object[] {fProvider.getRoot() };
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui
@Override
public Object[] getElements(Object element) {
return new Object[] {fProvider.getRoot() };
}
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui
@Override
public Image getImage(Object element) {
if (element == fProvider.getRoot()) {
return IMG_JAR;
} else {
return IMG_FOLDER;
}
}
代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui
public Object[] getElements(Object element) {
return new Object[] {fProvider.getRoot() };
}
代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui
public Object findFileByName(String name) {
return recursiveFind(fProvider.getRoot(), name);
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui
@Override
public Object getParent(Object element) {
if (element.equals(fProvider.getRoot())) {
return null;
}
IPath path= new Path(fProvider.getFullPath(element));
if (path.segmentCount() > 0) {
return findElement(path.removeLastSegments(1));
}
return fProvider.getRoot();
}
代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui
public String getText(Object element) {
if (element == fProvider.getRoot()) {
return fProvider.getZipFile().getName();
}
return fProvider.getLabel(element);
}
}
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui
@Override
public Object getParent(Object element) {
if (element.equals(fProvider.getRoot())) {
return null;
}
IPath path= new Path(fProvider.getFullPath(element));
if (path.segmentCount() > 0) {
return findElement(path.removeLastSegments(1));
}
return fProvider.getRoot();
}
代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui
public Object getParent(Object element) {
if (element.equals(fProvider.getRoot())) {
return null;
}
IPath path= new Path(fProvider.getFullPath(element));
if (path.segmentCount() > 0) {
return findElement(path.removeLastSegments(1));
}
return fProvider.getRoot();
}
代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.ui
private void importJar(File jar, IResource destination, IProgressMonitor monitor) throws CoreException, InvocationTargetException, InterruptedException {
try (ZipFile input = new ZipFile(jar);) {
ZipFileStructureProvider provider = new ZipFileStructureProvider(input);
ImportOperation op = new ImportOperation(destination.getFullPath(), provider.getRoot(), provider,
pathString -> IOverwriteQuery.ALL);
op.run(monitor);
} catch (IOException e) {
throw new CoreException(new Status(IStatus.ERROR, IPDEUIConstants.PLUGIN_ID, IStatus.OK,
NLS.bind(PDEUIMessages.NewProjectCreationOperation_errorImportingJar, jar), e));
}
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui
public Object findElement(IPath path) {
String[] segments= path.segments();
Object elem= fProvider.getRoot();
for (int i= 0; i < segments.length && elem != null; i++) {
List<?> list= fProvider.getChildren(elem);
String name= segments[i];
elem= null;
for (int k= 0; k < list.size(); k++) {
Object curr= list.get(k);
if (fProvider.isFolder(curr) && name.equals(fProvider.getLabel(curr))) {
elem= curr;
break;
}
}
}
return elem;
}
代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui
public Object findElement(IPath path) {
String[] segments= path.segments();
Object elem= fProvider.getRoot();
for (int i= 0; i < segments.length && elem != null; i++) {
List list= fProvider.getChildren(elem);
String name= segments[i];
elem= null;
for (int k= 0; k < list.size(); k++) {
Object curr= list.get(k);
if (fProvider.isFolder(curr) && name.equals(fProvider.getLabel(curr))) {
elem= curr;
break;
}
}
}
return elem;
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui
@Override
public String getText(Object element) {
if (element == fProvider.getRoot()) {
return BasicElementLabels.getResourceName(fProvider.getZipFile().getName());
}
return BasicElementLabels.getResourceName(fProvider.getLabel(element));
}
}
代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.ui
private void importFilesFromZip(ZipFile srcZipFile, IPath destPath, IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
ZipFileStructureProvider structureProvider = new ZipFileStructureProvider(srcZipFile);
ImportOperation op = new ImportOperation(destPath, structureProvider.getRoot(), structureProvider, query);
op.run(monitor);
}
}
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui
@Override
public String getText(Object element) {
if (element == fProvider.getRoot()) {
return BasicElementLabels.getResourceName(fProvider.getZipFile().getName());
}
return BasicElementLabels.getResourceName(fProvider.getLabel(element));
}
}
代码示例来源:origin: org.eclipse/org.eclipse.wst.xml.ui
private void importFilesFromZip(ZipFile srcZipFile, IPath destPath, IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
ZipFileStructureProvider structureProvider = new ZipFileStructureProvider(srcZipFile);
ImportOperation op = new ImportOperation(destPath, structureProvider.getRoot(), structureProvider, overwriteQuery);
op.run(monitor);
}
代码示例来源:origin: wala/WALA
public static void importZipfile(String projectName, ZipFile zipFile, IProgressMonitor monitor) {
ZipFileStructureProvider provider = new ZipFileStructureProvider(zipFile);
importProject(provider, monitor, projectName, provider.getRoot());
try {
zipFile.close();
} catch (IOException e) {
e.printStackTrace();
}
}
代码示例来源:origin: org.eclipse/org.eclipse.jst.j2ee.ui
/**
* Import the resources with extensions as specified by the user
*/
protected boolean importResourcesFromZip(List fileSystemObjects) {
ZipFile zipFile = getSpecifiedSourceFile();
ZipFileStructureProvider structureProvider = getStructureProvider(zipFile);
boolean result = executeImportOperation(new ImportOperation(getContainerFullPath(), structureProvider.getRoot(), structureProvider, this, fileSystemObjects));
closeZipFile(zipFile);
return result;
}
内容来源于网络,如有侵权,请联系作者删除!