本文整理了Java中org.eclipse.debug.core.sourcelookup.containers.ZipEntryStorage
类的一些代码示例,展示了ZipEntryStorage
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZipEntryStorage
类的具体详情如下:
包路径:org.eclipse.debug.core.sourcelookup.containers.ZipEntryStorage
类名称:ZipEntryStorage
[英]Storage implementation for zip entries.
This class may be instantiated.
[中]zip条目的存储实现。
这个类可以被实例化。
代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.debug.core
@Override
public boolean equals(Object object) {
return object instanceof ZipEntryStorage &&
getArchive().equals(((ZipEntryStorage)object).getArchive()) &&
getZipEntry().getName().equals(((ZipEntryStorage)object).getZipEntry().getName());
}
代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.debug.core
/**
* Constructs a new storage implementation for the
* given zip entry in the specified zip file
*
* @param archive zip file
* @param entry zip entry
*/
public ZipEntryStorage(ZipFile archive, ZipEntry entry) {
setArchive(archive);
setZipEntry(entry);
}
代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.debug.core
@Override
public String getName() {
int index = getZipEntry().getName().lastIndexOf('\\');
if (index == -1) {
index = getZipEntry().getName().lastIndexOf('/');
}
if (index == -1) {
return getZipEntry().getName();
}
return getZipEntry().getName().substring(index + 1);
}
代码示例来源:origin: org.eclipse/org.eclipse.jdt.debug.ui
public String getText(Object element) {
if (element instanceof IJavaElement) {
IJavaElement parent = ((IJavaElement)element).getParent();
return fJavaLabels.getText(parent);
} else if (element instanceof ZipEntryStorage) {
ZipEntryStorage storage = (ZipEntryStorage)element;
ZipFile zipFile = storage.getArchive();
IPath path = new Path(zipFile.getName());
IRuntimeClasspathEntry entry = JavaRuntime.newArchiveRuntimeClasspathEntry(path);
IResource res = entry.getResource();
if (res == null) {
// external
return zipFile.getName();
}
// internal
return res.getName();
} else if (element instanceof LocalFileStorage) {
LocalFileStorage storage = (LocalFileStorage)element;
File extFile = storage.getFile();
return extFile.getParent();
}
return super.getText(element);
}
代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.debug.core
ZipEntry entry = searchRoots(file, newname);
if (entry != null) {
return new Object[]{new ZipEntryStorage(file, entry)};
return new Object[]{new ZipEntryStorage(file, entry)};
matches = new ArrayList<ZipEntryStorage>();
matches.add(new ZipEntryStorage(file, entry));
} else {
return new Object[]{new ZipEntryStorage(file, entry)};
代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.debug.core
@Override
public int hashCode() {
return getZipEntry().getName().hashCode();
}
}
代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.debug.core
@Override
public InputStream getContents() throws CoreException {
try {
return getArchive().getInputStream(getZipEntry());
} catch (IOException e) {
throw new CoreException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.ERROR, SourceLookupMessages.ZipEntryStorage_0, e));
}
}
代码示例来源:origin: org.eclipse/org.eclipse.jdt.debug.ui
/**
* @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
*/
public String getText(Object element) {
if (element instanceof IJavaElement) {
return ((IJavaElement)element).getElementName();
} else if (element instanceof ZipEntryStorage) {
ZipEntryStorage storage = (ZipEntryStorage)element;
return storage.getZipEntry().getName();
} else if (element instanceof LocalFileStorage) {
LocalFileStorage storage = (LocalFileStorage)element;
return storage.getName();
}
return super.getText(element);
}
代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.debug.core
@Override
public IPath getFullPath() {
return new Path(getArchive().getName()).append(getZipEntry().getName());
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.debug.ui
@Override
public String getLabel(Object o) {
if (o instanceof LocalFileStorage) {
LocalFileStorage storage = (LocalFileStorage) o;
IPath path = storage.getFullPath();
return getQualifiedName(path);
}
if (o instanceof ZipEntryStorage) {
ZipEntryStorage storage = (ZipEntryStorage)o;
StringBuffer buffer = new StringBuffer();
buffer.append(storage.getZipEntry().getName());
buffer.append(" - "); //$NON-NLS-1$
buffer.append(storage.getArchive().getName());
return buffer.toString();
}
return IInternalDebugCoreConstants.EMPTY_STRING;
}
/* (non-Javadoc)
内容来源于网络,如有侵权,请联系作者删除!