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
,EventHandlerCollectionModel
,PackageDataModel
,PropertyPaletteModel
public abstract class Model extends Validable implements IModel
Base class for models.- See Also:
IModel
-
-
Constructor Summary
Constructors Constructor Description Model()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addModelListener(IModelListener listener)
Adds the model listener.protected void
beginExternalUpdate()
Begins the external update operation in the associated component.protected void
checkOffline()
Checks this model is offline.protected void
checkOnline()
Checks this model is online.void
commit()
Commits the changes to the data model.IModel
createWorkingCopy()
void
discard()
Discards the changes stored in the model buffer since lastIModel.commit()
operation.void
dispose()
Disposes this model.protected void
endExternalUpdate()
Ends the external update operation in the associated component.IComponent<?>
getComponent()
protected ChangeOrigin
getCurrentChangeOrigin()
Gets the current change origin for this model.protected IRunnableQueue
getRunnableQueue()
boolean
isOnline()
protected void
notifyModelChanged(ChangeOrigin changeOrigin)
Notifies the model listeners about the model changes.protected void
notifyModelCommitted()
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 void
setOnline(boolean value)
Marks model as online or offline notifying this model's listeners.String
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
-
-
-
-
Method Detail
-
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
public IModel createWorkingCopy()
- Specified by:
createWorkingCopy
in interfaceIModel
- Returns:
- the model working copy or
null
if working copies is not supported by the model.
-
getComponent
public IComponent<?> getComponent()
- Specified by:
getComponent
in interfaceIModel
- Returns:
- the component associated with the model or
null
if no association established.
-
setComponent
public void setComponent(IComponent<?> component)
Description copied from interface:IModel
Associate this model with the component.- Specified by:
setComponent
in interfaceIModel
- Parameters:
component
- the component to associate with.
-
addModelListener
public void addModelListener(IModelListener listener)
Description copied from interface:IModel
Adds the model listener.- Specified by:
addModelListener
in interfaceIModel
- Parameters:
listener
- the listener to add.
-
removeModelListener
public void removeModelListener(IModelListener listener)
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.
-
notifyModelChanged
protected final void notifyModelChanged(ChangeOrigin changeOrigin)
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
protected final IRunnableQueue getRunnableQueue()
- Returns:
- the runnable queue associated with this model.
-
getCurrentChangeOrigin
protected final ChangeOrigin getCurrentChangeOrigin()
Gets the current change origin for this model.- Returns:
- the current change origin.
- See Also:
ChangeOrigin
,IComponent.beginExternalUpdate()
,IComponent.endExternalUpdate()
-
beginExternalUpdate
protected final void beginExternalUpdate()
Begins the external update operation in the associated component.- See Also:
IComponent.beginExternalUpdate()
-
endExternalUpdate
protected final void endExternalUpdate()
Ends the external update operation in the associated component.- See Also:
IComponent.endExternalUpdate()
-
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.
-
-