org.openide.cookies
Interface ProjectCookie

All Superinterfaces:
Node.Cookie, Serializable

public interface ProjectCookie
extends Node.Cookie, Serializable

A cookie that provides project manipulation functionality. Such a cookie should be attached to any data object that represents a "Project" in the IDE.

A project should consist of a set of settings. When the project is opened, it should control the current settings of the IDE (change workplaces, control panel options, and the content of filesystem pool). Moreover the project has a so-called "Project Desktop" that should provide a default working node for the developer to store working files, and also to describe the capabilities of the project (for example if the project can the compiled, the node should support CompilerCookie).

To let the project save settings when explicitly asked to or when the project is closed, projectSave() is used. It is called when another project is opened. The method should store the current state of IDE to be restored on next opening.

To allow the IDE to remember the current project when it the IDE is closed and to reopen it on next startup, the project is required to be serializable.


Method Summary
 void projectClose()
          Close the project.
 Node projectDesktop()
          Get the "Project Desktop" node.
 void projectOpen()
          Open the project by loading its settings into the IDE.
 void projectSave()
          Save the project.
 

Method Detail

projectOpen

public void projectOpen()
                 throws IOException
Open the project by loading its settings into the IDE.
Throws:
IOException - if an error occurred during opening of the project

projectSave

public void projectSave()
                 throws IOException
Save the project. This method instructs the project to store the current settings of the IDE (that could be modified during work in the project) to be restored on the next open of the project. It is up to the project to decide which settings to store and how.
Throws:
IOException - if an error occurs during saving

projectClose

public void projectClose()
                  throws IOException
Close the project. This method instructs the project that another project is becoming the active project and that the project can drop allocated resources.
Throws:
IOException - if an error occurs during saving

projectDesktop

public Node projectDesktop()
Get the "Project Desktop" node. This should contain the main functionality associated with the project. For example, if the project can be compiled or executed, appropriate cookies (CompilerCookie, ExecCookie) should be attached to this node.

Moreover such a node may allow the user to store his "working files" to simplify access to them.

Returns:
the project destop node


Built on December 12 2001.  |  Portions Copyright 1997-2001 Sun Microsystems, Inc. All rights reserved.