public abstract class TextEditorBasedStructureViewModel extends java.lang.Object implements StructureViewModel, ProvidingTreeModel
StructureViewModel implementation which is linked to a text editor.StructureViewModel.ElementInfoProvider, StructureViewModel.ExpandInfoProviderDisposable.Parent| Modifier | Constructor and Description |
|---|---|
protected |
TextEditorBasedStructureViewModel(Editor editor)
Creates a structure view model instance linked to the specified text editor.
|
protected |
TextEditorBasedStructureViewModel(Editor editor,
PsiFile file) |
protected |
TextEditorBasedStructureViewModel(PsiFile psiFile)
Creates a structure view model instance linked to a text editor displaying the specified
file.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
protected java.lang.Object |
findAcceptableElement(PsiElement element) |
void |
fireModelUpdate() |
java.lang.Object |
getCurrentEditorElement()
Returns the element currently selected in the editor linked to the structure view.
|
protected Editor |
getEditor() |
Filter [] |
getFilters()
Returns the array of actions for filtering items in the tree.
|
Grouper [] |
getGroupers()
Returns the list of actions for grouping items in the tree.
|
java.util.Collection<NodeProvider> |
getNodeProviders() |
protected PsiFile |
getPsiFile() |
Sorter [] |
getSorters()
Returns the array of actions for sorting items in the tree.
|
protected java.lang.Class [] |
getSuitableClasses()
Returns the list of PSI element classes which are shown as structure view elements.
|
boolean |
isEnabled(NodeProvider provider) |
protected boolean |
isSuitable(PsiElement element) |
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.
|
boolean |
shouldEnterElement(java.lang.Object element) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetRootprotected TextEditorBasedStructureViewModel(PsiFile psiFile)
psiFile - the file for which the structure view model is requested.protected TextEditorBasedStructureViewModel(Editor editor)
editor - the editor for which the structure view model is requested.public final void addEditorPositionListener(FileEditorPositionListener listener)
StructureViewModeladdEditorPositionListener in interface StructureViewModellistener - the listener to add.public final void removeEditorPositionListener(FileEditorPositionListener listener)
StructureViewModelremoveEditorPositionListener in interface StructureViewModellistener - the listener to remove.public void dispose()
StructureViewModeldispose in interface StructureViewModeldispose in interface Disposablepublic void fireModelUpdate()
public boolean shouldEnterElement(java.lang.Object element)
shouldEnterElement in interface StructureViewModelpublic java.lang.Object getCurrentEditorElement()
StructureViewModelgetCurrentEditorElement in interface StructureViewModelprotected java.lang.Object findAcceptableElement(PsiElement element)
protected PsiFile getPsiFile()
protected boolean isSuitable(PsiElement element)
public void addModelListener(ModelListener modelListener)
StructureViewModeladdModelListener in interface StructureViewModelmodelListener - the listener to add.public void removeModelListener(ModelListener modelListener)
StructureViewModelremoveModelListener in interface StructureViewModelmodelListener - the listener to remove.protected java.lang.Class [] getSuitableClasses()
protected Editor getEditor()
public Grouper [] getGroupers()
TreeModelgetGroupers in interface TreeModelGrouper.EMPTY_ARRAYpublic Sorter [] getSorters()
TreeModelgetSorters in interface TreeModelSorter.EMPTY_ARRAYpublic Filter [] getFilters()
TreeModelgetFilters in interface TreeModelFilter.EMPTY_ARRAYpublic java.util.Collection<NodeProvider> getNodeProviders()
getNodeProviders in interface ProvidingTreeModelpublic boolean isEnabled(NodeProvider provider)
isEnabled in interface ProvidingTreeModel