com.intellij.ide.structureView
Interface StructureViewModel

All Superinterfaces:
TreeModel
All Known Implementing Classes:
TextEditorBasedStructureViewModel

public interface StructureViewModel
extends TreeModel

Defines the model for the data displayed in the standard structure view or file structure popup component. The model of the standard structure view is represented as a tree of elements.

See Also:
TreeBasedStructureViewBuilder.createStructureViewModel(), TextEditorBasedStructureViewModel

Method Summary
 void addEditorPositionListener(FileEditorPositionListener listener)
          Adds a listener which gets notified when the selection in the editor linked to the structure view moves to a different element visible in the structure view.
 void addModelListener(ModelListener modelListener)
          Adds a listener which gets notified when the data represented by the structure view is changed and the structure view needs to be rebuilt.
 void dispose()
          Disposes of the model.
 java.lang.Object getCurrentEditorElement()
          Returns the element currently selected in the editor linked to the structure view.
 StructureViewTreeElement getRoot()
          Returns the root element of the structure view tree.
 void removeEditorPositionListener(FileEditorPositionListener listener)
          Removes a listener which gets notified when the selection in the editor linked to the structure view moves to a different element visible in the structure view.
 void removeModelListener(ModelListener modelListener)
          Removes a listener which gets notified when the data represented by the structure view is changed and the structure view needs to be rebuilt.
 
Methods inherited from interface com.intellij.ide.util.treeView.smartTree.TreeModel
getFilters, getGroupers, getSorters
 

Method Detail

getCurrentEditorElement

@Nullable
java.lang.Object getCurrentEditorElement()
Returns the element currently selected in the editor linked to the structure view.

Returns:
the selected element, or null if the current editor position does not correspond to any element that can be shown in the structure view.

addEditorPositionListener

void addEditorPositionListener(FileEditorPositionListener listener)
Adds a listener which gets notified when the selection in the editor linked to the structure view moves to a different element visible in the structure view.

Parameters:
listener - the listener to add.

removeEditorPositionListener

void removeEditorPositionListener(FileEditorPositionListener listener)
Removes a listener which gets notified when the selection in the editor linked to the structure view moves to a different element visible in the structure view.

Parameters:
listener - the listener to remove.

addModelListener

void addModelListener(ModelListener modelListener)
Adds a listener which gets notified when the data represented by the structure view is changed and the structure view needs to be rebuilt.

Parameters:
modelListener - the listener to add.

removeModelListener

void removeModelListener(ModelListener modelListener)
Removes a listener which gets notified when the data represented by the structure view is changed and the structure view needs to be rebuilt.

Parameters:
modelListener - the listener to remove.

getRoot

@NotNull
StructureViewTreeElement getRoot()
Returns the root element of the structure view tree.

Specified by:
getRoot in interface TreeModel
Returns:
the structure view root.

dispose

void dispose()
Disposes of the model.