All Downloads are FREE. Search and download functionalities are using the official Maven repository.

at.spardat.xma.mdl.tree.ITreeWM Maven / Gradle / Ivy

/*******************************************************************************
 * Copyright (c) 2003, 2007 s IT Solutions AT Spardat GmbH .
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     s IT Solutions AT Spardat GmbH - initial API and implementation
 *******************************************************************************/

// @(#) $Id: ITreeWM.java 2089 2007-11-28 13:56:13Z s3460 $
package at.spardat.xma.mdl.tree;

import at.spardat.xma.mdl.ISelectable;

/**
 * The API for a widget model that holds a tree and its selection status.
 * 
 * @author YSD, 03.05.2003 19:56:56
 */
public interface ITreeWM extends ISelectable {
    
    /**
     * Specify this style constant in the constructor if you want the tree to
     * allow multi selection. The default is single selection.
     */
    public static final int             S_MULTI_SELECT = 1;

    /**
     * The numeric highest style constant used in this class 
     */
    public static final int             S_LAST = S_MULTI_SELECT;  
    

    /**
     * Removes all nodes from the tree and resets the selection information.
     */
    public void clear();

    /**
     * Returns the number of nodes in this tree.
     */
    public int size ();
    
    /**
     * Returns true if this tree contains a node whose key equals the one
     * provided as parameter.
     */
    public boolean containsKey (String key);
    
    /**
     * Returns the number of root nodes in this tree
     */
    public int getRootCount ();
    
    /**
     * Returns the root nodes of this tree. The returned array is newly
     * constructed so modifying it does not modify the tree.
     * 
     * @return array of length getRootCount().
     */
    public TreeNode[] getRoots ();
    
    /**
     * Returns the tree node for a particular key or null if there
     * is no such node.
     */
    public TreeNode getNode (String key);
    
    /**
     * Returns the selected tree node or null if there
     * is no such node.
     */
    public TreeNode getSelectedNode ();
    
    /**
     * Selects all nodes in the tree. Must not be called if this tree
     * is a single-selection-tree.
     */
    public void selectAll ();
    
    /**
     * Returns a newly created array containing the ids of the selected entries in ordered by
     * the rows on the screen.
     * If nothing is selected, an empty array is returned. If you do not need this order, use 
     * getSelection() instead, which is faster. 
     * 
     * @return array of the selected keys. The length of the array equals getSelectionCount().
     * @since 1.7.3
     */
    public String[] getSelectionOrdered();
    
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy