Inspector limiting an object printString output

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Inspector limiting an object printString output

Igor Stasenko
In

Inspector>>selectionPrintString it uses:

text := [self selection printStringLimitedTo: 5000]

which sometimes not quite adequate (sometimes i need to display more).

I think it would be nicer if inspector would ask object, if it desires
to limit itself (when printing in big inspection pane)
and what concrete limit it desires, instead of hardcoding the number
in inspector.

Something like:

Object>>printStringLimited
    ^ self printLimit ifNotNil: [:limit |
         self printStringLimitedTo: limit ]
    ifNil: [
      self printString ].

so, then #printLimit could be overridden by choice of developer, to
set (or not) the limits

--
Best regards,
Igor Stasenko AKA sig.

Reply | Threaded
Open this post in threaded view
|

Re: Inspector limiting an object printString output

Tudor Girba-2
+1

Doru


On 3 Aug 2011, at 06:10, Igor Stasenko wrote:

> In
>
> Inspector>>selectionPrintString it uses:
>
> text := [self selection printStringLimitedTo: 5000]
>
> which sometimes not quite adequate (sometimes i need to display more).
>
> I think it would be nicer if inspector would ask object, if it desires
> to limit itself (when printing in big inspection pane)
> and what concrete limit it desires, instead of hardcoding the number
> in inspector.
>
> Something like:
>
> Object>>printStringLimited
>    ^ self printLimit ifNotNil: [:limit |
>         self printStringLimitedTo: limit ]
>    ifNil: [
>      self printString ].
>
> so, then #printLimit could be overridden by choice of developer, to
> set (or not) the limits
>
> --
> Best regards,
> Igor Stasenko AKA sig.
>

--
www.tudorgirba.com

"We cannot reach the flow of things unless we let go."




Reply | Threaded
Open this post in threaded view
|

Re: Inspector limiting an object printString output

Stéphane Ducasse
In reply to this post by Igor Stasenko
add a new entry :)

Stef

On Aug 3, 2011, at 6:10 AM, Igor Stasenko wrote:

> In
>
> Inspector>>selectionPrintString it uses:
>
> text := [self selection printStringLimitedTo: 5000]
>
> which sometimes not quite adequate (sometimes i need to display more).
>
> I think it would be nicer if inspector would ask object, if it desires
> to limit itself (when printing in big inspection pane)
> and what concrete limit it desires, instead of hardcoding the number
> in inspector.
>
> Something like:
>
> Object>>printStringLimited
>    ^ self printLimit ifNotNil: [:limit |
>         self printStringLimitedTo: limit ]
>    ifNil: [
>      self printString ].
>
> so, then #printLimit could be overridden by choice of developer, to
> set (or not) the limits
>
> --
> Best regards,
> Igor Stasenko AKA sig.
>