Bookmark.st
branchjv
changeset 12123 4bde08cebd48
parent 10910 0d207c02ed40
child 12125 0c49a3b13e43
equal deleted inserted replaced
11227:3d57003855a7 12123:4bde08cebd48
   214 !
   214 !
   215 
   215 
   216 icon
   216 icon
   217     "superclass BookmarkEntry says that I am responsible to implement this method"
   217     "superclass BookmarkEntry says that I am responsible to implement this method"
   218     
   218     
   219     icon isNil ifTrue:[ self initializeIcon ].
   219     icon ifNil:[ self initializeIcon ].
   220     ^ icon
   220     ^ icon
   221 
   221 
   222     "Created: / 05-05-2011 / 22:52:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   222     "Created: / 05-05-2011 / 22:52:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   223     "Modified: / 18-11-2011 / 14:30:44 / cg"
       
   224 !
   223 !
   225 
   224 
   226 label
   225 label
   227     "superclass BookmarkEntry says that I am responsible to implement this method"
   226     "superclass BookmarkEntry says that I am responsible to implement this method"
   228     
   227     
   229     label isNil ifTrue:[ self initializeLabel ].
   228     label ifNil:[ self initializeLabel ].
   230     ^label isNil 
   229     ^label 
   231         ifTrue:[ self defaultLabel ]
   230         ifNil:[ self defaultLabel ]
   232         ifFalse: [ label ].
   231         ifNotNil: [ label ].
   233 
   232 
   234     "Created: / 05-05-2011 / 22:56:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   233     "Created: / 05-05-2011 / 22:56:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   235     "Modified: / 02-06-2011 / 11:56:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   234     "Modified: / 02-06-2011 / 11:56:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   236     "Modified (format): / 18-11-2011 / 14:31:05 / cg"
       
   237 !
   235 !
   238 
   236 
   239 label: aStringOrText
   237 label: aStringOrText
   240 
   238 
   241     label := aStringOrText.
   239     label := aStringOrText.
   438 className: aString
   436 className: aString
   439 
   437 
   440     className := aString.
   438     className := aString.
   441 
   439 
   442     (className endsWith: ' class') ifTrue:[
   440     (className endsWith: ' class') ifTrue:[
   443         className := className copyTo: (className size - 6)"/ ' class' size - 1
   441         className := className copyTo: (className size - 7)"/ ' class' size - 1
   444     ].
   442     ].
   445 
   443 
   446     className := className asSymbol.
   444     className := className asSymbol.
   447 
   445 
   448     "Modified: / 18-10-2011 / 13:33:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   446     "Modified: / 30-06-2011 / 19:13:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   449 ! !
   447 ! !
   450 
   448 
   451 !Bookmark::Class methodsFor:'accessing defaults'!
   449 !Bookmark::Class methodsFor:'accessing defaults'!
   452 
   450 
   453 defaultLabel
   451 defaultLabel
   491 
   489 
   492 initializeIcon
   490 initializeIcon
   493 
   491 
   494     | cls |
   492     | cls |
   495     cls :=  Smalltalk at: className asSymbol.
   493     cls :=  Smalltalk at: className asSymbol.
   496     cls notNil ifTrue:[icon := SystemBrowser iconForClass: cls].
   494     cls ifNotNil:[icon := SystemBrowser iconForClass: cls].
   497 
   495 
   498     "Created: / 05-05-2011 / 23:01:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   496     "Created: / 05-05-2011 / 23:01:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   499     "Modified: / 30-06-2011 / 19:10:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   497     "Modified: / 30-06-2011 / 19:10:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   500     "Modified: / 29-11-2011 / 11:20:52 / cg"
       
   501 !
   498 !
   502 
   499 
   503 initializeLabel
   500 initializeLabel
   504 
   501 
   505     className isNil ifTrue:[^self].
   502     className ifNil:[^self].
   506 
   503 
   507     label := className copyFrom: (className lastIndexOf: $:) + 1
   504     label := className copyFrom: (className lastIndexOf: $:) + 1
   508 
   505 
   509     "Created: / 05-05-2011 / 23:03:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   506     "Created: / 05-05-2011 / 23:03:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   510     "Modified: / 02-06-2011 / 11:57:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   507     "Modified: / 02-06-2011 / 11:57:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   511     "Modified: / 18-11-2011 / 14:31:11 / cg"
       
   512 ! !
   508 ! !
   513 
   509 
   514 !Bookmark::Class methodsFor:'testing'!
   510 !Bookmark::Class methodsFor:'testing'!
   515 
   511 
   516 isClassBookmark
   512 isClassBookmark
   674 !
   670 !
   675 
   671 
   676 moveOut: child
   672 moveOut: child
   677 
   673 
   678     | index myindex |
   674     | index myindex |
   679     self parent isNil ifTrue:[^self].
   675     self parent ifNil:[^self].
   680     index := children identityIndexOf: child.
   676     index := children identityIndexOf: child.
   681     myindex := self parent children identityIndexOf: self.
   677     myindex := self parent children identityIndexOf: self.
   682     self removeIndex: index. 
   678     self removeIndex: index. 
   683     self parent add: child afterIndex: myindex.
   679     self parent add: child afterIndex: myindex.
   684 
   680 
   685     "Created: / 03-06-2011 / 10:32:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   681     "Created: / 03-06-2011 / 10:32:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   686     "Modified: / 18-11-2011 / 14:31:15 / cg"
       
   687 !
   682 !
   688 
   683 
   689 moveUp: child
   684 moveUp: child
   690 
   685 
   691     | index |
   686     | index |
   763 
   758 
   764 !Bookmark::Method methodsFor:'private'!
   759 !Bookmark::Method methodsFor:'private'!
   765 
   760 
   766 initializeLabel
   761 initializeLabel
   767 
   762 
   768     className isNil ifTrue:[^self].
   763     className ifNil:[^self].
   769     selector  isNil ifTrue:[^self].
   764     selector  ifNil:[^self].
   770 
   765 
   771     label :=
   766     label :=
   772         (className copyFrom: ((className lastIndexOf: $:) + 1)) asText allBold ,
   767         (className copyFrom: ((className lastIndexOf: $:) + 1)) asText allBold ,
   773         ' >> ' , (selector asText "allItalic")
   768         ' >> ' , (selector asText "allItalic")
   774 
   769 
   775     "Created: / 05-05-2011 / 23:04:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   770     "Created: / 05-05-2011 / 23:04:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   776     "Modified: / 02-06-2011 / 22:00:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   771     "Modified: / 02-06-2011 / 22:00:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   777     "Modified: / 18-11-2011 / 14:31:19 / cg"
       
   778 ! !
   772 ! !
   779 
   773 
   780 !Bookmark::Method methodsFor:'testing'!
   774 !Bookmark::Method methodsFor:'testing'!
   781 
   775 
   782 isMethodBookmark
   776 isMethodBookmark
   898 ! !
   892 ! !
   899 
   893 
   900 !Bookmark class methodsFor:'documentation'!
   894 !Bookmark class methodsFor:'documentation'!
   901 
   895 
   902 version_CVS
   896 version_CVS
   903     ^ '$Header: /cvs/stx/stx/libtool/Bookmark.st,v 1.8 2011-11-29 10:20:58 cg Exp $'
   897     ^ '§Header: /cvs/stx/stx/libtool/Bookmark.st,v 1.5 2011/07/08 09:40:06 cg Exp §'
   904 !
   898 !
   905 
   899 
   906 version_SVN
   900 version_SVN
   907     ^ '§Id§'
   901     ^ '$Id$'
   908 ! !
   902 ! !