com.l2fprod.common.application.document
Interface Workspace

All Known Implementing Classes:
AbstractWorkspace, TabbedWorkspace

public interface Workspace

A workspace defined a container for documents. Documents can be added (opened) / removed (closed) to /from a workspace. At a given time, there is only one "active" document (selected) in the workspace.


Method Summary
 void close(WorkspaceDocument document)
          Closes the given document.
 WorkspaceDocument[] getDocuments()
          Gets all documents hosted in this workspace.
 WorkspaceDocument getSelected()
          Gets the currently selected document.
 void open(WorkspaceDocument document)
          Opens the given document in this workspace.
 void save(WorkspaceDocument document)
          Saves the given document.
 void setSelected(WorkspaceDocument document)
          Selects the given document in the workspace.
 

Method Detail

setSelected

void setSelected(WorkspaceDocument document)
                 throws java.lang.IllegalArgumentException,
                        java.beans.PropertyVetoException
Selects the given document in the workspace. The document must belong to this workspace otherwise an IllegalArgumentException will be thrown.

Parameters:
document -
Throws:
java.lang.IllegalArgumentException - if the document is not in this workspace
java.beans.PropertyVetoException - if the previously selected document prevents another document from being selected

getSelected

WorkspaceDocument getSelected()
Gets the currently selected document.

Returns:
the currently selected document

getDocuments

WorkspaceDocument[] getDocuments()
Gets all documents hosted in this workspace.

Returns:
all documents hosted in this workspace

open

void open(WorkspaceDocument document)
Opens the given document in this workspace.

Parameters:
document -

close

void close(WorkspaceDocument document)
           throws java.beans.PropertyVetoException
Closes the given document. Registered listeners on the document may prevent it from closing.

Parameters:
document -
Throws:
java.beans.PropertyVetoException - if one of the listeners prevented the document to be closed

save

void save(WorkspaceDocument document)
Saves the given document.

Parameters:
document -