home *** CD-ROM | disk | FTP | other *** search
- !!Script
- // Copyright ⌐ 2001 - Modelworks Software
- // @Created build 503 cm20010320
-
- /**
- @Tool: insertCommand~insert special variable
- into the command line.
- @EndTool:
- @Summary: insertCommand~insert special variable
- */
-
- var gCommandLineMapfile = getMapFile("CommandLine.map");
- var gOutput = getOutput();
-
- function OnEvent(menu)
- {
- var scriptPath = getScriptPath();
- menu.appendItem("Choose File...",
- scriptPath,
- "Choose file path to insert",
- false, "ChooseFile");
-
- menu.appendItem("Choose Directory...",
- scriptPath,
- "Choose directory path to insert",
- false, "ChooseDirectory");
-
- menu.appendItem("$editor.path",
- scriptPath,
- "Insert the path to the active editor",
- false, "$editor.path");
-
- menu.appendItem("$editor.directory",
- scriptPath,
- "Insert the directory of the active editor",
- false, "$editor.directory");
-
- menu.appendItem("$editor.name",
- scriptPath,
- "Insert the name of the active editor",
- false, "$editor.name");
-
- menu.appendItem("$editor.fileType",
- scriptPath,
- "Insert the file type of the active editor",
- false, "$editor.fileType");
-
- menu.appendItem("$editor.sourcepath",
- scriptPath,
- "Insert the sourcepath of the active editor (java only)",
- false, "$editor.sourcepath");
-
- menu.appendItem("$project.java.classpaths",
- scriptPath,
- "Insert the classpaths of the project (java only)",
- false, "$project.java.classpaths");
-
- menu.appendItem("$java.jdk.customclasspaths",
- scriptPath,
- "Insert the custom classpaths (java only - see JDK menu)",
- false, "$java.jdk.customclasspaths");
-
- menu.appendItem("$java.jdk.standardclasspaths",
- scriptPath,
- "Insert the standard classpaths (java only - see JDK menu)",
- false, "$java.jdk.standardclasspaths");
-
- return true;
- }
-
- function ChooseDirectory()
- {
- var directory = gCommandLineMapfile.lookup("CurrentDirectory", "");
- directory = chooseDirectory("Choose Directory", directory);
- if (directory && directory.length > 0)
- {
- commandLineComboBox = getGlobal("CommandLine.CommandLineComboBox");
- if (commandLineComboBox)
- {
- commandLineComboBox.text += " " + directory;
- }
- }
- }
-
- function ChooseFile()
- {
- var directory = gCommandLineMapfile.lookup("CurrentDirectory", "");
- var file = chooseFile("Choose File", "*.*", "*.*", directory);
- if (file)
- {
- commandLineComboBox = getGlobal("CommandLine.CommandLineComboBox");
- if (commandLineComboBox)
- {
- if (commandLineComboBox.text.length > 0)
- {
- commandLineComboBox.text += " ";
- }
- commandLineComboBox.text += file.path;
- }
- }
- }
-
- function DoCommand(id, cookie)
- {
- if (cookie == "ChooseDirectory")
- {
- ChooseDirectory();
- }
- else if (cookie == "ChooseFile")
- {
- ChooseFile();
- }
- else
- {
- var commandLineComboBox = getGlobal("CommandLine.CommandLineComboBox");
- if (commandLineComboBox)
- {
- commandLineComboBox.text += " " + cookie;
- }
- }
- }
-
- !!/Script
-
-