KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > kelp > jbuilder > properties > XMLCPackagePropertyPage


1 /*
2  * Enhydra Java Application Server Project
3  *
4  * The contents of this file are subject to the Enhydra Public License
5  * Version 1.1 (the "License"); you may not use this file except in
6  * compliance with the License. You may obtain a copy of the License on
7  * the Enhydra web site ( http://www.enhydra.org/ ).
8  *
9  * Software distributed under the License is distributed on an "AS IS"
10  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
11  * the License for the specific terms governing rights and limitations
12  * under the License.
13  *
14  * The Initial Developer of the Enhydra Application Server is Lutris
15  * Technologies, Inc. The Enhydra Application Server and portions created
16  * by Lutris Technologies, Inc. are Copyright Lutris Technologies, Inc.
17  * All Rights Reserved.
18  *
19  * Contributor(s):
20  *
21  */

22 package org.enhydra.kelp.jbuilder.properties;
23
24 // Kelp imports
25
import org.enhydra.kelp.KelpInfo;
26 import org.enhydra.kelp.common.node.OtterNode;
27 import org.enhydra.kelp.common.properties.XMLCPackagePropertyPanel;
28 import org.enhydra.kelp.jbuilder.node.PrimeNode;
29
30 // JBuilder Foundation Imports
31
import com.borland.primetime.help.HelpTopic;
32 import com.borland.primetime.help.ZipHelpTopic;
33 import com.borland.primetime.node.LightweightNode;
34 import com.borland.primetime.properties.PropertyPage;
35
36 // Standard imports
37
import java.awt.BorderLayout JavaDoc;
38
39 /**
40  * Class declaration
41  *
42  *
43  * @author Paul Mahar
44  */

45 public class XMLCPackagePropertyPage extends PropertyPage {
46     // string not to be resourced
47
private final String JavaDoc HELP_LINK = KelpInfo.getAddinHelpURL(); // nores
48
//
49
private XMLCPackagePropertyPanel packagePanel = new XMLCPackagePropertyPanel();
50     private BorderLayout JavaDoc layoutMain = new BorderLayout JavaDoc();
51
52     /**
53      * Constructor declaration
54      *
55      *
56      * @param topic
57      */

58     public XMLCPackagePropertyPage(Object JavaDoc topic) {
59         if (topic instanceof LightweightNode) {
60             LightweightNode nativeNode = null;
61             OtterNode otterNode = null;
62
63             nativeNode = (LightweightNode) topic;
64             otterNode = new PrimeNode(nativeNode);
65             try {
66                 packagePanel.setNode(otterNode);
67                 jbInit();
68             } catch (Exception JavaDoc e) {
69                 e.printStackTrace();
70             }
71         }
72     }
73
74     /**
75      * Method declaration
76      *
77      */

78     public void readProperties() {
79         packagePanel.readProperties();
80     }
81
82     /**
83      * Method declaration
84      *
85      *
86      * @return
87      */

88     public HelpTopic getHelpTopic() {
89         ZipHelpTopic topic = null;
90
91         topic = new ZipHelpTopic(null, HELP_LINK);
92         return topic;
93     }
94
95     /**
96      * Method declaration
97      *
98      */

99     public void writeProperties() {
100         packagePanel.writeProperties();
101     }
102
103     /**
104      * Constructor declaration
105      *
106      */

107     public XMLCPackagePropertyPage() {
108         try {
109             jbInit();
110         } catch (Exception JavaDoc e) {
111             e.printStackTrace();
112         }
113     }
114
115     /**
116      * Method declaration
117      *
118      *
119      * @exception Exception
120      */

121     private void jbInit() throws Exception JavaDoc {
122         this.setLayout(layoutMain);
123         this.add(packagePanel, BorderLayout.CENTER);
124     }
125
126 }
127
Popular Tags