extensions.st
branchcvs_MAIN
changeset 4000 76dc79cc42a2
parent 3894 fd7498845be2
equal deleted inserted replaced
3999:d7c199709abd 4000:76dc79cc42a2
   307 
   307 
   308 
   308 
   309     | nm |
   309     | nm |
   310     nm := self asJavaComponentClassName.
   310     nm := self asJavaComponentClassName.
   311     (nm first == $L) ifTrue: [
   311     (nm first == $L) ifTrue: [
   312 	nm := nm copyFrom: 2 to: nm size - 1.
   312         nm := nm copyButFirstAndLast.
   313 	(nm includes: $/) ifTrue: [
   313         (nm includes: $/) ifTrue: [
   314 	    "/ No need to do another copt here!!
   314             "/ No need to do another copt here!!
   315 	    nm replaceAll: $/ with: $.
   315             nm replaceAll: $/ with: $.
   316 	].
   316         ].
   317     ] ifFalse:[
   317     ] ifFalse:[
   318 	(nm includes: $/) ifTrue: [
   318         (nm includes: $/) ifTrue: [
   319 	    nm := nm copyReplaceAll: $/ with: $.
   319             nm := nm copyReplaceAll: $/ with: $.
   320 	].
   320         ].
   321     ].
   321     ].
   322     ^ nm.
   322     ^ nm.
   323 
   323 
   324     "Created: / 21-10-2011 / 12:31:51 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
   324     "Created: / 21-10-2011 / 12:31:51 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
   325     "Created: / 30-10-2011 / 17:41:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   325     "Created: / 30-10-2011 / 17:41:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   356 asSTXInternalJavaClassName
   356 asSTXInternalJavaClassName
   357     | internalName |
   357     | internalName |
   358 
   358 
   359     internalName := self asJavaComponentClassName.
   359     internalName := self asJavaComponentClassName.
   360     (internalName startsWith: $L) ifTrue: [
   360     (internalName startsWith: $L) ifTrue: [
   361 	internalName := internalName copyFrom: 2 to: internalName size - 1
   361         internalName := internalName copyButFirstAndLast
   362     ].
   362     ].
   363     (internalName includes: $.) ifTrue: [
   363     (internalName includes: $.) ifTrue: [
   364 	internalName := internalName asString copyReplaceAll: $. with: $/
   364         internalName := internalName asString copyReplaceAll: $. with: $/
   365     ].
   365     ].
   366     ^internalName.
   366     ^internalName.
   367 ! !
   367 ! !
   368 
   368 
   369 !CharacterArray methodsFor:'java conversions'!
   369 !CharacterArray methodsFor:'java conversions'!
   371 asSlashedJavaClassName
   371 asSlashedJavaClassName
   372     "removes square brackets and adds slashes"
   372     "removes square brackets and adds slashes"
   373     | internalName |
   373     | internalName |
   374     internalName := self asJavaComponentClassName.
   374     internalName := self asJavaComponentClassName.
   375     (internalName first == $L) ifTrue: [
   375     (internalName first == $L) ifTrue: [
   376 	internalName := internalName copyFrom: 2 to: internalName size - 1.
   376         internalName := internalName copyButFirstAndLast.
   377 	"/ No need to do another copy here
   377         "/ No need to do another copy here
   378 	(internalName includes: $.) ifTrue: [
   378         (internalName includes: $.) ifTrue: [
   379 	    internalName replaceAll: $. with: $/
   379             internalName replaceAll: $. with: $/
   380 	].
   380         ].
   381     ] ifFalse:[
   381     ] ifFalse:[
   382 	(internalName includes: $.) ifTrue: [
   382         (internalName includes: $.) ifTrue: [
   383 	    internalName := internalName copyReplaceAll: $. with: $/
   383             internalName := internalName copyReplaceAll: $. with: $/
   384 	].
   384         ].
   385     ].
   385     ].
   386     ^ internalName.
   386     ^ internalName.
   387 
   387 
   388     "Created: / 21-10-2011 / 12:31:51 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
   388     "Created: / 21-10-2011 / 12:31:51 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
   389     "Created: / 30-10-2011 / 17:40:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   389     "Created: / 30-10-2011 / 17:40:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"