KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > kelp > jbuilder > tool > XMLCTool


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.tool;
24
25 // JBuilder imports
26
import com.borland.jbuilder.JBuilderHelp;
27 import com.borland.jbuilder.node.JBProject;
28 import com.borland.primetime.help.ZipHelpBook;
29 import com.borland.primetime.help.ZipHelpTopic;
30 import com.borland.primetime.ide.Browser;
31 import com.borland.primetime.ide.BrowserAction;
32
33 // Kelp imports
34
import org.enhydra.kelp.KelpInfo;
35 import org.enhydra.kelp.common.Constants;
36 import org.enhydra.kelp.common.ResUtil;
37 import org.enhydra.kelp.common.node.OtterXMLCNode;
38 import org.enhydra.kelp.common.swing.KelpIconSet;
39 import org.enhydra.kelp.common.xmlc.CoreXMLCTool;
40 import org.enhydra.kelp.jbuilder.wizard.AbstractBasicWizard;
41 import org.enhydra.kelp.jbuilder.node.PrimeProject;
42
43 //
44
public class XMLCTool extends AbstractBasicTool {
45
46     // string not to be resourced
47
private final String JavaDoc HELP_LINK = KelpInfo.getAddinHelpURL(); // nores
48

49     public static void initOpenTool(byte majorVersion, byte minorVersion) {
50         AbstractBasicTool.initAllTools(majorVersion, minorVersion);
51     }
52
53     public XMLCTool() {
54         putValue(BrowserAction.SMALL_ICON, KelpIconSet.getSmallIcon());
55     }
56
57     // implement: org.enhydra.kelp.jbuilder.AbstractBasicTool
58
public String JavaDoc getTitle() {
59         return CoreXMLCTool.getDefaultTitle();
60     }
61
62
63     // implements: org.enhydra.kelp.jbuilder.tool.AbstractBasicTool
64
public String JavaDoc getDescription() {
65         return res.getString("Compile_XMLC_DOCS");
66     }
67
68     // implement: com.borland.primetime.ide.BrowserAction
69
public void actionPerformed(Browser browser) {
70         PrimeProject primeProject = null;
71         CoreXMLCTool coreTool = null;
72
73         setNativeProject((JBProject) browser.getProjectView().getActiveProject());
74         if (getNativeProject() == null) {
75
76             // do nothing
77
} else {
78             primeProject = new PrimeProject(getNativeProject());
79             primeProject.save();
80             saveNodes(primeProject.getAllXMLCNodes());
81             if (verifyAllClassPaths(browser.getParent())) {
82                 coreTool = new CoreXMLCTool();
83                 coreTool.addHelpListener(this);
84                 coreTool.setProject(primeProject);
85                 coreTool.showDialog(browser);
86             }
87         }
88     }
89
90     public String JavaDoc getHelpAnchor() {
91         return HELP_LINK;
92     }
93
94 }
95
Popular Tags