|
Class: Model
Object
|
+--Model
|
+--ApplicationModel
|
+--GraphColumn
|
+--HTTPServerSettingsAppl::PluggableServicesSettingsAppl::AvailableServiceItem
|
+--Menu
|
+--Plug
|
+--SelectionInHierarchy
|
+--SelectionInTree
|
+--TabItem
|
+--TabulatorSpecification
|
+--Tools::Inspector2::NavigationState
|
+--ValueModel
- Package:
- stx:libview2
- Category:
- Interface-Support-Models
- Version:
- rev:
1.56
date: 2022/07/10 13:57:24
- user: cg
- file: Model.st directory: libview2
- module: stx stc-classLibrary: libview2
Models are things which represent information models, i.e. something
which holds the data for user interface components and on which these operate.
Basically, instances keep track of which components depend on them and
inform the dependents of any changes.
The Model class itself is abstract and not too useful, see subclasses,
especially, ValueHolder and SelectionInList.
Notice:
Actually the Model class is not really needed; since the dependency
mechanism is inherited by Object, you can take any object as a model.
However, instances of Model (and subclasses) keep the dependents locally
in an instance variable; thus speeding up access a bit.
Model redefines the dependency methods to use non-weak dependencies
(in contrast to weak dependencies used by Object).
[Instance variables:]
dependents <Collection> those objects which depend on me.
To save some storage, a single dependent
is kept directly here.
Otherwise, if there are multiple dependents,
a collection of dependents is held here.
copyrightCOPYRIGHT (c) 1992 by Claus Gittinger
All Rights Reserved
This software is furnished under a license and may be used
only in accordance with the terms of that license and with the
inclusion of the above copyright notice. This software may not
be provided or otherwise made available to, or used by, any
other person. No title to or ownership of the software is
hereby transferred.
queries
-
isAbstract
-
Return if this class is an abstract class.
True is returned here for myself only; false for subclasses.
Abstract subclasses must redefine this again.
converting
-
skippedInLiteralEncoding
-
define the inst-slots which are skipped when generating a literalArrayEncoding;
(to skip the ones with default values.)
copying
-
skipInstvarIndexInDeepCopy: index
-
a helper for deepCopy; only indices for which this method returns
false are copied in a deep copy.
copying-private
-
postCopy
-
release dependents after copying
dependents access
-
addDependent: anObject
-
make the argument, anObject be a dependent of the receiver
-
breakDependents
-
remove all dependencies from the receiver
-
dependents
-
return a Collection of dependents
-
dependents: aCollectionOrNil
-
set the collection of dependents
-
dependentsDo: aBlock
-
evaluate aBlock for all of my dependents.
Iterate over a copy, so tha aBlock may remove dependents.
-
removeDependent: anObject
-
make the argument, anObject be independent of the receiver
dependents access (non weak)
-
addNonWeakDependent: anObject
-
make the argument, anObject be a dependent of the receiver.
Since all dependencies are nonWeak in Model, this is simply
forwarded to addDependent:
-
interests
-
return a Collection of interests - empty if there is none.
Here, we use the normal dependents collection for interests.
-
nonWeakDependents
-
return a Collection of dependents - empty if there is none.
Since all dependencies are nonWeak in Model, this is a dummy.
-
removeNonWeakDependent: anObject
-
make the argument, anObject be independent of the receiver.
Since all dependencies are nonWeak in Model, this is simply
forwarded to removeDependent:
encoding & decoding
-
skippedInJSONEncoding
( an extension from the stx:goodies/communication package )
-
return the names of inst-slots which are to be skipped when generating a jsonEncoding;
(to skip the ones with default or irrelevant values.)
suppressing updates
-
isLocked
-
ask the updateLocked query.
-
withUpdatesLockedDo: aBlock
-
execute aBlock with updates to myself temporarily suppressed,
(i.e. by answering true to the updateLocked query)
This is a cooperative interface - i.e. possible updaters MUST
check me via isLocked, before sending #value
-
withoutSendingUpdatesDo: aBlock
-
execute aBlock with updates to dependents temporarily suppressed
(i.e. I will not notify the dependents during aBlock)
Warning:
do not change any dependencies inside the block,
as the original dependencies from before will be restored and such changes
are lost then.
ModelUpdateLockedQuery
|