# com.bea.ide.lang.java.driver
JavaSourceViewDriver Class

public class JavaSourceViewDriver
extends `DefaultSourceViewDriver`

Implements custom source viewing for Java files and derivations.

Hierarchy
  `Object`
  `DefaultDocumentDriver`
  `DefaultSourceViewDriver`
  `JavaSourceViewDriver`

All Implemented Interfaces
  `IDriverSupport`, `ISourceViewDriver`

## Constructor Summary

JavaSourceViewDriver(`ISourceDocument` file)

## Method Summary

`public `String`` | `getCollapsedText`(`ISourceElement` element) Returns default text to be shown for the collapsible element types specified by `isCollapsible```.
`public `String`` | `getCollapsedText`(`ISourceElementGroup` group) Returns default text to be shown for the collapsible element types specified by `isCollapsible```.
`public `ISourceElementGroup`` | `getElementGroup`(`ISourceElement` element) Java documents support grouping of import statements into a single collapsible node.
`public boolean` | `isCollapsedByDefault`(`ISourceElement` element) Specifies that no editor sections are initially collapsed for java document types.
`public boolean` | `isCollapsedByDefault`(`ISourceElementGroup` group) Specifies that groups of import statements are collapsed by default when a document is opened.
`public boolean` | `isCollapsible`(`ISourceElement` element) Specifies that methods, comments, and classes are the standard collapsible entities for standard java document types.
`public boolean` | `isCollapsible`(`ISourceElementGroup` group) In addition to the various elements that are collapsible, this method specifies that groups of imports are also collapsible.
`public boolean` | `showCollapse`() Specifies that standard java document types support collapsed source view sections.

Methods from `com.bea.ide.sourceeditor.driver.`DefaultSourceViewDriver``
``addDriver`, `getDriver`, `getLanguageDriver`, `getSelectionRange`,`

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

### JavaSourceViewDriver

    public JavaSourceViewDriver(ISourceDocument file)

## Method Detail

### getCollapsedText(ISourceElement) Method

    public String getCollapsedText(ISourceElement element)

Returns default text to be shown for the collapsible element types specified by `isCollapsible```.

Also see:
`showCollapse```
`isCollapsible```
`isCollapsedByDefault```

Overrides
  `DefaultSourceViewDriver.getCollapsedText(ISourceElement)`

#### Returns

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

### getCollapsedText(ISourceElementGroup) Method

    public String getCollapsedText(ISourceElementGroup group)

Returns default text to be shown for the collapsible element types specified by `isCollapsible```.

Also see:

Overrides
  `DefaultSourceViewDriver.getCollapsedText(ISourceElementGroup)`

#### Returns

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

Related Topics

``JavaSourceViewDriver.getElementGroup(ISourceElement)``
``JavaSourceViewDriver.isCollapsible(ISourceElementGroup)``

### getElementGroup(ISourceElement) Method

    public ISourceElementGroup getElementGroup(ISourceElement element)

Java documents support grouping of import statements into a single collapsible node.

Overrides
  `DefaultSourceViewDriver.getElementGroup(ISourceElement)`

#### Parameters

element
  Any element in a java document.

#### Returns

true iff element is a JavaImport object.

Also see:
`isCollapsible```
`isCollapsedByDefault```
`getCollapsedText```
`JavaSourceViewDriver.showCollapse()```
`ISourceViewDriver.getElementGroup```

### isCollapsedByDefault(ISourceElement) Method

    public boolean isCollapsedByDefault(ISourceElement element)

Specifies that no editor sections are initially collapsed for java document types.

Also see:
`showCollapse```
`isCollapsible```
`getCollapsedText```

Overrides
  `DefaultSourceViewDriver.isCollapsedByDefault(ISourceElement)`

#### Returns

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

### isCollapsedByDefault(ISourceElementGroup) Method

    public boolean isCollapsedByDefault(ISourceElementGroup group)

Specifies that groups of import statements are collapsed by default when a document is opened.

Overrides
  `DefaultSourceViewDriver.isCollapsedByDefault(ISourceElementGroup)`

#### Parameters

group
  A group object, representing a collection of similar elements.

#### Returns

true iff the group is the imports group.

Related Topics

``JavaSourceViewDriver.getElementGroup(ISourceElement)``
``JavaSourceViewDriver.isCollapsible(ISourceElementGroup)``

### isCollapsible(ISourceElement) Method

    public boolean isCollapsible(ISourceElement element)

Specifies that methods, comments, and classes are the standard collapsible entities for standard java document types.

Also see:
`showCollapse```
`isCollapsedByDefault```
`getCollapsedText```

Overrides
  `DefaultSourceViewDriver.isCollapsible(ISourceElement)`

#### Returns

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

### isCollapsible(ISourceElementGroup) Method

    public boolean isCollapsible(ISourceElementGroup group)

In addition to the various elements that are collapsible, this method specifies that groups of imports are also collapsible.

Overrides
  `DefaultSourceViewDriver.isCollapsible(ISourceElementGroup)`

#### Parameters

group
  A group object, representing a collection of similar elements.

#### Returns

true iff the group is the imports group.

Related Topics

``JavaSourceViewDriver.getElementGroup(ISourceElement)``

### showCollapse() Method

    public boolean showCollapse()

Specifies that standard java document types support collapsed source view sections.

Also see:
`isCollapsible```
`isCollapsedByDefault```
`getCollapsedText```
`getElementGroup```

Overrides
  `DefaultSourceViewDriver.showCollapse()`

#### Returns

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