On Tue, Feb 16, 2010 at 10:58 AM, dtrussardi@tiscali.it <dtrussardi@tiscali.it> wrote:
Hey John,

Hey Dario,
I can try and help.

On Tue, Feb 16, 2010 at 6:34 AM, dtrussardi@tiscali.it <dtrussardi@tiscali.it> wrote:
Hi,

i'm interested to display and change the priority of MADescription components when the browser display  Halos.

For example i have a class with descriptionA, descriptionB.

For display the priority  i change the WAClassnameHaloPlugin renderOn: method.


For change i create the WAPriorityHaloPlugin.

In the relative  execute method i test if component is anMAComponent :  self target description respondTo: #priority .

If yes i,m interested to open the Browser or WABrowser on the relative descriptionA.



The first question is:  how i can define the name of descriptionA from anObject with magritte structure  ?

       into execute context of WAPriorityHaloPlugin  i see aObject with memento, description, accessor .....  but i d'ont found link to the relative generating descriptionA.

Given that aObject's description is a container you can iterate through the contained descriptions looking for a match on the selector of the description.
  aObject description detect: [ :each | each accessor selector = #theSelectorIWant ]

The problem is: at  this level i d'ont understand the description name ( descriptionA )relative to the magritte component.

Any magritte component ( create with descriptionA descriptionB descriptionX  relative to one class )  when rendering with halo view, is display with the relative WAPriorityHaloPlugin anchor.

Now    assume to  click on anchor relative to component create with descriptionA    i go into relative  'execute' context of WAPriorityHaloPlugin  where i found a specific aObject with memento, description, accessor,

but i d'ont found,  a this level, any link to the original descriptionA.


I can add property to the descriptionA define method:

descriptionA

^(MABooleanDescription new) autoAccessor: #attivo; checkboxLabel: 'Account attivo'; label: 'Attivo'; priority: 4030;


propertyAt: #descriptionName put: #'descriptionA';
.........


but with this solution i need to change all the descriptions.

Maybe extend MADescription with #descriptionName that returns a reasonable default?
   ^self propertyAt: #descriptionName ifAbsent: [ 'Description for ' , self label ]



The second question is: after change the descriptionA with the WABrowser and return to the halo browser how i can update the view to reflect the change ?

       i have do some test but for now ti need to close and reopen the view.

Descriptions are cached so sending #flush to MANamedBuilder default forces the (container) descriptions to be rebuilt with the modified descripitons. I dont know if that will work well in your situation.



I do MANamedBuilder default flush  but not work ( the view is rendering with no change ).

I need to close and reopen the view.

I was afraid that would be the case, but once you change the priorities it would have to rebuild the container component no? I am not really that familiar with the halo/plugin stuff....maybe senders of the open: method might provide some clues


I can flush the cache relative to one specific class ?

Best of luck with it
John



Thank,

Dario

_______________________________________________
Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki



--
http://jmck.seasidehosting.st