Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 351550
Collapse All | Expand All

(-)js/org/eclipse/rwt/TreeRowContainerWrapper.js (-2 / +2 lines)
Lines 121-127 Link Here
121
    this._rowWidth = value;
121
    this._rowWidth = value;
122
    this._layoutX();
122
    this._layoutX();
123
  },
123
  },
124
  
124
125
  setScrollLeft : function( value ) {
125
  setScrollLeft : function( value ) {
126
    this._container[ 1 ].setScrollLeft( value );
126
    this._container[ 1 ].setScrollLeft( value );
127
  },
127
  },
Lines 146-152 Link Here
146
    this._container[ 0 ].renderAll();
146
    this._container[ 0 ].renderAll();
147
    this._container[ 1 ].renderAll();
147
    this._container[ 1 ].renderAll();
148
  },
148
  },
149
  
149
150
  _updateConfig : function() {
150
  _updateConfig : function() {
151
    var configLeft = this._container[ 0 ].getRenderConfig();
151
    var configLeft = this._container[ 0 ].getRenderConfig();
152
    var configRight = this._container[ 1 ].getRenderConfig();
152
    var configRight = this._container[ 1 ].getRenderConfig();
(-)js/org/eclipse/rwt/widgets/TreeRowContainer.js (-9 / +15 lines)
Lines 140-150 Link Here
140
      for( var i = 0; i < linesNeeded; i++ ) {
140
      for( var i = 0; i < linesNeeded; i++ ) {
141
        this._renderVerticalGridline( i );          
141
        this._renderVerticalGridline( i );          
142
      }
142
      }
143
      while( this._vertGridLines.length > linesNeeded ) {
143
      for( var i = linesNeeded; i < this._vertGridLines.length; i++ ) {
144
        var line = this._vertGridLines.pop();
144
        this._removeGridLine( i );
145
        if( line ) {
146
          this._getTargetNode().removeChild( line );
147
        }
148
      }
145
      }
149
    },
146
    },
150
147
Lines 156-166 Link Here
156
        var line = this._getVerticalGridline( column );
153
        var line = this._getVerticalGridline( column );
157
        line.style.left = left + "px";
154
        line.style.left = left + "px";
158
        line.style.height = this.getHeight() + "px";
155
        line.style.height = this.getHeight() + "px";
156
      } else {
157
        this._removeGridLine( column );
159
      }
158
      }
160
    },
159
    },
161
160
162
    _getVerticalGridline : function( number ) {
161
    _getVerticalGridline : function( column ) {
163
      if( typeof this._vertGridLines[ number ] === "undefined" ) {
162
      if( typeof this._vertGridLines[ column ] === "undefined" ) {
164
        var line = document.createElement( "div" );
163
        var line = document.createElement( "div" );
165
        line.style.zIndex = 1;
164
        line.style.zIndex = 1;
166
        line.style.position = "absolute";
165
        line.style.position = "absolute";
Lines 174-182 Link Here
174
            this._getTargetNode().appendChild( line );
173
            this._getTargetNode().appendChild( line );
175
          }, this );
174
          }, this );
176
        }
175
        }
177
        this._vertGridLines[ number ] = line;
176
        this._vertGridLines[ column ] = line;
177
      }
178
      return this._vertGridLines[ column ];
179
    },
180
181
    _removeGridLine : function( column ) {
182
      if( this._vertGridLines[ column ] ) {
183
        this._getTargetNode().removeChild( this._vertGridLines[ column ] );
184
        delete this._vertGridLines[ column ];
178
      }
185
      }
179
      return this._vertGridLines[ number ];
180
    },
186
    },
181
187
182
    _getVerticalGridBorder : function() {
188
    _getVerticalGridBorder : function() {
(-)js/org/eclipse/rwt/test/tests/TreeUtilTest.js (-1 / +38 lines)
Lines 401-407 Link Here
401
      tree.destroy();
401
      tree.destroy();
402
    },
402
    },
403
403
404
    testLinesVisibleForSplitTree: function() {
404
    testLinesVisibleForSplitTree : function() {
405
      var testUtil = org.eclipse.rwt.test.fixture.TestUtil;
405
      var testUtil = org.eclipse.rwt.test.fixture.TestUtil;
406
      var tree = this._createSplitTree();
406
      var tree = this._createSplitTree();
407
      for( var i = 0; i < 5; i++ ) {
407
      for( var i = 0; i < 5; i++ ) {
Lines 422-427 Link Here
422
      tree.destroy();
422
      tree.destroy();
423
    },
423
    },
424
424
425
    testVerticalGridLayoutOnSplitTree : function() {
426
      var testUtil = org.eclipse.rwt.test.fixture.TestUtil;
427
      var tree = this._createSplitTree();
428
      testUtil.flush();
429
      var cont1 = tree.getRowContainer().getSubContainer( 0 )._getTargetNode();
430
      var cont2 = tree.getRowContainer().getSubContainer( 1 )._getTargetNode();
431
      var offset1 = cont1.childNodes.length;
432
      var offset2 = cont2.childNodes.length;
433
      tree.setLinesVisible( true );
434
      testUtil.flush();
435
      assertEquals( offset1 + 2, cont1.childNodes.length );
436
      assertEquals( offset2 + 3, cont2.childNodes.length ); // column count is 5
437
      assertEquals( 49, parseInt( cont1.childNodes[ offset1 ].style.left ) );
438
      assertEquals( 21, parseInt( cont1.childNodes[ offset1 + 1 ].style.left )  );
439
      assertEquals( 20, parseInt( cont2.childNodes[ offset2 ].style.left )  );
440
      assertEquals( 52, parseInt( cont2.childNodes[ offset2 + 1 ].style.left )  );
441
      assertEquals( 52, parseInt( cont2.childNodes[ offset2 + 2 ].style.left )  );
442
      tree.destroy();
443
    },
444
445
    testVerticalGridLayoutOnChangeFixedColumns : function() {
446
      var testUtil = org.eclipse.rwt.test.fixture.TestUtil;
447
      var tree = this._createSplitTree();
448
      testUtil.flush();
449
      var cont1 = tree.getRowContainer().getSubContainer( 0 )._getTargetNode();
450
      var cont2 = tree.getRowContainer().getSubContainer( 1 )._getTargetNode();
451
      var offset1 = cont1.childNodes.length;
452
      var offset2 = cont2.childNodes.length;
453
      tree.setLinesVisible( true );
454
      testUtil.flush();
455
      org.eclipse.rwt.TreeUtil.setFixedColumns( tree, 0 );
456
      testUtil.flush();
457
      assertEquals( offset1, cont1.childNodes.length );
458
      assertEquals( offset2 + 5, cont2.childNodes.length ); // column count is 5
459
      tree.destroy();
460
    },
461
425
    /////////
462
    /////////
426
    // helper
463
    // helper
427
    
464
    

Return to bug 351550