Class EditTraversalStrategy

    • Constructor Detail

      • EditTraversalStrategy

        public EditTraversalStrategy​(ITraversalStrategy baseStrategy,
                                     NatTable natTable)
        Parameters:
        baseStrategy - The ITraversalStrategy that should be wrapped by this EditTraversalStrategy.
        natTable - The NatTable instance this strategy is connected to. Needed to be able to perform checks related to NatTable states and configurations.
    • Method Detail

      • isCycle

        public boolean isCycle()
        Specified by:
        isCycle in interface ITraversalStrategy
        Returns:
        true if on traversal the selection should cycle, false if the selection should stay at the last/first position without cycling.
      • getStepCount

        public int getStepCount()
        Specified by:
        getStepCount in interface ITraversalStrategy
        Returns:
        The number of steps to jump on traversal.
      • isValidTarget

        public boolean isValidTarget​(ILayerCell from,
                                     ILayerCell to)
        Description copied from interface: ITraversalStrategy
        Checks whether the ILayerCell that would be selected after the selection movement is valid or not. In case the target is invalid, the responsible command handler is able to react accordingly, e.g. move the next valid cell.

        This is for example useful for editing traversal. If the selection movement is triggered on committing a value in an editor, the next editable cell should be selected and the editor opened immediately.

        Specified by:
        isValidTarget in interface ITraversalStrategy
        Parameters:
        from - The ILayerCell from which the selection movement is started.
        to - The ILayerCell to which the selection movement should be performed.
        Returns:
        true if the target is a valid target for selection movement, false if not