KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openuss > presentation > enhydra > framework > BaseTable


1 /**
2  * Title: OpenUSS - Open Source University Support System
3  * Description: BaseTable Presentation Object
4  * Copyright: Copyright (c) B. Lofi Dewanto
5  * Company: University of Muenster
6  * @author B. Lofi Dewanto
7  * @version 1.0
8  */

9 package org.openuss.presentation.enhydra.framework;
10
11 import org.w3c.dom.*;
12 import org.w3c.dom.html.*;
13
14
15 /**
16  * The base table for Enhydra.
17  *
18  * @author B. Lofi Dewanto
19  * @version 1.0
20  */

21 public abstract class BaseTable {
22     // The document for showing this table
23
protected Document mainPage;
24
25     /**
26      * Constructor.
27      */

28     public BaseTable() {
29     }
30
31     /**
32      * Constructor.
33      */

34     public BaseTable(Document mainPage) throws BaseTableException {
35         this.mainPage = mainPage;
36     }
37
38     /**
39      * Set the document.
40      */

41     public void setDocument(Document mainPage) {
42         this.mainPage = mainPage;
43     }
44
45     /**
46      * Get the result table document.
47      */

48     abstract public Node getTable();
49
50     /**
51      * Get the result table document.
52      */

53     public Node getTableForDocument() {
54         // Import the table into the current document
55
Node currentNode = mainPage.importNode(this.getTable(), true);
56
57         return currentNode;
58     }
59 }
Popular Tags