| Summary: | API request for class SourceType | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Eugene Chan <ewchan> |
| Component: | Core | Assignee: | JDT-Core-Inbox <jdt-core-inbox> |
| Status: | CLOSED INVALID | QA Contact: | |
| Severity: | blocker | ||
| Priority: | P3 | CC: | popescu |
| Version: | 3.2 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows 2000 | ||
| Whiteboard: | |||
| Bug Depends on: | |||
| Bug Blocks: | 126587 | ||
*** Bug 126614 has been marked as a duplicate of this bug. *** From this code snippet, you're using isAnonymous(), getOccurrenceCount() and getElementName() which are all available as existing APIs on IType or its super interfaces. Did I miss something ? Thanks for your comment, this bug is no longer valid. close bug. |
Internal class org.eclipse.jdt.internal.core.SourceType is required in TPTP for Source Opening Action. We would like to request that this be made public API. Here is how it is used: /** * Returns the specified inner class from the given java element. * * @param je the java element containing the inner class. * @param innerClassType the inner class to get. * @return an IType representing the inner class. */ private static IType getInnerType(IJavaElement je, InnerClassType innerClassType) { try { if (je instanceof SourceType) { SourceType type = (SourceType) je; if (type.isAnonymous() == innerClassType.isAnonymous() && ((innerClassType.isAnonymous() && innerClassType.getAnonymousNumber() == type.getOccurrenceCount()) || (!innerClassType.isAnonymous() && type.getElementName().equals(innerClassType.getName())))) return type; } if (je instanceof IParent) { IParent parentElement = (IParent)je; IJavaElement[] children = parentElement.getChildren(); for (int i = 0; i < children.length; i++) { IType result = getInnerType(children[i], innerClassType); if (result != null) return result; } } } catch (Exception e) { HyadesUIPlugin.logError(e); } return null; } This is a blocking defect on TPTP.