View Javadoc

1   /*
2    *  File: IJaretTableSelection.java 
3    *  Copyright (c) 2004-2007  Peter Kliem (Peter.Kliem@jaret.de)
4    *  A commercial license is available, see http://www.jaret.de.
5    *
6    * All rights reserved. This program and the accompanying materials
7    * are made available under the terms of the Common Public License v1.0
8    * which accompanies this distribution, and is available at
9    * http://www.eclipse.org/legal/cpl-v10.html
10   */
11  package de.jaret.util.ui.table.model;
12  
13  import java.util.List;
14  import java.util.Set;
15  
16  /***
17   * Interface describing the selection in a jaret table. The selection is composed of full selected rows and columns and
18   * of a list of selected cells. If the selection contains full selected rows or columns, the cells of the rows/columns
19   * are not included in the list of single cells.
20   * 
21   * @author Peter Kliem
22   * @version $Id: IJaretTableSelection.java 179 2007-01-07 17:37:50Z olk $
23   */
24  public interface IJaretTableSelection {
25      /***
26       * Retrieve selected rows.
27       * 
28       * @return selected rows.
29       */
30      List<IRow> getSelectedRows();
31  
32      /***
33       * Retrieve selected Columns.
34       * 
35       * @return selecetd columns
36       */
37      List<IColumn> getSelectedColumns();
38  
39      /***
40       * Retrieve cells that have been selected seperately.
41       * 
42       * @return List of JaretTableCells selected seperately
43       */
44      List<IJaretTableCell> getSelectedCells();
45  
46      /***
47       * Retrieve a set of all selected cells (union of all cells in selected rows and columns plus. the cells selected
48       * seperately)
49       * 
50       * @param model is needed to determine all cells.
51       * @return Set of all selected cells.
52       */
53      Set<IJaretTableCell> getAllSelectedCells(IJaretTableModel model);
54  
55      /***
56       * Add a row to the selection.
57       * 
58       * @param row the row to add
59       */
60      void addRow(IRow row);
61  
62      /***
63       * Remove row from selection.
64       * 
65       * @param row row to remove
66       */
67      void remRow(IRow row);
68  
69      /***
70       * Add a acolumn to the selection.
71       * 
72       * @param column column to add
73       */
74      void addColumn(IColumn column);
75  
76      /***
77       * Remove column from the selection.
78       * 
79       * @param column col to remove
80       */
81      void remColumn(IColumn column);
82  
83      /***
84       * Add a cell to the selection.
85       * 
86       * @param cell cell to add
87       */
88      void addCell(IJaretTableCell cell);
89  
90      /***
91       * Remove a cell from the selection.
92       * 
93       * @param cell cell to remove
94       */
95      void remCell(IJaretTableCell cell);
96  
97      /***
98       * Check if something is selected.
99       * 
100      * @return true if the selection is empty
101      */
102     boolean isEmpty();
103 
104     /***
105      * Clear the selection.
106      * 
107      */
108     void clear();
109 }