[squeak-dev] ProgressInitiationException>>defaultAction calls
#isMorphic
Balázs Kósi
rebmekop at gmail.com
Thu Apr 14 17:18:41 UTC 2011
Hi,
In the Trunk displayProgress:at:from:to:during: has two senders:
(1) MCHttpRepository >> displayProgress:during:
(2) String >> displayProgressAt:from:to:during
and has three identical implementations in MVCUIManager,
MorphicUIManager, SimpleMorphicUIManager. The implementation:
displayProgress: titleString at: aPoint from: minVal to: maxVal
during: workBlock
"Display titleString as a caption over a progress bar while workBlock
is evaluated."
^ProgressInitiationException
display: titleString
at: aPoint
from: minVal
to: maxVal
during: workBlock
don't even use the object where it resides.
With the exception of (1) everybody else (56 senders) uses (2) to
display progress in the Trunk.
My take would be to change (1) to also use (2). Change (2) to:
String >> displayProgressAt: aPoint from: minVal to: maxVal during: workBlock
"Display titleString as a caption over a progress bar while workBlock
is evaluated."
^ProgressInitiationException
display: self
at: aPoint
from: minVal
to: maxVal
during: workBlock
Change ProgressInitiationException's defaultAction to:
ProgressInitiationException >> defaultAction
UIManager default
displayProgress: progressTitle
at: aPoint
from: minVal
to: maxVal
during: workBlock
And move the actual implementations of the displaying to the
corresponding UIManager subclasses.
The drawback of this approach is that we possibly break code out there
which uses UIManager's displayProgress:at:from:to:during:. So we could
make up a new name like reallyDisplayProgress:at:from:to:during:, and
send that from ProgressInitiationException >> defaultAction. It would
be a bit less nice, but backward compatible. What do you think?
Balázs
More information about the Squeak-dev
mailing list
|