01: /*
02: * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
03: * PROPRIETARY/CONFIDENTIAL. Use of this product is subject to license terms.
04: */
05:
06: //
07: package com.sun.portal.ffj.actions;
08:
09: import java.io.File;
10:
11: import java.net.URLEncoder;
12:
13: import org.openide.filesystems.FileObject;
14:
15: import org.openide.nodes.Node;
16:
17: import org.openide.util.HelpCtx;
18: import org.openide.util.NbBundle;
19:
20: import com.sun.portal.ffj.filesystems.PSFileSystem;
21:
22: import com.sun.portal.ffj.util.ParEntry;
23:
24: public class ExecuteAction extends PSNodeAction {
25:
26: public String getName() {
27: return NbBundle.getMessage(ExecuteAction.class,
28: "LBL_ExecuteAction");
29: }
30:
31: public HelpCtx getHelpCtx() {
32: return HelpCtx.DEFAULT_HELP;
33: // If you will provide context help then use:
34: // return new HelpCtx (ExecuteAction.class);
35: }
36:
37: /** Perform special enablement check in addition to the normal one.
38: protected boolean enable (Node[] nodes) {
39: if (! super.enable (nodes)) return false;
40: if (...) ...;
41: }
42: */
43:
44: /** Perform extra initialization of this action's singleton.
45: * PLEASE do not use constructors for this purpose!
46: protected void initialize () {
47: super.initialize ();
48: * putProperty (Action.SHORT_DESCRIPTION, NbBundle.getMessage (ExecuteAction.class, "HINT_Action"));
49: }
50: */
51:
52: protected String constructQueryString(ParEntry pe,
53: String pePathName, PSFileSystem psFS) {
54:
55: StringBuffer retVal = new StringBuffer();
56:
57: File cf = new File(pePathName);
58: String tpl = (new File(cf.getParent(), "desktop")).getPath();
59:
60: retVal.append("COMPFILE");
61: retVal.append("=");
62: retVal.append(URLEncoder.encode(pePathName));
63: retVal.append("&");
64: retVal.append("CONFIGDIR");
65: retVal.append("=");
66: retVal.append(URLEncoder.encode(psFS.getRootDirectory()
67: .getPath()));
68: retVal.append("&");
69: retVal.append("DESKTOP_XFER");
70: retVal.append("=");
71: retVal.append(URLEncoder.encode(tpl));
72:
73: return retVal.toString();
74: }
75:
76: protected FileObject getPSRunObject(PSFileSystem psFS) {
77: return psFS.getPSSimulator();
78: }
79: }
|