saker.build Documentation TaskDoc JavaDoc Packages
public interface StructureOutlineEntry
Interface for providing outline information about the source code.

A structure outline defines a general outline information about the structure of the source code. It is in a tree hierarchy, meaning every outline element can have children of their own, and so on.

Each outline bears a label, which is usually displayed alongside the object in an IDE. A secondary information (type) is present for more optional short information which the IDE can display. These informations are usually displayed in the following format:

 label : type
 
where ": type" is optional and might be using a different color for text display.

The outline defines two text ranges which are used to provide dynamic navigation to the user.

The offset-length pair will define the range of the corresponding source element for an outline object. When the user navigates in the source code, and the cursor is in the range, the corresponding outline object will be highlighted in the outline view.

The selection offset-selection length pair defines a range which is highlighted in the document when the user selects the outline object manually.

Example:

 build_target {
 	...
 }
 
When the user navigates the cursor inside the braces, the outline for build_target will be highlighted. When the user selects the outline for build_target, the preceding "build_target" phrase will be highlighted.

Outline tree objects should be constructed in a way that the positional information (offset and length) will be inside of the parent positional information. This ensures that the appropriate outline object will be highlighted when the user navigates through the code.

Usually the innermost outline object is highlighted.

The above mechanism for outline highlight in the IDE is a recommendation for IDE plugin implementation, but they might follow a different behaviour.

All offsets in this class is zero based, and work on decoded characters, not on raw byte data.

Methods
public default List<extends StructureOutlineEntry>
Gets the children outlines for this object.
public String
Gets the label for the outline.
public int
Gets the outline position length.
public int
Gets the outline position offset.
public default String
Gets the schema identifier string of the outline entry.
public default Map<String, String>
Gets the schema related meta-data ssociated with this outline entry.
public int
Gets the selection length.
public int
Gets the selection offset.
public default String
Gets the type of this outline.
public default List<extends StructureOutlineEntry> getChildren()
Gets the children outlines for this object.

The default implementation returns an empty list.

An unmodifiable list of child outlines.
public abstract String getLabel()
Gets the label for the outline.

The label is the primary information about the outline object, should be short, and single line.

The label.
public abstract int getLength()
Gets the outline position length.
The length.
public abstract int getOffset()
Gets the outline position offset.
The offset.
public default String getSchemaIdentifier()
Gets the schema identifier string of the outline entry.

Similarly to ScriptStructureOutline, entries can also have schema identifiers. They can be used to differentiate various outline entries for IDE plugins.

See ScriptStructureOutline.getSchemaIdentifier() for more information.

E.g.:

 "org.company.scripting.language.outline.entry.target"
 
The schema identifier or null if none.
public default Map<String, String> getSchemaMetaData()
Gets the schema related meta-data ssociated with this outline entry.

Similarly to ScriptStructureOutline, entries can also have meta-data defined for them. They can be used to convey various information about the given outline entry.

See ScriptStructureOutline.getSchemaMetaData() for more information.

The meta-data for the outline entry. May be null, or empty.
public abstract int getSelectionLength()
Gets the selection length.
The selection length.
public abstract int getSelectionOffset()
Gets the selection offset.
The selection offset.
public default String getType()
Gets the type of this outline.

The type is a secondary optional information about the outline object. Should be short and single line.

The type.