@@ -432,9 +432,12 @@ rect.y+=this.marginHeight;
432
432
rect . width -= 2 * this . marginWidth ;
433
433
rect . height -= 2 * this . marginHeight ;
434
434
for ( var i = 0 ; i < children . length ; i ++ ) {
435
+ if ( children [ i ] != this . topControl ) {
436
+ children [ i ] . handle . style . display = "none" ;
437
+ } else {
435
438
children [ i ] . setBounds ( rect ) ;
436
- children [ i ] . setVisible ( children [ i ] == this . topControl ) ;
437
- }
439
+ children [ i ] . handle . style . display = "block" ;
440
+ } }
438
441
} , "$wt.widgets.Composite,~B" ) ;
439
442
$_M ( c$ , "getName" ,
440
443
function ( ) {
@@ -2158,12 +2161,14 @@ this.rightEl=d$.createElement("DIV");
2158
2161
this . rightEl . className = this . cssClassForRight ( ) ;
2159
2162
this . handle . appendChild ( this . rightEl ) ;
2160
2163
this . configureRightEl ( ) ;
2164
+ this . parent . updateSelection ( this . parent . getSelectionIndex ( ) ) ;
2161
2165
} this . text = string ;
2162
2166
} , "~S" ) ;
2163
2167
$_M ( c$ , "configureRightEl" ,
2164
2168
function ( ) {
2165
2169
System . out . println ( "Show close : " + this . showClose ) ;
2166
- if ( this . showClose ) this . rightEl . onclick = $_Q ( ( function ( i$ , v$ ) {
2170
+ if ( this . showClose ) {
2171
+ this . rightEl . onclick = $_Q ( ( function ( i$ , v$ ) {
2167
2172
if ( ! $_D ( "org.eclipse.swt.custom.CTabItem$4" ) ) {
2168
2173
$_H ( ) ;
2169
2174
c$ = $_C ( function ( ) {
@@ -2193,7 +2198,41 @@ c$=$_P();
2193
2198
}
2194
2199
return $_N ( $wt . custom . CTabItem$4 , i$ , v$ ) ;
2195
2200
} ) ( this , null ) ) ;
2201
+ this . rightEl . onmouseover = $_Q ( ( function ( i$ , v$ ) {
2202
+ if ( ! $_D ( "org.eclipse.swt.custom.CTabItem$5" ) ) {
2203
+ $_H ( ) ;
2204
+ c$ = $_C ( function ( ) {
2205
+ $_B ( this , arguments ) ;
2206
+ $_Z ( this , arguments ) ;
2207
+ } , $wt . custom , "CTabItem$5" , $wt . internal . RunnableCompatibility ) ;
2208
+ $_V ( c$ , "run" ,
2209
+ function ( ) {
2210
+ this . b$ [ "$wt.custom.CTabItem" ] . prepareCloseBtn ( true ) ;
2211
+ this . b$ [ "$wt.custom.CTabItem" ] . rightEl . className = this . b$ [ "$wt.custom.CTabItem" ] . rightEl . className . trim ( ) + "-hover" ;
2196
2212
} ) ;
2213
+ c$ = $_P ( ) ;
2214
+ }
2215
+ return $_N ( $wt . custom . CTabItem$5 , i$ , v$ ) ;
2216
+ } ) ( this , null ) ) ;
2217
+ this . rightEl . onmouseout = $_Q ( ( function ( i$ , v$ ) {
2218
+ if ( ! $_D ( "org.eclipse.swt.custom.CTabItem$6" ) ) {
2219
+ $_H ( ) ;
2220
+ c$ = $_C ( function ( ) {
2221
+ $_B ( this , arguments ) ;
2222
+ $_Z ( this , arguments ) ;
2223
+ } , $wt . custom , "CTabItem$6" , $wt . internal . RunnableCompatibility ) ;
2224
+ $_V ( c$ , "run" ,
2225
+ function ( ) {
2226
+ this . b$ [ "$wt.custom.CTabItem" ] . prepareCloseBtn ( false ) ;
2227
+ var idx = this . b$ [ "$wt.custom.CTabItem" ] . rightEl . className . indexOf ( "-hover" ) ;
2228
+ if ( idx >= 0 ) {
2229
+ this . b$ [ "$wt.custom.CTabItem" ] . rightEl . className = this . b$ [ "$wt.custom.CTabItem" ] . rightEl . className . substring ( 0 , idx ) ;
2230
+ } } ) ;
2231
+ c$ = $_P ( ) ;
2232
+ }
2233
+ return $_N ( $wt . custom . CTabItem$6 , i$ , v$ ) ;
2234
+ } ) ( this , null ) ) ;
2235
+ } } ) ;
2197
2236
$_M ( c$ , "setToolTipText" ,
2198
2237
function ( string ) {
2199
2238
this . toolTipText = string ;
@@ -2227,14 +2266,14 @@ this.handle=null;
2227
2266
} ) ;
2228
2267
$_M ( c$ , "prepareCloseBtn" ,
2229
2268
function ( $in ) {
2230
- var key = "ctab-item-attach-close-right" ;
2269
+ var key = " ctab-item-attach-close-right" ;
2231
2270
if ( this . isSelected || ! this . parent . showClose ) {
2232
2271
return ;
2233
2272
} var idx = this . rightEl . className . indexOf ( key ) ;
2234
2273
if ( idx != - 1 ) {
2235
2274
this . rightEl . className = this . rightEl . className . substring ( 0 , idx ) + this . rightEl . className . substring ( idx + key . length ) ;
2236
2275
} if ( $in ) {
2237
- this . rightEl . className += " ctab-item-attach-close-right " ;
2276
+ this . rightEl . className += " ctab-item-attach-close-right" ;
2238
2277
} this . handle . style . height = ( O$ . getContainerHeight ( this . textEl ) + 1 ) + "px" ;
2239
2278
this . rightEl . style . height = ( O$ . getContainerHeight ( this . textEl ) + 1 ) + "px" ;
2240
2279
} , "~B" ) ;
@@ -3213,13 +3252,15 @@ this.setSelection(index,false);
3213
3252
$_M ( c$ , "setSelection" ,
3214
3253
function ( index , notify ) {
3215
3254
var oldIndex = this . getSelectionIndex ( ) ;
3255
+ System . out . println ( "setselection called! at " + oldIndex + " at " + index ) ;
3216
3256
if ( oldIndex == index ) {
3217
3257
return ;
3218
3258
} if ( oldIndex != - 1 ) {
3219
3259
var item = this . items [ oldIndex ] ;
3220
3260
var control = item . control ;
3221
3261
if ( control != null && ! control . isDisposed ( ) ) {
3222
3262
control . setVisible ( false ) ;
3263
+ control . handle . style . display = "none" ;
3223
3264
} } this . updateSelection ( index ) ;
3224
3265
var newIndex = index ;
3225
3266
if ( newIndex != - 1 ) {
@@ -3229,6 +3270,7 @@ var control=item.control;
3229
3270
if ( control != null && ! control . isDisposed ( ) ) {
3230
3271
control . setBounds ( this . getClientArea ( ) ) ;
3231
3272
control . setVisible ( true ) ;
3273
+ control . handle . style . display = "block" ;
3232
3274
} if ( notify ) {
3233
3275
var event = new $wt . widgets . Event ( ) ;
3234
3276
event . item = item ;
@@ -3250,6 +3292,7 @@ var idx=cssName.indexOf(key);
3250
3292
if ( idx != - 1 ) {
3251
3293
this . items [ i ] . handle . className = cssName . substring ( 0 , idx ) + cssName . substring ( idx + key . length ) ;
3252
3294
this . items [ i ] . rightEl . className = this . items [ i ] . cssClassForRight ( ) ;
3295
+ var el = this . buttonArea ;
3253
3296
this . items [ i ] . handle . style . height = ( O$ . getContainerHeight ( this . buttonArea ) - 3 ) + "px" ;
3254
3297
this . items [ i ] . isSelected = false ;
3255
3298
if ( i > index ) {
@@ -3271,14 +3314,13 @@ if(ww>0){
3271
3314
if ( cssName == null ) cssName = "" ;
3272
3315
var idx = cssName . indexOf ( key ) ;
3273
3316
if ( idx == - 1 ) {
3274
- var w = O$ . getContainerWidth ( this . items [ index ] . rightEl ) + O$ . getContainerWidth ( this . items [ index ] . textEl ) ;
3275
3317
this . items [ index ] . handle . className += " " + key ;
3276
3318
this . items [ index ] . rightEl . className = this . items [ index ] . cssClassForRight ( ) ;
3277
3319
this . items [ index ] . handle . style . height = ( O$ . getContainerHeight ( this . buttonArea ) + 3 ) + "px" ;
3278
3320
this . items [ index ] . rightEl . style . height = this . items [ index ] . handle . style . height ;
3279
3321
this . items [ index ] . isSelected = true ;
3322
+ var w = O$ . getContainerWidth ( this . items [ index ] . rightEl ) + O$ . getContainerWidth ( this . items [ index ] . textEl ) ;
3280
3323
if ( ! this . simple ) {
3281
- w += 24 ;
3282
3324
} var s = this . items [ index ] . handle . style ;
3283
3325
s . width = w + "px" ;
3284
3326
} this . items [ index ] . handle . style . zIndex = ( this . items . length + 1 ) + "" ;
0 commit comments