|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ITypeRoot
Represents an entire JavaScript type root (either an IJavaScriptUnit
or an IClassFile
).
This interface is not intended to be implemented by clients.
Note that methods {@link #findPrimaryType()} and {@link #getElementAt(int)}
were already implemented in this interface respectively since version 3.0 and version 1.0.
,
Note that method {@link #getWorkingCopy(WorkingCopyOwner, IProgressMonitor)}
was already implemented in this interface since version 3.0.
Provisional API: This class/interface is part of an interim API that is still under development and expected to
change significantly before reaching stability. It is being made available at this early stage to solicit feedback
from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
(repeatedly) as the API evolves.
Field Summary |
---|
Fields inherited from interface org.eclipse.wst.jsdt.core.IJavaScriptElement |
---|
CLASS_FILE, FIELD, IMPORT_CONTAINER, IMPORT_DECLARATION, INITIALIZER, JAVASCRIPT_MODEL, JAVASCRIPT_PROJECT, JAVASCRIPT_UNIT, LOCAL_VARIABLE, METHOD, PACKAGE_DECLARATION, PACKAGE_FRAGMENT, PACKAGE_FRAGMENT_ROOT, TYPE, TYPE_PARAMETER |
Method Summary | |
---|---|
IType |
findPrimaryType()
Finds the primary type of this JavaScript type root (that is, the type with the same name as the javascript file), or null if no such a type exists. |
IJavaScriptElement |
getElementAt(int position)
Returns the smallest element within this JavaScript type root that includes the given source position (that is, a method, field, etc.), or null if there is no element other than the JavaScript type root
itself at the given position, or if the given position is not
within the source range of the source of this JavaScript type root. |
IJavaScriptUnit |
getWorkingCopy(WorkingCopyOwner owner,
IProgressMonitor monitor)
Returns a shared working copy on this javaScirpt file using the given working copy owner to create the buffer. |
Methods inherited from interface org.eclipse.wst.jsdt.core.IJavaScriptElement |
---|
exists, getAncestor, getAttachedJavadoc, getCommonSuperType, getCorrespondingResource, getDisplayName, getElementName, getElementType, getHandleIdentifier, getHostPath, getJavaScriptModel, getJavaScriptProject, getOpenable, getParent, getPath, getPrimaryElement, getResource, getSchedulingRule, getUnderlyingResource, isReadOnly, isStructureKnown, isVirtual |
Methods inherited from interface org.eclipse.wst.jsdt.core.ILookupScope |
---|
newNameLookup, newNameLookup, newSearchableNameEnvironment, newSearchableNameEnvironment |
Methods inherited from interface org.eclipse.wst.jsdt.core.IParent |
---|
getChildren, hasChildren |
Methods inherited from interface org.eclipse.wst.jsdt.core.IOpenable |
---|
close, findRecommendedLineSeparator, getBuffer, hasUnsavedChanges, isConsistent, isOpen, makeConsistent, open, save |
Methods inherited from interface org.eclipse.wst.jsdt.core.ISourceReference |
---|
exists, getSource, getSourceRange |
Methods inherited from interface org.eclipse.wst.jsdt.core.ICodeAssist |
---|
codeComplete, codeComplete, codeSelect, codeSelect |
Methods inherited from interface org.eclipse.wst.jsdt.core.IFunctionContainer |
---|
getField, getFields, getFunction, getFunctions, getMethods, getType |
Method Detail |
---|
IType findPrimaryType()
null
if no such a type exists.
null
if no such a type existsIJavaScriptElement getElementAt(int position) throws JavaScriptModelException
null
if there is no element other than the JavaScript type root
itself at the given position, or if the given position is not
within the source range of the source of this JavaScript type root.
position
- a source position inside the JavaScript type root
null
if none (excluding the JavaScript type root).
JavaScriptModelException
- if the JavaScript type root does not exist or if an
exception occurs while accessing its corresponding resourceIJavaScriptUnit getWorkingCopy(WorkingCopyOwner owner, IProgressMonitor monitor) throws JavaScriptModelException
Object.equals(java.lang.Object)
).
The life time of a shared working copy is as follows:
getWorkingCopy(WorkingCopyOwner, IProgressMonitor)
creates a new working copy for this elementIJavaScriptUnit.discardWorkingCopy()
decrements the internal counter.Note that the working copy owner will be used for the life time of the shared working copy, that is if the working copy is closed then reopened, this owner will be used. The buffer will be automatically initialized with the original's JavaScript type root content upon creation.
When the shared working copy instance is created, an ADDED IJavaScriptElementDelta is reported on this working copy.
A working copy can be created on a not-yet existing compilation unit. In particular, such a working copy can then be committed in order to create the corresponding compilation unit.
Note that possible problems of this working copy are reported using this method. only
if the given working copy owner returns a problem requestor for this working copy
(see WorkingCopyOwner.getProblemRequestor(IJavaScriptUnit)
).
owner
- the working copy owner that creates a buffer that is used to get the content
of the working copymonitor
- a progress monitor used to report progress while opening this compilation unit
or null
if no progress should be reported
JavaScriptModelException
- if the contents of this element can
not be determined.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |