Mantis - Squeak Packages
Viewing Issue Advanced Details
6928 OmniBrowser minor always 02-15-08 01:23 02-20-08 09:19
Nicolai Hess  
dr  
normal  
resolved  
fixed  
none    
none  
0006928: No pretty-printing in OBMultipleSelectionBrowser
OBCmdPrettyPrint>>execute search the browserpanels for one of kind
OBDefinitionPanel to getDefinition and pretty-printing,
but OBMultipleSelectionBrowser uses OBMultipleDefinitionPanels
instead, and so OBCmdPrettyPrint leaves the execute method
without change.
I tried to fix this, by searching panels of kind OBDefinitionPanel or
OBMultipleDefinitionPanel.
But I don't know how to get the definition from here, as it is hold
by one of his OBCloseableDefinitionPanel.
Can I get the current active definitionpanel from the OBMultipleDefinitionPanel?

Maybe it is simpler to execute this command not by OBCommand>>execute, but
implement perform:orSendTo:

Here we can take the additional orSendTo-Argument to get the current Textmorph
than the model and hope it is a kind of DefinitionPanel:

perform:action orSendTo:anObject
    | morph definition source |
    (anObject isKindOf: OBPluggableTextMorph)
    ifFalse:[self perform:action].
    morph:=anObject.
    definition:= anObject model getDefinition.
    source := morph text asString.
    (definition prettyPrint: source) = source
        ifTrue: [ ^ self ].
    requestor browser announce: definition.
    morph hasUnacceptedEdits: true






Notes
(0011828)
dr   
02-18-08 14:56   
There are actually two pretty print commands available: One from OB-Refactory (which is broken in the multiple selection browser) and one in the cmd OBCmdMultiView which still works also in the multiple selection browser. You can access it in the fixed tab panel (the panel between the columns and the definition panel) on the right side.
The fix for the other command needs to be done in the OmniBrowser and in the OB-Refactory. I'm working on that.

One possibility to get the current active def panel from an OBMultipleDefintionPanel would be this code (requires the newest version of OB-Enhancements):

definitionPanel
   ^self panels detect: [:ea | ea node = self currentNode]
(0011851)
dr   
02-20-08 09:19   
I fixed this issue now.
You need the newest version of the following packages: OmniBrowser, OB-Refactory and OB-Enhancements. You can load them from http://source.wiresong.ca/ob. [^]

Please note that I recently changed a lot of code in OB-Enhancements which is not yet thoroughly tested. Hence you might find new issues when you update to the latest version.