home *** CD-ROM | disk | FTP | other *** search
- !!Script
- // Copyright ⌐ 1997-1998 - Modelworks Software
- // @Modified build 431 cm20001011 - added "Classpath_changed" event
-
- //
- // Classpath utilities
- //
-
- function DoCommand()
- {
- alert("The classpathUtilities script only contains funtions\nthat can be used by other scripts");
- }
-
- function EditJDKCustomClasspaths(classpaths)
- {
- var newClasspaths = EditClasspaths(
- "Edit JDK custom classpaths - do not enter a path for classes.zip",
- classpaths);
- return newClasspaths;
- }
-
- function EditMSJCustomClasspaths(classpaths)
- {
- var newClasspaths = EditClasspaths(
- "Edit MSJ custom classpaths - do not enter a path for classes.zip",
- classpaths);
- return newClasspaths;
- }
-
- function EditClasspaths(message, classpaths)
- {
- // Extract paths speparated by semicolons
-
- var classpathList = newList();
- var start = 0;
- if (typeof(classpaths) == "string")
- {
- var index = classpaths.indexOf(";")
- while(index != -1)
- {
- var classpath = classpaths.substring(start, index);
- classpathList.addTail(classpath);
- start = index + 1;
- index = classpaths.indexOf(";", start);
- }
- }
- else
- {
- classpaths = "";
- }
-
- if (start < classpaths.length)
- {
- var classpath = classpaths.substring(start, classpaths.length);
- classpathList.addTail(classpath);
- }
-
- var newClasspathList = editList("Classpaths",
- message,
- classpathList,
- null,
- EditClasspath,
- null,
- false);
-
- if (newClasspathList)
- {
- var newclasspaths = "";
- var position = newClasspathList.getHeadPosition();
- while (position.valid)
- {
- newclasspaths += newClasspathList.getNext(position);
- if (position.valid)
- {
- newclasspaths += ";";
- }
- }
-
- if (newclasspaths != classpaths)
- {
- Application.setEvent("Classpath_changed", 1);
- }
-
- return newclasspaths;
- }
- return classpaths;
- }
-
- function EditClasspath(classpath)
- {
- var newclasspath = editDirectoryFilePath("Enter your directory or archive path",
- "", classpath,
- "Archive files (*.zip;*.jar;*.cab)", "*.zip;*.jar;*.cab");
-
- return newclasspath;
- }
-
- !!/Script
-
-