|
|||||||||||||||||||
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover | |||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
Table.java | 0% | 0% | 0% | 0% |
|
1 |
// Copyright 2004, 2005 The Apache Software Foundation
|
|
2 |
//
|
|
3 |
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4 |
// you may not use this file except in compliance with the License.
|
|
5 |
// You may obtain a copy of the License at
|
|
6 |
//
|
|
7 |
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8 |
//
|
|
9 |
// Unless required by applicable law or agreed to in writing, software
|
|
10 |
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11 |
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12 |
// See the License for the specific language governing permissions and
|
|
13 |
// limitations under the License.
|
|
14 |
|
|
15 |
package org.apache.tapestry.contrib.table.components;
|
|
16 |
|
|
17 |
import org.apache.tapestry.BaseComponent;
|
|
18 |
import org.apache.tapestry.contrib.table.model.ITableColumn;
|
|
19 |
import org.apache.tapestry.contrib.table.model.ITableModel;
|
|
20 |
import org.apache.tapestry.contrib.table.model.ITableModelSource;
|
|
21 |
|
|
22 |
/**
|
|
23 |
* The facade component in the Table family. Table allows you to present a sortable and pagable
|
|
24 |
* table simply and easily by using only this one component. Please see the Component Reference for
|
|
25 |
* details on how to use this component. [ <a
|
|
26 |
* href="../../../../../../../ComponentReference/contrib.Table.html">Component Reference </a>]
|
|
27 |
*
|
|
28 |
* @author mindbridge
|
|
29 |
*/
|
|
30 |
public abstract class Table extends BaseComponent implements ITableModelSource |
|
31 |
{ |
|
32 |
/**
|
|
33 |
* @see org.apache.tapestry.contrib.table.model.ITableModelSource#getTableModel()
|
|
34 |
*/
|
|
35 | 0 |
public ITableModel getTableModel()
|
36 |
{ |
|
37 | 0 |
return getTableViewComponent().getTableModel();
|
38 |
} |
|
39 |
|
|
40 |
/**
|
|
41 |
* Indicates that the table model has changed and it may need to saved. This method has to be
|
|
42 |
* invoked if modifications are made to the model.
|
|
43 |
*
|
|
44 |
* @see org.apache.tapestry.contrib.table.model.ITableModelSource#fireObservedStateChange()
|
|
45 |
*/
|
|
46 | 0 |
public void fireObservedStateChange() |
47 |
{ |
|
48 | 0 |
getTableViewComponent().fireObservedStateChange(); |
49 |
} |
|
50 |
|
|
51 |
/**
|
|
52 |
* Resets the state of the component and forces it to load a new TableModel from the tableModel
|
|
53 |
* binding the next time it renders.
|
|
54 |
*/
|
|
55 | 0 |
public void reset() |
56 |
{ |
|
57 | 0 |
getTableViewComponent().reset(); |
58 |
} |
|
59 |
|
|
60 |
/**
|
|
61 |
* Returns the currently rendered table column. You can call this method to obtain the current
|
|
62 |
* column.
|
|
63 |
*
|
|
64 |
* @return ITableColumn the current table column
|
|
65 |
*/
|
|
66 | 0 |
public ITableColumn getTableColumn()
|
67 |
{ |
|
68 | 0 |
Object objCurrentRow = getTableRow(); |
69 |
|
|
70 |
// if the current row is null, then we are most likely rendering TableColumns
|
|
71 | 0 |
if (objCurrentRow == null) |
72 | 0 |
return getTableColumnsComponent().getTableColumn();
|
73 |
|
|
74 | 0 |
return getTableValuesComponent().getTableColumn();
|
75 |
} |
|
76 |
|
|
77 |
/**
|
|
78 |
* Returns the currently rendered table row or null if the rows are not rendered at the moment.
|
|
79 |
* You can call this method to obtain the current row.
|
|
80 |
*
|
|
81 |
* @return Object the current table row
|
|
82 |
*/
|
|
83 | 0 |
public Object getTableRow()
|
84 |
{ |
|
85 | 0 |
return getTableRowsComponent().getTableRow();
|
86 |
} |
|
87 |
|
|
88 | 0 |
protected TableView getTableViewComponent()
|
89 |
{ |
|
90 | 0 |
return (TableView) getComponent("tableView"); |
91 |
} |
|
92 |
|
|
93 | 0 |
protected TableColumns getTableColumnsComponent()
|
94 |
{ |
|
95 | 0 |
return (TableColumns) getComponent("tableColumns"); |
96 |
} |
|
97 |
|
|
98 | 0 |
protected TableRows getTableRowsComponent()
|
99 |
{ |
|
100 | 0 |
return (TableRows) getComponent("tableRows"); |
101 |
} |
|
102 |
|
|
103 | 0 |
protected TableValues getTableValuesComponent()
|
104 |
{ |
|
105 | 0 |
return (TableValues) getComponent("tableValues"); |
106 |
} |
|
107 |
} |
|