com.l2fprod.common.application.document
Class AbstractWorkspace

java.lang.Object
  extended by com.l2fprod.common.application.document.AbstractWorkspace
All Implemented Interfaces:
Workspace
Direct Known Subclasses:
TabbedWorkspace

public class AbstractWorkspace
extends java.lang.Object
implements Workspace

Base implementation for a Workspace.


Constructor Summary
AbstractWorkspace()
           
 
Method Summary
 void close(WorkspaceDocument document)
          Closes the given document.
protected  void documentChanged(WorkspaceDocument document, java.beans.PropertyChangeEvent event)
          Called whenever a property is changed in the Document
protected  void documentClosed(WorkspaceDocument document)
          Called once the document has been closed.
protected  void documentOpened(WorkspaceDocument document)
          Called once the document has been opened in this workspace.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractWorkspace

public AbstractWorkspace()
Method Detail

setSelected

public void setSelected(WorkspaceDocument document)
                 throws java.beans.PropertyVetoException
Description copied from interface: Workspace
Selects the given document in the workspace. The document must belong to this workspace otherwise an IllegalArgumentException will be thrown.

Specified by:
setSelected in interface Workspace
Throws:
java.beans.PropertyVetoException - if the previously selected document prevents another document from being selected

getSelected

public final WorkspaceDocument getSelected()
Description copied from interface: Workspace
Gets the currently selected document.

Specified by:
getSelected in interface Workspace
Returns:
the currently selected document

getDocuments

public final WorkspaceDocument[] getDocuments()
Description copied from interface: Workspace
Gets all documents hosted in this workspace.

Specified by:
getDocuments in interface Workspace
Returns:
all documents hosted in this workspace

open

public final void open(WorkspaceDocument document)
Description copied from interface: Workspace
Opens the given document in this workspace.

Specified by:
open in interface Workspace

documentOpened

protected void documentOpened(WorkspaceDocument document)
Called once the document has been opened in this workspace. Subclasses will react by making the document visible to the user.

Parameters:
document -

documentChanged

protected void documentChanged(WorkspaceDocument document,
                               java.beans.PropertyChangeEvent event)
Called whenever a property is changed in the Document


documentClosed

protected void documentClosed(WorkspaceDocument document)
Called once the document has been closed. Subclasses will react by hiding the document.

Parameters:
document -

close

public void close(WorkspaceDocument document)
           throws java.beans.PropertyVetoException
Description copied from interface: Workspace
Closes the given document. Registered listeners on the document may prevent it from closing.

Specified by:
close in interface Workspace
Throws:
java.beans.PropertyVetoException - if one of the listeners prevented the document to be closed

save

public void save(WorkspaceDocument document)
Description copied from interface: Workspace
Saves the given document.

Specified by:
save in interface Workspace