Advertisement
Guest User

Untitled

a guest
Jan 30th, 2013
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. qx.Class.define('qx.ui.mobile.list.renderer.CheckBoxListItemRenderer', {
  2.   extend : qx.ui.mobile.list.renderer.Abstract,
  3.  
  4.   // overridden
  5.   construct : function () {
  6.     this.base( arguments, new qx.ui.mobile.layout.HBox().set( { alignY: 'middle' } ) );
  7.     this._init();
  8.   },
  9.  
  10.   members : {
  11.     __title : null,
  12.     __subtitle : null,
  13.     __checkbox : null,
  14.     __leftContainer : null,
  15.  
  16.     getTitle : function () {
  17.       return this.__title.getValue()
  18.     },
  19.  
  20.     setTitle : function (title) {
  21.       this.__title.setValue( title );
  22.     },
  23.  
  24.     getSubTitle : function () {
  25.       return this.__subtitle.getValue();
  26.     },
  27.  
  28.     setSubTitle : function (subtitle) {
  29.       this.__subtitle.setValue( subtitle );
  30.     },
  31.  
  32.     getValue : function () {
  33.       return this.__checkbox.getValue();
  34.     },
  35.  
  36.     setValue : function (checked) {
  37.       this.__checkbox.setValue( checked );
  38.     },
  39.  
  40.     _init : function () {
  41.       this.__leftContainer = this._createLeftContainer();
  42.       this.add( this.__leftContainer, { flex: 1 } );
  43.  
  44.       this.__title = this._createTitle();
  45.       this.__leftContainer.add( this.__title );
  46.  
  47.       this.__subtitle = this._createSubTitle();
  48.       this.__leftContainer.add( this.__subtitle );
  49.  
  50.  
  51.       this.__checkbox = this._createCheckBox();
  52.       this.add( this.__checkbox );
  53.     },
  54.  
  55.     _createLeftContainer : function () {
  56.       return new qx.ui.mobile.container.Composite( new qx.ui.mobile.layout.VBox() );
  57.     },
  58.  
  59.     _createTitle : function () {
  60.       var title = new qx.ui.mobile.basic.Label();
  61.       title.addCssClass( 'list-itemlabel' );
  62.  
  63.       return title;
  64.     },
  65.  
  66.     _createSubTitle : function () {
  67.       var subtitle = new qx.ui.mobile.basic.Label();
  68.       subtitle.addCssClass( 'subtitle' );
  69.  
  70.       return subtitle;
  71.     },
  72.  
  73.     _createCheckBox : function () {
  74.       var checkbox = new qx.ui.mobile.form.CheckBoxListCheckBox();
  75.  
  76.       return checkbox;
  77.     },
  78.  
  79.     // overridden
  80.     _applyShowArrow : function (value, old) {
  81.       return;
  82.     },
  83.  
  84.     // overriden
  85.     reset : function () {
  86.       this.__title.setValue( '' );
  87.       this.__subtitle.setValue( '' );
  88.       this.__checkbox.setValue( false );
  89.     }
  90.   },
  91.  
  92.   // overriden
  93.   destruct : function () {
  94.     this._disposeObjects( '__title', '__subtitle', '__checkbox', '__leftContainer' );
  95.   }
  96. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement