CodeGeneratorTool.st
changeset 6935 0e40809ca185
parent 6921 821413de0099
child 6936 a75cb12252cb
equal deleted inserted replaced
6934:4bbf39bf4538 6935:0e40809ca185
  1843                 inCategory:'documentation'.
  1843                 inCategory:'documentation'.
  1844         ]
  1844         ]
  1845     ].
  1845     ].
  1846 ! !
  1846 ! !
  1847 
  1847 
  1848 !CodeGeneratorTool methodsFor:'compilation'!
       
  1849 
       
  1850 compile:theCode forClass:aClass inCategory:cat 
       
  1851     "install some code for a class.
       
  1852      If refactory browser stuff is avaliable the refactory tools are used to support undo"
       
  1853 
       
  1854     |change|
       
  1855 
       
  1856     self canUseRefactoringSupport ifFalse:[
       
  1857         "/ compile immediately
       
  1858         aClass compile:theCode classified:cat.
       
  1859         ^ self.
       
  1860     ].
       
  1861 
       
  1862     change := InteractiveAddMethodChange compile:(theCode asString) in:aClass classified:cat.
       
  1863 
       
  1864     "/ if collecting, add to changes (to be executed as one change at the end,
       
  1865     "/ in order to have only one change in the undo-list (instead of many)
       
  1866     compositeChangeCollector notNil ifTrue:[
       
  1867         compositeChangeCollector addChange:change
       
  1868     ] ifFalse:[
       
  1869         RefactoryChangeManager instance performChange:change.
       
  1870     ]
       
  1871 ! !
       
  1872 
  1848 
  1873 !CodeGeneratorTool methodsFor:'private'!
  1849 !CodeGeneratorTool methodsFor:'private'!
  1874 
  1850 
  1875 canUseRefactoringSupport
  1851 canUseRefactoringSupport
  1876     "check if refactory browser stuff is avaliable"
  1852     "check if refactory browser stuff is avaliable"
  1932 ! !
  1908 ! !
  1933 
  1909 
  1934 !CodeGeneratorTool class methodsFor:'documentation'!
  1910 !CodeGeneratorTool class methodsFor:'documentation'!
  1935 
  1911 
  1936 version
  1912 version
  1937     ^ '$Header: /cvs/stx/stx/libtool/CodeGeneratorTool.st,v 1.40 2006-08-21 10:15:56 cg Exp $'
  1913     ^ '$Header: /cvs/stx/stx/libtool/CodeGeneratorTool.st,v 1.41 2006-08-21 16:37:21 cg Exp $'
  1938 ! !
  1914 ! !