|
Benjamin Van Ryseghem |
|
|
> Ok...I did it. A few remarks:
> > 1) RecentMessageList >> initialize > > you do > > SmalltalkImage current addToStartUpList: self class. > > but should be SmalltalkImage addToStartUpList: self class. >just Smalltalk addToStartUpList: self class. Thank you, it's done ^^ > > > (at least in Pharo 1.1) > > 2) What is the idea of the Recent Messages? To see the recent MODIFIED methods ? isn't it? If true, maybe would be good to > 2.1) directly show the diff with the previous version I do not know how to do that, I'll search :) > 2.2) Have a button to see the versions of that method Good idea, but it means having the RecentMessageList already running ^^ > > 3) Once you press any button, like collapse all or similar, they become blue and neve grey again I have not this bug :( The collapse and expend button are disabled when the list is empty. The buttons browse and remove are enabled only when an item is selectioned. > > 4) When is the list of recen messages clean ? how do you know the recen messages? you store that information somewhere? when is that cleaned? The list is empty when you just have initialize the RecentMessageList (ie the first time you launch it) but you can reset the list by sending : RecentMessageList resetUniqueInstance Otherwise it's never automatically cleaned (but you can remove each node you want) I know the recent messages by registering the class in the SystemChangeNotifier, and they are stored in the RecentMessageList uniqueInstance messageList > > > Thank you very much and continue with the good work! Maybe once we can include it by defult in Pharo. > yes this is the point. Thank you both for your advice _______________________________________________ Pharo-users mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users |
|
Benjamin Van Ryseghem |
|
|
> 2.1) directly show the diff with the previous version I've addeed two options in the drop list, one for the version, the other for the diffs ^^ Gofer new squeaksource: 'PharoTaskForces'; package: 'RecentSubmissions'; load. Thank you again Benjamin _______________________________________________ Pharo-users mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users |
|
Stéphane Ducasse |
|
|
In reply to this post by Benjamin Van Ryseghem
Hi ben
on which version should I load it? It is important that recentMessages works without shout. I got a DNU on 1.2 buildTextArea | text | text := PluggableShoutMorph on: self text: #textToDisplay accept: #compileMethod: readSelection: nil menu: #msgPaneMenu:shifted:. text visible: false; askBeforeDiscardingEdits: true. ^ text Stef On Jul 31, 2010, at 9:29 PM, Benjamin Van Ryseghem wrote: > > Ok...I did it. A few remarks: > > > > 1) RecentMessageList >> initialize > > > > you do > > > > SmalltalkImage current addToStartUpList: self class. > > > > but should be SmalltalkImage addToStartUpList: self class. > > >just Smalltalk addToStartUpList: self class. > > Thank you, it's done ^^ > > > > > > > (at least in Pharo 1.1) > > > > 2) What is the idea of the Recent Messages? To see the recent MODIFIED methods ? isn't it? If true, maybe would be good to > > 2.1) directly show the diff with the previous version > > I do not know how to do that, I'll search :) > > > 2.2) Have a button to see the versions of that method > > Good idea, but it means having the RecentMessageList already running ^^ > > > > > 3) Once you press any button, like collapse all or similar, they become blue and neve grey again > > I have not this bug :( The collapse and expend button are disabled when the list is empty. > The buttons browse and remove are enabled only when an item is selectioned. > > > > > 4) When is the list of recen messages clean ? how do you know the recen messages? you store that information somewhere? when is that cleaned? > > The list is empty when you just have initialize the RecentMessageList (ie the first time you launch it) but you can reset the list by sending : > > RecentMessageList resetUniqueInstance > > Otherwise it's never automatically cleaned (but you can remove each node you want) > > I know the recent messages by registering the class in the SystemChangeNotifier, and they are stored in the RecentMessageList uniqueInstance messageList > > > > > > > Thank you very much and continue with the good work! Maybe once we can include it by defult in Pharo. > > > yes this is the point. > > > Thank you both for your advice > > > > _______________________________________________ > Pharo-users mailing list > [hidden email] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users _______________________________________________ Pharo-users mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users |
|
Benjamin Van Ryseghem |
|
|
In reply to this post by Benjamin Van Ryseghem
Now that I see you understand this, could you please take care about this I've found this topic when I had the same problem :) To run tests on 1.2 about text styling, I've only file in the categories Shout-Styling and Shout-Parsing and I had to add a method to PluggableTextMorph : stylerStyled: styledCopyOfText textMorph contents runs: styledCopyOfText runs . "textMorph paragraph recomposeFrom: 1 to: textMorph contents size delta: 0." "caused chars to appear in wrong order esp. in demo mode. remove this line when sure it is fixed" textMorph updateFromParagraph. selectionInterval ifNotNil:[ textMorph editor selectInvisiblyFrom: selectionInterval first to: selectionInterval last; storeSelectionInParagraph; setEmphasisHere]. "textMorph editor blinkParen." self scrollSelectionIntoView With that, i've color in my PluggableTextMorph, but I think it's not the proper way to do it :)
I've now merged the two classes, there only remains NullTextStyler ^^ I've also added a new way to sort method : by package, but it's a bite too slow to be really usefull, I will try to improve that. And i've added a mini-menu on tree nodes but with only 2 items because I've no idea what could be useful Ben _______________________________________________ Pharo-users mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users |
|
Stéphane Ducasse |
|
|
In reply to this post by Benjamin Van Ryseghem
Hi benjamin
Thanks for your code!!!! I did a review of your latest code: Here are some points that it would be nice to address I fixed what I saw and republished 0 - all the classes should have comments MessageList ---------- 1- MessageList example does not work Can you create some Unit tests to cover the expected behavior of the MessageList 2- MessageList>>browsers I removed it 3- recategorized the methods 4- I removed all the "comment10" 5- what I level Can you comment it? 6- for asDictionaryByClass why don't you use groupedBy: or similar methods? I'm not sure that I would call them asDictionaryBy.... since you return an association? Why don't you call them groupedBySelectors, groupedByClasses, groupedByPackages then why do you return an Association and not a dictionary. 7- Can you add oneline method comments to method? 8- Could you introduce an explicit instance variable representing the environment in use and initialize it with Smalltalk globals because like that we can specify in which environment the set is working. 9- openInWorldWithADictionarySelector: sucks :) the name is not really cool then you bind the core with the UI so you should define this method as an extension of RecentSubmission-UI and may be 10- You update all the browsers open but this should not be your role. As a core domain object you should not do this kind of behavior. The UI widget should register to event or notification and update themselves when you change. updateView browsers ifNotNilDo: [:collection | collection do: [:each | each updateView]] MessageListAssociation -------------------- why do you need this guy? Just to print the elements? This is a UI concerns. The UI should wrap the model and provide a specific printed version or the MessageListAssociation should be explained in the class comment MethodReferenceWithSource ------------------------ We should probably move some behavior to MethodReference NullTextStyler ------------ I categorized all the methods following SHStyler categories RecentMessageList ---------------- I cleaned the singleton part. You do not need UniqueInstance ifNotNil: [:u | UniqueInstance releaseAll]. Again the model should not be referencing the ui releaseAll super initialize. MessageListBrowser allInstancesDo: [:each | each messageList = self ifTrue:[each delete]]. browser:= nil. self methodReferenceList: OrderedCollection new. Why the setting is registration is done in the core and not at the level of the widget? - at startUp: you should not create the instance since uniqueInstance is lazzily accessed. However you should register to the SystemChangeNotifier to get the notification. MessageListBrowser ----------------- Instead of having MessageListBrowser >>byDateAscendingOn: aMessageList ^self on: aMessageList withADictionarySelector: #asDictionaryByDateAscending. MessageListBrowser >>byDateAscendingOn: aMessageList ^self on: aMessageList withADictionarySelector: aMessageList asDictionaryByDateAscendingSelector and MessageList>> asDictionaryByDateAscendingSelector ^ #asDictionaryByDateAscending => encapsulate information from model to UI. => I did it So for now this is enough :) Stef On Aug 1, 2010, at 3:00 AM, Benjamin Van Ryseghem wrote: > Gofer new > squeaksource: 'PharoTaskForces'; > package: 'RecentSubmissions'; > load. _______________________________________________ Pharo-users mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users |
|
Guillermo Polito |
|
|
Hi!
I submitted a little fix where the UI is updated and the example is working. I expect you don't get upset for touching it. By the way, I have some extra comments: -Why there are MessageList and RecentMessageList? Why not only one of them? -Why MethodReferenceWithSource is called like that? It can contain also Class references... Otherwise, maybe there is a better name for that class. Maybe something like RecentChangeNotification or something like that... -There is no RecentMessageList example or similar!!!! I had to browse the code and guess that "RecentMessageList new openInWorld" should open it :). - All the asDictionaryByXXX are very similar... Maybe you can build a asDictionaryBy (or groupedBy: as Stephane said) parametrized like: groupBy: groupBlock valueBy: valueBlock | result tempList | result := Dictionary new. tempList := self methodReferenceList copy sort: [:m1 :m2 | m2 timeStamp <= m1 timeStamp]. tempList do: [:each | | key value | key := groupBlock value each. value := valueBlock value: each. (result includesKey: key) ifFalse: [result at: key put: OrderedCollection new]. (result at: key) add: value]. ^(Association key: result value: tempList) - And that reminds me: Why does that method return an association? So you can return multiple values? :( Thats not nice.. Maybe you can make the RecentMessageList stateful and let it have a sorted collection with the sorted elements. Maybe playing with that let you manage the speed problems. - And maybe you should look at SettingBrowser>>treeMorphIn:. There's the way to build a MorphTreeMorph binded to a list, so you can update the view sending the message #changed to the model. Cheers, Guille On Tue, Aug 10, 2010 at 8:11 AM, Stéphane Ducasse <[hidden email]> wrote: Hi benjamin _______________________________________________ Pharo-users mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users |
|
Stéphane Ducasse |
|
|
On Aug 11, 2010, at 11:05 PM, Guillermo Polito wrote: > Hi! > > I submitted a little fix where the UI is updated and the example is working. How? Because the model should not rely on the UI as it was before > I expect you don't get upset for touching it. > > By the way, I have some extra comments: > > -Why there are MessageList and RecentMessageList? Why not only one of them? Because you can reuse MessageList in other circumstances > -Why MethodReferenceWithSource is called like that? It can contain also Class references... Otherwise, maybe there is a better name for that class. Maybe something like RecentChangeNotification or something like that... This has nothing to do with notification. This is just an extension of MethodReference > -There is no RecentMessageList example or similar!!!! I had to browse the code and guess that "RecentMessageList new openInWorld" should open it :). > - All the asDictionaryByXXX are very similar... Maybe you can build a asDictionaryBy (or groupedBy: as Stephane said) parametrized like: > > groupBy: groupBlock valueBy: valueBlock > | result tempList | > result := Dictionary new. > tempList := self methodReferenceList copy sort: [:m1 :m2 | m2 timeStamp <= m1 timeStamp]. > tempList do: [:each | > | key value | > key := groupBlock value each. > value := valueBlock value: each. > (result includesKey: key) > ifFalse: [result at: key put: OrderedCollection new]. > (result at: key) add: value]. > ^(Association key: result value: tempList) probably > - And that reminds me: Why does that method return an association? So you can return multiple values? :( Thats not nice.. Maybe you can make the RecentMessageList stateful and let it have a sorted collection with the sorted elements. Maybe playing with that let you manage the speed problems. > > - And maybe you should look at SettingBrowser>>treeMorphIn:. There's the way to build a MorphTreeMorph binded to a list, so you can update the view sending the message #changed to the model. Yes that part I do not know > > Cheers, > Guille > > On Tue, Aug 10, 2010 at 8:11 AM, Stéphane Ducasse <[hidden email]> wrote: > Hi benjamin > > Thanks for your code!!!! > > I did a review of your latest code: Here are some points that it would be nice to address > I fixed what I saw and republished > > > 0 - all the classes should have comments > > MessageList > ---------- > 1- MessageList example does not work > Can you create some Unit tests to cover the expected behavior of the MessageList > > 2- MessageList>>browsers > I removed it > > 3- recategorized the methods > > 4- I removed all the "comment10" > > 5- what I level > Can you comment it? > > 6- for asDictionaryByClass > why don't you use groupedBy: or similar methods? > I'm not sure that I would call them asDictionaryBy.... since you return an association? > > > Why don't you call them groupedBySelectors, groupedByClasses, groupedByPackages > then why do you return an Association and not a dictionary. > > 7- Can you add oneline method comments to method? > > > 8- Could you introduce an explicit instance variable representing the environment in use and initialize > it with Smalltalk globals because like that we can specify in which environment the set is working. > > 9- openInWorldWithADictionarySelector: sucks :) > the name is not really cool > then you bind the core with the UI > so you should define this method as an extension of RecentSubmission-UI and may be > > 10- You update all the browsers open but this should not be your role. > As a core domain object you should not do this kind of behavior. The UI widget should register to event > or notification and update themselves when you change. > > updateView > browsers ifNotNilDo: [:collection | collection do: [:each | each updateView]] > > > MessageListAssociation > -------------------- > why do you need this guy? > Just to print the elements? > This is a UI concerns. The UI should wrap the model and provide a specific printed version > or the MessageListAssociation should be explained in the class comment > > > MethodReferenceWithSource > ------------------------ > We should probably move some behavior to MethodReference > > > NullTextStyler > ------------ > I categorized all the methods following SHStyler categories > > RecentMessageList > ---------------- > I cleaned the singleton part. > You do not need > UniqueInstance ifNotNil: [:u | UniqueInstance releaseAll]. > > Again the model should not be referencing the ui > releaseAll > super initialize. > MessageListBrowser allInstancesDo: [:each | each messageList = self ifTrue:[each delete]]. > browser:= nil. > self methodReferenceList: OrderedCollection new. > > > Why the setting is registration is done in the core and not at the level of the widget? > > > - at startUp: you should not create the instance since uniqueInstance is lazzily accessed. > However you should register to the SystemChangeNotifier to get the notification. > > > > > MessageListBrowser > ----------------- > Instead of having > > MessageListBrowser >>byDateAscendingOn: aMessageList > > ^self > on: aMessageList > withADictionarySelector: #asDictionaryByDateAscending. > > > MessageListBrowser >>byDateAscendingOn: aMessageList > > ^self > on: aMessageList > withADictionarySelector: aMessageList asDictionaryByDateAscendingSelector > > and > > MessageList>> asDictionaryByDateAscendingSelector > ^ #asDictionaryByDateAscending > > => encapsulate information from model to UI. > => I did it > > > > So for now this is enough :) > > > Stef > > On Aug 1, 2010, at 3:00 AM, Benjamin Van Ryseghem wrote: > > > Gofer new > > squeaksource: 'PharoTaskForces'; > > package: 'RecentSubmissions'; > > load. > > > _______________________________________________ > Pharo-users mailing list > [hidden email] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users > > _______________________________________________ > Pharo-users mailing list > [hidden email] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users _______________________________________________ Pharo-users mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users |
|
Guillermo Polito |
|
|
On Fri, Aug 13, 2010 at 7:06 AM, Stéphane Ducasse <[hidden email]> wrote:
Well, I add a "self changed" in the #updateView method of the model, and made the view update in the #update:. Maybe this can be cleaner using the bindings..
Yeah, but it seemed a little of overdesing to me :$. This was not necessary now, that's all.
Looking the code I thought this RecentMessageList stored and showed the last methods and classes changed. I don't know if XXNotification is the best name.
_______________________________________________ Pharo-users mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users |
|
Benjamin Van Ryseghem |
|
|
In reply to this post by Benjamin Van Ryseghem
>From: Guillermo Polito <[hidden email]>
> >On Fri, Aug 13, 2010 at 7:06 AM, St?phane Ducasse <[hidden email] >> wrote: > >> >> On Aug 11, 2010, at 11:05 PM, Guillermo Polito wrote: >> >> > Hi! >> > >> > I submitted a little fix where the UI is updated and the example is >> working. >> >> How? >> Because the model should not rely on the UI as it was before >> > >Well, I add a "self changed" in the #updateView method of the model, and >made the view update in the #update:. Maybe this can be cleaner using the >bindings.. It does'nt seem to work on Pharo 1.2 but i fixed it with Announcement ^^ I've also improved the example. I'm still working on the code, I'll push a version this evening I think Ben _______________________________________________ Pharo-users mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users |
|
Benjamin Van Ryseghem |
|
|
In reply to this post by Benjamin Van Ryseghem
Hi benjamin I'm on it, but it's a bit long
I've fixed it thanks to Guillermo Polito :)
Thank you
Thanks again
It's commented now. Level represents the number of levels used to shows the list
I've changed the names. They return an association because they return the dictionary and the list sorted. I've choose this way because when i add referecens in the dictionary, the references are sorted alphabetically and so I lost the order :s 7- Can you add oneline method comments to method? I'm on o too
I do not understand ...
I've removed this method
I've fixed that using Announcement MessageList >> updateView self triggerEvent: #changed MessageListBrowser >> messageList: anObject messageList := anObject. messageList when: #changed send: #updateView to: self. messageList when: #reset send: #delete to: self. MessageListAssociation I used them to quickly have the MethodReference corresponding to a node.
I do not dare to change Pharo core alone ^^
Thank you :)
Ok, now i used event too :)
It's just easier to write in RecentMessageList self openInWorld than to write in MessageListBrowser on: RecentMesageList uniquInstance withADictionarySelector: RecentMessageList uniqueInstance sortingSelector - at startUp: you should not create the instance since uniqueInstance is lazzily accessed. It's done, i've implemented the RecentMessageList class >> event: method. MessageListBrowser I do not understand :s
Cool :) Thank you and Guillermo Polito Ben Gofer new squeaksource: 'PharoTaskForces'; package: 'RecentSubmissions'; load. _______________________________________________ Pharo-users mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users |
|
Stéphane Ducasse |
|
|
at some place you use Smalltalk globals to access the class.
Now it would be better to have an environment instance variable that is initialized by default to point to Smalltalk globals. Like that I can use your code if I want to store a list of message with another environment that Smalltalk globals I can pass another instance of systemDictionary with what I want inside On Aug 13, 2010, at 8:44 PM, Benjamin Van Ryseghem wrote: > > 8- Could you introduce an explicit instance variable representing the environment in use and initialize > it with Smalltalk globals because like that we can specify in which environment the set is working. > > I do not understand ... _______________________________________________ Pharo-users mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users |
|
Stéphane Ducasse |
|
|
In reply to this post by Benjamin Van Ryseghem
good!
For the record these are not annoucement but events. Announcement pass objects as send: parameters. Stef On Aug 13, 2010, at 8:44 PM, Benjamin Van Ryseghem wrote: > I've fixed that using Announcement > > > MessageList >> updateView > self triggerEvent: #changed > > MessageListBrowser >> messageList: anObject > messageList := anObject. > messageList > when: #changed > send: #updateView > to: self. > messageList > when: #reset > send: #delete > to: self. _______________________________________________ Pharo-users mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users |
|
Stéphane Ducasse |
|
|
In reply to this post by Benjamin Van Ryseghem
have a look at the code, the point is that as a class you do not want to let the user decide how to interpret you.
You can say there are three ways to change me 1, 2, 3 but not how you decided internally to represent them. I just made asDictionaryByDateAscendingSelector = a choice like 1 the client does not have to know that this is #asDictionaryByDateAscending. It could be anything else. Setf On Aug 13, 2010, at 8:44 PM, Benjamin Van Ryseghem wrote: > > MessageListBrowser >>byDateAscendingOn: aMessageList > > ^self > on: aMessageList > withADictionarySelector: aMessageList asDictionaryByDateAscendingSelector > > and > > MessageList>> asDictionaryByDateAscendingSelector > ^ #asDictionaryByDateAscending > > => encapsulate information from model to UI. > => I did it > > I do not understand :s _______________________________________________ Pharo-users mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users |
|
Benjamin Van Ryseghem |
|
|
In reply to this post by Benjamin Van Ryseghem
at some place you use Smalltalk globals to access the class. Ok, i've added a environment variable in MessageList which is initialized trought the environment method ;)
Ok, i'll resume trying to understand how Announcement works ... have a look at the code, the point is that as a class you do not want to let the user decide how to interpret you. Ok, now i see :) Thank you again Ben _______________________________________________ Pharo-users mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users |
| Powered by Nabble | See how NAML generates this page |