public abstract class AbstractDocument extends Object implements Serializable, Persistent, Document
Modifier and Type | Field and Description |
---|---|
protected PropertyChangeSupport |
change |
static String |
PERSISTENCE_DEFINITION_NAME |
ACCESS_DOCUMENT_AUTHORIZATION
Constructor and Description |
---|
AbstractDocument()
Creates a new ProjectElement object.
|
AbstractDocument(DocumentManager factory) |
Modifier and Type | Method and Description |
---|---|
void |
addListener(ProjectDocumentListener listener)
Register a ProjectDocumentListener.
|
void |
addPropertyChangeListener(PropertyChangeListener listener)
Add a listener to monitor the changes in the properties of the document
|
void |
afterAdd() |
void |
afterRemove() |
protected void |
callCreateWindow(IWindow window)
Deprecated.
use {link
raiseEventCreateWindow(IWindow) |
String |
exportDocumentAsText() |
String |
getComment()
Gets the comments asociateds to the document
|
String |
getCreationDate()
Get the creation date of the document.
|
DocumentManager |
getFactory() |
JComponent |
getMainComponent()
Return the main JComponent associated to this document.
|
IWindow |
getMainWindow()
Return the main window associated to this document.
|
String |
getName()
return the name of the document
|
String |
getOwner()
Get the creator name of the document.
|
Project |
getProject() |
IWindow |
getPropertiesWindow() |
String |
getTypeName()
Return the name of the type of documents
|
WindowLayout |
getWindowLayout() |
boolean |
isAvailable() |
boolean |
isLocked()
Tells whether if this project's element is locked/protected or not.
|
boolean |
isModified() |
boolean |
isTemporary() |
void |
loadFromState(PersistentState state)
Set the state of the object from the state passed as parameter.
|
void |
lock()
Locks this project element protecting it from deleting from the project.
|
void |
raiseEventCreateWindow(IWindow window)
Throw this event when a new window is created
|
static void |
registerPersistent() |
void |
saveToState(PersistentState state)
Saves the internal state of the object on the provided
PersistentState object.
|
void |
setComment(String string)
Gets the comments asociateds to the document
|
void |
setCreationDate(String string)
Set the creation date of the document.
|
void |
setModified(boolean modified) |
void |
setName(String name)
Sets the nane of the document
|
void |
setOwner(String string)
Sets the creator name of the document
|
void |
setProject(Project project) |
void |
setStateFromText(String text) |
void |
setWindowLayout(WindowLayout layout) |
String |
toString() |
void |
unlock()
Unlocks this element.
|
public static final String PERSISTENCE_DEFINITION_NAME
protected PropertyChangeSupport change
public AbstractDocument()
public AbstractDocument(DocumentManager factory)
public String toString()
toString
in class Object
Object.toString()
public String getName()
public String getTypeName()
getTypeName
in interface Document
public void setName(String name)
public String getCreationDate()
getCreationDate
in interface Document
public String getOwner()
public void setCreationDate(String string)
setCreationDate
in interface Document
string
- public void setOwner(String string)
public String getComment()
getComment
in interface Document
public void setComment(String string)
setComment
in interface Document
string
- public void addPropertyChangeListener(PropertyChangeListener listener)
addPropertyChangeListener
in interface Document
listener
- public void addListener(ProjectDocumentListener listener)
addListener
in interface Document
listener
- ProjectDocumentListenerpublic WindowLayout getWindowLayout()
getWindowLayout
in interface Document
public void setWindowLayout(WindowLayout layout)
setWindowLayout
in interface Document
public void loadFromState(PersistentState state) throws PersistenceException
Persistent
loadFromState
in interface Persistent
PersistenceException
public void saveToState(PersistentState state) throws PersistenceException
Persistent
saveToState
in interface Persistent
PersistenceException
public static void registerPersistent()
public Project getProject()
getProject
in interface Document
public void setProject(Project project)
setProject
in interface Document
public void lock()
public void unlock()
public boolean isLocked()
public DocumentManager getFactory()
getFactory
in interface Document
public boolean isModified()
isModified
in interface Document
public void setModified(boolean modified)
setModified
in interface Document
public void raiseEventCreateWindow(IWindow window)
window
- IWindow createdprotected void callCreateWindow(IWindow window)
raiseEventCreateWindow(IWindow)
public void afterRemove()
afterRemove
in interface Document
public String exportDocumentAsText()
public void setStateFromText(String text)
public IWindow getPropertiesWindow()
getPropertiesWindow
in interface Document
public IWindow getMainWindow()
Document
this.getFactory().getMainWindow(doc)
getMainWindow
in interface Document
public JComponent getMainComponent()
Document
this.getFactory().getMainComponent(doc)
getMainComponent
in interface Document
public boolean isTemporary()
isTemporary
in interface Document
public boolean isAvailable()
isAvailable
in interface Document