@@ -432,9 +432,12 @@ rect.y+=this.marginHeight;
432432rect . width -= 2 * this . marginWidth ;
433433rect . height -= 2 * this . marginHeight ;
434434for ( var i = 0 ; i < children . length ; i ++ ) {
435+ if ( children [ i ] != this . topControl ) {
436+ children [ i ] . handle . style . display = "none" ;
437+ } else {
435438children [ i ] . setBounds ( rect ) ;
436- children [ i ] . setVisible ( children [ i ] == this . topControl ) ;
437- }
439+ children [ i ] . handle . style . display = "block" ;
440+ } }
438441} , "$wt.widgets.Composite,~B" ) ;
439442$_M ( c$ , "getName" ,
440443function ( ) {
@@ -2158,12 +2161,14 @@ this.rightEl=d$.createElement("DIV");
21582161this . rightEl . className = this . cssClassForRight ( ) ;
21592162this . handle . appendChild ( this . rightEl ) ;
21602163this . configureRightEl ( ) ;
2164+ this . parent . updateSelection ( this . parent . getSelectionIndex ( ) ) ;
21612165} this . text = string ;
21622166} , "~S" ) ;
21632167$_M ( c$ , "configureRightEl" ,
21642168function ( ) {
21652169System . 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$ ) {
21672172if ( ! $_D ( "org.eclipse.swt.custom.CTabItem$4" ) ) {
21682173$_H ( ) ;
21692174c$ = $_C ( function ( ) {
@@ -2193,7 +2198,41 @@ c$=$_P();
21932198}
21942199return $_N ( $wt . custom . CTabItem$4 , i$ , v$ ) ;
21952200} ) ( 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" ;
21962212} ) ;
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+ } } ) ;
21972236$_M ( c$ , "setToolTipText" ,
21982237function ( string ) {
21992238this . toolTipText = string ;
@@ -2227,14 +2266,14 @@ this.handle=null;
22272266} ) ;
22282267$_M ( c$ , "prepareCloseBtn" ,
22292268function ( $in ) {
2230- var key = "ctab-item-attach-close-right" ;
2269+ var key = " ctab-item-attach-close-right" ;
22312270if ( this . isSelected || ! this . parent . showClose ) {
22322271return ;
22332272} var idx = this . rightEl . className . indexOf ( key ) ;
22342273if ( idx != - 1 ) {
22352274this . rightEl . className = this . rightEl . className . substring ( 0 , idx ) + this . rightEl . className . substring ( idx + key . length ) ;
22362275} if ( $in ) {
2237- this . rightEl . className += " ctab-item-attach-close-right " ;
2276+ this . rightEl . className += " ctab-item-attach-close-right" ;
22382277} this . handle . style . height = ( O$ . getContainerHeight ( this . textEl ) + 1 ) + "px" ;
22392278this . rightEl . style . height = ( O$ . getContainerHeight ( this . textEl ) + 1 ) + "px" ;
22402279} , "~B" ) ;
@@ -3213,13 +3252,15 @@ this.setSelection(index,false);
32133252$_M ( c$ , "setSelection" ,
32143253function ( index , notify ) {
32153254var oldIndex = this . getSelectionIndex ( ) ;
3255+ System . out . println ( "setselection called! at " + oldIndex + " at " + index ) ;
32163256if ( oldIndex == index ) {
32173257return ;
32183258} if ( oldIndex != - 1 ) {
32193259var item = this . items [ oldIndex ] ;
32203260var control = item . control ;
32213261if ( control != null && ! control . isDisposed ( ) ) {
32223262control . setVisible ( false ) ;
3263+ control . handle . style . display = "none" ;
32233264} } this . updateSelection ( index ) ;
32243265var newIndex = index ;
32253266if ( newIndex != - 1 ) {
@@ -3229,6 +3270,7 @@ var control=item.control;
32293270if ( control != null && ! control . isDisposed ( ) ) {
32303271control . setBounds ( this . getClientArea ( ) ) ;
32313272control . setVisible ( true ) ;
3273+ control . handle . style . display = "block" ;
32323274} if ( notify ) {
32333275var event = new $wt . widgets . Event ( ) ;
32343276event . item = item ;
@@ -3250,6 +3292,7 @@ var idx=cssName.indexOf(key);
32503292if ( idx != - 1 ) {
32513293this . items [ i ] . handle . className = cssName . substring ( 0 , idx ) + cssName . substring ( idx + key . length ) ;
32523294this . items [ i ] . rightEl . className = this . items [ i ] . cssClassForRight ( ) ;
3295+ var el = this . buttonArea ;
32533296this . items [ i ] . handle . style . height = ( O$ . getContainerHeight ( this . buttonArea ) - 3 ) + "px" ;
32543297this . items [ i ] . isSelected = false ;
32553298if ( i > index ) {
@@ -3271,14 +3314,13 @@ if(ww>0){
32713314if ( cssName == null ) cssName = "" ;
32723315var idx = cssName . indexOf ( key ) ;
32733316if ( idx == - 1 ) {
3274- var w = O$ . getContainerWidth ( this . items [ index ] . rightEl ) + O$ . getContainerWidth ( this . items [ index ] . textEl ) ;
32753317this . items [ index ] . handle . className += " " + key ;
32763318this . items [ index ] . rightEl . className = this . items [ index ] . cssClassForRight ( ) ;
32773319this . items [ index ] . handle . style . height = ( O$ . getContainerHeight ( this . buttonArea ) + 3 ) + "px" ;
32783320this . items [ index ] . rightEl . style . height = this . items [ index ] . handle . style . height ;
32793321this . items [ index ] . isSelected = true ;
3322+ var w = O$ . getContainerWidth ( this . items [ index ] . rightEl ) + O$ . getContainerWidth ( this . items [ index ] . textEl ) ;
32803323if ( ! this . simple ) {
3281- w += 24 ;
32823324} var s = this . items [ index ] . handle . style ;
32833325s . width = w + "px" ;
32843326} this . items [ index ] . handle . style . zIndex = ( this . items . length + 1 ) + "" ;