|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Pluggable behaviour for source elements.
SourceElement
Field Summary | |
static int |
ADD
Add some top-level classes. |
static int |
REMOVE
Remove some top-level classes. |
static long |
serialVersionUID
Deprecated. Only public by accident. |
static int |
SET
Set the top-classes. |
Method Summary | |
void |
changeClasses(ClassElement[] elems,
int action)
Change the set of top-level classes. |
void |
changeImports(Import[] elems,
int action)
Change the set of imports. |
ClassElement[] |
getAllClasses()
Get all classes recursively, both top-level and inner. |
ClassElement |
getClass(Identifier name)
Find a top-level class by name. |
ClassElement[] |
getClasses()
Get all top-level classes. |
Import[] |
getImports()
Get all imports. |
Identifier |
getPackage()
Get the package of this source file. |
int |
getStatus()
Get the parsing status of the element. |
Task |
prepare()
Begin parsing this source element. |
void |
runAtomic(Runnable run)
Lock the underlaing document to have exclusive access to it and could make changes on this SourceElement. |
void |
runAtomicAsUser(Runnable run)
Executes given runnable in "user mode" does not allowing any modifications to parts of text marked as guarded. |
void |
setPackage(Identifier id)
Set the package of this source file. |
Methods inherited from interface org.openide.src.Element.Impl |
addPropertyChangeListener, attachedToElement, getCookie, markCurrent, readResolve, removePropertyChangeListener |
Field Detail |
public static final int ADD
public static final int REMOVE
public static final int SET
public static final long serialVersionUID
Method Detail |
public int getStatus()
public Task prepare()
getStatus()
should be SourceElement.STATUS_NOT
, and change
to one of the other three when parsing is complete, according to whether
or not errors were encountered, and their severity.
public void setPackage(Identifier id) throws SourceException
id
- the package name, or null
to use the default package
SourceException
- if the operation cannot proceedpublic Identifier getPackage()
null
if this source file is in the default packagepublic Import[] getImports()
public void changeImports(Import[] elems, int action) throws SourceException
elems
- the imports to changeaction
- one of ADD
, REMOVE
, or SET
SourceException
- if the action cannot be handledpublic void changeClasses(ClassElement[] elems, int action) throws SourceException
elems
- the classes to changeaction
- one of ADD
, REMOVE
, or SET
SourceException
- if the action cannot be handledpublic ClassElement[] getClasses()
public ClassElement getClass(Identifier name)
name
- the name to look for
null
if it does not existpublic ClassElement[] getAllClasses()
public void runAtomic(Runnable run)
run
- the action to runpublic void runAtomicAsUser(Runnable run) throws SourceException
run
- the action to run
SourceException
- if a modification of guarded text occured
and that is why no changes to the document has been done.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |