bluej.extensions
Class BProject

java.lang.Object
  extended bybluej.extensions.BProject

public class BProject
extends java.lang.Object

A wrapper for a BlueJ project.

Version:
$Id: BProject.java,v 1.22 2003/12/09 12:18:54 mik Exp $

Method Summary
 void close()
          Saves any open files, then closes all frames belonging to this project.
 java.io.File getDir()
          Returns the directory in which this project is stored.
 java.lang.String getName()
          Returns the name of this project.
 BPackage getPackage(java.lang.String name)
          Get a package belonging to this project.
 BPackage[] getPackages()
          Returns all packages belonging to this project.
 BPackage newPackage(java.lang.String fullyQualifiedName)
          Create and return a new package with the given fully qualified name.
 void save()
          Requests a "save" of all open files in this project.
 java.lang.String toString()
          Returns a string representation of this package object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getName

public java.lang.String getName()
                         throws ProjectNotOpenException
Returns the name of this project. This is what is displayed in the title bar of the frame after 'BlueJ'.

Throws:
ProjectNotOpenException - if the project has been closed by the user.

getDir

public java.io.File getDir()
                    throws ProjectNotOpenException
Returns the directory in which this project is stored.

Throws:
ProjectNotOpenException - if the project has been closed by the user.

save

public void save()
          throws ProjectNotOpenException
Requests a "save" of all open files in this project.

Throws:
ProjectNotOpenException - if the project has been closed by the user.

close

public void close()
           throws ProjectNotOpenException
Saves any open files, then closes all frames belonging to this project.

Throws:
ProjectNotOpenException - if the project has been closed by the user.

newPackage

public BPackage newPackage(java.lang.String fullyQualifiedName)
                    throws ProjectNotOpenException,
                           PackageAlreadyExistsException
Create and return a new package with the given fully qualified name. The necessary directories and files will be created.

Returns:
the requested package, or null if it wasn't found
Throws:
ProjectNotOpenException - if the project has been closed by the user.
PackageExistException - if the named package already exist in BlueJ.
PackageAlreadyExistsException

getPackage

public BPackage getPackage(java.lang.String name)
                    throws ProjectNotOpenException
Get a package belonging to this project.

Parameters:
name - the fully-qualified name of the package
Returns:
the requested package, or null if it wasn't found
Throws:
ProjectNotOpenException - if the project has been closed by the user.

getPackages

public BPackage[] getPackages()
                       throws ProjectNotOpenException
Returns all packages belonging to this project.

Returns:
The array of this project's packages, if none exist an empty array is returned.
Throws:
ProjectNotOpenException - if the project has been closed by the user.

toString

public java.lang.String toString()
Returns a string representation of this package object



BlueJ homepage