本文整理汇总了Java中org.eclipse.jdt.internal.core.hierarchy.TypeHierarchy类的典型用法代码示例。如果您正苦于以下问题:Java TypeHierarchy类的具体用法?Java TypeHierarchy怎么用?Java TypeHierarchy使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TypeHierarchy类属于org.eclipse.jdt.internal.core.hierarchy包,在下文中一共展示了TypeHierarchy类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: notifyTypeHierarchies
import org.eclipse.jdt.internal.core.hierarchy.TypeHierarchy; //导入依赖的package包/类
private void notifyTypeHierarchies(IElementChangedListener[] listeners, int listenerCount) {
for (int i = 0; i < listenerCount; i++) {
final IElementChangedListener listener = listeners[i];
if (!(listener instanceof TypeHierarchy)) continue;
// wrap callbacks with Safe runnable for subsequent listeners to be called when some are
// causing grief
SafeRunner.run(
new ISafeRunnable() {
public void handleException(Throwable exception) {
Util.log(
exception,
"Exception occurred in listener of Java element change notification"); // $NON-NLS-1$
}
public void run() throws Exception {
TypeHierarchy typeHierarchy = (TypeHierarchy) listener;
if (typeHierarchy.hasFineGrainChanges()) {
// case of changes in primary working copies
typeHierarchy.needsRefresh = true;
typeHierarchy.fireChange();
}
}
});
}
}
示例2: notifyTypeHierarchies
import org.eclipse.jdt.internal.core.hierarchy.TypeHierarchy; //导入依赖的package包/类
private void notifyTypeHierarchies(IElementChangedListener[] listeners, int listenerCount) {
for (int i= 0; i < listenerCount; i++) {
final IElementChangedListener listener = listeners[i];
if (!(listener instanceof TypeHierarchy)) continue;
// wrap callbacks with Safe runnable for subsequent listeners to be called when some are causing grief
SafeRunner.run(new ISafeRunnable() {
public void handleException(Throwable exception) {
Util.log(exception, "Exception occurred in listener of Java element change notification"); //$NON-NLS-1$
}
public void run() throws Exception {
TypeHierarchy typeHierarchy = (TypeHierarchy)listener;
if (typeHierarchy.hasFineGrainChanges()) {
// case of changes in primary working copies
typeHierarchy.needsRefresh = true;
typeHierarchy.fireChange();
}
}
});
}
}
示例3: CreateTypeHierarchyOperation
import org.eclipse.jdt.internal.core.hierarchy.TypeHierarchy; //导入依赖的package包/类
/**
* Constructs an operation to create a type hierarchy for the
* given type and working copies.
*/
public CreateTypeHierarchyOperation(IType element, ICompilationUnit[] workingCopies, IJavaSearchScope scope, boolean computeSubtypes) {
super(element);
ICompilationUnit[] copies;
if (workingCopies != null) {
int length = workingCopies.length;
copies = new ICompilationUnit[length];
System.arraycopy(workingCopies, 0, copies, 0, length);
} else {
copies = null;
}
this.typeHierarchy = new TypeHierarchy(element, copies, scope, computeSubtypes);
}
示例4: processDelta
import org.eclipse.jdt.internal.core.hierarchy.TypeHierarchy; //导入依赖的package包/类
public void processDelta(IJavaElementDelta delta, int eventType) {
if (this.needsRefresh) return;
this.needsRefresh = this.hierarchy == null ? false : ((TypeHierarchy)this.hierarchy).isAffected(delta, eventType);
}
示例5: loadTypeHierachy
import org.eclipse.jdt.internal.core.hierarchy.TypeHierarchy; //导入依赖的package包/类
public ITypeHierarchy loadTypeHierachy(InputStream input, WorkingCopyOwner owner, IProgressMonitor monitor) throws JavaModelException {
return TypeHierarchy.load(this, input, owner);
}
示例6: loadTypeHierachy
import org.eclipse.jdt.internal.core.hierarchy.TypeHierarchy; //导入依赖的package包/类
/**
* NOTE: This method is not part of the API has it is not clear clients would easily use it: they would need to
* first make sure all working copies for the given owner exist before calling it. This is especially har at startup
* time.
* In case clients want this API, here is how it should be specified:
* <p>
* Loads a previously saved ITypeHierarchy from an input stream. A type hierarchy can
* be stored using ITypeHierachy#store(OutputStream). A compilation unit of a
* loaded type has the given owner if such a working copy exists, otherwise the type's
* compilation unit is a primary compilation unit.
*
* Only hierarchies originally created by the following methods can be loaded:
* <ul>
* <li>IType#newSupertypeHierarchy(IProgressMonitor)</li>
* <li>IType#newSupertypeHierarchy(WorkingCopyOwner, IProgressMonitor)</li>
* <li>IType#newTypeHierarchy(IJavaProject, IProgressMonitor)</li>
* <li>IType#newTypeHierarchy(IJavaProject, WorkingCopyOwner, IProgressMonitor)</li>
* <li>IType#newTypeHierarchy(IProgressMonitor)</li>
* <li>IType#newTypeHierarchy(WorkingCopyOwner, IProgressMonitor)</li>
* </u>
*
* @param input stream where hierarchy will be read
* @param monitor the given progress monitor
* @return the stored hierarchy
* @exception JavaModelException if the hierarchy could not be restored, reasons include:
* - type is not the focus of the hierarchy or
* - unable to read the input stream (wrong format, IOException during reading, ...)
* @see ITypeHierarchy#store(java.io.OutputStream, IProgressMonitor)
* @since 3.0
*/
public ITypeHierarchy loadTypeHierachy(InputStream input, WorkingCopyOwner owner, IProgressMonitor monitor) throws JavaModelException {
// TODO monitor should be passed to TypeHierarchy.load(...)
return TypeHierarchy.load(this, input, owner);
}