Hi Everybody, Is there a way to list all the entries of a pool dictionary referenced by the methods of a class? Big picture: I am working on a Seaside project where I have given CSS (Cascading Style Sheet) classes to most everything that I want to be able to change how they look via a CSS file. I have defined these classes in a poolDictionary, so I don't have the same string (CSS class name) used all over the place. I would like to document which class (which equates to a screen page) uses which CSS classes. If I could get a list of the references to a poolDictionary of a class I would be well on my way to having what I want. Thanks, Lou
-- You received this message because you are subscribed to the Google Groups "VA Smalltalk" group. To view this discussion on the web visit https://groups.google.com/d/msg/va-smalltalk/-/7IfFpF6lhH0J. To post to this group, send email to [hidden email]. To unsubscribe from this group, send email to [hidden email]. For more options, visit this group at http://groups.google.com/group/va-smalltalk?hl=en. |
Lou -
You are looking for the #allSharedPoolNames method -- for example, Array allSharedPoolNames will answer OrderedCollection(#NlsCatKRN #SystemPrimitiveErrors #SystemExceptions ). This collection is derived from the sharedPoolNames class variable of the class and its superclasses; it does not include pools referenced explicitly (for example, CldtConstants::Lf).
John O'Keefe
-- You received this message because you are subscribed to the Google Groups "VA Smalltalk" group. To view this discussion on the web visit https://groups.google.com/d/msg/va-smalltalk/-/N52OaBoVpVEJ. To post to this group, send email to [hidden email]. To unsubscribe from this group, send email to [hidden email]. For more options, visit this group at http://groups.google.com/group/va-smalltalk?hl=en. |
Hi John, Thank you very much for the reply. I was just thinking about this at breakfast and how no one had responded and then there you are. Unfortunately this isn't quite what I am looking for. The method, #allSharedPoolNames, gives the names of the pools referenced bu the class but I know the pool I am interested in and want to know the pool entries referenced. I will take a look at Behavior, the class that implements
#allSharedPoolNames and see if it has any methods that may do what I need. If you have any other ideas, I would love to hear them. Lou
-- You received this message because you are subscribed to the Google Groups "VA Smalltalk" group. To view this discussion on the web visit https://groups.google.com/d/msg/va-smalltalk/-/FUGKeUCXpjgJ. To post to this group, send email to [hidden email]. To unsubscribe from this group, send email to [hidden email]. For more options, visit this group at http://groups.google.com/group/va-smalltalk?hl=en. |
Lou -
I think you will find that trying to find all the pool dictionary ENTRIES that are referenced is, in general, going to be a lost cause. This is because the compiler only keeps the association (copied from the pool dictionary at the time the method is compiled) in the CompiledMethod literal pool, at least for pool entries declared as constant. For your special case, you could root through the CompiledMethod's literal pool and use some hueristic (such as knowing that the pool entry's name always begins with 'CSS') to determine if an association there is a pool dictionary entry. John O'Keefe
-- You received this message because you are subscribed to the Google Groups "VA Smalltalk" group. To view this discussion on the web visit https://groups.google.com/d/msg/va-smalltalk/-/_mhMtL4u6mIJ. To post to this group, send email to [hidden email]. To unsubscribe from this group, send email to [hidden email]. For more options, visit this group at http://groups.google.com/group/va-smalltalk?hl=en. |
Hi John, Thanks for the info. Fortunately, this isn't a real high priority. I was hoping it would save me time digging through the components to document which CSS classes went with which component (web screen). The project servers many groups, admins of each group can modify a the groups CSS file (applied after my base CSS file). The can do this on line from the system. I want to build a help file so they have some idea which CSS class goes where on which screen. I can dig through the screen but it would be faster and less error prone if I could just run something that listed the CSS classes used by each screen (component). Thanks again, Lou
-- You received this message because you are subscribed to the Google Groups "VA Smalltalk" group. To view this discussion on the web visit https://groups.google.com/d/msg/va-smalltalk/-/spcE7lUW_xEJ. To post to this group, send email to [hidden email]. To unsubscribe from this group, send email to [hidden email]. For more options, visit this group at http://groups.google.com/group/va-smalltalk?hl=en. |
On the other hand when inspecting a pool and selected an entry there is a menu entry to show you the references to that selected entry - therefore the logic you want seems to be there Am 30.07.2011 00:07 schrieb "Louis LaBrunda" <[hidden email]>:
-- > Hi John, > > Thanks for the info. Fortunately, this isn't a real high priority. I was > hoping it would save me time digging through the components to document > which CSS classes went with which component (web screen). The project > servers many groups, admins of each group can modify a the groups CSS file > (applied after my base CSS file). The can do this on line from the system. > I want to build a help file so they have some idea which CSS class goes > where on which screen. > > I can dig through the screen but it would be faster and less error prone if > I could just run something that listed the CSS classes used by each screen > (component). > > Thanks again, Lou > > -- > You received this message because you are subscribed to the Google Groups "VA Smalltalk" group. > To view this discussion on the web visit https://groups.google.com/d/msg/va-smalltalk/-/spcE7lUW_xEJ. > To post to this group, send email to [hidden email]. > To unsubscribe from this group, send email to [hidden email]. > For more options, visit this group at http://groups.google.com/group/va-smalltalk?hl=en. > You received this message because you are subscribed to the Google Groups "VA Smalltalk" group. To post to this group, send email to [hidden email]. To unsubscribe from this group, send email to [hidden email]. For more options, visit this group at http://groups.google.com/group/va-smalltalk?hl=en. |
What about this code? Actually you have to find out all pool entries and for each entry you execute the following code and then just filter the result. But perhaps I have not understood your wish.
<pre< | methods poolEntryToFind | poolEntryToFind := SQLiteConstants::DeclarationForBoolean. methods := OrderedCollection new. System classHierarchyRoots do: [:cl | methods addAll: (cl allMethodsReferencingLiteral: poolEntryToFind)]. methods inspect </pre> -- You received this message because you are subscribed to the Google Groups "VA Smalltalk" group. To view this discussion on the web visit https://groups.google.com/d/msg/va-smalltalk/-/eE46ACkwn_sJ. To post to this group, send email to [hidden email]. To unsubscribe from this group, send email to [hidden email]. For more options, visit this group at http://groups.google.com/group/va-smalltalk?hl=en. |
Hi Marten, Thanks. This looks very interesting. Between what John has suggested and this I think I can get the classes that have methods that reference entries in the pool I'm interested in. Those classes are components and as such relate to browser screens. I should then be able to document that a given screen uses a list of CSS classes to help paint certain parts of the screen. Then (within limits) users can change the CSS file I make available to them to make the screen look the way they want. For example: I allow the use of user (admin level) defined logo at the top of each screen. Knowing the CSS class for the image object allows the display size of the image to be changed. I will let the group know how the code you and John suggested works out. Lou
-- You received this message because you are subscribed to the Google Groups "VA Smalltalk" group. To view this discussion on the web visit https://groups.google.com/d/msg/va-smalltalk/-/SLxIg5Mc74QJ. To post to this group, send email to [hidden email]. To unsubscribe from this group, send email to [hidden email]. For more options, visit this group at http://groups.google.com/group/va-smalltalk?hl=en. |
Free forum by Nabble | Edit this page |