# com.bea.ide.sourceeditor
EditorSvc.I Interface

public static interface EditorSvc.I

Enclosing class
  `EditorSvc`

## Method Summary

`public `ISourceModel`` | `createSourceModel`(`URI` uri) Creates a new source model by loading the disk data found at a specified URI.
`public `ISourceView`` | `createSourceView`(`ISourceDocument` doc) Creates a new source view
`public `INavigationPoint`` | `createViewlessNavigationPoint`(`Object` target, int scrollMode) Creates a navigation point that will allow for navigation to a source view that may not have been created yet.
`public `INavigationPoint`` | `createViewlessNavigationPoint`(`IDocument` doc, `Object` target, int scrollMode) Creates a navigation point that will allow for navigation to a source view that may not have been created yet.
`public `Color`` | `getBackgroundColor`(`String` tokenName) Gets the background syntax color for tokens of a specific type, as specified in user preferences.
`public `ISourceView`` | `getCurrentSourceView`() Gets the currently active source view.
`public `Color`` | `getForegroundColor`(`String` tokenName) Gets the foreground syntax color for tokens of a specific type, as specified in user preferences.
`public `Font`` | `getPrinterFont`(int style) Returns the current printer font, as specified in user preferences.
`public boolean` | `reloadSourceModel`(`ISourceModel` model, `URI` uri) Reloads a source model with data found at a particular URI.
`public void` | `switchToFile`(`URI` file, int lineNumber, int colNumber, int colEnd) Jumps the user to a specified location in source view for a specified file using the `ISourceView.SCROLL_MIDDLE``` scroll constant.
`public void` | `switchToFile`(`URI` file, int lineNumber, int colNumber, int colEnd, int scrollMode) Jumps the user to a specified location in source view for a specified file.

## Method Detail

### createSourceModel(URI) Method

    public ISourceModel createSourceModel(URI uri)

Creates a new source model by loading the disk data found at a specified URI.

#### Parameters

uri
  The URI that will be used to find the data for this source model.

#### Returns

A new source model containing the data from the specified URI.

### createSourceView(ISourceDocument) Method

    public ISourceView createSourceView(ISourceDocument doc)

Creates a new source view

#### Parameters

doc
  The document that will be edited by the new source view

#### Returns

A new ISourceView object

### createViewlessNavigationPoint(Object, int) Method

    public INavigationPoint createViewlessNavigationPoint(Object target,
                                                          int scrollMode)

Creates a navigation point that will allow for navigation to a source view that may not have been created yet. This is a frequent occurrence because views are not created until they are activated by the user. Using this method is a useful tool for increasing performance and decreasing memory usage when there is a chance that the user may not elect to navigate to the newly created point.

This overload creates a navigation point that can be used with `DocumentSvc.get().displayDocument```. If a document object is availailable, `EditorSvc.I.createViewlessNavigationPoint(IDocument, Object, int)``` can also be used.

#### Parameters

target
  An object describing where in the file the user should jump. This object should be of type `Range```, `ISourceElement```, or `Rectangle```. If a rectangle is provided, it is interpreted as follows:
  `rect.x = start column`
  `rect.y = end column`
  `rect.x + rect.width = end column`
  `rect.y + rect.height = end line`

scrollMode
  The type of scrolling that should be performed if the file is currently open. See `ISourceView``` for the scroll mode constants.

#### Returns

The newly created navigation point

### createViewlessNavigationPoint(IDocument, Object, int) Method

    public INavigationPoint createViewlessNavigationPoint(IDocument doc,
                                                          Object target,
                                                          int scrollMode)

Creates a navigation point that will allow for navigation to a source view that may not have been created yet. This is a frequent occurrence because views are not created until they are activated by the user. Using this method is a useful tool for increasing performance and decreasing memory usage when there is a chance that the user may not elect to navigate to the newly created point.

If a document object is not available when creating the navigation point, `EditorSvc.I.createViewlessNavigationPoint(Object, int)``` can also be used.

#### Parameters

doc
  The document to which the navigation point will jump.

target
  An object describing where in the file the user should jump. This object should be of type `Range```, `ISourceElement```, or `Rectangle```. If a rectangle is provided, it is interpreted as follows:
  `rect.x = start column`
  `rect.y = end column`
  `rect.x + rect.width = end column`
  `rect.y + rect.height = end line`

scrollMode
  The type of scrolling that should be performed if the file is currently open. See `ISourceView``` for the scroll mode constants.

#### Returns

The newly created navigation point

### getBackgroundColor(String) Method

    public Color getBackgroundColor(String tokenName)

Gets the background syntax color for tokens of a specific type, as specified in user preferences.

#### Parameters

tokenName
  The token type

#### Returns

The token background color

### getCurrentSourceView() Method

    public ISourceView getCurrentSourceView()

Gets the currently active source view. This method works even if the source view is embedded within another document view.

#### Returns

The currently active source view, null if no source view is active.

### getForegroundColor(String) Method

    public Color getForegroundColor(String tokenName)

Gets the foreground syntax color for tokens of a specific type, as specified in user preferences.

#### Parameters

tokenName
  The token type

#### Returns

The token foreground color

### getPrinterFont(int) Method

    public Font getPrinterFont(int style)

Returns the current printer font, as specified in user preferences.

#### Parameters

style
  A font style, composed of zero or more of `Font.BOLD``` and `Font.ITALIC```.

#### Returns

The printer font of the appropriate style.

### reloadSourceModel(ISourceModel, URI) Method

    public boolean reloadSourceModel(ISourceModel model,
                                     URI uri)

Reloads a source model with data found at a particular URI. This method is most frequently called when the IDE detects that a file's data has changed on disk.

#### Parameters

model
  The model to reload

uri
  The location of the new model data

#### Returns

boolean indicating success or failure

### switchToFile(URI, int, int, int) Method

    public void switchToFile(URI file,
                             int lineNumber,
                             int colNumber,
                             int colEnd)

Jumps the user to a specified location in source view for a specified file using the `ISourceView.SCROLL_MIDDLE``` scroll constant.

#### Parameters

file
  The URI of the document to be shown in source view. This document does not have to be open.

lineNumber
  The line where the caret should be placed.

colNumber
  The column where the caret selection should start

colEnd
  The column where the caret selection should end

### switchToFile(URI, int, int, int, int) Method

    public void switchToFile(URI file,
                             int lineNumber,
                             int colNumber,
                             int colEnd,
                             int scrollMode)

Jumps the user to a specified location in source view for a specified file.

#### Parameters

file
  The URI of the document to be shown in source view. This document does not have to be open.

lineNumber
  The line where the caret should be placed.

colNumber
  The column where the caret selection should start

colEnd
  The column where the caret selection should end

scrollMode
  The type of scrolling that should be performed if the file is currently open. See `ISourceView``` for the scroll mode constants.