MethodFinderWindow.st
changeset 3766 b1c31e1707b2
parent 3763 c3c9e58661a6
child 3767 4c67d2bfe4f4
equal deleted inserted replaced
3765:4443157a398a 3766:b1c31e1707b2
  1342         ] fork.
  1342         ] fork.
  1343 
  1343 
  1344     "Created: / 01-06-2012 / 13:16:54 / cg"
  1344     "Created: / 01-06-2012 / 13:16:54 / cg"
  1345 !
  1345 !
  1346 
  1346 
       
  1347 selectedImplementorChanged
       
  1348     self updateImplementorsOf:selectedImplementorsHolder value
       
  1349 !
       
  1350 
  1347 updateImplementorsOf:anInteger 
  1351 updateImplementorsOf:anInteger 
  1348     "Request the implementors of the selected argument provided by aNumber.
  1352     "Request the implementors of the selected argument provided by aNumber.
  1349      Return the receiver."
  1353      Return the receiver."
  1350     
  1354     
  1351     |methods classList aNumber|
  1355     |methods classList aNumber|
  1539 selectedImplementorsHolder
  1543 selectedImplementorsHolder
  1540     "valueHolder which contains the index of the selected implementors list (left list)"
  1544     "valueHolder which contains the index of the selected implementors list (left list)"
  1541 
  1545 
  1542     selectedImplementorsHolder isNil ifTrue:[
  1546     selectedImplementorsHolder isNil ifTrue:[
  1543         selectedImplementorsHolder := ValueHolder new.
  1547         selectedImplementorsHolder := ValueHolder new.
  1544         selectedImplementorsHolder onChangeEvaluate:[self updateImplementorsOf:selectedImplementorsHolder value].
  1548         selectedImplementorsHolder onChangeSend:#selectedImplementorChanged to:self.
  1545     ].
  1549     ].
  1546     ^ selectedImplementorsHolder
  1550     ^ selectedImplementorsHolder
  1547 
  1551 
  1548     "Created: / 21-09-2012 / 11:10:13 / cg"
  1552     "Created: / 21-09-2012 / 11:10:13 / cg"
  1549 !
  1553 !
  1758 ! !
  1762 ! !
  1759 
  1763 
  1760 !MethodFinderWindow methodsFor:'private'!
  1764 !MethodFinderWindow methodsFor:'private'!
  1761 
  1765 
  1762 argumentEditorsContents
  1766 argumentEditorsContents
  1763 
  1767     "Determine how many text editors of the arguments are used and store the result
  1764 "Determine how many text editors of the arguments are used and store the result
  1768     as argCounter. The result being the minimum between how many editors have
  1765 as argCounter. The result being the minimum between how many editors have
  1769     expressions in and how many are displayed.
  1766 expressions in and how many are displayed.
  1770 
  1767 
  1771     Add each argument string (key)and the evaluated version (value) to an Ordered Dictionary
  1768 Add each argument string (key)and the evaluated version (value) to an Ordered Dictionary
  1772     from each of the text editors.
  1769 from each of the text editors.
  1773 
  1770 
  1774     Return the OrderedDictionary with the expressions from all the text editors. "
  1771 Return the OrderedDictionary with the expressions from all the text editors. "
       
  1772 
  1775 
  1773      | tempArguments argCounter tempArgument1Editor tempArgument2Editor tempArgument3Editor
  1776      | tempArguments argCounter tempArgument1Editor tempArgument2Editor tempArgument3Editor
  1774 associationKey associationValue|
  1777        associationKey associationValue|
  1775 
  1778 
  1776 argCounter:=0.
  1779     argCounter:=0.
  1777 
  1780 
  1778 tempArgument1Editor:= (self cleanInputs: argument1Editor contents).
  1781     tempArgument1Editor:= (self cleanInputs: argument1Editor contents).
  1779 tempArgument2Editor:=  (self cleanInputs: argument2Editor contents).
  1782     tempArgument2Editor:=  (self cleanInputs: argument2Editor contents).
  1780 tempArgument3Editor:= (self cleanInputs: argument3Editor contents).
  1783     tempArgument3Editor:= (self cleanInputs: argument3Editor contents).
  1781 
  1784 
  1782 tempArgument1Editor = '' ifFalse:[argCounter:=argCounter +1].
  1785     tempArgument1Editor = '' ifFalse:[argCounter:=argCounter +1].
  1783 tempArgument2Editor = '' ifFalse:[argCounter:=argCounter +1].
  1786     tempArgument2Editor = '' ifFalse:[argCounter:=argCounter +1].
  1784 tempArgument3Editor = '' ifFalse:[argCounter:=argCounter +1].
  1787     tempArgument3Editor = '' ifFalse:[argCounter:=argCounter +1].
  1785 
  1788 
  1786 
  1789     argCounter:= (argCounter min: (self argCountHolder value -1)).
  1787 argCounter:= (argCounter min: (self argCountHolder value -1)).
  1790     tempArguments:= OrderedDictionary new:argCounter. 
  1788 tempArguments:= OrderedDictionary new:argCounter. 
  1791 
  1789 
  1792     (argCounter value >= 1) ifTrue:[
  1790 (argCounter value >= 1) 
  1793         associationValue:= (Compiler evaluate: tempArgument1Editor).
  1791                 ifTrue:[associationValue:= (Compiler evaluate: tempArgument1Editor).
  1794         ((self isExpression:tempArgument1Editor) or:[ associationValue isNil]) ifTrue:[
  1792                         ((self isExpression:tempArgument1Editor) or:[ associationValue isNil]) ifTrue:[                  "looks if an expression is typed in"
  1795             "looks if an expression is typed in"
  1793                                         associationKey:=associationValue printString]
  1796             associationKey:=associationValue printString
  1794                                                           ifFalse:[
  1797         ] ifFalse:[
  1795                                         associationKey:=tempArgument1Editor].
  1798             associationKey:=tempArgument1Editor
  1796 
  1799         ].
  1797                         tempArguments add: associationKey-> associationValue.
  1800         tempArguments add: associationKey-> associationValue.
  1798                         ].
  1801     ].
  1799 (argCounter value >= 2) 
  1802     (argCounter value >= 2) ifTrue:[ 
  1800                 ifTrue:[ associationValue:= (Compiler evaluate: tempArgument2Editor).
  1803         associationValue:= (Compiler evaluate: tempArgument2Editor).
  1801                         (((self isExpression:tempArgument2Editor) or:[ associationValue isNil])) ifTrue:[                  "looks if an expression is typed in"
  1804         (((self isExpression:tempArgument2Editor) or:[ associationValue isNil])) ifTrue:[
  1802                                         associationKey:=associationValue printString]
  1805             "looks if an expression is typed in"
  1803                                                           ifFalse:[
  1806             associationKey:=associationValue printString
  1804                                         associationKey:=tempArgument2Editor].
  1807         ] ifFalse:[
  1805 
  1808             associationKey:=tempArgument2Editor
  1806                         tempArguments add: associationKey-> associationValue].
  1809         ].
  1807 
  1810         tempArguments add: associationKey-> associationValue
  1808 (argCounter value >= 3)
  1811     ].
  1809                 ifTrue:[ associationValue:= (Compiler evaluate: tempArgument3Editor).
  1812 
  1810                         ((self isExpression:tempArgument3Editor) or:[ associationValue isNil]) ifTrue:[                  "looks if an expression is typed in"
  1813     (argCounter value >= 3) ifTrue:[ 
  1811                                         associationKey:=associationValue printString]
  1814         associationValue:= (Compiler evaluate: tempArgument3Editor).
  1812                                                           ifFalse:[
  1815         ((self isExpression:tempArgument3Editor) or:[ associationValue isNil]) ifTrue:[
  1813                                         associationKey:=tempArgument3Editor].
  1816             "looks if an expression is typed in"
  1814 
  1817             associationKey:=associationValue printString
  1815                         tempArguments add: associationKey-> associationValue].
  1818         ] ifFalse:[
  1816 
  1819             associationKey:=tempArgument3Editor
  1817 
  1820         ].
  1818 ^tempArguments
  1821         tempArguments add: associationKey-> associationValue
       
  1822     ].
       
  1823 
       
  1824 
       
  1825     ^tempArguments
  1819 !
  1826 !
  1820 
  1827 
  1821 extractClassAndSelectorFrom:anArgument 
  1828 extractClassAndSelectorFrom:anArgument 
  1822     "Opens browser on theArgument of a specific class. anArgument being a string with the
  1829     "Opens browser on theArgument of a specific class. anArgument being a string with the
  1823        Class and the selector upon which the browser is to be opened. Return the receiver."
  1830        Class and the selector upon which the browser is to be opened. Return the receiver."