public abstract class AbstractDocumentManager extends java.lang.Object implements DocumentManager, Observer
NOTIFY_AFTER_CREATEDOCUMENT, NOTIFY_AFTER_CREATEMAINWINDOW, NOTIFY_AFTER_CREATEPROPERTIESWINDOW, NOTIFY_AFTER_GETMAINWINDOW, NOTIFY_AFTER_GETPROPERTIESWINDOW
Modifier | Constructor and Description |
---|---|
protected |
AbstractDocumentManager() |
Modifier and Type | Method and Description |
---|---|
void |
addObserver(Observer o) |
java.lang.Object |
create()
Crea una instancia de la extension y la retorna.
|
java.lang.Object |
create(java.util.Map args) |
java.lang.Object |
create(java.lang.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
|
java.util.Iterator<? extends Document> |
createDocumentsByUser()
Uses a gui to be able from the characteristics that we want a
ProjectDocument
|
java.util.Iterator<? extends Document> |
createDocumentsByUser(Invocable whenDocumentsLoaded) |
protected IDocumentWindow |
createDocumentWindow(Document document) |
java.lang.Object |
createFromState(PersistentState state)
Create an instance of the object represented by the state.
|
void |
deleteObserver(Observer o) |
void |
deleteObservers() |
boolean |
existName(Project project,
java.lang.String documentName)
Deprecated.
use instead project.getProjectDocument
|
java.lang.Class |
getClassOfDocument() |
java.util.List<DynStruct> |
getDefinitions()
Return a List of the definition managed by this factory where the key is
className and value is definition |
protected abstract java.lang.Class |
getDocumentClass()
Return the class or interface for the documents managed by this factory.
|
java.lang.String |
getDomainName()
Returns the domain name of the objects persisted by this factory.
|
java.lang.String |
getDomainURL()
Returns the domain URL to use for the schema.
|
java.util.Map |
getExtendedProperties()
Returns a hash map with all new properties associated to this layer.
|
javax.swing.ImageIcon |
getIcon()
Returns the icon for the type of document.
|
javax.swing.ImageIcon |
getIconSelected()
Returns the icon for the type of document when is selected
|
javax.swing.JComponent |
getMainComponent(Document doc)
Devuelbe el JComponent que se corresponde con el documento indicado.
|
javax.swing.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.
|
java.lang.Class |
getManagedClass(java.lang.Object object)
Return the class or interface the factory asociate to
the object.
|
java.lang.Class |
getManagedClass(PersistentState state)
Return the class or interface the factory asociate to
the object.
|
java.lang.Class |
getManagedClass(java.lang.String name)
Return the class or interface the factory asociate to
the java class name.
|
java.util.List |
getManagedClasses()
Return the list of classes or interfaces managed by this
factory.
|
java.lang.String |
getManagedClassName(java.lang.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.
|
java.lang.Object |
getProperty(java.lang.Object key)
Returns a reference to an object (property) associated to this layer.
|
java.lang.String |
getTitle()
Returns the title of type of document.
|
boolean |
hasMainWindow(Document doc) |
void |
loadFromState(PersistentState state,
java.lang.Object object)
Load a instance of
classToUse from state data. |
boolean |
manages(java.lang.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(java.lang.String type,
Document doc) |
protected Notification |
notifyObservers(java.lang.String type,
IWindow doc) |
void |
registerMainComponent(DocumentsContainer container,
Document doc,
javax.swing.JComponent component) |
void |
saveToState(PersistentState state,
java.lang.Object obj)
Fill
state with data to persist of obj . |
void |
setProperty(java.lang.Object key,
java.lang.Object obj)
Inserts an object as a property to this layer.
|
void |
unregisterMainComponent(DocumentsContainer container,
Document doc) |
void |
update(Observable observable,
java.lang.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 javax.swing.ImageIcon getIcon()
getIcon
in interface DocumentManager
public javax.swing.ImageIcon getIconSelected()
getIconSelected
in interface DocumentManager
public java.lang.String getTitle()
getTitle
in interface DocumentManager
public AbstractDocument createDocumentByUser()
DocumentManager
createDocumentByUser
in interface DocumentManager
public java.util.Iterator<? extends Document> createDocumentsByUser()
DocumentManager
createDocumentsByUser
in interface DocumentManager
public java.util.Iterator<? extends Document> createDocumentsByUser(Invocable whenDocumentsLoaded)
createDocumentsByUser
in interface DocumentManager
public java.lang.Object create()
ExtensionBuilder
create
in interface ExtensionBuilder
ExtensionBuilder
public java.lang.Object create(java.lang.Object[] args)
ExtensionBuilder
create
in interface ExtensionBuilder
ExtensionBuilder
public java.lang.Object create(java.util.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 boolean hasMainWindow(Document doc)
hasMainWindow
in interface DocumentManager
public IWindow getPropertiesWindow(Document doc)
DocumentManager
getPropertiesWindow
in interface DocumentManager
public javax.swing.JComponent getMainComponent(Document doc)
DocumentManager
getMainComponent
in interface DocumentManager
public javax.swing.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, javax.swing.JComponent component)
registerMainComponent
in interface DocumentManager
public boolean existName(Project project, java.lang.String documentName)
existName
in interface DocumentManager
project
- documentName
- protected abstract java.lang.Class getDocumentClass()
public java.lang.Class getClassOfDocument()
getClassOfDocument
in interface DocumentManager
public java.lang.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, java.lang.Object object) throws PersistenceException
PersistenceFactory
classToUse
from state
data.loadFromState
in interface PersistenceFactory
PersistenceException
public void saveToState(PersistentState state, java.lang.Object obj) throws PersistenceException
PersistenceFactory
state
with data to persist of obj
.saveToState
in interface PersistenceFactory
PersistenceException
public boolean manages(java.lang.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 java.util.List<DynStruct> getDefinitions()
PersistenceFactory
className
and value is definition
getDefinitions
in interface PersistenceFactory
public java.lang.String getDomainName()
PersistenceFactory
getDomainName
in interface PersistenceFactory
public java.lang.String getDomainURL()
PersistenceFactory
getDomainURL
in interface PersistenceFactory
public java.util.List getManagedClasses()
PersistenceFactory
getManagedClasses
in interface PersistenceFactory
public java.lang.Class getManagedClass(java.lang.Object object)
PersistenceFactory
getManagedClass
in interface PersistenceFactory
public java.lang.Class getManagedClass(PersistentState state)
PersistenceFactory
getManagedClass
in interface PersistenceFactory
public java.lang.Class getManagedClass(java.lang.String name)
PersistenceFactory
getManagedClass
in interface PersistenceFactory
public java.lang.String getManagedClassName(java.lang.Object object)
PersistenceFactory
getManagedClassName
in interface PersistenceFactory
protected IDocumentWindow createDocumentWindow(Document document)
public void update(Observable observable, java.lang.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(java.lang.String type, Document doc)
protected Notification notifyObservers(java.lang.String type, IWindow doc)
public java.lang.Object getProperty(java.lang.Object key)
ExtendedPropertiesSupport
Returns a reference to an object (property) associated to this layer.
For example, you can attach a network definition to key "network" and check if a layer has a network loaded using getAssociatedObject("network") and that it's not null.
getProperty
in interface ExtendedPropertiesSupport
key
- the key associated to the propertynull
if key is not foundExtendedPropertiesSupport.getExtendedProperties()
,
ExtendedPropertiesSupport.setProperty(Object, Object)
public void setProperty(java.lang.Object key, java.lang.Object obj)
ExtendedPropertiesSupport
setProperty
in interface ExtendedPropertiesSupport
key
- the key associated to the propertyobj
- the propertyExtendedPropertiesSupport.getProperty(Object)
,
ExtendedPropertiesSupport.getExtendedProperties()
public java.util.Map getExtendedProperties()
ExtendedPropertiesSupport
getExtendedProperties
in interface ExtendedPropertiesSupport
ExtendedPropertiesSupport.getProperty(Object)
,
ExtendedPropertiesSupport.setProperty(Object, Object)