|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openbp.guiclient.model.ModelConnector
public final class ModelConnector
The model connector provides access to models (Model) and items (Item) of models.
It is actually some kind of proxy class for the active implementation of the ModelMgr interface.
It adds some functionalities like observer management to the model manager.
| Method Summary | |
|---|---|
void |
addItem(Model model,
Item item,
boolean syncGlobalReferences)
Adds an item. |
void |
addModel(Model model)
Adds a new model |
protected void |
fireEvent(ModelConnectorEvent event)
Notifies all registered observers about a model connector event. |
static ModelConnector |
getInstance()
Gets the singleton instance for this class. |
Item |
getItemByQualifier(ModelQualifier qualifier,
boolean required)
Gets a particular model item. |
ItemTypeDescriptor |
getItemTypeDescriptor(java.lang.String itemType)
Gets the item type descriptor of a particular item type. |
ItemTypeDescriptor[] |
getItemTypeDescriptors(int mode)
Gets a list of item type descriptors. |
java.lang.String[] |
getItemTypes(int mode)
Gets a list of item types. |
Model |
getModelByQualifier(ModelQualifier modelQualifier)
Gets a model specified by its qualifier. |
java.util.List |
getModels()
Gets a list of all top level models. |
StandardMsgContainer |
getMsgContainer()
Gets the message container for validation error logging. |
Model |
getOptionalModelByQualifier(ModelQualifier modelQualifier)
Gets an (optional) model specified by its path name. |
void |
initialize(CoreModule coreModule)
Looks up the model manager reads the model tree from the server. |
void |
moveItem(Item item,
ModelQualifier destinationQualifier)
Moves an item. |
void |
registerObserver(EventObserver observer,
java.lang.String[] eventTypes)
Registers an observer. |
void |
removeItem(Item item)
Deletes an item from a model. |
void |
removeModel(Model model)
Deletes a model including all its sub models and the contents (processes, actions) of these models. |
void |
resumeModelConnectorEvents()
Resumes broadcasting of model connector events. |
boolean |
saveItem(Item item,
boolean isNew)
Convenience method: Saves the given item. |
void |
showExceptionDialog(java.lang.Throwable e,
ModelObject o)
Shows an exception message dialog. |
boolean |
suspendModelConnectorEvents()
Suspends broadcasting of model connector events. |
void |
unregisterObserver(EventObserver observer)
Unregisters an observer. |
void |
updateItem(Item item)
Updates the properties of an item. |
void |
updateModel(Model model)
Updates the properties of the model. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static ModelConnector getInstance()
public void initialize(CoreModule coreModule)
coreModule - The core module
OpenBPException - If the server's model manager be located or there was an error reading the model treepublic StandardMsgContainer getMsgContainer()
public void showExceptionDialog(java.lang.Throwable e,
ModelObject o)
e - Exception that occuredo - Model object that caused the exception
public boolean saveItem(Item item,
boolean isNew)
item - Item or model to saveisNew - true: The item is a new item and will be added to the model.public Model getModelByQualifier(ModelQualifier modelQualifier)
modelQualifier - Reference to the model
OpenBPException - If the specified model does not existpublic Model getOptionalModelByQualifier(ModelQualifier modelQualifier)
modelQualifier - Reference to the model
public java.util.List getModels()
Model objects) or nullpublic void addModel(Model model)
model - Model to addOpenBPException - If the model could not be createdpublic void updateModel(Model model)
model - Model to update
OpenBPException - If the model could not be updatedpublic void removeModel(Model model)
model - Model to delete
OpenBPException - On error.
Note that depending on the error condition, some or all of the processes and/or sub models
may already have been deleted when the error condition is raised.
public Item getItemByQualifier(ModelQualifier qualifier,
boolean required)
qualifier - Reference to the itemrequired - true: Will throw an exception if the item does not exist.Item class will be returned.
OpenBPException - On error
public void addItem(Model model,
Item item,
boolean syncGlobalReferences)
model - Model the item shall belong toitem - Item to addsyncGlobalReferences - true: Updates the names of external references (e. g. to data types)OpenBPException - If the item could not be addedpublic void updateItem(Item item)
moveItem(org.openbp.core.model.item.Item, org.openbp.core.model.ModelQualifier) for this.
item - Item to update
OpenBPException - If the item could not be updatedpublic void removeItem(Item item)
item - Item to delete
OpenBPException - On error
public void moveItem(Item item,
ModelQualifier destinationQualifier)
item - Item to renamedestinationQualifier - New name of the item
OpenBPException - On error. The item has not been renamed/moved in this case.public java.lang.String[] getItemTypes(int mode)
mode - ItemTypeRegistry.ALL_TYPES / ItemTypeRegistry.SKIP_MODEL|ItemTypeRegistry.SKIP_INVISIBLE
ItemTypes class)public ItemTypeDescriptor[] getItemTypeDescriptors(int mode)
mode - ItemTypeRegistry.ALL_TYPES / ItemTypeRegistry.SKIP_MODEL|ItemTypeRegistry.SKIP_INVISIBLE
ItemTypeDescriptor objects or nullpublic ItemTypeDescriptor getItemTypeDescriptor(java.lang.String itemType)
itemType - Item type to look for
public void registerObserver(EventObserver observer,
java.lang.String[] eventTypes)
observer - The observereventTypes - Lit of event types the observer wants to be notified of
or null for all event typespublic void unregisterObserver(EventObserver observer)
observer - The observerpublic boolean suspendModelConnectorEvents()
public void resumeModelConnectorEvents()
protected void fireEvent(ModelConnectorEvent event)
event - Model connector event to dispatch
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||