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 TypeMethodDescriptionvoid
addModelListener
(IModelListener listener) Adds the model listener.protected final void
Begins the external update operation in the associated component.protected final void
Checks this model is offline.protected final void
Checks this model is online.void
commit()
Commits the changes to the data model.void
discard()
Discards the changes stored in the model buffer since lastIModel.commit()
operation.void
dispose()
Disposes this model.protected final void
Ends the external update operation in the associated component.IComponent<?>
protected final ChangeOrigin
Gets the current change origin for this model.protected final IRunnableQueue
boolean
isOnline()
protected final void
notifyModelChanged
(ChangeOrigin changeOrigin) Notifies the model listeners about the model changes.protected final void
Notifies the model listeners about the model is committed.void
removeModelListener
(IModelListener listener) Removes the model listener.void
setComponent
(IComponent<?> component) Associate this model with the component.protected final void
setOnline
(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, validate
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods 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:IModel
Commits the changes to the data model. -
discard
public void discard()Description copied from interface:IModel
Discards the changes stored in the model buffer since lastIModel.commit()
operation. -
createWorkingCopy
- Specified by:
createWorkingCopy
in interfaceIModel
- Returns:
- the model working copy or
null
if working copies is not supported by the model.
-
getComponent
- Specified by:
getComponent
in interfaceIModel
- Returns:
- the component associated with the model or
null
if no association established.
-
setComponent
Description copied from interface:IModel
Associate this model with the component.- Specified by:
setComponent
in interfaceIModel
- Parameters:
component
- the component to associate with.
-
addModelListener
Description copied from interface:IModel
Adds the model listener.- Specified by:
addModelListener
in interfaceIModel
- Parameters:
listener
- the listener to add.
-
removeModelListener
Description copied from interface:IModel
Removes the model listener.- Specified by:
removeModelListener
in interfaceIModel
- Parameters:
listener
- the listener to remove.
-
dispose
public void dispose()Description copied from interface:IModel
Disposes 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
-true
to go online orfalse
to 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.
-