Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.4.0)

E13403-05

oracle.javatools.editor.folding
Interface CodeFoldingProvider


public interface CodeFoldingProvider

The interface that defines how a language implementation provides a generic data model for supporting collapsible source code blocks in the code editor.

Since:
10.1.3

Method Summary
 CodeFoldingModel createModel(BasicEditorPane editorPane)
          Creates a new data model describing the collapsible source code blocks in the document attached to the specified editor component.
 javax.swing.JPopupMenu getPopupMenu()
          Returns the popup menu of actions that can be performed by the provider.
 void insertUpdate(CodeFoldingModel model, int offset, int length)
          Executes an immediate update of the model due to an insertion in the document.
 void removeUpdate(CodeFoldingModel model, int offset, int length)
          Executes an immediate update of the model due to a deletion in the document.
 

Method Detail

createModel

CodeFoldingModel createModel(BasicEditorPane editorPane)
Creates a new data model describing the collapsible source code blocks in the document attached to the specified editor component. Implementations are expected to parse the document and create a complete model.

Parameters:
editorPane - the editor pane component
Returns:
the code folding data model

insertUpdate

void insertUpdate(CodeFoldingModel model,
                  int offset,
                  int length)
Executes an immediate update of the model due to an insertion in the document. Implementations are expected to update the model without reparsing the document. The provider should fire the appropriate model events when the model changes. When performance is at a premium, it is permissible for this method simply to do nothing, at the expense of causing the code folding UI to become out of sync with the document until the next full refresh of the model.

Parameters:
model - the code folding data model
offset - the caret offset of the insertion
length - the length in characters of the inserted text

removeUpdate

void removeUpdate(CodeFoldingModel model,
                  int offset,
                  int length)
Executes an immediate update of the model due to a deletion in the document. Implementations are expected to update the model without reparsing the document. The provider should fire the appropriate model events when the model changes. When performance is at a premium, it is permissible for this method simply to do nothing, at the expense of causing the code folding UI to become out of sync with the document until the next full refresh of the model.

Parameters:
model - the code folding data model
offset - the caret offset of the deletion
length - the length in characters of the deleted text

getPopupMenu

javax.swing.JPopupMenu getPopupMenu()
Returns the popup menu of actions that can be performed by the provider. Implementations are expected to return a menu containing the global folding and expanding actions that can be performed in the editor irrespective of the caret position, or null if no actions are supported.

Returns:
a popup menu containing the supported folding actions, or null if no actions are supported

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.4.0)

E13403-05

Copyright © 1997, 2011, Oracle. All rights reserved.