MenuEditor.st
changeset 654 45cc74ba1113
parent 642 f8ba35e5a678
child 667 0afd85e27240
equal deleted inserted replaced
653:20bec8d70d14 654:45cc74ba1113
  1847     ].
  1847     ].
  1848     ^ nil
  1848     ^ nil
  1849 !
  1849 !
  1850 
  1850 
  1851 doSave
  1851 doSave
  1852     |cls treeView menu spec mthd category code|
  1852     |cls treeView menu spec mthd category code BANG|
  1853 
  1853 
  1854     super doSave ifFalse: [^nil].
  1854     super doSave ifFalse: [^nil].
  1855 
  1855 
  1856     cls := self resolveName: specClass.
  1856     cls := self resolveName: specClass.
  1857     treeView := self treeView.
  1857     treeView := self treeView.
  1866     category := 'menu specs'.
  1866     category := 'menu specs'.
  1867     (mthd := cls class compiledMethodAt:specSelector) notNil ifTrue:[
  1867     (mthd := cls class compiledMethodAt:specSelector) notNil ifTrue:[
  1868         category := mthd category.
  1868         category := mthd category.
  1869     ].
  1869     ].
  1870 
  1870 
  1871     code := Character excla asString 
  1871     BANG := Character excla asString.
  1872             , cls name , ' class methodsFor:' , category storeString
  1872 
  1873             , Character excla asString , '\\'
  1873     code := BANG
       
  1874             , (cls name , ' class methodsFor:' , category storeString)
       
  1875             , BANG , '\\'
  1874 
  1876 
  1875             , specSelector , '\'
  1877             , specSelector , '\'
  1876             , '    "this window spec was automatically generated by the ST/X MenuEditor"\\'
  1878             , '    "this window spec was automatically generated by the ST/X MenuEditor"\\'
  1877             , '    "do not manually edit this - the builder may not be able to\'
  1879             , '    "do not manually edit this - the builder may not be able to\'
  1878             , '     handle the specification if its corrupted."\\'
  1880             , '     handle the specification if its corrupted."\\'
  1879             , '    "\'
  1881             , '    "\'
  1880             , '     MenuEditor new openOnClass:' , cls name , ' andSelector:#' , specSelector , '\'
  1882             , ('     MenuEditor new openOnClass:' , cls name , ' andSelector:#' , specSelector , '\')
  1881             , '     (Menu new fromLiteralArrayEncoding:(' , cls name , ' ' , specSelector , ')) startUp\'
  1883             , ('     (Menu new fromLiteralArrayEncoding:(' , cls name , ' ' , specSelector , ')) startUp\')
  1882             , '    "\'.
  1884             , '    "\'.
  1883 
  1885 
  1884     code := code 
  1886     code := code 
  1885             , '\'
  1887             , '\'
  1886             , '    <resource: #menu>\\'
  1888             , '    <resource: #menu>\\'
  1887             , '    ^\' 
  1889             , '    ^\' 
  1888             , '     ', spec
  1890             , '     ', spec
  1889             , '\'
  1891             , '\'
  1890             , Character excla asString
  1892             , (BANG , ' ' , BANG)
  1891             , ' '
       
  1892             , Character excla asString
       
  1893             , '\\'.
  1893             , '\\'.
  1894 
  1894 
  1895     code := code withCRs.
  1895     code := code withCRs.
  1896     (ReadStream on:code) fileIn.
  1896     (ReadStream on:code) fileIn.
  1897 
  1897