Interface NodeSelectionSource
-
- All Superinterfaces:
ApplicationComponent
- All Known Implementing Classes:
AstTreeView
,MetricPaneController
,NodeDetailPaneController
,NodeEditionCodeArea
,NodeParentageCrumbBar
,ScopesPanelController
,XPathRuleEditorController
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
,XPathRuleEditorController
, 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
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
NodeSelectionSource.NodeSelectionEvent
-
Field Summary
Fields Modifier and Type Field Description static DataHolder.DataKey<Integer>
CARET_POSITION
The position of the caret, when the selection is carried out from the code area.static DataHolder.DataKey<Boolean>
SELECTION_RECOVERY
This selection is the reselection of a node across a parsing.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default org.reactfx.value.Val<net.sourceforge.pmd.lang.ast.Node>
initNodeSelectionHandling(DesignerRoot root, org.reactfx.EventStream<? extends NodeSelectionSource.NodeSelectionEvent> mySelectionEvents, boolean alwaysHandleSelection)
Initialises this component.void
setFocusNode(net.sourceforge.pmd.lang.ast.Node node, DataHolder options)
Updates the UI to react to a change in focus node.-
Methods inherited from interface net.sourceforge.pmd.util.fxdesigner.app.ApplicationComponent
getDebugName, getDesignerRoot, getLogCategory, getLogger, getMainStage, getService, globalLanguageProperty, isDeveloperMode, languageBindingsProperty, logInternalDebugInfo, logInternalDebugInfo, logInternalException, logUserException, raiseParsableSourceFlag, raiseParsableXPathFlag
-
-
-
-
Field Detail
-
SELECTION_RECOVERY
static final DataHolder.DataKey<Boolean> SELECTION_RECOVERY
This selection is the reselection of a node across a parsing. Stuff like scrolling or external style changes should be avoided, only the internal model should be affected.
-
CARET_POSITION
static final DataHolder.DataKey<Integer> CARET_POSITION
The position of the caret, when the selection is carried out from the code area.
-
-
Method Detail
-
setFocusNode
void setFocusNode(net.sourceforge.pmd.lang.ast.Node node, DataHolder options)
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 org.reactfx.value.Val<net.sourceforge.pmd.lang.ast.Node> initNodeSelectionHandling(DesignerRoot root, org.reactfx.EventStream<? extends NodeSelectionSource.NodeSelectionEvent> 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.- Returns:
- A Val reflecting the current global selection for the app. Note that that Val is lazy and so if you don't subscribe to it or pin it you won't see updates!
-
-