KickJava   Java API By Example, From Geeks To Geeks.

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


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 // JBuilder imports
25
import com.borland.primetime.ide.Browser;
26 import com.borland.primetime.node.TextFileNode;
27 import com.borland.primetime.node.Node;
28 import com.borland.primetime.node.Project;
29 import com.borland.primetime.properties.PropertyPageFactory;
30 import com.borland.primetime.properties.PropertyPage;
31 import com.borland.primetime.properties.PropertyManager;
32 import com.borland.primetime.properties.PropertyGroup;
33
34 // Kelp imports
35
import org.enhydra.kelp.KelpInfo;
36 import org.enhydra.kelp.common.PathUtil;
37 import org.enhydra.kelp.common.node.OtterProject;
38 import org.enhydra.kelp.common.node.OtterTextFileNode;
39 import org.enhydra.kelp.jbuilder.node.PrimeProject;
40 import org.enhydra.kelp.jbuilder.node.PrimeTextFileNode;
41
42 // Standard imports
43
import java.io.File JavaDoc;
44 import java.util.ResourceBundle JavaDoc;
45 public class DeployProperties implements PropertyGroup {
46     static ResourceBundle JavaDoc res =
47         ResourceBundle.getBundle("org.enhydra.kelp.jbuilder.Res"); // nores
48

49     public DeployProperties() {}
50
51     /**
52      * Initialize this OpenTool
53      */

54     public static void initOpenTool(byte majorVersion, byte minorVersion) {
55         if (KelpInfo.isClassPathComplete()) {
56             PropertyManager.registerPropertyGroup(new DeployProperties());
57         }
58     }
59
60     /**
61      * Returns a PropertyPageFactory for the project or for an
62      * conf.in file node. Null if topic is something else.
63      */

64     public PropertyPageFactory getPageFactory(final Object JavaDoc topic) {
65         PropertyPageFactory factory = null;
66         TextFileNode nativeTextNode = null;
67         OtterTextFileNode otterNode = null;
68
69         if (topic instanceof TextFileNode) {
70             nativeTextNode = (TextFileNode) topic;
71             otterNode = new PrimeTextFileNode(nativeTextNode);
72             if (PathUtil.isTemplate(otterNode)) {
73                 factory =
74                     (new PropertyPageFactory("Input Template") {
75                     public PropertyPage createPropertyPage() {
76                         return new TemplateNodePropertyPage(topic);
77                     }
78
79                 });
80             }
81         } else if (topic instanceof Project) {
82
83             // Project property page to set your XMLC properties
84
factory =
85                 (new PropertyPageFactory("Kelp Deployer") {
86                 public PropertyPage createPropertyPage() {
87                     return new DeployProjectPropertyPage(topic);
88                 }
89
90             });
91         }
92         return factory;
93     }
94
95     public void initializeProperties() {}
96
97 }
98
Popular Tags