TabListEditor.st
changeset 2281 e6cc565bff35
parent 1972 c1b9c7d9e8f4
child 2346 d6fdeda319de
equal deleted inserted replaced
2280:d9a56ee79c70 2281:e6cc565bff35
     7  inclusion of the above copyright notice. This software may not
     7  inclusion of the above copyright notice. This software may not
     8  be provided or otherwise made available to, or used by, any
     8  be provided or otherwise made available to, or used by, any
     9  other person.  No title to or ownership of the software is
     9  other person.  No title to or ownership of the software is
    10  hereby transferred.
    10  hereby transferred.
    11 "
    11 "
    12 
       
    13 
       
    14 
       
    15 "{ Package: 'stx:libtool2' }"
    12 "{ Package: 'stx:libtool2' }"
    16 
    13 
    17 ResourceSpecEditor subclass:#TabListEditor
    14 ResourceSpecEditor subclass:#TabListEditor
    18 	instanceVariableNames:'listOfTabs'
    15 	instanceVariableNames:'listOfTabs'
    19 	classVariableNames:''
    16 	classVariableNames:''
  1330 ! !
  1327 ! !
  1331 
  1328 
  1332 !TabListEditor methodsFor:'queries'!
  1329 !TabListEditor methodsFor:'queries'!
  1333 
  1330 
  1334 canToggleTestMode
  1331 canToggleTestMode
  1335     "checks whether testMode button is enabled
  1332     "checks whether testMode button is enabled"
  1336     "
  1333 
  1337     self testMode value ifTrue:[
  1334     self testMode value ifTrue:[
  1338         ^ true
  1335         ^ true
  1339     ].
  1336     ].
  1340 
  1337 
  1341     self valueOfEnablingCommitButtons value ifFalse:[
  1338     self enablingCommitButtonsHolder value ifFalse:[
  1342         ^ listOfTabs notEmpty
  1339         ^ listOfTabs notEmpty
  1343     ].
  1340     ].
  1344     ^ false
  1341     ^ false
  1345 ! !
  1342 ! !
  1346 
  1343 
  1380     ] ifFalse:[
  1377     ] ifFalse:[
  1381         noteBookModel value:0
  1378         noteBookModel value:0
  1382     ].
  1379     ].
  1383     self cancel.
  1380     self cancel.
  1384     self hasSelectionHolder value:hasSelection.
  1381     self hasSelectionHolder value:hasSelection.
  1385     self valueOfCanPaste.
  1382     self canPasteHolder.
  1386 !
  1383 !
  1387 
  1384 
  1388 setSelection:anIndex
  1385 setSelection:anIndex
  1389     |index|
  1386     |index|
  1390 
  1387 
  1441         self setModified.
  1438         self setModified.
  1442     ].
  1439     ].
  1443 !
  1440 !
  1444 
  1441 
  1445 cancel
  1442 cancel
  1446     "cancel all changes
  1443     "cancel all changes"
  1447     "
  1444 
  1448     |tab idx asb|
  1445     |tab idx asb|
  1449 
  1446 
  1450     (     (idx := self selection) ~~ 0
  1447     (     (idx := self selection) ~~ 0
  1451      and:[(tab := self selectedElement) notNil]
  1448      and:[(tab := self selectedElement) notNil]
  1452     ) ifTrue:[
  1449     ) ifTrue:[
  1458                   ifFalse:[asb := 1].
  1455                   ifFalse:[asb := 1].
  1459 
  1456 
  1460         self autoHideScrollBars value:asb.
  1457         self autoHideScrollBars value:asb.
  1461     ].
  1458     ].
  1462     self canMoveTabItemUpOrDown value:(listOfTabs size > 1 and:[idx ~~ 0]).
  1459     self canMoveTabItemUpOrDown value:(listOfTabs size > 1 and:[idx ~~ 0]).
  1463     self valueOfEnablingCommitButtons value: false
  1460     self enablingCommitButtonsHolder value: false
  1464 
       
  1465 
       
  1466 
       
  1467 !
  1461 !
  1468 
  1462 
  1469 doCopy
  1463 doCopy
  1470     "copy selected tab
  1464     "copy selected tab
  1471     "
  1465     "