BrowserView.st
changeset 263 7b9622ce4fcc
parent 261 fe9aa619107b
child 264 621107e65e1e
equal deleted inserted replaced
262:29e57d617edd 263:7b9622ce4fcc
  1661             self normalLabel.
  1661             self normalLabel.
  1662         ]
  1662         ]
  1663     ]
  1663     ]
  1664 
  1664 
  1665     "Created: 23.11.1995 / 11:41:38 / cg"
  1665     "Created: 23.11.1995 / 11:41:38 / cg"
  1666     "Modified: 9.12.1995 / 19:50:09 / cg"
  1666     "Modified: 9.12.1995 / 21:19:08 / cg"
  1667 !
  1667 !
  1668 
  1668 
  1669 classCompareWithNewestInRepository
  1669 classCompareWithNewestInRepository
  1670     "open a diff-textView comparing the current (in-image) version
  1670     "open a diff-textView comparing the current (in-image) version
  1671      with the most recent version found in the repository."
  1671      with the most recent version found in the repository."
  1689             ] ifFalse:[
  1689             ] ifFalse:[
  1690                 self busyLabel:'extracting previous %1' with:currentClass name.
  1690                 self busyLabel:'extracting previous %1' with:currentClass name.
  1691                 aStream := mgr sourceStreamFor:currentClass revision:rev.
  1691                 aStream := mgr sourceStreamFor:currentClass revision:rev.
  1692                 revString := rev
  1692                 revString := rev
  1693             ].
  1693             ].
       
  1694             aStream isNil ifTrue:[
       
  1695                 self warn:'could not extract source from repository'.
       
  1696                 ^ self
       
  1697             ].
  1694             comparedSource := aStream contents.
  1698             comparedSource := aStream contents.
  1695             aStream close.
  1699             aStream close.
  1696 
  1700 
  1697             self busyLabel:'generating current source ...' with:nil.
  1701             self busyLabel:'generating current source ...' with:nil.
  1698 
  1702 
  1709             self normalLabel.
  1713             self normalLabel.
  1710         ]
  1714         ]
  1711     ]
  1715     ]
  1712 
  1716 
  1713     "Created: 14.11.1995 / 16:43:15 / cg"
  1717     "Created: 14.11.1995 / 16:43:15 / cg"
  1714     "Modified: 9.12.1995 / 19:50:22 / cg"
  1718     "Modified: 9.12.1995 / 21:57:10 / cg"
  1715 !
  1719 !
  1716 
  1720 
  1717 classCreateSourceContainerFor:aClass
  1721 classCreateSourceContainerFor:aClass
  1718     "let user specify the source-repository values for aClass"
  1722     "let user specify the source-repository values for aClass"
  1719 
  1723 
  1727 
  1731 
  1728     |box 
  1732     |box 
  1729      moduleHolder packageHolder fileNameHolder 
  1733      moduleHolder packageHolder fileNameHolder 
  1730      module package fileName 
  1734      module package fileName 
  1731      specialFlags
  1735      specialFlags
  1732      check y component info fn project nm|
  1736      check y component info fn project nm mgr|
  1733 
  1737 
  1734     aClass isLoaded ifFalse:[
  1738     aClass isLoaded ifFalse:[
  1735         self warn:'please load the class first'.
  1739         self warn:'please load the class first'.
  1736         ^ self.
  1740         ^ self.
  1737     ].
  1741     ].
  1758 
  1762 
  1759     "/
  1763     "/
  1760     "/ ask the sourceCodeManager if it knows anything about that class
  1764     "/ ask the sourceCodeManager if it knows anything about that class
  1761     "/ if so, take that as a default.
  1765     "/ if so, take that as a default.
  1762     "/
  1766     "/
  1763     info := (aClass sourceCodeManager) sourceInfoOfClass:aClass.
  1767     info := (mgr := aClass sourceCodeManager) sourceInfoOfClass:aClass.
  1764     info notNil ifTrue:[
  1768     info notNil ifTrue:[
  1765         (info includesKey:#module) ifTrue:[
  1769         (info includesKey:#module) ifTrue:[
  1766             moduleHolder value:(info at:#module).
  1770             moduleHolder value:(info at:#module).
  1767         ].
  1771         ].
  1768         (info includesKey:#directory) ifTrue:[
  1772         (info includesKey:#directory) ifTrue:[
  1825     box addAbortButton; addOkButton.
  1829     box addAbortButton; addOkButton.
  1826 
  1830 
  1827     box showAtPointer.
  1831     box showAtPointer.
  1828 
  1832 
  1829     box accepted ifTrue:[
  1833     box accepted ifTrue:[
       
  1834         aClass revisionString isNil ifTrue:[
       
  1835             (self confirm:(resources string:'%1 does not have any revision info (#version method)\\Shall I create one ?' with:aClass name) withCRs)
       
  1836                 ifFalse:[
       
  1837                     ^ self
       
  1838                 ].
       
  1839             aClass updateVersionMethodFor:(mgr initialRevisionStringFor:aClass).
       
  1840         ].
       
  1841 
  1830         module := moduleHolder value withoutSpaces.
  1842         module := moduleHolder value withoutSpaces.
  1831         package := packageHolder value withoutSpaces.
  1843         package := packageHolder value withoutSpaces.
  1832         fileName := fileNameHolder value withoutSpaces.
  1844         fileName := fileNameHolder value withoutSpaces.
  1833 
  1845 
  1834         "/
  1846         "/
  1835         "/ check for the module
  1847         "/ check for the module
  1836         "/
  1848         "/
  1837         (SourceCodeManager 
  1849         (mgr checkForExistingModule:module) ifFalse:[
  1838                 checkForExistingModule:module) ifFalse:[
       
  1839             (self confirm:(resources string:'%1 is a new module.\\create it ?' with:module) withCRs) ifFalse:[
  1850             (self confirm:(resources string:'%1 is a new module.\\create it ?' with:module) withCRs) ifFalse:[
  1840                 ^ self.
  1851                 ^ self.
  1841             ].
  1852             ].
  1842             (SourceCodeManager createModule:module) ifFalse:[
  1853             (mgr createModule:module) ifFalse:[
  1843                 self warn:(resources string:'cannot create new module: %1' with:module).
  1854                 self warn:(resources string:'cannot create new module: %1' with:module).
  1844                 ^ self.
  1855                 ^ self.
  1845             ]
  1856             ]
  1846         ].
  1857         ].
  1847 
  1858 
  1848         "/
  1859         "/
  1849         "/ check for the package
  1860         "/ check for the package
  1850         "/
  1861         "/
  1851         (SourceCodeManager 
  1862         (mgr checkForExistingModule:module package:package) ifFalse:[
  1852                 checkForExistingModule:module
       
  1853                                package:package) ifFalse:[
       
  1854             (self confirm:(resources string:'%1 is a new package (in module %2).\\create it ?' with:package with:module) withCRs) ifFalse:[
  1863             (self confirm:(resources string:'%1 is a new package (in module %2).\\create it ?' with:package with:module) withCRs) ifFalse:[
  1855                 ^ self.
  1864                 ^ self.
  1856             ].
  1865             ].
  1857             (SourceCodeManager createModule:module package:package) ifFalse:[
  1866             (mgr createModule:module package:package) ifFalse:[
  1858                 self warn:(resources string:'cannot create new package: %1 (in module %2)' with:package with:module).
  1867                 self warn:(resources string:'cannot create new package: %1 (in module %2)' with:package with:module).
  1859                 ^ self.
  1868                 ^ self.
  1860             ]
  1869             ]
  1861         ].
  1870         ].
  1862 
  1871 
  1863         "/
  1872         "/
  1864         "/ check for the container itself
  1873         "/ check for the container itself
  1865         "/
  1874         "/
  1866         (SourceCodeManager 
  1875         (mgr checkForExistingContainerInModule:module package:package container:fileName) ifTrue:[
  1867                 checkForExistingContainerInModule:module
       
  1868                 package:package
       
  1869                 container:fileName) ifTrue:[
       
  1870             self warn:(resources string:'container for %1 already exists in %2/%3.\\You have to destroy the old one or use another name.' with:fileName with:module with:package) withCRs.
  1876             self warn:(resources string:'container for %1 already exists in %2/%3.\\You have to destroy the old one or use another name.' with:fileName with:module with:package) withCRs.
  1871             ^ self
  1877             ^ self
  1872         ].
  1878         ].
  1873 
  1879 
  1874         SourceCodeManager 
  1880         (mgr
  1875                 createContainerFor:aClass
  1881                 createContainerFor:aClass
  1876                 inModule:module
  1882                 inModule:module
  1877                 package:package
  1883                 package:package
  1878                 container:fileName                
  1884                 container:fileName) ifFalse:[
       
  1885             self warn:(resources string:'failed to create container.').
       
  1886             ^ self.
       
  1887         ].
  1879     ].
  1888     ].
  1880     box destroy
  1889     box destroy
  1881 
  1890 
  1882     "Modified: 9.12.1995 / 19:55:59 / cg"
  1891     "Modified: 9.12.1995 / 21:51:54 / cg"
  1883 !
  1892 !
  1884 
  1893 
  1885 classLoadRevision
  1894 classLoadRevision
  1886     "load a specific revision into the system - especially useful to
  1895     "load a specific revision into the system - especially useful to
  1887      upgrade a class to the newest revision"
  1896      upgrade a class to the newest revision"
  6146 ! !
  6155 ! !
  6147 
  6156 
  6148 !BrowserView class methodsFor:'documentation'!
  6157 !BrowserView class methodsFor:'documentation'!
  6149 
  6158 
  6150 version
  6159 version
  6151 ^ '$Header: /cvs/stx/stx/libtool/BrowserView.st,v 1.64 1995-12-09 20:03:38 cg Exp $'! !
  6160     ^ '$Header: /cvs/stx/stx/libtool/BrowserView.st,v 1.65 1995-12-09 21:13:16 cg Exp $'
       
  6161 ! !
  6152 BrowserView initialize!
  6162 BrowserView initialize!