Package pivot.collections.Sequence.Tree

Examples of pivot.collections.Sequence.Tree.Path


            int index = Sequence.Search.binarySearch(paths, basePath, PATH_COMPARATOR);
            index = (index < 0 ? -(index + 1) : index + 1);

            // Remove all descendants from the paths list
            for (int i = index, n = paths.getLength(); i < n; i++) {
                Path affectedPath = paths.get(index);

                if (!Sequence.Tree.isDescendant(basePath, affectedPath)) {
                    break;
                }
View Full Code Here


        Sequence<Path> selectedPaths = new ArrayList<Path>(count);

        // Deep copy the selected paths into a new list
        for (int i = 0; i < count; i++) {
            selectedPaths.add(new Path(this.selectedPaths.get(i)));
        }

        return selectedPaths;
    }
View Full Code Here

        if (selectedPaths != previousSelectedPaths) {
            this.selectedPaths = new ArrayList<Path>(PATH_COMPARATOR);

            for (int i = 0, n = selectedPaths.getLength(); i < n; i++) {
                Path path = selectedPaths.get(i);

                // Monitor the path's parent
                monitorBranch(new Path(path, 0, path.getLength() - 1));

                // Update the selection
                this.selectedPaths.add(new Path(path));
            }

            // Notify listeners
            treeViewSelectionListeners.selectedPathsChanged(this, previousSelectedPaths);
        }
View Full Code Here

     *
     * @return
     * The first selected path, or <tt>null</tt> if nothing is selected.
     */
    public Path getFirstSelectedPath() {
        Path selectedPath = null;

        if (selectedPaths.getLength() > 0) {
            selectedPath = new Path(selectedPaths.get(0));
        }

        return selectedPath;
    }
View Full Code Here

     *
     * @return
     * The last selected path, or <tt>null</tt> if nothing is selected.
     */
    public Path getLastSelectedPath() {
        Path selectedPath = null;

        if (selectedPaths.getLength() > 0) {
            selectedPath = new Path(selectedPaths.get(selectedPaths.getLength() - 1));
        }

        return selectedPath;
    }
View Full Code Here

    public Path getSelectedPath() {
        if (selectMode != SelectMode.SINGLE) {
            throw new IllegalStateException("Tree view is not in single-select mode.");
        }

        Path selectedPath = null;

        if (selectedPaths.getLength() > 0) {
            selectedPath = new Path(selectedPaths.get(0));
        }

        return selectedPath;
    }
View Full Code Here

        if (path == null) {
            throw new IllegalArgumentException("path is null.");
        }

        Sequence<Path> selectedPaths = new ArrayList<Path>(1);
        selectedPaths.add(new Path(path));

        setSelectedPaths(selectedPaths);
    }
View Full Code Here

     * technically, the selected path could be backed by a <tt>null</tt> data
     * value. If the caller wishes to distinguish between these cases, they can
     * use <tt>getSelectedPath()</tt> instead.
     */
    public Object getSelectedNode() {
        Path path = getSelectedPath();
        Object node = null;

        if (path != null) {
            node = Sequence.Tree.get(treeData, path);
        }
View Full Code Here

            throw new IllegalStateException("Tree view is not in multi-select mode.");
        }

        if (selectedPaths.indexOf(path) < 0) {
            // Monitor the path's parent
            monitorBranch(new Path(path, 0, path.getLength() - 1));

            // Update the selection
            selectedPaths.add(new Path(path));

            // Notify listeners
            treeViewSelectionListeners.selectedPathAdded(this, path);
        }
    }
View Full Code Here

        if ((index < 0 && disabled)
            || (index >= 0 && !disabled)) {
            if (disabled) {
                // Monitor the path's parent
                monitorBranch(new Path(path, 0, path.getLength() - 1));

                // Update the disabled paths
                disabledPaths.add(new Path(path));
            } else {
                // Update the disabled paths
                disabledPaths.remove(index, 1);
            }
View Full Code Here

TOP

Related Classes of pivot.collections.Sequence.Tree.Path

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.