WorkspaceApplication.st
changeset 3198 1c34cd12b80b
parent 3196 86540e27b2e0
child 3207 88ed12ce69a4
equal deleted inserted replaced
3197:f49450e43af5 3198:1c34cd12b80b
   422 
   422 
   423 addWorkspace
   423 addWorkspace
   424     self addWindow:(HVScrollableView for:Workspace) named:'Workspace%1'
   424     self addWindow:(HVScrollableView for:Workspace) named:'Workspace%1'
   425 !
   425 !
   426 
   426 
       
   427 basicInspectIt
       
   428     self inspectIt:true
       
   429 !
       
   430 
   427 browseIt
   431 browseIt
   428     self selectedWorkspace browseIt
   432     self selectedWorkspacesTextView browseIt
   429 !
   433 !
   430 
   434 
   431 copySelection
   435 copySelection
   432     self selectedWorkspace copySelection
   436     self selectedWorkspacesTextView copySelection
   433 !
   437 !
   434 
   438 
   435 cutSelection
   439 cutSelection
   436     self selectedWorkspace cutSelection
   440     self selectedWorkspacesTextView cutSelection
   437 !
   441 !
   438 
   442 
   439 doIt
   443 doIt
   440     self selectedWorkspace doIt
   444     self selectedWorkspacesTextView doIt
   441 !
   445 !
   442 
   446 
   443 inspectIt
   447 inspectIt
       
   448     self inspectIt:false
       
   449 !
       
   450 
       
   451 inspectIt:basic
   444     |ws obj v|
   452     |ws obj v|
   445 
   453 
   446     ws := self selectedWorkspace.
   454     ws := self selectedWorkspacesTextView.
   447     ws
   455     ws
   448         do:(ws selection) 
   456         do:(ws selection) 
   449         withValueDo:[:result | 
   457         withValueDo:[:result | 
   450                         | cls |
   458                         | cls |
   451 
   459 
   452                         cls := result inspectorClass.
   460                         basic ifFalse:[
       
   461                             cls := result inspectorClass.
       
   462                         ].
   453                         cls isNil ifTrue:[
   463                         cls isNil ifTrue:[
   454                             cls := InspectorView
   464                             cls := InspectorView
   455                         ].
   465                         ].
   456                         v := cls new.
   466                         v := cls new.
   457                         v inspect:result.
   467                         v inspect:result.
       
   468                         v allowFollow:true.
   458                         self addWindow:v named:'Inspecting: ' , result classNameWithArticle.
   469                         self addWindow:v named:'Inspecting: ' , result classNameWithArticle.
   459                     ]
   470                     ]
   460 
   471 
   461 "/    self selectedWorkspace inspectIt
   472 "/    self selectedWorkspace inspectIt
   462 !
   473 !
   466 
   477 
   467     (self askIfModified:'Text was modified. Load anyway ?' yesButton:'Load') ifFalse:[ ^ self].
   478     (self askIfModified:'Text was modified. Load anyway ?' yesButton:'Load') ifFalse:[ ^ self].
   468 
   479 
   469     file := Dialog requestFileName:'Load file:'.
   480     file := Dialog requestFileName:'Load file:'.
   470     file size > 0 ifTrue:[
   481     file size > 0 ifTrue:[
   471         (ws := self selectedWorkspace) contents:file asFilename contentsOfEntireFile.
   482         (ws := self selectedWorkspacesTextView) contents:file asFilename contentsOfEntireFile.
   472         ws modified:false.        
   483         ws modified:false.        
   473     ]
   484     ]
   474 !
   485 !
   475 
   486 
   476 menuSaveAs
   487 menuSaveAs
   477     |file ws|
   488     |file ws|
   478 
   489 
   479     file := Dialog requestFileName:'Save file:' default:'file.wsp'. 
   490     file := Dialog requestFileName:'Save file:' default:'file.wsp'. 
   480     file size > 0 ifTrue:[
   491     file size > 0 ifTrue:[
   481         (ws := self selectedWorkspace) saveAs:file.
   492         (ws := self selectedWorkspacesTextView) saveAs:file.
   482         ws modified:false.
   493         ws modified:false.
   483     ]
   494     ]
   484 !
   495 !
   485 
   496 
   486 openDocumentation
   497 openDocumentation
   488 
   499 
   489     self openHTMLDocument: 'tools/misc/TOP.html#WORKSPACE'
   500     self openHTMLDocument: 'tools/misc/TOP.html#WORKSPACE'
   490 !
   501 !
   491 
   502 
   492 paste
   503 paste
   493     self selectedWorkspace paste
   504     self selectedWorkspacesTextView paste
   494 !
   505 !
   495 
   506 
   496 printIt
   507 printIt
   497     self selectedWorkspace printIt
   508     self selectedWorkspacesTextView printIt
   498 !
   509 !
   499 
   510 
   500 removeWorkspace
   511 removeWorkspace
   501     self removeWorkspace:(self selectedWorkspaceIndexHolder value)
   512     self removeWorkspace:(self selectedWorkspaceIndexHolder value)
   502 !
   513 !
   587     ^ false
   598     ^ false
   588 
   599 
   589     "Modified: 2.10.1997 / 14:23:47 / stefan"
   600     "Modified: 2.10.1997 / 14:23:47 / stefan"
   590 !
   601 !
   591 
   602 
       
   603 selectedWorkspacesTextView
       
   604     |textView|
       
   605 
       
   606     textView := self selectedWorkspace.
       
   607     (textView isKindOf:ScrollableView) ifTrue:[
       
   608         textView := textView scrolledView
       
   609     ].
       
   610     (textView isKindOf:TextView) ifTrue:[
       
   611         ^ textView
       
   612     ].
       
   613     ^ textView workspace
       
   614 !
       
   615 
   592 workspaceSelectionChanged
   616 workspaceSelectionChanged
   593     |wsIndex windowLabel|
   617     |wsIndex windowLabel|
   594 
   618 
   595     "/ self selected
   619     "/ self selected
   596     self workspaceHolder value:(self selectedWorkspace).
   620     self workspaceHolder value:(self selectedWorkspace).
   603 ! !
   627 ! !
   604 
   628 
   605 !WorkspaceApplication class methodsFor:'documentation'!
   629 !WorkspaceApplication class methodsFor:'documentation'!
   606 
   630 
   607 version
   631 version
   608     ^ '$Header: /cvs/stx/stx/libtool/WorkspaceApplication.st,v 1.6 2001-09-25 12:01:49 cg Exp $'
   632     ^ '$Header: /cvs/stx/stx/libtool/WorkspaceApplication.st,v 1.7 2001-09-25 12:44:36 cg Exp $'
   609 ! !
   633 ! !