Interface NodeSelectionSource
-
- All Superinterfaces:
ApplicationComponent
- All Known Implementing Classes:
AstTreeView
,NodeEditionCodeArea
,NodeInfoPanelController
,XPathPanelController
public interface NodeSelectionSource extends ApplicationComponent
A control or controller that somehow displays nodes in a form that the user can select. When a node is selected by the user (e.g.AstTreeView
,XPathPanelController
, etc), the whole UI is synchronized to reflect information about the node. This includes scrolling the TreeView, the editor, etc. To achieve that uniformly, node selection events are forwarded as messages on aMessageChannel
.- Author:
- Clément Fournier
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default void
initNodeSelectionHandling(DesignerRoot root, org.reactfx.EventStream<? extends net.sourceforge.pmd.lang.ast.Node> mySelectionEvents, boolean alwaysHandleSelection)
Initialises this component.void
setFocusNode(net.sourceforge.pmd.lang.ast.Node node)
Updates the UI to react to a change in focus node.-
Methods inherited from interface net.sourceforge.pmd.util.fxdesigner.app.ApplicationComponent
getDebugName, getDesignerRoot, getLogger, getMainStage, isDeveloperMode, logInternalDebugInfo, logInternalException, logMessageTrace, logUserException, raiseParsableSourceFlag, raiseParsableXPathFlag
-
-
-
-
Method Detail
-
setFocusNode
void setFocusNode(net.sourceforge.pmd.lang.ast.Node node)
Updates the UI to react to a change in focus node. This is called whenever some selection source in the tree records a change.
-
initNodeSelectionHandling
default void initNodeSelectionHandling(DesignerRoot root, org.reactfx.EventStream<? extends net.sourceforge.pmd.lang.ast.Node> mySelectionEvents, boolean alwaysHandleSelection)
Initialises this component. Must be called by the component somewhere.- Parameters:
root
- Instance of the app. Should be the same asApplicationComponent.getDesignerRoot()
, but the parameter here is to make it clear thatApplicationComponent.getDesignerRoot()
must be initialized before this method is called.mySelectionEvents
- Stream of nodes that should push an event each time the user selects a node from this control. The whole app will sync to this new selection.alwaysHandleSelection
- Whether the component should handle selection events that originated from itself. For now some must, because they aggregate several selection sources (theNodeInfoPanelController
). Splitting it into separate controls will remove the need for that.
-
-