# com.bea.ide.sourceeditor.driver
DefaultSourceViewDriver Class

public class DefaultSourceViewDriver
extends `DefaultDocumentDriver`
implements `ISourceViewDriver`

A default implementation of `SourceViewStrategy`.

Hierarchy
  `Object`
  `DefaultDocumentDriver`
  `DefaultSourceViewDriver`

All Implemented Interfaces
  `IDriverSupport`, `ISourceViewDriver`

Direct Known Subclasses
  `JavaSourceViewDriver`, `XmlSourceViewDriver`

## Constructor Summary

DefaultSourceViewDriver(`ISourceDocument` moduleDoc)

## Method Summary

`protected void` | `addDriver`(`Class` oClass, `Object` driver) Allows derived classes to add a driver to the driver map.
`public `String`` | `getCollapsedText`(`ISourceElement` element) Default implementation of getCollapsedText.
`public `String`` | `getCollapsedText`(`ISourceElementGroup` group) Default implementation of getCollapsedText.
`public `Object`` | `getDriver`(`Class` oClass) Returns the driver object associated with the given class.
`public `ISourceElementGroup`` | `getElementGroup`(`ISourceElement` element) Default implementation of getElementGroup.
`public `ILanguageDriver`` | `getLanguageDriver`(`String` language) Default implementation of getLanguageDriver.
`public `Range`` | `getSelectionRange`(`ISourceElement` element) Default implementation of getSelectionRange.
`public boolean` | `isCollapsedByDefault`(`ISourceElement` element) Default implementation of isCollapsedByDefault.
`public boolean` | `isCollapsedByDefault`(`ISourceElementGroup` group) Default implementation of isCollapsedByDefault.
`public boolean` | `isCollapsible`(`ISourceElement` element) Default implementation of isCollapsible.
`public boolean` | `isCollapsible`(`ISourceElementGroup` group) Default implementation of isCollapsible.
`public boolean` | `showCollapse`() Default implementation of showCollapse.

Methods from `com.bea.ide.sourceeditor.driver.`DefaultDocumentDriver``
``getDocument`, `setDocument``

Methods from class `java.lang.`Object``
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

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

Methods from interface `com.bea.ide.sourceeditor.driver.`ISourceViewDriver``
``getCollapsedText`, `getCollapsedText`, `getElementGroup`, `getLanguageDriver`, `getSelectionRange`, `isCollapsedByDefault`, `isCollapsedByDefault`, `isCollapsible`, `isCollapsible`, `showCollapse``

## Constructor Detail

### DefaultSourceViewDriver

    public DefaultSourceViewDriver(ISourceDocument moduleDoc)

## Method Detail

### addDriver(Class, Object) Method

    protected void addDriver(Class oClass,
                             Object driver)

Allows derived classes to add a driver to the driver map. These will be returned automatically in response to a call to getDriver()

### getCollapsedText(ISourceElement) Method

    public String getCollapsedText(ISourceElement element)

Default implementation of getCollapsedText.

#### Parameters

element
  The element in question.

#### Returns

null. By default, the source view will not display collapsible regions.

Related Topics

``ISourceViewDriver.getCollapsedText(ISourceElement)``

### getCollapsedText(ISourceElementGroup) Method

    public String getCollapsedText(ISourceElementGroup group)

Default implementation of getCollapsedText.

#### Parameters

group
  The element group in question.

#### Returns

null. By default, the source view will not display collapsible regions.

Related Topics

``ISourceViewDriver.getCollapsedText(ISourceElement)``

### getDriver(Class) Method

    public Object getDriver(Class oClass)

Description copied from `IDriverSupport.getDriver(Class)`
Returns the driver object associated with the given class. Drivers are typically used to customize the behavior of shared services and implementations. Typically, the driver will be represented by some interface. When that interface is passed to getDriver, the object implementing the interface for this document should be returned. The method may return null to indicate that the requested driver does not have an implementation for this document.

#### Parameters

oClass
  The class object representing the class of the driver that is being requested.

#### Returns

An object implementing the given class or null if no driver is not implemented.

Related Topics

``IDriverSupport.getDriver(Class)``

### getElementGroup(ISourceElement) Method

    public ISourceElementGroup getElementGroup(ISourceElement element)

Default implementation of getElementGroup.

#### Parameters

element
  The element in question.

#### Returns

null. By default, elements are not grouped.

Related Topics

``ISourceViewDriver.getElementGroup(ISourceElement)``

### getLanguageDriver(String) Method

    public ILanguageDriver getLanguageDriver(String language)

Default implementation of getLanguageDriver. Care should be taken when overriding this method, since language drivers have an enormous effect on the behavior of the source editor. It is recommended that any overrides of this method return an ILanguageDriver implementation that wraps the object returned by the default call, modifying only those ILanguageDriver methods that are required.

#### Parameters

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

#### Returns

A language-specific ILanguageDriver implmentation provided by the compiler service.

Related Topics

``ISourceViewDriver.getLanguageDriver(String)``

### getSelectionRange(ISourceElement) Method

    public Range getSelectionRange(ISourceElement element)

Default implementation of getSelectionRange.

#### Returns

If the provided element has a non-null range in source, a zero length range at the start of the element is returned. Otherwise, this method returns null.

Related Topics

``ISourceViewDriver.getSelectionRange(ISourceElement)``

### isCollapsedByDefault(ISourceElement) Method

    public boolean isCollapsedByDefault(ISourceElement element)

Default implementation of isCollapsedByDefault.

#### Parameters

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

#### Returns

false. By default, the source view will not display collapsible regions.

Related Topics

``ISourceViewDriver.isCollapsedByDefault(ISourceElement)``

### isCollapsedByDefault(ISourceElementGroup) Method

    public boolean isCollapsedByDefault(ISourceElementGroup group)

Default implementation of isCollapsedByDefault.

#### Parameters

group
  The element group type in question.

#### Returns

null. By default, the source view will not display collapsible regions.

Related Topics

``ISourceViewDriver.isCollapsedByDefault(ISourceElement)``

### isCollapsible(ISourceElement) Method

    public boolean isCollapsible(ISourceElement element)

Default implementation of isCollapsible.

#### Parameters

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

#### Returns

false. By default, the source view will not display collapsible regions.

Related Topics

``ISourceViewDriver.isCollapsible(ISourceElement)``

### isCollapsible(ISourceElementGroup) Method

    public boolean isCollapsible(ISourceElementGroup group)

Default implementation of isCollapsible.

#### Parameters

group
  The group type in question.

#### Returns

null. By default, the source view will not display collapsible regions.

Related Topics

``ISourceViewDriver.isCollapsible(ISourceElement)``

### showCollapse() Method

    public boolean showCollapse()

Default implementation of showCollapse.

#### Returns

false. By default, the source view will not display collapsible regions.

Related Topics

``ISourceViewDriver.showCollapse()``