public abstract class AbstractDocumentManager extends Object implements DocumentManager, Observer
NOTIFY_AFTER_CREATEDOCUMENT, NOTIFY_AFTER_GETMAINWINDOW, NOTIFY_AFTER_GETPROPERTIESWINDOW
Modifier | Constructor and Description |
---|---|
protected |
AbstractDocumentManager() |
Modifier and Type | Method and Description |
---|---|
void |
addObserver(Observer o) |
Object |
create()
Crea una instancia de la extension y la retorna.
|
Object |
create(Map args) |
Object |
create(Object[] args)
Crea una instancia de la extension y la retorna.
|
AbstractDocument |
createDocumentByUser()
Uses a gui to be able from the characteristics that we want a
ProjectDocument
|
Iterator<? extends Document> |
createDocumentsByUser()
Uses a gui to be able from the characteristics that we want a
ProjectDocument
|
protected IDocumentWindow |
createDocumentWindow(Document document) |
Object |
createFromState(PersistentState state)
Create an instance of the object represented by the state.
|
void |
deleteObserver(Observer o) |
void |
deleteObservers() |
boolean |
existName(Project project,
String documentName)
Deprecated.
use instead project.getProjectDocument
|
List<DynStruct> |
getDefinitions()
Return a List of the definition managed by this factory where the key is
className and value is definition |
protected abstract Class |
getDocumentClass()
Return the class or interface for the documents managed by this factory.
|
String |
getDomainName()
Returns the domain name of the objects persisted by this factory.
|
String |
getDomainURL()
Returns the domain URL to use for the schema.
|
ImageIcon |
getIcon()
Returns the icon for the type of document.
|
ImageIcon |
getIconSelected()
Returns the icon for the type of document when is selected
|
JComponent |
getMainComponent(Document doc)
Devuelbe el JComponent que se corresponde con el documento indicado.
|
JComponent |
getMainComponent(DocumentsContainer container,
Document doc)
Create a new JComponent for the document or if already exists
in the specified container, return this.
|
IWindow |
getMainWindow(Document doc)
Return the main window asociated to the passed document.
|
IWindow |
getMainWindow(Document doc,
WindowLayout layout)
Return the main window asociated to the document.
|
Class |
getManagedClass(Object object)
Return the class or interface the factory asociate to
the object.
|
Class |
getManagedClass(PersistentState state)
Return the class or interface the factory asociate to
the object.
|
Class |
getManagedClass(String name)
Return the class or interface the factory asociate to
the java class name.
|
List |
getManagedClasses()
Return the list of classes or interfaces managed by this
factory.
|
String |
getManagedClassName(Object object)
Return the name class or interface the factory asociate to
the object.
|
int |
getPriority()
Returns the type of document priority.
|
IWindow |
getPropertiesWindow(Document doc)
Return the windows properties asociated to the document.
|
String |
getTitle()
Returns the title of type of document.
|
void |
loadFromState(PersistentState state,
Object object)
Load a instance of
classToUse from state data. |
boolean |
manages(Class theClass)
Informs if
theClass is managed by this factory. |
boolean |
manages(PersistentState state)
Informs if this factory can recreate the object represented by
state . |
protected Notification |
notifyObservers(String type,
Document doc) |
protected Notification |
notifyObservers(String type,
IWindow doc) |
void |
registerMainComponent(DocumentsContainer container,
Document doc,
JComponent component) |
void |
saveToState(PersistentState state,
Object obj)
Fill
state with data to persist of obj . |
void |
unregisterMainComponent(DocumentsContainer container,
Document doc) |
void |
update(Observable observable,
Object notification)
Called whenever a
Observable object is changed and this
Observer has registered on it to receive notifications. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createDocument, getMainWindowClass, getTypeName
getDefinition, manages
public int getPriority()
getPriority
in interface DocumentManager
public ImageIcon getIcon()
getIcon
in interface DocumentManager
public ImageIcon getIconSelected()
getIconSelected
in interface DocumentManager
public String getTitle()
getTitle
in interface DocumentManager
public AbstractDocument createDocumentByUser()
DocumentManager
createDocumentByUser
in interface DocumentManager
public Iterator<? extends Document> createDocumentsByUser()
DocumentManager
createDocumentsByUser
in interface DocumentManager
public Object create()
ExtensionBuilder
create
in interface ExtensionBuilder
ExtensionBuilder
public Object create(Object[] args)
ExtensionBuilder
create
in interface ExtensionBuilder
ExtensionBuilder
public Object create(Map args)
create
in interface ExtensionBuilder
ExtensionBuilder
public IWindow getMainWindow(Document doc)
DocumentManager
getMainWindow
in interface DocumentManager
public IWindow getMainWindow(Document doc, WindowLayout layout)
DocumentManager
getMainWindow
in interface DocumentManager
public IWindow getPropertiesWindow(Document doc)
DocumentManager
getPropertiesWindow
in interface DocumentManager
public JComponent getMainComponent(Document doc)
DocumentManager
getMainComponent
in interface DocumentManager
public JComponent getMainComponent(DocumentsContainer container, Document doc)
DocumentManager
getMainComponent
in interface DocumentManager
public void unregisterMainComponent(DocumentsContainer container, Document doc)
unregisterMainComponent
in interface DocumentManager
public void registerMainComponent(DocumentsContainer container, Document doc, JComponent component)
registerMainComponent
in interface DocumentManager
public boolean existName(Project project, String documentName)
existName
in interface DocumentManager
project
- documentName
- protected abstract Class getDocumentClass()
public Object createFromState(PersistentState state) throws PersistenceException
PersistenceFactory
PersistenceFactory.loadFromState(PersistentState, Object)
only create
the object.createFromState
in interface PersistenceFactory
PersistenceException
public void loadFromState(PersistentState state, Object object) throws PersistenceException
PersistenceFactory
classToUse
from state
data.loadFromState
in interface PersistenceFactory
PersistenceException
public void saveToState(PersistentState state, Object obj) throws PersistenceException
PersistenceFactory
state
with data to persist of obj
.saveToState
in interface PersistenceFactory
PersistenceException
public boolean manages(Class theClass)
PersistenceFactory
theClass
is managed by this factory.manages
in interface PersistenceFactory
public boolean manages(PersistentState state)
PersistenceFactory
state
.manages
in interface PersistenceFactory
public List<DynStruct> getDefinitions()
PersistenceFactory
className
and value is definition
getDefinitions
in interface PersistenceFactory
public String getDomainName()
PersistenceFactory
getDomainName
in interface PersistenceFactory
public String getDomainURL()
PersistenceFactory
getDomainURL
in interface PersistenceFactory
public List getManagedClasses()
PersistenceFactory
getManagedClasses
in interface PersistenceFactory
public Class getManagedClass(Object object)
PersistenceFactory
getManagedClass
in interface PersistenceFactory
public Class getManagedClass(PersistentState state)
PersistenceFactory
getManagedClass
in interface PersistenceFactory
public Class getManagedClass(String name)
PersistenceFactory
getManagedClass
in interface PersistenceFactory
public String getManagedClassName(Object object)
PersistenceFactory
getManagedClassName
in interface PersistenceFactory
protected IDocumentWindow createDocumentWindow(Document document)
public void update(Observable observable, Object notification)
Observer
Observable
object is changed and this
Observer
has registered on it to receive notifications.
Implementations of this method will be called for each simple notification or, if a complex notification is created, for each of the child notifications.
In the latter case, don't assume any ordering in the notification between
this Observer
and other Observer
s listening to the same
Observable
.
In a complex notification scenario, if you want to receive only the
complex notification and not each of the child notifications, just
implement the ComplexObserver
and prepare this method
implementation to handle receiving DefaultComplexNotification
instances
as well as direct notification objects.
public void addObserver(Observer o)
addObserver
in interface Observable
public void deleteObserver(Observer o)
deleteObserver
in interface Observable
public void deleteObservers()
deleteObservers
in interface Observable
protected Notification notifyObservers(String type, Document doc)
protected Notification notifyObservers(String type, IWindow doc)