Skip to content

Instantly share code, notes, and snippets.

@eiswind
Created August 11, 2012 05:15
Show Gist options
  • Save eiswind/3321343 to your computer and use it in GitHub Desktop.
Save eiswind/3321343 to your computer and use it in GitHub Desktop.
Render Row IDs on Eclipse RAP for UI testing (Snippet for TreeRowContainer.js)
_updateRows : function( from, delta, contentOnly ) {
this._updateRowsEvenState();
var item = this._topItem;
var to = from + delta;
var row = 0;
while( item != null && row < this._children.length ) {
if( row >= from && row <= to ) {
this._renderRow( this._children[ row ], item, contentOnly );
this._items[ row ] = item;
}
item = item.getNextItem();
row++;
}
for( var i = row; i < this._children.length; i++ ) {
this._renderRow( this._children[ i ], null, contentOnly );
this._items[ i ] = null;
if( qx.ui.core.Widget._renderHtmlIds ) {
this._children[ i ].applyObjectId('row_'+ this._generateId(i));
}
}
},
_generateId : function( id ) {
var s = String(id);
var result = '';
for( var i = 0; i< s.length; i++){
var ch = s.charAt(i);
result = result + 'abcdefghijklmnopqrstuvwxyz'[(ch-0)];
}
return result;
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment