Is there a way to view a class with all the inherited instance
variables and/or methods? I'm trying to understand some code, and because the inheritance tree is not shallow, I'd like to see all the variables it has (both own and inherited). Regards! Esteban A. Maringolo |
#withAllSubclasses
TextMorphForFieldView withAllSuperclasses reversed collect: [ :cls | cls -> {cls instVarNames . cls methods }]. Best regards, Henrik -----Original Message----- From: Pharo-users [mailto:[hidden email]] On Behalf Of Esteban A. Maringolo Sent: Tuesday, March 8, 2016 8:50 PM To: Pharo users <[hidden email]> Subject: [Pharo-users] View a class with inherited variables/methods Is there a way to view a class with all the inherited instance variables and/or methods? I'm trying to understand some code, and because the inheritance tree is not shallow, I'd like to see all the variables it has (both own and inherited). Regards! Esteban A. Maringolo |
In reply to this post by Esteban A. Maringolo
Le 08/03/2016 20:50, Esteban A. Maringolo a écrit :
> Is there a way to view a class with all the inherited instance > variables and/or methods? > > I'm trying to understand some code, and because the inheritance tree > is not shallow, I'd like to see all the variables it has (both own and > inherited). > > Regards! > > Esteban A. Maringolo > (class variable and instance variable) in Nautilus (Pharo 4) on the button Variables in Nautilus (Pharo 5). -- Cyril Ferlicot http://www.synectique.eu 165 Avenue Bretagne Lille 59000 France |
In reply to this post by Henrik Nergaard
Hi Henrik,
2016-03-08 16:57 GMT-03:00 Henrik Nergaard <[hidden email]>: > #withAllSubclasses > > TextMorphForFieldView withAllSuperclasses reversed collect: [ :cls | cls -> {cls instVarNames . cls methods }]. I was doing something similar like: MyClass withAllSuperclasses reversed flatCollect: [ :cls | cls instVarNames ]. But I was asking if there was a tool that already provides that. Thank you! Esteban A. Maringolo |
>From: Pharo-users [mailto:[hidden email]] On Behalf Of Esteban A. Maringolo
>Sent: Tuesday, March 8, 2016 9:03 PM >To: Any question about pharo is welcome <[hidden email]> >Subject: Re: [Pharo-users] View a class with inherited variables/methods >Hi Henrik, >2016-03-08 16:57 GMT-03:00 Henrik Nergaard <[hidden email]>: >> #withAllSubclasses >> TextMorphForFieldView withAllSuperclasses reversed collect: [ :cls | cls -> {cls instVarNames . cls methods }]. >I was doing something similar like: >MyClass withAllSuperclasses reversed flatCollect: [ :cls | cls instVarNames ]. >But I was asking if there was a tool that already provides that. Ah, so Something like this then? ---------------------------------------------------------------------- | classToView browser list nav | classToView := TextMorphForFieldView. nav := SystemNavigation new browsedEnvironment: RBBrowserEnvironment new; yourself. browser := MessageBrowser new title: 'aTitle'; autoSelect: classToView name; messages: #(); yourself. list := FTEasyListMorph new hResizing: #spaceFill; vResizing: #spaceFill; elements: (classToView withAllSuperclasses reversed flatCollect: [ :cls | cls instVarNames ]); beSingleSelection; yourself. list onAnnouncement: FTSelectionChanged do: [ :ann | | ivar | ivar := [ list dataSource elementAt: ann newSelectedRowIndexes anyOne ] ifError: [ nil ]. ivar ifNotNil: [ browser messages: (nav allAccessesTo: ivar from: classToView ) ] ]. (AlignmentMorph new setAsRow; addMorph: browser buildWithSpec; addMorph: list; layoutChanged; fullBounds; openInWindowLabeled: 'Stuff') position: 20@20; extent: 900@620. --------------------------------------------------------------- Best regards, Henrik >Thank you! >Esteban A. Maringolo |
Free forum by Nabble | Edit this page |