Package com._1c.g5.aef2.models
Class Model
java.lang.Object
com._1c.g5.aef2.validators.Validable
com._1c.g5.aef2.models.Model
- All Implemented Interfaces:
IModel,IValidable
- Direct Known Subclasses:
AbstractDefinitionModel,AbstractDtGranularEditorManagingModel,AddressingAttributesCollectionModel,CompoundModel,EditableModel,EmfIntervalBoundModelValue,EmptyModel,InfobasePublicationsModel,PackageDataModel,PredefinedDataModel,PropertyPaletteModel,SpreadSheetScrollBarUseModel,WebServiceDataModel
Base class for models.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddModelListener(IModelListener listener) Adds the model listener.protected final voidBegins the external update operation in the associated component.protected final voidChecks this model is offline.protected final voidChecks this model is online.voidcommit()Commits the changes to the data model.voiddiscard()Discards the changes stored in the model buffer since lastIModel.commit()operation.voiddispose()Disposes this model.protected final voidEnds the external update operation in the associated component.IComponent<?>protected final ChangeOriginGets the current change origin for this model.protected final IRunnableQueuebooleanisOnline()protected final voidnotifyModelChanged(ChangeOrigin changeOrigin) Notifies the model listeners about the model changes.protected final voidNotifies the model listeners about the model is committed.voidremoveModelListener(IModelListener listener) Removes the model listener.voidsetComponent(IComponent<?> component) Associate this model with the component.protected final voidsetOnline(boolean value) Marks model as online or offline notifying this model's listeners.toString()Methods inherited from class com._1c.g5.aef2.validators.Validable
addValidator, getValidatorTarget, removeValidator, validate, validateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com._1c.g5.aef2.validators.IValidable
addValidator, removeValidator, validate, validate
-
Constructor Details
-
Model
public Model()
-
-
Method Details
-
isOnline
public boolean isOnline() -
commit
public void commit()Description copied from interface:IModelCommits the changes to the data model. -
discard
public void discard()Description copied from interface:IModelDiscards the changes stored in the model buffer since lastIModel.commit()operation. -
createWorkingCopy
- Specified by:
createWorkingCopyin interfaceIModel- Returns:
- the model working copy or
nullif working copies is not supported by the model.
-
getComponent
- Specified by:
getComponentin interfaceIModel- Returns:
- the component associated with the model or
nullif no association established.
-
setComponent
Description copied from interface:IModelAssociate this model with the component.- Specified by:
setComponentin interfaceIModel- Parameters:
component- the component to associate with.
-
addModelListener
Description copied from interface:IModelAdds the model listener.- Specified by:
addModelListenerin interfaceIModel- Parameters:
listener- the listener to add.
-
removeModelListener
Description copied from interface:IModelRemoves the model listener.- Specified by:
removeModelListenerin interfaceIModel- Parameters:
listener- the listener to remove.
-
dispose
public void dispose()Description copied from interface:IModelDisposes this model. -
toString
-
notifyModelChanged
Notifies the model listeners about the model changes. -
notifyModelCommitted
protected final void notifyModelCommitted()Notifies the model listeners about the model is committed. -
setOnline
protected final void setOnline(boolean value) Marks model as online or offline notifying this model's listeners.- Parameters:
value-trueto go online orfalseto go offline.
-
getRunnableQueue
- Returns:
- the runnable queue associated with this model.
-
getCurrentChangeOrigin
Gets the current change origin for this model.- Returns:
- the current change origin.
- See Also:
-
beginExternalUpdate
protected final void beginExternalUpdate()Begins the external update operation in the associated component.- See Also:
-
endExternalUpdate
protected final void endExternalUpdate()Ends the external update operation in the associated component.- See Also:
-
checkOnline
protected final void checkOnline()Checks this model is online.- Throws:
IllegalStateException- if this value is offline.
-
checkOffline
protected final void checkOffline()Checks this model is offline.- Throws:
IllegalStateException- if this value is online.
-