# com.bea.ide.sourceeditor.driver
ISourceViewDriver Interface

public interface ISourceViewDriver
extends `IDriverSupport`

Implements customizable features of the source view. This driver extends IDriverSupport so that the source view can obtain customized drivers for structure view, property view, etc.... The SourceView will call ISourceViewDriver#getDriver(Object) for drivers not implemented by the source view itself. Drivers that the source view implements, include: IHelpDriver, IPrintDriver and ITransferDriver.

All Known Implementing Classes
  `DefaultSourceViewDriver`

All Superinterfaces
  `IDriverSupport`

## Method Summary

`public `String`` | `getCollapsedText`(`ISourceElement` element) Allows a document implementation to specify the text that appears on the single line left visible when an editor section is collapsed.
`public `String`` | `getCollapsedText`(`ISourceElementGroup` group) Allows a document implementation to specify the text that appears on the single line left visible when an editor section is collapsed.
`public `ISourceElementGroup`` | `getElementGroup`(`ISourceElement` element) Some elements are not themselves collapsible, but can be grouped with like elements into an imaginary container element that is collapsible.
`public `ILanguageDriver`` | `getLanguageDriver`(`String` language) Returns an ILanguageDriver appropriate for the named language.
`public `Range`` | `getSelectionRange`(`ISourceElement` element) Allows a document type to specify what range of text should be selected when an element selection is translated to a text selection, generally during a call to `ISourceView.setSelection(ISourceElement, int)```.
`public boolean` | `isCollapsedByDefault`(`ISourceElement` element) Allows a document implementation to specify which ISourceElements are collapsed by default.
`public boolean` | `isCollapsedByDefault`(`ISourceElementGroup` group) Allows a document implementation to specify which ISourceElement groups are collapsed by default.
`public boolean` | `isCollapsible`(`ISourceElement` element) Allows a document implementation to specify which ISourceElement types are collapsible.
`public boolean` | `isCollapsible`(`ISourceElementGroup` group) Allows a document implementation to specify which ISourceElement types are collapsible as groups.
`public boolean` | `showCollapse`() Specifies whether collapsible editor sections are displayed in the source editor line bar.

Methods from interface `com.bea.ide.core.`IDriverSupport``
``getDriver``

## Method Detail

### getCollapsedText(ISourceElement) Method

    public String getCollapsedText(ISourceElement element)

Allows a document implementation to specify the text that appears on the single line left visible when an editor section is collapsed. Note that this method is only relevant if `showCollapse``` returns true.

#### Parameters

element
  The element in question.

### getCollapsedText(ISourceElementGroup) Method

    public String getCollapsedText(ISourceElementGroup group)

Allows a document implementation to specify the text that appears on the single line left visible when an editor section is collapsed. Note that this method is only relevant if `showCollapse``` returns true.

#### Parameters

group
  The element group in question.

### getElementGroup(ISourceElement) Method

    public ISourceElementGroup getElementGroup(ISourceElement element)

Some elements are not themselves collapsible, but can be grouped with like elements into an imaginary container element that is collapsible.

When consecutive ISourceElement objects use the same group object, the collapsing lines feature creates a collapsible node around them.

Stylistically, it is akward when an element is both part of a group and itself individually collapsible. However, this is technically allowed.

#### Parameters

element
  The element in question.

### getLanguageDriver(String) Method

    public ILanguageDriver getLanguageDriver(String language)

Returns an ILanguageDriver appropriate for the named language. Language names are generally obtained by calling `CompilerSvc.get().getLanguageName```.

#### Parameters

language
  a the name of the language for which a driver is needed

#### Returns

an ILangaugeDriver specific to the specified language

### getSelectionRange(ISourceElement) Method

    public Range getSelectionRange(ISourceElement element)

Allows a document type to specify what range of text should be selected when an element selection is translated to a text selection, generally during a call to `ISourceView.setSelection(ISourceElement, int)```. For example, the text selection that results from double-clicking an element in the structure pane is determined by calling this method. The default selection places the cursor at the beginning of the element. Other implementations may want to select the entire element or a sub-element or property.

### isCollapsedByDefault(ISourceElement) Method

    public boolean isCollapsedByDefault(ISourceElement element)

Allows a document implementation to specify which ISourceElements are collapsed by default. Note that this method is only relevant if `showCollapse``` returns true. This method will only be called for elements that are specified as collapsible by the `isCollapsible``` method of this class.

#### Parameters

element
  The element in question. Generally only the element's type is considered.

### isCollapsedByDefault(ISourceElementGroup) Method

    public boolean isCollapsedByDefault(ISourceElementGroup group)

Allows a document implementation to specify which ISourceElement groups are collapsed by default. Note that this method is only relevant if `showCollapse``` returns true.

#### Parameters

group
  The element group type in question.

### isCollapsible(ISourceElement) Method

    public boolean isCollapsible(ISourceElement element)

Allows a document implementation to specify which ISourceElement types are collapsible. Note that this method is only relevant if `showCollapse``` returns true.

#### Parameters

element
  The element in question. Generally only the element's type is considered.

### isCollapsible(ISourceElementGroup) Method

    public boolean isCollapsible(ISourceElementGroup group)

Allows a document implementation to specify which ISourceElement types are collapsible as groups. Note that this method is only relevant if `showCollapse``` returns true.

#### Parameters

group
  The group type in question.

### showCollapse() Method

    public boolean showCollapse()

Specifies whether collapsible editor sections are displayed in the source editor line bar. If a particular document type does not specify any collapsible element types in `isCollapsible``` then this method should return false, as extra processing is required when the feature is enabled.

#### Returns

a boolean indicating whether collapsible sections are enabled for the owning document type.