KickJava   Java API By Example, From Geeks To Geeks.

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


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 Devel doper 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.OtterNode;
38 import org.enhydra.kelp.common.swing.KelpIconSet;
39 import org.enhydra.kelp.common.deployer.CoreDeployTool;
40 import org.enhydra.kelp.jbuilder.node.PrimeProject;
41
42 //
43
public class DeployTool extends AbstractBasicTool {
44     //
45
private final String JavaDoc HELP_LINK = KelpInfo.getAddinHelpURL(); // nores
46

47     //
48
public static void initOpenTool(byte majorVersion, byte minorVersion) {
49         AbstractBasicTool.initAllTools(majorVersion, minorVersion);
50     }
51
52     //
53
public DeployTool() {
54         putValue(BrowserAction.SMALL_ICON, KelpIconSet.getSmallIcon());
55     }
56
57     // implement: org.enhydra.kelp.jbuilder.toolAbstractBasicWizard
58
public String JavaDoc getTitle() {
59         return CoreDeployTool.getDefaultTitle();
60     }
61
62     // implement: org.enhydra.kelp.jbuilder.toolAbstractBasicWizard
63
public String JavaDoc getDescription() {
64         return res.getString("Deploy_content");
65     }
66
67     // implement: com.borland.primetime.ide.BrowserAction
68
public void actionPerformed(Browser browser) {
69         PrimeProject primeProject = null;
70         OtterNode[] inputNodes = new OtterNode[0];
71         CoreDeployTool 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             inputNodes = primeProject.getAllInput();
81             saveNodes(inputNodes);
82             if (verifyAllClassPaths(browser.getOwner())) {
83                 coreTool = new CoreDeployTool();
84                 coreTool.addHelpListener(this);
85                 coreTool.setProject(primeProject);
86                 coreTool.showDialog(browser);
87             }
88         }
89     }
90
91     public String JavaDoc getHelpAnchor() {
92         return HELP_LINK;
93     }
94
95 }
96
Popular Tags