本文整理了Java中org.eclipse.ui.wizards.datatransfer.ZipFileStructureProvider.getLabel()
方法的一些代码示例,展示了ZipFileStructureProvider.getLabel()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZipFileStructureProvider.getLabel()
方法的具体详情如下:
包路径:org.eclipse.ui.wizards.datatransfer.ZipFileStructureProvider
类名称:ZipFileStructureProvider
方法名:getLabel
暂无
代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui
private Object recursiveFind(Object element, String name) {
if (name.equals(fProvider.getLabel(element))) {
return element;
}
List list= fProvider.getChildren(element);
if (list != null) {
for (int k= 0; k < list.size(); k++) {
Object res= recursiveFind(list.get(k), name);
if (res != null) {
return res;
}
}
}
return null;
}
代码示例来源: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.pde/org.eclipse.pde.ui
public static String[] getTopLevelResources(File file) {
ArrayList<String> result = new ArrayList<>();
try (ZipFile zipFile = new ZipFile(file)) {
ZipFileStructureProvider provider = new ZipFileStructureProvider(zipFile);
List<?> children = provider.getChildren(provider.getRoot());
if (children != null && !children.isEmpty()) {
for (int i = 0; i < children.size(); i++) {
Object curr = children.get(i);
if (provider.isFolder(curr)) {
if (!isClassFolder(provider, curr))
result.add(provider.getLabel(curr) + "/"); //$NON-NLS-1$
else {
if (!result.contains(".")) //$NON-NLS-1$
result.add("."); //$NON-NLS-1$
}
} else {
result.add(provider.getLabel(curr));
}
}
}
} catch (IOException e) {
}
return result.toArray(new String[result.size()]);
}
代码示例来源: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
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.jdt/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.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.pde/org.eclipse.pde.ui
boolean ignoreThisChild = false;
for (IPath currentPath : ignoreFolders) {
if (provider.getLabel(curr).equals(currentPath.segment(0))) {
if (currentPath.segmentCount() > 1) {
} else if (!provider.getLabel(curr).endsWith(".class")) { //$NON-NLS-1$
collected.add(curr);
代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.ui
/**
* Recursively searches through the zip files searching for files inside of
* the specified folder. The files found will be added to the given list.
* @param provider zip provider
* @param element element of the zip currently being looked at
* @param folderPath location of the folder to get resources from
* @param collected list of files found
* @since 3.4
*/
private static void collectResourcesFromFolder(ZipFileStructureProvider provider, Object element, IPath folderPath, ArrayList<Object> collected) {
List<?> children = provider.getChildren(element);
if (children != null && !children.isEmpty()) {
for (int i = 0; i < children.size(); i++) {
Object curr = children.get(i);
if (provider.isFolder(curr)) {
if (provider.getLabel(curr).equals(folderPath.segment(0))) {
if (folderPath.segmentCount() > 1) {
collectResourcesFromFolder(provider, curr, folderPath.removeFirstSegments(1), collected);
} else {
collectResources(provider, curr, collected);
}
}
}
}
}
}
代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.ui
boolean ignoreThisChild = false;
for (IPath currentPath : ignoreFolders) {
if (provider.getLabel(curr).equals(currentPath.segment(0))) {
if (currentPath.segmentCount() > 1) {
内容来源于网络,如有侵权,请联系作者删除!