home *** CD-ROM | disk | FTP | other *** search
- !!Script
- // Copyright ⌐ 1997-1998 - Modelworks Software
- // @Modified build 255 cm19990120 - incremented the updateWorkspaceTab indexes
-
- /**
- @Tool: addPackage~displays a new package dialog to let you define
- and new package to be added to the current project. A package requires
- a source directory, a destination directory (which may be the
- same as the source directory), and a source and destination
- file types. If you are adding a Java package then you also need
- to select the package name from the drop down list. If you are
- defining a non-Java package, you can enter any name that you like
- for the package name.
- @Note: For Java packages, the correct package name is included in
- a package statement in at least one Java source file in the
- source directory.
- @EndNote:
- @Image: Add Package Dialog@addPackage_Project.gif
- @Paragraph: Choosing a custom package type will require you to
- enter in a source and destination file types in another dialog.
- Choosing the Java package type automatically defines the
- source and destination file types (e.g., ".java.class").
- @Paragraph: How files are added to a package depends upon the auto include state.
- If auto include is on then all files matching the file type in the package
- source directory or subdirectory are automatically included in the package.
- In this case you can use the removeFiles script to exclude files and you
- can use the addFiles script to include files that have been excluded. If the
- auto include is off then you must use the addFiles script to include files
- in the package and use removeFiles to exclude files added by the addFiles
- script.
- @EndTool:
- @Summary: addPackage~displays a new package dialog
- */
-
- function DoUpdate(cmdUI)
- {
- var project = getCurrentProject();
- cmdUI.enable(project != null && !project.readOnly)
- return true;
- }
-
- function DoCommand()
- {
- var project = getCurrentProject();
-
- if (project)
- {
- var p = chooseNewPackage("Create Package");
- // Note you can not use the variable name "package"
- // because it is a reserve word in JavaScript
- if (p)
- {
- project.addPackage(p);
- Application.updateWorkspaceTab("Class");
- Application.updateWorkspaceTab("Package");
- Application.updateWorkspaceTab("Files");
- }
- }
- else
- {
- alert("A project must be open before you can add a package");
- }
- }
-
-
- !!/Script
-