public class StructureViewComponent extends SimpleToolWindowPanel implements TreeActionsOwner, DataProvider, StructureView.Scrollable
javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
java.awt.Container.AccessibleAWTContainer
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
StructureView.Scrollable
Disposable.Parent
myVertical
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
KEY
Constructor and Description |
---|
StructureViewComponent(FileEditor editor,
StructureViewModel structureViewModel,
Project project,
boolean showRootNode) |
Modifier and Type | Method and Description |
---|---|
protected void |
addGroupByActions(DefaultActionGroup result) |
void |
centerSelectedRow() |
static void |
clearStructureViewState(Project project) |
protected ActionGroup |
createActionGroup() |
static TreeElementWrapper |
createWrapper(Project project,
TreeElement value,
TreeModel treeModel) |
void |
disableStoreState() |
void |
dispose()
Usually not invoked directly, see class javadoc.
|
Promise<AbstractTreeNode<?>> |
expandPathToElement(java.lang.Object element) |
java.awt.Dimension |
getCurrentSize() |
java.lang.Object |
getData(java.lang.String dataId)
Returns the object corresponding to the specified data identifier.
|
FileEditor |
getFileEditor()
Returns the editor whose structure is displayed in the structure view.
|
java.lang.String |
getHelpID() |
Project |
getProject() |
static JBIterable<java.lang.Object> |
getSelectedValues(javax.swing.JTree tree) |
javax.swing.JTree |
getTree() |
StructureViewModel |
getTreeModel() |
boolean |
isActionActive(java.lang.String name) |
boolean |
isDisposed() |
boolean |
navigateToSelectedElement(boolean requestFocus)
Selects the element which corresponds to the current cursor position in the editor
linked to the structure view.
|
void |
queueUpdate() |
void |
rebuild() |
<any> |
rebuildAndUpdate() |
static void |
registerAutoExpandListener(javax.swing.JTree tree,
StructureViewModel structureViewModel) |
static void |
registerPsiListener(Project project,
Disposable disposable,
java.lang.Runnable onChange) |
void |
restoreState()
Restores the state of the structure view (the expanded and selected elements)
from the user data of the file editor to which it is linked.
|
Promise<javax.swing.tree.TreePath> |
select(java.lang.Object element,
boolean requestFocus) |
void |
setActionActive(java.lang.String name,
boolean state) |
void |
setReferenceSizeWhileInitializing(java.awt.Dimension size) |
protected boolean |
showScrollToFromSourceActions() |
void |
showToolbar() |
void |
storeState()
Stores the state of the structure view (the expanded and selected elements)
in the user data of the file editor to which it is linked.
|
static java.lang.Object |
unwrapNavigatable(java.lang.Object o) |
static java.lang.Object |
unwrapValue(java.lang.Object o) |
static java.lang.Object |
unwrapWrapper(java.lang.Object o) |
getActions, getComponent, getContent, getToolbar, isToolbarVisible, isVertical, paintComponent, setContent, setProvideQuickActions, setToolbar, setVertical
getComponentGraphics, getEmptyText, withEmptyText
andOpaque, andTransparent, getMaximumSize, getMinimumSize, getPreferredSize, withBackground, withBorder, withFont, withMaximumHeight, withMaximumWidth, withMinimumHeight, withMinimumWidth, withPreferredHeight, withPreferredSize, withPreferredWidth
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getComponent
getName, isCycleRoot
public StructureViewComponent(FileEditor editor, StructureViewModel structureViewModel, Project project, boolean showRootNode)
public static void registerAutoExpandListener(javax.swing.JTree tree, StructureViewModel structureViewModel)
protected boolean showScrollToFromSourceActions()
public FileEditor getFileEditor()
StructureView
getFileEditor
in interface StructureView
public void showToolbar()
public static void registerPsiListener(Project project, Disposable disposable, java.lang.Runnable onChange)
public Project getProject()
public javax.swing.JTree getTree()
public void queueUpdate()
public void rebuild()
public static JBIterable<java.lang.Object> getSelectedValues(javax.swing.JTree tree)
public void storeState()
StructureView
storeState
in interface StructureView
UserDataHolder.putUserData(com.intellij.openapi.util.Key, Object)
public void disableStoreState()
disableStoreState
in interface StructureView
public void restoreState()
StructureView
restoreState
in interface StructureView
UserDataHolder.getUserData(com.intellij.openapi.util.Key)
protected ActionGroup createActionGroup()
protected void addGroupByActions(DefaultActionGroup result)
public Promise<AbstractTreeNode<?>> expandPathToElement(java.lang.Object element)
public Promise<javax.swing.tree.TreePath> select(java.lang.Object element, boolean requestFocus)
public void dispose()
Disposable
dispose
in interface Disposable
public boolean isDisposed()
public void centerSelectedRow()
centerSelectedRow
in interface StructureView
public void setActionActive(java.lang.String name, boolean state)
setActionActive
in interface TreeActionsOwner
public boolean isActionActive(java.lang.String name)
isActionActive
in interface TreeActionsOwner
public static void clearStructureViewState(Project project)
public java.lang.Object getData(java.lang.String dataId)
DataProvider
PlatformDataKeys
class.getData
in interface DataProvider
getData
in class SimpleToolWindowPanel
dataId
- the data identifier for which the value is requested.public StructureViewModel getTreeModel()
getTreeModel
in interface StructureView
public boolean navigateToSelectedElement(boolean requestFocus)
StructureView
navigateToSelectedElement
in interface StructureView
requestFocus
- if true, the structure view component also grabs the focus.public <any> rebuildAndUpdate()
public java.lang.String getHelpID()
public java.awt.Dimension getCurrentSize()
getCurrentSize
in interface StructureView.Scrollable
public void setReferenceSizeWhileInitializing(java.awt.Dimension size)
setReferenceSizeWhileInitializing
in interface StructureView.Scrollable
public static java.lang.Object unwrapValue(java.lang.Object o)
public static java.lang.Object unwrapNavigatable(java.lang.Object o)
public static java.lang.Object unwrapWrapper(java.lang.Object o)
public static TreeElementWrapper createWrapper(Project project, TreeElement value, TreeModel treeModel)