Interface NodeSelectionSource

    • 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 as ApplicationComponent.getDesignerRoot(), but the parameter here is to make it clear that ApplicationComponent.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!