KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > kelp > jbuilder > node > PrimeTemplateNode


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  * Paul Mahar
21  *
22  */

23 package org.enhydra.kelp.jbuilder.node;
24
25 // ToolBox
26
import org.enhydra.tool.common.ToolException;
27 import org.enhydra.tool.common.PathHandle;
28
29 // AddinCore
30
import org.enhydra.kelp.common.ResUtil;
31 import org.enhydra.kelp.common.PropUtil;
32 import org.enhydra.kelp.common.PathUtil;
33 import org.enhydra.kelp.common.node.OtterProject;
34 import org.enhydra.kelp.common.node.OtterNode;
35 import org.enhydra.kelp.common.node.OtterTemplateNode;
36
37 // JBuilder
38
import com.borland.primetime.node.FileNode;
39 import com.borland.primetime.node.Project;
40 import com.borland.primetime.node.Node;
41 import com.borland.primetime.vfs.Url;
42 import com.borland.primetime.node.DuplicateNodeException;
43
44 // JDK
45
import java.io.File JavaDoc;
46 import java.util.ResourceBundle JavaDoc;
47
48 //
49
public class PrimeTemplateNode extends PrimeTextFileNode
50     implements OtterTemplateNode {
51
52     //
53
static ResourceBundle JavaDoc res =
54         ResourceBundle.getBundle("org.enhydra.kelp.jbuilder.Res"); // nores
55

56     public PrimeTemplateNode(FileNode n) throws ToolException {
57         super(n);
58         if (!PathUtil.isTemplate(this)) {
59             StringBuffer JavaDoc buf = new StringBuffer JavaDoc();
60
61             buf.append(res.getString("Invalid_template_node"));
62             buf.append('\n');
63             buf.append(ResUtil.format(res.getString("Node_file_path_0_"),
64                                       getFilePath()));
65             buf.append('\n');
66             buf.append(ResUtil.format(res.getString("Deploy_input_path_0_"),
67                                       getProject().getDeployInputPath()));
68             throw new ToolException(buf.toString());
69         }
70     }
71
72     /**
73      * Constructor declaration
74      *
75      *
76      * @param otterNode
77      * @param file
78      */

79     public PrimeTemplateNode(OtterNode otterNode, String JavaDoc file) {
80         super(otterNode, file);
81     }
82
83     // implments OtterTemplateNode
84
public String JavaDoc getOutputPath() {
85         return PathUtil.getOutputPath(this);
86     }
87
88 }
89
Popular Tags