Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| org.openide.src 1.8.22
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.openide.src
Interface SourceElement.Impl

All Superinterfaces:
  Element.Impl, Serializable

Enclosing class:
  SourceElement

    public static interface SourceElement.Impl

extends Element.Impl

Pluggable behaviour for source elements.

See Also:
  `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

### ADD

    static final int ADD

  Add some top-level classes.

  See Also:
    Constant Field Values

### REMOVE

    static final int REMOVE

  Remove some top-level classes.

  See Also:
    Constant Field Values

### SET

    static final int SET

  Set the top-classes.

  See Also:
    Constant Field Values

### serialVersionUID

    static final long serialVersionUID

  Deprecated. Only public by accident.
  See Also:
    Constant Field Values

Method Detail

### getStatus

    int getStatus()

  Get the parsing status of the element. This is a non-blocking operation.

  Returns:
    one of `SourceElement.STATUS_NOT`, `SourceElement.STATUS_ERROR`, `SourceElement.STATUS_PARTIAL`, or `SourceElement.STATUS_OK`

### prepare

    Task prepare()

  Begin parsing this source element. This method is non-blocking; it only returns a task that can be used to control the ongoing parse. Initially the `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.

  Returns:
    a task to control the preparation of the element

### setPackage

    void setPackage(Identifier id)
                    throws SourceException

  Set the package of this source file.

  Parameters:
    `id` - the package name, or `null` to use the default package
  Throws:
    `SourceException` - if the operation cannot proceed

### getPackage

    Identifier getPackage()

  Get the package of this source file.

  Returns:
    the package name, or `null` if this source file is in the default package

### getImports

    Import[] getImports()

  Get all imports.

  Returns:
    the imports

### changeImports

    void changeImports(Import[] elems,
                       int action)
                       throws SourceException

  Change the set of imports.

  Parameters:
    `elems` - the imports to change
    `action` - one of `ADD`, `REMOVE`, or `SET`
  Throws:
    `SourceException` - if the action cannot be handled

### changeClasses

    void changeClasses(ClassElement[] elems,
                       int action)
                       throws SourceException

  Change the set of top-level classes.

  Parameters:
    `elems` - the classes to change
    `action` - one of `ADD`, `REMOVE`, or `SET`
  Throws:
    `SourceException` - if the action cannot be handled

### getClasses

    ClassElement[] getClasses()

  Get all top-level classes.

  Returns:
    the classes

### getClass

    ClassElement getClass(Identifier name)

  Find a top-level class by name.

  Parameters:
    `name` - the name to look for
  Returns:
    the class, or `null` if it does not exist

### getAllClasses

    ClassElement[] getAllClasses()

  Get all classes recursively, both top-level and inner.

  Returns:
    all classes

### runAtomic

    void runAtomic(Runnable run)

  Lock the underlaing document to have exclusive access to it and could make changes on this SourceElement.

  Parameters:
    `run` - the action to run

### runAtomicAsUser

    void runAtomicAsUser(Runnable run)
                         throws SourceException

  Executes given runnable in "user mode" does not allowing any modifications to parts of text marked as guarded. The actions should be run as "atomic" so either happen all at once or none at all (if a guarded block should be modified).

  Parameters:
    `run` - the action to run
  Throws:
    `SourceException` - if a modification of guarded text occured and that is why no changes to the document has been done.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| org.openide.src 1.8.22
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Built on December 7 2006. | Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.