//##############################################################################
// The $class Library, version 1.5
// Copyright 2006, Jeff Lau
// License: http://creativecommons.org/licenses/LGPL/2.1/
// Contact: jlau@uselesspickles.com
// Web:     www.uselesspickles.com
//##############################################################################
// Packed with Dean Edwards' Packer: http://dean.edwards.name/packer/
//##############################################################################
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?"":e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('$v={2w:"1.5",1h:8(){1u{4.1m=2o}1U(1B){4.1m="2p"}4.1h=u("6 4.1m");6 4.1m},1k:8(){4.1C=1n("("+4.1h()+")");4.1k=u("6 4.1C");6 4.1C},1b:8(1f,24){c k=(K.15==2&&1f)?1f:{};c 1D=((K.15==2)?24:1f)||{};L(c i 1e 1D){k[i]=1D[i]}6 k},12:8(){}};8 $r(f){9(4 y $r){4.F=f;6}9(!f){$r.U=J;6}c 18=f.2q(".");c 19=$v.1k();L(c i=0;i<18.15;++i){c 16=19[18[i]];9(!16){16=a $r(18.2r(0,i+1).2s("."));19[18[i]]=16}19=16}$r.U=19}$r.q={C:8(){6 4.F},I:8(){6"[$r "+4.C()+"]"}};8 $3(f,j){9(4 y $3){4.F=f;4.1P=j.n;4.G=j.7;4.Q=j.p||(4.G==x?J:x);4.E={};9(4.G!=x){9(4.Q!=x){9(j.27$3){$v.12.q=4.Q.q;4.G.q=a $v.12();4.G.q.1x=4.G}4.E=$v.1b(4.Q.$3.E)}4.G.q.e$3=4}6}9($r.U){f=$r.U.C()+"."+f}c p=j.$S||x;c 1L=f.2t(/[^.]*\\./g,"");c 7=j.$1x||j[1L];c 1M$M=/\\2u\\.\\$M\\b/;c 25=/^\\s*8[^(]*\\([^)]*\\)[^{]*\\{\\s*(6)?\\s*;?\\s*\\}\\s*$/;9(!7){7=a u()}9(25.1N(7)){7.e$X=d;9(p!=x){7.e$1a=p.e$1a||p}}9(1M$M.1N(7)){7=$3.1p(7,p)}1I 9(!p.e$X){7=$3.1S(7,p)}7.$3=a $3(f,{7:7,p:p,27$3:d});9(j.$1K!=J){c t=j.$1K;9(!(t y 14)){t=[t]}L(c i=0,1g=t.15;i<1g;++i){$v.1b(7.$3.E,t[i].E)}}c 1w={$1x:d,$S:d,$1K:d,$10:d};1w[1L]=d;L(c A 1e j){9(1w.1R(A)){1G}c l=j[A];9(l y $3.1i){7[A]=l.l;1G}9(l y u&&1M$M.1N(l)){l=$3.1p(l,7.q[A])}7.q[A]=l}9(7.q.I==x.q.I){7.q.I=a u("6 \\"[1Y \\" + $3.1v(4) + \\"]\\";")}1n(f+" = 7;");9(j.$10){j.$10.2v(7)}}$3.q={C:8(){6 4.F},n:8(){6 4.1P},28:8(){6 4.G},29:8(){6 4.Q?4.Q.$3:J},2b:8(o){6 $3.1W(o,4.G)},1V:8(B){6 4.E.1R(B.C())},I:8(){6"[$3 "+4.F+"]"}};$3.1p=8(D,P){c k=a u("c m=K.1q;"+"c h=4.$M;"+"4.$M=m.e$11;"+"1u{6 m.e$W.13(4,K);}"+"2d{4.$M=h;}");k.e$W=D;k.e$11=P.e$1a||P;k.I=$3.1s;6 k};$3.1S=8(D,P){c k=a u("K.1q.e$11.13(4,K);"+(D.e$X?"":"K.1q.e$W.13(4,K);"));k.e$W=D;k.e$11=P.e$1a||P;k.I=$3.1s;9(D.e$X){k.e$1a=k.e$11}6 k};$3.1s=8(){6 N(4.e$W)};$3.1i=8(1t,l){4.1t=1t;4.l=l};$3.2f=8(1T){1u{6 1n("("+$v.1h()+"."+1T+")")}1U(1B){6 1z}};$3.1X=8(o,B){6 $3.1y(o).1V(B)};$3.1W=8(o,w){9(w y $H){6 $3.1X(o,w)}2h(2i o){T"1Y":6(o y w)||(o===J&&w==1c)||(o y R)&&(w==u);T"2j":6(w==1l);T"2k":6(w==N);T"2l":6(w==17);T"8":6(w==u)||(o y R)&&(w==R);T"1z":6(w==Z)}6 2m};$3.1v=8(o){6 $3.1y(o).C()};$3.1y=8(o){9(o==J){9(o===1z){6 Z.$3}6 1c.$3}6 o.e$3||x.$3};$3.2n=8(7,1A){9(7.$3&&7.$3.n()){6 7.13($v.1k(),1A)}1I{$v.12.q=7.q;c k=a $v.12();7.13(k,1A);6 k}};8 $H(f,j){9(4 y $H){4.F=f;4.O={};4.Y=J;4.E={};4.E[f]=4;6}9($r.U){f=$r.U.C()+"."+f}c B=a $H(f);9(j.$S!=J){c t=j.$S;9(!(t y 14)){t=[t]}L(c i=0,1g=t.15;i<1g;++i){$v.1b(B.O,t[i].O);$v.1b(B.E,t[i].E)}}L(c A 1e j){9(A=="$S"){1G}c l=j[A];9(l y $3.1i){B[A]=l.l}1I{B.O[A]=B.F}}1n(f+" = B;")}$H.q={C:8(){6 4.F},2a:8(1d){6 17(4.O[1d])},2c:8(){9(!4.Y){4.Y=[];L(c 1d 1e 4.O){4.Y.2e(1d)}}6 4.Y},I:8(){6"[$H "+4.F+"]"}};8 $2g(D){6 D}8 $10(l){6 a $3.1i("10",l)}8 $V(D){6 D}$r.$3=a $3("$r",{7:$r});$3.$3=a $3("$3",{7:$3});$H.$3=a $3("$H",{7:$H});x.$3=a $3("x",{n:d,7:x});x.e$X=d;14.$3=a $3("14",{n:d,7:14});N.$3=a $3("N",{n:d,7:N});1l.$3=a $3("1l",{n:d,7:1l});17.$3=a $3("17",{n:d,7:17});u.$3=a $3("u",{n:d,7:u});R.$3=a $3("R",{n:d,7:R,p:u});1E.$3=a $3("1E",{n:d,7:1E});z.$3=a $3("z",{n:d,7:z});1F.$3=a $3("1F",{n:d,7:1F,p:z});1H.$3=a $3("1H",{n:d,7:1H,p:z});1J.$3=a $3("1J",{n:d,7:1J,p:z});1O.$3=a $3("1O",{n:d,7:1O,p:z});1o.$3=a $3("1o",{n:d,7:1o,p:z});1r.$3=a $3("1r",{n:d,7:1r,p:z});$3("Z",{Z:$V(8(){1Z a z("20 21 22 23 Z 3.")})});$3("1c",{1c:$V(8(){1Z a z("20 21 22 23 1c 3.")})});$3("1Q",{$S:z,1Q:8(1j){4.1j=N(1j);4.f=$3.1v(4)},C:$V(8(){6 4.f}),26:$V(8(){6 4.1j}),I:$V(8(){6"[1B "+4.C()+"] "+4.26()})});',62,157,'|||class|this||return|ctor|function|if|new||var|true|_|name||||descriptor|result|value||isNative|obj|baseCtor|prototype|package||ifaces|Function|class_library|type|Object|instanceof|Error|propertyName|iface|getName|method|_interfaces|_name|_ctor|interface|toString|null|arguments|for|base|String|_methods|baseMethod|_baseCtor|RegExp|extends|case|_currentPackage|final|class_wrappedMethod|class_isTrivialCtor|_methodsArray|Undefined|static|class_baseMethod|_surrogateCtor|apply|Array|length|nextContext|Boolean|components|context|class_relevantImplementation|_copyObject|Null|methodName|in|obj1|ifacesLength|_getGlobalObjectName|_ModifiedProperty|message|_getGlobalObject|Number|_globalObjectName|eval|TypeError|_wrapExtendedMethod|callee|URIError|_wrappedMethod_toString|modifier|try|typeOf|specialProperties|constructor|getClass|undefined|args|error|_globalObject|source|Date|EvalError|continue|RangeError|else|ReferenceError|implements|ctorName|uses|test|SyntaxError|_isNative|Exception|hasOwnProperty|_wrapExtendedCtor|qualifiedName|catch|implementsInterface|instanceOf|implementationOf|object|throw|Attempted|instantiation|of|the|obj2|isTrivialCtor|getMessage|calledFrom|getConstructor|getSuperclass|hasMethod|isInstance|getMethods|finally|push|resolve|abstract|switch|typeof|number|string|boolean|false|instantiate|GLOBAL_NAMESPACE_OBJECT_NAME|self|split|slice|join|replace|bthis|call|version'.split('|'),0,{}))

var base2={name:"base2",version:"1.0 (beta 2)",exports:"Base,Package,Abstract,Module,Enumerable,Map,Collection,RegGrp,"+"assert,assertArity,assertType,assignID,copy,detect,extend,"+"forEach,format,global,instanceOf,match,rescape,slice,trim,typeOf,"+"I,K,Undefined,Null,True,False,bind,delegate,flip,not,unbind",global:this,detect:new function(_){var global=_;var jscript=NaN/*@cc_on||@_jscript_version@*/;var java=_.java?true:false;if(_.navigator){var MSIE=/MSIE[\d.]+/g;var element=document.createElement("span");var userAgent=navigator.userAgent.replace(/([a-z])[\s\/](\d)/gi,"$1$2");if(!jscript)userAgent=userAgent.replace(MSIE,"");if(MSIE.test(userAgent))userAgent=userAgent.match(MSIE)[0]+" "+userAgent.replace(MSIE,"");userAgent=navigator.platform+" "+userAgent;java&=navigator.javaEnabled()}return function(a){var r=false;var b=a.charAt(0)=="!";if(b)a=a.slice(1);if(a.charAt(0)=="("){try{eval("r=!!"+a)}catch(e){}}else{r=new RegExp("("+a+")","i").test(userAgent)}return!!(b^r)}}(this)};new function(_){var _0="function base(o,a){return o.base.apply(o,a)};";eval(_0);var detect=base2.detect;var Undefined=K(),Null=K(null),True=K(true),False=K(false);var _1=/%([1-9])/g;var _2=/^\s\s*/;var _3=/\s\s*$/;var _4=/([\/()[\]{}|*+-.,^$?\\])/g;var _5=/eval/.test(detect)?/\bbase\s*\(/:/.*/;var _6=["constructor","toString","valueOf"];var _7=detect("(jscript)")?new RegExp("^"+rescape(isNaN).replace(/isNaN/,"\\w+")+"$"):{test:False};var _8=1;var _9=Array.prototype.slice;var slice=Array.slice||function(a){return _9.apply(a,_9.call(arguments,1))};_10();var _11=function(a,b){base2.__prototyping=this.prototype;var c=new this;extend(c,a);delete base2.__prototyping;var d=c.constructor;function e(){if(!base2.__prototyping){if(this.constructor==arguments.callee||this.__constructing){this.__constructing=true;d.apply(this,arguments);delete this.__constructing}else{return extend(arguments[0],c)}}return this};c.constructor=e;for(var i in Base)e[i]=this[i];e.ancestor=this;e.base=Undefined;e.init=Undefined;extend(e,b);e.prototype=c;e.init();return e};var Base=_11.call(Object,{constructor:function(){if(arguments.length>0){this.extend(arguments[0])}},base:function(){},extend:delegate(extend)},Base={ancestorOf:delegate(_12),extend:_11,forEach:delegate(_10),implement:function(a){if(typeof a=="function"){if(_12(Base,a)){a(this.prototype)}}else{extend(this.prototype,a)}return this}});var Package=Base.extend({constructor:function(d,e){this.extend(e);if(this.init)this.init();if(this.name!="base2"){if(!this.parent)this.parent=base2;this.parent.addName(this.name,this);this.namespace=format("var %1=%2;",this.name,String(this).slice(1,-1))}var f=/[^\s,]+/g;if(d){d.imports=Array2.reduce(this.imports.match(f),function(a,b){eval("var ns=base2."+b);assert(ns,format("Package not found: '%1'.",b),ReferenceError);return a+=ns.namespace},_0+base2.namespace+JavaScript.namespace);d.exports=Array2.reduce(this.exports.match(f),function(a,b){var c=this.name+"."+b;this.namespace+="var "+b+"="+c+";";return a+="if(!"+c+")"+c+"="+b+";"},"",this)}},exports:"",imports:"",name:"",namespace:"",parent:null,addName:function(a,b){if(!this[a]){this[a]=b;this.exports+=","+a;this.namespace+=format("var %1=%2.%1;",a,this.name)}},addPackage:function(a){this.addName(a,new Package(null,{name:a,parent:this}))},toString:function(){return format("[%1]",this.parent?String(this.parent).slice(1,-1)+"."+this.name:this.name)}});var Abstract=Base.extend({constructor:function(){throw new TypeError("Class cannot be instantiated.");}});var Module=Abstract.extend(null,{extend:function(a,b){var c=this.base();c.implement(this);c.implement(a);extend(c,b);c.init();return c},implement:function(d){var e=this;if(typeof d=="function"){if(!_12(d,e)){this.base(d)}if(_12(Module,d)){forEach(d,function(a,b){if(!e[b]){if(typeof a=="function"&&a.call&&d.prototype[b]){a=function(){return d[b].apply(d,arguments)}}e[b]=a}})}}else{extend(e,d);_10(Object,d,function(b,c){if(c.charAt(0)=="@"){if(detect(c.slice(1))){forEach(b,arguments.callee)}}else if(typeof b=="function"&&b.call){e.prototype[c]=function(){var a=_9.call(arguments);a.unshift(this);return e[c].apply(e,a)}}})}return e}});var Enumerable=Module.extend({every:function(c,d,e){var f=true;try{this.forEach(c,function(a,b){f=d.call(e,a,b,c);if(!f)throw StopIteration;})}catch(error){if(error!=StopIteration)throw error;}return!!f},filter:function(d,e,f){var i=0;return this.reduce(d,function(a,b,c){if(e.call(f,b,c,d)){a[i++]=b}return a},[])},invoke:function(b,c){var d=_9.call(arguments,2);return this.map(b,(typeof c=="function")?function(a){return(a==null)?undefined:c.apply(a,d)}:function(a){return(a==null)?undefined:a[c].apply(a,d)})},map:function(c,d,e){var f=[],i=0;this.forEach(c,function(a,b){f[i++]=d.call(e,a,b,c)});return f},pluck:function(b,c){return this.map(b,function(a){return(a==null)?undefined:a[c]})},reduce:function(c,d,e,f){var g=arguments.length>2;this.forEach(c,function(a,b){if(g){e=d.call(f,e,a,b,c)}else{e=a;g=true}});return e},some:function(a,b,c){return!this.every(a,not(b),c)}},{forEach:forEach});var _13="#";var Map=Base.extend({constructor:function(a){this.merge(a)},copy:delegate(copy),forEach:function(a,b){for(var c in this)if(c.charAt(0)==_13){a.call(b,this[c],c.slice(1),this)}},get:function(a){return this[_13+a]},getKeys:function(){return this.map(flip(I))},getValues:function(){return this.map(I)},has:function(a){/*@cc_on@*//*@if(@_14<5.5)return $Legacy.has(this,_13+a);@else@*/return _13+a in this;/*@end@*/},merge:function(b){var c=flip(this.put);forEach(arguments,function(a){forEach(a,c,this)},this);return this},remove:function(a){delete this[_13+a]},put:function(a,b){if(arguments.length==1)b=a;this[_13+a]=b},size:function(){var a=0;for(var b in this)if(b.charAt(0)==_13)a++;return a},union:function(a){return this.merge.apply(this.copy(),arguments)}});Map.implement(Enumerable);var _15="~";var Collection=Map.extend({constructor:function(a){this[_15]=new Array2;this.base(a)},add:function(a,b){assert(!this.has(a),"Duplicate key '"+a+"'.");this.put.apply(this,arguments)},copy:function(){var a=this.base();a[_15]=this[_15].copy();return a},forEach:function(a,b){var c=this[_15];var d=c.length;for(var i=0;i<d;i++){a.call(b,this[_13+c[i]],c[i],this)}},getAt:function(a){if(a<0)a+=this[_15].length;var b=this[_15][a];return(b===undefined)?undefined:this[_13+b]},getKeys:function(){return this[_15].concat()},indexOf:function(a){return this[_15].indexOf(String(a))},insertAt:function(a,b,c){assert(Math.abs(a)<this[_15].length,"Index out of bounds.");assert(!this.has(b),"Duplicate key '"+b+"'.");this[_15].insertAt(a,String(b));this[_13+b]==null;this.put.apply(this,_9.call(arguments,1))},item:function(a){return this[typeof a=="number"?"getAt":"get"](a)},put:function(a,b){if(arguments.length==1)b=a;if(!this.has(a)){this[_15].push(String(a))}var c=this.constructor;if(c.Item&&!instanceOf(b,c.Item)){b=c.create.apply(c,arguments)}this[_13+a]=b},putAt:function(a,b){assert(Math.abs(a)<this[_15].length,"Index out of bounds.");arguments[0]=this[_15].item(a);this.put.apply(this,arguments)},remove:function(a){if(this.has(a)){this[_15].remove(String(a));delete this[_13+a]}},removeAt:function(a){var b=this[_15].removeAt(a);delete this[_13+b]},reverse:function(){this[_15].reverse();return this},size:function(){return this[_15].length},sort:function(c){if(c){var d=this;this[_15].sort(function(a,b){return c(d[_13+a],d[_13+b],a,b)})}else this[_15].sort();return this},toString:function(){return String(this[_15])}},{Item:null,create:function(a,b){return this.Item?new this.Item(a,b):b},extend:function(a,b){var c=this.base(a);c.create=this.create;extend(c,b);if(!c.Item){c.Item=this.Item}else if(typeof c.Item!="function"){c.Item=(this.Item||Base).extend(c.Item)}c.init();return c}});var _16=/\\(\d+)/g,_17=/\\./g,_18=/\(\?[:=!]|\[[^\]]+\]/g,_19=/\(/g,_20=/\$(\d+)/,_21=/^\$\d+$/;var RegGrp=Collection.extend({constructor:function(a,b){this.base(a);if(typeof b=="string"){this.global=/g/.test(b);this.ignoreCase=/i/.test(b)}},global:true,ignoreCase:false,exec:function(f,g){var h=(this.global?"g":"")+(this.ignoreCase?"i":"");f=String(f)+"";if(arguments.length==1){var j=this;var k=this[_15];g=function(a){if(a){var b,c=1,i=0;while((b=j[_13+k[i++]])){var d=c+b.length+1;if(arguments[c]){var e=b.replacement;switch(typeof e){case"function":return e.apply(j,_9.call(arguments,c,d));case"number":return arguments[c+e];default:return e}}c=d}}return""}}return f.replace(new RegExp(this,h),g)},insertAt:function(a,b,c){if(instanceOf(b,RegExp)){arguments[1]=b.source}return base(this,arguments)},test:function(a){return this.exec(a)!=a},toString:function(){var e=0;return"("+this.map(function(c){var d=String(c).replace(_16,function(a,b){return"\\"+(1+Number(b)+e)});e+=c.length+1;return d}).join(")|(")+")"}},{IGNORE:"$0",init:function(){forEach("add,get,has,put,remove".split(","),function(b){_22(this,b,function(a){if(instanceOf(a,RegExp)){arguments[0]=a.source}return base(this,arguments)})},this.prototype)},Item:{constructor:function(a,b){if(typeof b=="number")b=String(b);else if(b==null)b="";if(typeof b=="string"&&_20.test(b)){if(_21.test(b)){b=parseInt(b.slice(1))}else{var Q=/'/.test(b.replace(/\\./g,""))?'"':"'";b=b.replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\$(\d+)/g,Q+"+(arguments[$1]||"+Q+Q+")+"+Q);b=new Function("return "+Q+b.replace(/(['"])\1\+(.*)\+\1\1$/,"$1")+Q)}}this.length=RegGrp.count(a);this.replacement=b;this.toString=K(String(a))},length:0,replacement:""},count:function(a){a=String(a).replace(_17,"").replace(_18,"");return match(a,_19).length}});var JavaScript={name:"JavaScript",version:base2.version,exports:"Array2,Date2,String2",namespace:"",bind:function(c){forEach(this.exports.match(/\w+/g),function(a){var b=a.slice(0,-1);extend(c[b],this[a]);this[a](c[b].prototype)},this);return this}};if((new Date).getYear()>1900){Date.prototype.getYear=function(){return this.getFullYear()-1900};Date.prototype.setYear=function(a){return this.setFullYear(a+1900)}}Function.prototype.prototype={};if("".replace(/^/,K("$$"))=="$"){extend(String.prototype,"replace",function(a,b){if(typeof b=="function"){var c=b;b=function(){return String(c.apply(null,arguments)).split("$").join("$$")}}return this.base(a,b)})}var Array2=_23(Array,Array,"concat,join,pop,push,reverse,shift,slice,sort,splice,unshift",[Enumerable,{combine:function(d,e){if(!e)e=d;return this.reduce(d,function(a,b,c){a[b]=e[c];return a},{})},contains:function(a,b){return this.indexOf(a,b)!=-1},copy:function(a){var b=_9.call(a);if(!b.swap)this(b);return b},flatten:function(c){var d=0;return this.reduce(c,function(a,b){if(this.like(b)){this.reduce(b,arguments.callee,a,this)}else{a[d++]=b}return a},[],this)},forEach:_24,indexOf:function(a,b,c){var d=a.length;if(c==null){c=0}else if(c<0){c=Math.max(0,d+c)}for(var i=c;i<d;i++){if(a[i]===b)return i}return-1},insertAt:function(a,b,c){this.splice(a,b,0,c);return c},item:function(a,b){if(b<0)b+=a.length;return a[b]},lastIndexOf:function(a,b,c){var d=a.length;if(c==null){c=d-1}else if(c<0){c=Math.max(0,d+c)}for(var i=c;i>=0;i--){if(a[i]===b)return i}return-1},map:function(c,d,e){var f=[];this.forEach(c,function(a,b){f[b]=d.call(e,a,b,c)});return f},remove:function(a,b){var c=this.indexOf(a,b);if(c!=-1)this.removeAt(a,c);return b},removeAt:function(a,b){return this.splice(a,b,1)},swap:function(a,b,c){if(b<0)b+=a.length;if(c<0)c+=a.length;var d=a[b];a[b]=a[c];a[c]=d;return a}}]);Array2.reduce=Enumerable.reduce;Array2.like=function(a){return!!(a&&typeof a=="object"&&typeof a.length=="number")};var _25=/^((-\d+|\d{4,})(-(\d{2})(-(\d{2}))?)?)?T((\d{2})(:(\d{2})(:(\d{2})(\.(\d{1,3})(\d)?\d*)?)?)?)?(([+-])(\d{2})(:(\d{2}))?|Z)?$/;var _26={FullYear:2,Month:4,Date:6,Hours:8,Minutes:10,Seconds:12,Milliseconds:14};var _27={Hectomicroseconds:15,UTC:16,Sign:17,Hours:18,Minutes:20};var _28=/(((00)?:0+)?:0+)?\.0+$/;var _29=/(T[0-9:.]+)$/;var Date2=_23(Date,function(a,b,c,h,m,s,d){switch(arguments.length){case 0:return new Date;case 1:return new Date(a);default:return new Date(a,b,arguments.length==2?1:c,h||0,m||0,s||0,d||0)}},"",[{toISOString:function(c){var d="####-##-##T##:##:##.###";for(var e in _26){d=d.replace(/#+/,function(a){var b=c["getUTC"+e]();if(e=="Month")b++;return("000"+b).slice(-a.length)})}return d.replace(_28,"").replace(_29,"$1Z")}}]);Date2.now=function(){return(new Date).valueOf()};Date2.parse=function(a,b){if(arguments.length>1){assertType(b,"number","defaultDate should be of type 'number'.")}var c=String(a).match(_25);if(c){if(c[_26.Month])c[_26.Month]--;if(c[_27.Hectomicroseconds]>=5)c[_26.Milliseconds]++;var d=new Date(b||0);var e=c[_27.UTC]||c[_27.Hours]?"UTC":"";for(var f in _26){var g=c[_26[f]];if(!g)continue;d["set"+e+f](g);if(d["get"+e+f]()!=c[_26[f]]){return NaN}}if(c[_27.Hours]){var h=Number(c[_27.Sign]+c[_27.Hours]);var i=Number(c[_27.Sign]+(c[_27.Minutes]||0));d.setUTCMinutes(d.getUTCMinutes()+(h*60)+i)}return d.valueOf()}else{return Date.parse(a)}};var String2=_23(String,function(a){return new String(arguments.length==0?"":a)},"charAt,charCodeAt,concat,indexOf,lastIndexOf,match,replace,search,slice,split,substr,substring,toLowerCase,toUpperCase",[{trim:trim}]);function _23(c,constructor,d,e){var f=Module.extend();forEach(d.match(/\w+/g),function(a){f[a]=unbind(c.prototype[a])});forEach(e,f.implement,f);var g=function(){return f(this.constructor==f?constructor.apply(null,arguments):arguments[0])};g.prototype=f.prototype;forEach(f,function(a,b){if(c[b]){f[b]=c[b];delete f.prototype[b]}g[b]=f[b]});g.ancestor=Object;delete g.extend;if(c!=Array)delete g.forEach;return g};function extend(a,b){if(a&&b){if(arguments.length>2){var c=b;b={};b[c]=arguments[2]}var d=(typeof b=="function"?Function:Object).prototype;var i=_6.length,c;if(base2.__prototyping){while(c=_6[--i]){var e=b[c];if(e!=d[c]){if(_5.test(e)){_22(a,c,e)}else{a[c]=e}}}}for(c in b){if(d[c]===undefined){var e=b[c];if(c.charAt(0)=="@"){if(detect(c.slice(1)))arguments.callee(a,e);continue}var f=a[c];if(f&&typeof e=="function"){if(e!=f&&(!f.method||!_12(e,f))){if(_5.test(e)){_22(a,c,e)}else{e.ancestor=f;a[c]=e}}}else{a[c]=e}}}}return a};function _12(a,b){while(b){if(!b.ancestor)return false;b=b.ancestor;if(b==a)return true}return false};function _22(c,d,e){var f=c[d];var g=base2.__prototyping;if(g&&f!=g[d])g=null;function h(){var a=this.base;this.base=g?g[d]:f;var b=e.apply(this,arguments);this.base=a;return b};h.ancestor=f;c[d]=h};if(typeof StopIteration=="undefined"){StopIteration=new Error("StopIteration")}function forEach(a,b,c,d){if(a==null)return;if(!d){if(typeof a=="function"&&a.call){d=Function}else if(typeof a.forEach=="function"&&a.forEach!=arguments.callee){a.forEach(b,c);return}else if(typeof a.length=="number"){_24(a,b,c);return}}_10(d||Object,a,b,c)};function _24(a,b,c){if(a==null)return;var d=a.length,i;if(typeof a=="string"){for(i=0;i<d;i++){b.call(c,a.charAt(i),i,a)}}else{for(i=0;i<d;i++){/*@cc_on@*//*@if(@_14<5.2)if($Legacy.has(a,i))@else@*/if(i in a)/*@end@*/b.call(c,a[i],i,a)}}};function _10(g,h,j,k){var l=function(){this.i=1};l.prototype={i:1};var m=0;for(var i in new l)m++;_10=(m>1)?function(a,b,c,d){var e={};for(var f in b){if(!e[f]&&a.prototype[f]===undefined){e[f]=true;c.call(d,b[f],f,b)}}}:function(a,b,c,d){for(var e in b){if(a.prototype[e]===undefined){c.call(d,b[e],e,b)}}};_10(g,h,j,k)};function typeOf(a){var b=typeof a;switch(b){case"object":return a===null?"null":typeof a.call=="function"||_7.test(a)?"function":b;case"function":return typeof a.call=="function"?b:"object";default:return b}};function instanceOf(a,b){if(typeof b!="function"){throw new TypeError("Invalid 'instanceOf' operand.");}if(a==null)return false;/*@cc_on if(typeof a.constructor!="function"){return typeOf(a)==typeof b.prototype.valueOf()}@*//*@if(@_14<5.1)if($Legacy.instanceOf(a,b))return true;@else@*/if(a instanceof b)return true;/*@end@*/if(Base.ancestorOf==b.ancestorOf)return false;if(Base.ancestorOf==a.constructor.ancestorOf)return b==Object;switch(b){case Array:return!!(typeof a=="object"&&a.join&&a.splice);case Function:return typeOf(a)=="function";case RegExp:return typeof a.constructor.$1=="string";case Date:return!!a.getTimezoneOffset;case String:case Number:case Boolean:return typeof a==typeof b.prototype.valueOf();case Object:return true}return false};function assert(a,b,c){if(!a){throw new(c||Error)(b||"Assertion failed.");}};function assertArity(a,b,c){if(b==null)b=a.callee.length;if(a.length<b){throw new SyntaxError(c||"Not enough arguments.");}};function assertType(a,b,c){if(b&&(typeof b=="function"?!instanceOf(a,b):typeOf(a)!=b)){throw new TypeError(c||"Invalid type.");}};function assignID(a){if(!a.base2ID)a.base2ID="b2_"+_8++;return a.base2ID};function copy(a){var b=function(){};b.prototype=a;return new b};function format(c){var d=arguments;var e=new RegExp("%([1-"+arguments.length+"])","g");return String(c).replace(e,function(a,b){return d[b]})};function match(a,b){return String(a).match(b)||[]};function rescape(a){return String(a).replace(_4,"\\$1")};function trim(a){return String(a).replace(_2,"").replace(_3,"")};function I(i){return i};function K(k){return function(){return k}};function bind(a,b){var c=_9.call(arguments,2);return c.length==0?function(){return a.apply(b,arguments)}:function(){return a.apply(b,c.concat.apply(c,arguments))}};function delegate(b,c){return function(){var a=_9.call(arguments);a.unshift(this);return b.apply(c,a)}};function flip(a){return function(){return a.apply(this,Array2.swap(arguments,0,1))}};function not(a){return function(){return!a.apply(this,arguments)}};function unbind(b){return function(a){return b.apply(a,_9.call(arguments,1))}};base2=new Package(this,base2);eval(this.exports);base2.extend=extend;forEach(Enumerable,function(a,b){if(!Module[b])base2.addName(b,bind(a,Enumerable))});JavaScript=new Package(this,JavaScript);eval(this.exports)};new function(_){var DOM=new base2.Package(this,{name:"DOM",version:"1.0 (beta 2)",exports:"Interface,Binding,Node,Document,Element,AbstractView,HTMLDocument,HTMLElement,"+"Selector,Traversal,XPathParser,NodeSelector,DocumentSelector,ElementSelector,"+"StaticNodeList,Event,EventTarget,DocumentEvent,ViewCSS,CSSStyleDeclaration",bind:function(a){if(a&&a.nodeType){var b=assignID(a);if(!DOM.bind[b]){switch(a.nodeType){case 1:if(typeof a.className=="string"){(HTMLElement.bindings[a.tagName]||HTMLElement).bind(a)}else{Element.bind(a)}break;case 9:if(a.writeln){HTMLDocument.bind(a)}else{Document.bind(a)}break;default:Node.bind(a)}DOM.bind[b]=true}}return a},"@MSIE5.+win":{bind:function(a){if(a&&a.writeln){a.nodeType=9}return this.base(a)}}});eval(this.imports);var _30=detect("MSIE");var _31=detect("MSIE5");var Interface=Module.extend(null,{implement:function(e){var f=this;if(Interface.ancestorOf(e)){forEach(e,function(a,b){if(e[b]._32){f[b]=function(){return e[b].apply(e,arguments)}}})}else if(typeof e=="object"){this.forEach(e,function(a,b){if(b.charAt(0)=="@"){forEach(a,arguments.callee)}else if(typeof a=="function"&&a.call){if(!f[b]){var c="var fn=function _%1(%2){%3.base=%3.%1.ancestor;var m=%3.base?'base':'%1';return %3[m](%4)}";var d="abcdefghij".split("").slice(-a.length);eval(format(c,b,d,d[0],d.slice(1)));fn._32=b;f[b]=fn}}})}return this.base(e)}});var Binding=Interface.extend(null,{bind:function(a){return extend(a,this.prototype)}});var Node=Binding.extend({"@!(element.compareDocumentPosition)":{compareDocumentPosition:function(a,b){if(Traversal.contains(a,b)){return 4|16}else if(Traversal.contains(b,a)){return 2|8}var c=_33(a);var d=_33(b);if(c<d){return 4}else if(c>d){return 2}return 0}}});var _33=document.documentElement.sourceIndex?function(a){return a.sourceIndex}:function(a){var b=0;while(a){b=Traversal.getNodeIndex(a)+"."+b;a=a.parentNode}return b};var Document=Node.extend(null,{bind:function(b){extend(b,"createElement",function(a){return DOM.bind(this.base(a))});AbstractView.bind(b.defaultView);if(b!=window.document)new DOMContentLoadedEvent(b);return this.base(b)},"@!(document.defaultView)":{bind:function(a){a.defaultView=Traversal.getDefaultView(a);return this.base(a)}}});var _34=/^(href|src)$/;var _35={"class":"className","for":"htmlFor"};var Element=Node.extend({"@MSIE.+win":{getAttribute:function(a,b,c){if(a.className===undefined){return this.base(a,b)}var d=_36(a,b);if(d&&(d.specified||b=="value")){if(_34.test(b)){return this.base(a,b,2)}else if(b=="style"){return a.style.cssText}else{return d.nodeValue}}return null},setAttribute:function(a,b,c){if(a.className===undefined){this.base(a,b,c)}else if(b=="style"){a.style.cssText=c}else{c=String(c);var d=_36(a,b);if(d){d.nodeValue=c}else{this.base(a,_35[b]||b,c)}}}},"@!(element.hasAttribute)":{hasAttribute:function(a,b){return this.getAttribute(a,b)!=null}}});extend(Element.prototype,"cloneNode",function(a){var b=this.base(a||false);b.base2ID=undefined;return b});if(_30){var _37="colSpan,rowSpan,vAlign,dateTime,accessKey,tabIndex,encType,maxLength,readOnly,longDesc";extend(_35,Array2.combine(_37.toLowerCase().split(","),_37.split(",")));var _36=_31?function(a,b){return a.attributes[b]||a.attributes[_35[b.toLowerCase()]]}:function(a,b){return a.getAttributeNode(b)}}var TEXT=_30?"innerText":"textContent";var Traversal=Module.extend({getDefaultView:function(a){return this.getDocument(a).defaultView},getNextElementSibling:function(a){while(a&&(a=a.nextSibling)&&!this.isElement(a))continue;return a},getNodeIndex:function(a){var b=0;while(a&&(a=a.previousSibling))b++;return b},getOwnerDocument:function(a){return a.ownerDocument},getPreviousElementSibling:function(a){while(a&&(a=a.previousSibling)&&!this.isElement(a))continue;return a},getTextContent:function(a){return a[TEXT]},isEmpty:function(a){a=a.firstChild;while(a){if(a.nodeType==3||this.isElement(a))return false;a=a.nextSibling}return true},setTextContent:function(a,b){return a[TEXT]=b},"@MSIE":{getDefaultView:function(a){return(a.document||a).parentWindow},"@MSIE5":{getOwnerDocument:function(a){return a.ownerDocument||a.document}}}},{contains:function(a,b){while(b&&(b=b.parentNode)&&a!=b)continue;return!!b},getDocument:function(a){return this.isDocument(a)?a:this.getOwnerDocument(a)},isDocument:function(a){return!!(a&&a.documentElement)},isElement:function(a){return!!(a&&a.nodeType==1)},"@(element.contains)":{contains:function(a,b){return a!=b&&(this.isDocument(a)?a==this.getOwnerDocument(b):a.contains(b))}},"@MSIE5":{isElement:function(a){return!!(a&&a.nodeType==1&&a.nodeName!="!")}}});var AbstractView=Binding.extend();var Event=Binding.extend({"@!(document.createEvent)":{initEvent:function(a,b,c,d){a.type=b;a.bubbles=c;a.cancelable=d;a.timeStamp=new Date().valueOf()},"@MSIE":{initEvent:function(a,b,c,d){this.base(a,b,c,d);a.cancelBubble=!a.bubbles},preventDefault:function(a){if(a.cancelable!==false){a.returnValue=false}},stopPropagation:function(a){a.cancelBubble=true}}}},{"@!(document.createEvent)":{"@MSIE":{bind:function(a){if(!a.timeStamp){a.bubbles=!!_38[a.type];a.cancelable=!!_39[a.type];a.timeStamp=new Date().valueOf()}if(!a.target){a.target=a.srcElement}a.relatedTarget=a[(a.type=="mouseout"?"to":"from")+"Element"];return this.base(a)}}}});if(_30){var _38="abort,error,select,change,resize,scroll";var _39="click,mousedown,mouseup,mouseover,mousemove,mouseout,keydown,keyup,submit,reset";_38=Array2.combine((_38+","+_39).split(","));_39=Array2.combine(_39.split(","))}var EventTarget=Interface.extend({"@!(element.addEventListener)":{addEventListener:function(a,b,c,d){var e=assignID(a);var f=assignID(c);var g=_40[e];if(!g)g=_40[e]={};var h=g[b];var i=a["on"+b];if(!h){h=g[b]={};if(i)h[0]=i}h[f]=c;if(i!==undefined){a["on"+b]=_40._41}},dispatchEvent:function(a,b){return _41.call(a,b)},removeEventListener:function(a,b,c,d){var e=_40[a.base2ID];if(e&&e[b]){delete e[b][c.base2ID]}},"@(element.fireEvent)":{dispatchEvent:function(a,b){var c="on"+b.type;b.target=a;if(a[c]===undefined){return this.base(a,b)}else{return a.fireEvent(c,b)}}}}});var _40=new Base({_41:_41,"@MSIE":{_41:function(){var a=this;var b=(a.document||a).parentWindow;if(a.Infinity)a=b;return _41.call(a,b.event)}}});function _41(a){var b=true;var c=_40[this.base2ID];if(c){Event.bind(a);var d=c[a.type];for(var i in d){var listener=d[i];if(listener.handleEvent){var result=listener.handleEvent(a)}else{result=listener.call(this,a)}if(result===false||a.returnValue===false)b=false}}return b};var DocumentEvent=Interface.extend({"@!(document.createEvent)":{createEvent:function(a,b){return Event.bind({})},"@(document.createEventObject)":{createEvent:function(a,b){return Event.bind(a.createEventObject())}}},"@(document.createEvent)":{"@!(document.createEvent('Events'))":{createEvent:function(a,b){return this.base(a,b=="Events"?"UIEvents":b)}}}});var DOMContentLoadedEvent=Base.extend({constructor:function(b){var c=false;this.fire=function(){if(!c){c=true;setTimeout(function(){var a=DocumentEvent.createEvent(b,"Events");Event.initEvent(a,"DOMContentLoaded",false,false);EventTarget.dispatchEvent(b,a)},1)}};EventTarget.addEventListener(b,"DOMContentLoaded",function(){c=true},false);this.listen(b)},listen:function(a){EventTarget.addEventListener(Traversal.getDefaultView(a),"load",this.fire,false)},"@MSIE.+win":{listen:function(a){if(a.readyState!="complete"){var b=this;a.write("<script id=__ready defer src=//:><\/script>");a.all.__ready.onreadystatechange=function(){if(this.readyState=="complete"){this.removeNode();b.fire()}}}}},"@KHTML":{listen:function(a){if(a.readyState!="complete"){var b=this;var c=setInterval(function(){if(/loaded|complete/.test(a.readyState)){clearInterval(c);b.fire()}},100)}}}});new DOMContentLoadedEvent(document);Document.implement(DocumentEvent);Document.implement(EventTarget);Element.implement(EventTarget);var _42=/^\d+(px)?$/i;var _43=/(width|height|top|bottom|left|right|fontSize)$/;var _44=/^(color|backgroundColor)$/;var ViewCSS=Interface.extend({"@!(document.defaultView.getComputedStyle)":{"@MSIE":{getComputedStyle:function(a,b,c){var d=b.currentStyle;var e={};for(var i in d){if(_43.test(i)){e[i]=_45(b,e[i])+"px"}else if(_44.test(i)){e[i]=_46(b,i=="color"?"ForeColor":"BackColor")}else{e[i]=d[i]}}return e}}},getComputedStyle:function(a,b,c){return _47.bind(this.base(a,b,c))}},{toCamelCase:function(c){return c.replace(/\-([a-z])/g,function(a,b){return b.toUpperCase()})}});function _45(a,b){if(_42.test(b))return parseInt(b);var c=a.style.left;var d=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;a.style.left=b||0;b=a.style.pixelLeft;a.style.left=c;a.runtimeStyle.left=d;return b};function _46(a,b){var c=a.document.body.createTextRange();c.moveToElementText(a);var d=c.queryCommandValue(b);return format("rgb(%1,%2,%3)",d&0xff,(d&0xff00)>>8,(d&0xff0000)>>16)};var _47=Binding.extend({getPropertyValue:function(a,b){return this.base(a,_48[b]||b)},"@MSIE.+win":{getPropertyValue:function(a,b){return b=="float"?a.styleFloat:a[ViewCSS.toCamelCase(b)]}}});var CSSStyleDeclaration=_47.extend({setProperty:function(a,b,c,d){return this.base(a,_48[b]||b,c,d)},"@MSIE.+win":{setProperty:function(a,b,c,d){if(b=="opacity"){c*=100;a.opacity=c;a.zoom=1;a.filter="Alpha(opacity="+c+")"}else{a.setAttribute(b,c)}}}},{"@MSIE":{bind:function(a){a.getPropertyValue=this.prototype.getPropertyValue;a.setProperty=this.prototype.setProperty;return a}}});var _48=new Base({"@Gecko":{opacity:"-moz-opacity"},"@KHTML":{opacity:"-khtml-opacity"}});with(CSSStyleDeclaration.prototype)getPropertyValue.toString=setProperty.toString=function(){return"[base2]"};AbstractView.implement(ViewCSS);var NodeSelector=Interface.extend({"@!(element.querySelector)":{querySelector:function(a,b){return new Selector(b).exec(a,1)},querySelectorAll:function(a,b){return new Selector(b).exec(a)}}});extend(NodeSelector.prototype,{querySelector:function(a){return DOM.bind(this.base(a))},querySelectorAll:function(b){return extend(this.base(b),"item",function(a){return DOM.bind(this.base(a))})}});var DocumentSelector=NodeSelector.extend();var ElementSelector=NodeSelector.extend({"@!(element.matchesSelector)":{matchesSelector:function(a,b){return new Selector(b).test(a)}}});var StaticNodeList=Base.extend({constructor:function(b){b=b||[];this.length=b.length;this.item=function(a){return b[a]}},length:0,forEach:function(a,b){for(var i=0;i<this.length;i++){a.call(b,this.item(i),i,this)}},item:Undefined,"@(XPathResult)":{constructor:function(b){if(b&&b.snapshotItem){this.length=b.snapshotLength;this.item=function(a){return b.snapshotItem(a)}}else this.base(b)}}});StaticNodeList.implement(Enumerable);var _49=/'(\\.|[^'\\])*'|"(\\.|[^"\\])*"/g,_50=/([\s>+~,]|[^(]\+|^)([#.:\[])/g,_51=/(^|,)([^\s>+~])/g,_52=/\s*([\s>+~(),]|^|$)\s*/g,_53=/\s\*\s/g,_54=/\x01(\d+)/g,_55=/'/g;var CSSParser=RegGrp.extend({constructor:function(a){this.base(a);this.cache={};this.sorter=new RegGrp;this.sorter.add(/:not\([^)]*\)/,RegGrp.IGNORE);this.sorter.add(/([ >](\*|[\w-]+))([^: >+~]*)(:\w+-child(\([^)]+\))?)([^: >+~]*)/,"$1$3$6$4")},cache:null,ignoreCase:true,escape:function(b){var c=this._56=[];return this.optimise(this.format(String(b).replace(_49,function(a){return"\x01"+c.push(a.slice(1,-1).replace(_55,"\\'"))})))},format:function(a){return a.replace(_52,"$1").replace(_51,"$1 $2").replace(_50,"$1*$2")},optimise:function(a){return this.sorter.exec(a.replace(_53,">* "))},parse:function(a){return this.cache[a]||(this.cache[a]=this.unescape(this.exec(this.escape(a))))},unescape:function(c){var d=this._56;return c.replace(_54,function(a,b){return d[b-1]})}});function _57(c,d,e,f,g,h,i,j){f=/last/i.test(c)?f+"+1-":"";if(!isNaN(d))d="0n+"+d;else if(d=="even")d="2n";else if(d=="odd")d="2n+1";d=d.split("n");var a=d[0]?(d[0]=="-")?-1:parseInt(d[0]):1;var b=parseInt(d[1])||0;var k=a<0;if(k){a=-a;if(a==1)b++}var l=format(a==0?"%3%7"+(f+b):"(%4%3-%2)%6%1%70%5%4%3>=%2",a,b,e,f,h,i,j);if(k)l=g+"("+l+")";return l};var XPathParser=CSSParser.extend({constructor:function(){this.base(XPathParser.rules);this.sorter.putAt(1,"$1$4$3$6")},escape:function(a){return this.base(a).replace(/,/g,"\x02")},unescape:function(b){return this.base(b.replace(/\[self::\*\]/g,"").replace(/(^|\x02)\//g,"$1./").replace(/\x02/g," | ")).replace(/'[^'\\]*\\'(\\.|[^'\\])*'/g,function(a){return"concat("+a.split("\\'").join("',\"'\",'")+")"})},"@opera":{unescape:function(a){return this.base(a.replace(/last\(\)/g,"count(preceding-sibling::*)+count(following-sibling::*)+1"))}}},{init:function(){this.values.attributes[""]="[@$1]";forEach(this.types,function(a,b){forEach(this.values[b],a,this.rules)},this)},optimised:{pseudoClasses:{"first-child":"[1]","last-child":"[last()]","only-child":"[last()=1]"}},rules:extend({},{"@!KHTML":{"(^|\\x02) (\\*|[\\w-]+)#([\\w-]+)":"$1id('$3')[self::$2]","([ >])(\\*|[\\w-]+):([\\w-]+-child(\\(([^)]+)\\))?)":function(a,b,c,d,e,f){var g=(b==" ")?"//*":"/*";if(/^nth/i.test(d)){g+=_58(d,f,"position()")}else{g+=XPathParser.optimised.pseudoClasses[d]}return g+"[self::"+c+"]"}}}),types:{identifiers:function(a,b){this[rescape(b)+"([\\w-]+)"]=a},combinators:function(a,b){this[rescape(b)+"(\\*|[\\w-]+)"]=a},attributes:function(a,b){this["\\[([\\w-]+)\\s*"+rescape(b)+"\\s*([^\\]]*)\\]"]=a},pseudoClasses:function(a,b){this[":"+b.replace(/\(\)$/,"\\(([^)]+)\\)")]=a}},values:{identifiers:{"#":"[@id='$1'][1]",".":"[contains(concat(' ',@class,' '),' $1 ')]"},combinators:{" ":"/descendant::$1",">":"/child::$1","+":"/following-sibling::*[1][self::$1]","~":"/following-sibling::$1"},attributes:{"*=":"[contains(@$1,'$2')]","^=":"[starts-with(@$1,'$2')]","$=":"[substring(@$1,string-length(@$1)-string-length('$2')+1)='$2']","~=":"[contains(concat(' ',@$1,' '),' $2 ')]","|=":"[contains(concat('-',@$1,'-'),'-$2-')]","!=":"[not(@$1='$2')]","=":"[@$1='$2']"},pseudoClasses:{"empty":"[not(child::*) and not(text())]","first-child":"[not(preceding-sibling::*)]","last-child":"[not(following-sibling::*)]","not()":_59,"nth-child()":_58,"nth-last-child()":_58,"only-child":"[not(preceding-sibling::*) and not(following-sibling::*)]","root":"[not(parent::*)]"}},"@opera":{init:function(){this.optimised.pseudoClasses["last-child"]=this.values.pseudoClasses["last-child"];this.optimised.pseudoClasses["only-child"]=this.values.pseudoClasses["only-child"];this.base()}}});var _60=new XPathParser;function _59(a,b){return"[not("+_60.exec(trim(b)).replace(/\[1\]/g,"").replace(/^(\*|[\w-]+)/,"[self::$1]").replace(/\]\[/g," and ").slice(1,-1)+")]"};function _58(a,b,c){return"["+_57(a,b,c||"count(preceding-sibling::*)+1","last()","not"," and "," mod ","=")+"]"};var Selector=Base.extend({constructor:function(a){this.toString=K(trim(a))},exec:function(a,b){return Selector.parse(this)(a,b)},test:function(a){var b=new Selector(this+"[b2-test]");a.setAttribute("b2-test",true);var c=b.exec(Traversal.getOwnerDocument(a),true);a.removeAttribute("b2-test");return c==a},toXPath:function(){return Selector.toXPath(this)},"@(XPathResult)":{exec:function(a,b){if(_61.test(this)){return this.base(a,b)}var c=Traversal.getDocument(a);var d=b?9:7;var e=c.evaluate(this.toXPath(),a,null,d,null);return b?e.singleNodeValue:e}},"@MSIE":{exec:function(a,b){if(typeof a.selectNodes!="undefined"&&!_61.test(this)){var c=b?"selectSingleNode":"selectNodes";return a[c](this.toXPath())}return this.base(a,b)}},"@(true)":{exec:function(a,b){try{var c=this.base(a||document,b)}catch(error){throw new SyntaxError(format("'%1' is not a valid CSS selector.",this));}return b?c:new StaticNodeList(c)}}},{toXPath:function(a){if(!_62)_62=new XPathParser;return _62.parse(a)}});var _61=":(checked|disabled|enabled|contains)|^(#[\\w-]+\\s*)?\\w+$";if(detect("KHTML")){if(detect("WebKit5")){_61+="|nth\\-|,"}else{_61="."}}_61=new RegExp(_61);var _63={"=":"%1=='%2'","!=":"%1!='%2'","~=":/(^| )%1( |$)/,"|=":/^%1(-|$)/,"^=":/^%1/,"$=":/%1$/,"*=":/%1/};_63[""]="%1!=null";var _64={"checked":"e%1.checked","contains":"e%1[TEXT].indexOf('%2')!=-1","disabled":"e%1.disabled","empty":"Traversal.isEmpty(e%1)","enabled":"e%1.disabled===false","first-child":"!Traversal.getPreviousElementSibling(e%1)","last-child":"!Traversal.getNextElementSibling(e%1)","only-child":"!Traversal.getPreviousElementSibling(e%1)&&!Traversal.getNextElementSibling(e%1)","root":"e%1==Traversal.getDocument(e%1).documentElement"};var _65=detect("(element.sourceIndex)");var _66="var p%2=0,i%2,e%2,n%2=e%1.";var _67=_65?"e%1.sourceIndex":"assignID(e%1)";var _68="var g="+_67+";if(!p[g]){p[g]=1;";var _69="r[r.length]=e%1;if(s)return e%1;";var _70="var _71=function(e0,s){_72++;var r=[],p={},reg=[%1],"+"d=Traversal.getDocument(e0),c=d.body?'toUpperCase':'toString';";var _62;var _73;var _74;var _75;var _76;var _77;var _78={};var _79=new CSSParser({"^ \\*:root":function(a){_75=false;var b="e%2=d.documentElement;if(Traversal.contains(e%1,e%2)){";return format(b,_74++,_74)}," (\\*|[\\w-]+)#([\\w-]+)":function(a,b,c){_75=false;var d="var e%2=_80(d,'%4');if(e%2&&";if(b!="*")d+="e%2.nodeName=='%3'[c]()&&";d+="Traversal.contains(e%1,e%2)){";if(_76)d+=format("i%1=n%1.length;",_76);return format(d,_74++,_74,b,c)}," (\\*|[\\w-]+)":function(a,b){_77++;_75=b=="*";var c=_66;c+=(_75&&_31)?"all":"getElementsByTagName('%3')";c+=";for(i%2=0;(e%2=n%2[i%2]);i%2++){";return format(c,_74++,_76=_74,b)},">(\\*|[\\w-]+)":function(a,b){var c=_30&&_76;_75=b=="*";var d=_66;d+=c?"children":"childNodes";if(!_75&&c)d+=".tags('%3')";d+=";for(i%2=0;(e%2=n%2[i%2]);i%2++){";if(_75){d+="if(e%2.nodeType==1){";_75=_31}else{if(!c)d+="if(e%2.nodeName=='%3'[c]()){"}return format(d,_74++,_76=_74,b)},"\\+(\\*|[\\w-]+)":function(a,b){var c="";if(_75&&_30)c+="if(e%1.nodeName!='!'){";_75=false;c+="e%1=Traversal.getNextElementSibling(e%1);if(e%1";if(b!="*")c+="&&e%1.nodeName=='%2'[c]()";c+="){";return format(c,_74,b)},"~(\\*|[\\w-]+)":function(a,b){var c="";if(_75&&_30)c+="if(e%1.nodeName!='!'){";_75=false;_77=2;c+="while(e%1=e%1.nextSibling){if(e%1.b2_adjacent==_72)break;if(";if(b=="*"){c+="e%1.nodeType==1";if(_31)c+="&&e%1.nodeName!='!'"}else c+="e%1.nodeName=='%2'[c]()";c+="){e%1.b2_adjacent=_72;";return format(c,_74,b)},"#([\\w-]+)":function(a,b){_75=false;var c="if(e%1.id=='%2'){";if(_76)c+=format("i%1=n%1.length;",_76);return format(c,_74,b)},"\\.([\\w-]+)":function(a,b){_75=false;_73.push(new RegExp("(^|\\s)"+rescape(b)+"(\\s|$)"));return format("if(e%1.className&&reg[%2].test(e%1.className)){",_74,_73.length-1)},":not\\((\\*|[\\w-]+)?([^)]*)\\)":function(a,b,c){var d=(b&&b!="*")?format("if(e%1.nodeName=='%2'[c]()){",_74,b):"";d+=_79.exec(c);return"if(!"+d.slice(2,-1).replace(/\)\{if\(/g,"&&")+"){"},":nth(-last)?-child\\(([^)]+)\\)":function(a,b,c){_75=false;b=format("e%1.parentNode.b2_length",_74);var d="if(p%1!==e%1.parentNode)p%1=_81(e%1.parentNode);";d+="var i=e%1[p%1.b2_lookup];if(p%1.b2_lookup!='b2_index')i++;if(";return format(d,_74)+_57(a,c,"i",b,"!","&&","%","==")+"){"},":([\\w-]+)(\\(([^)]+)\\))?":function(a,b,c,d){return"if("+format(_64[b]||"throw",_74,d||"")+"){"},"\\[([\\w-]+)\\s*([^=]?=)?\\s*([^\\]]*)\\]":function(a,b,c,d){var e=_35[b]||b;if(c){var f="e%1.getAttribute('%2',2)";if(!_34.test(b)){f="e%1.%3||"+f}b=format("("+f+")",_74,b,e)}else{b=format("Element.getAttribute(e%1,'%2')",_74,b)}var g=_63[c||""];if(instanceOf(g,RegExp)){_73.push(new RegExp(format(g.source,rescape(_79.unescape(d)))));g="reg[%2].test(%1)";d=_73.length-1}return"if("+format(g,b,d)+"){"}});new function(_){var _80=_30?function(a,b){var c=a.all[b]||null;if(!c||c.id==b)return c;for(var i=0;i<c.length;i++){if(c[i].id==b)return c[i]}return null}:function(a,b){return a.getElementById(b)};var _72=1;function _81(a){if(a.rows){a.b2_length=a.rows.length;a.b2_lookup="rowIndex"}else if(a.cells){a.b2_length=a.cells.length;a.b2_lookup="cellIndex"}else if(a.b2_indexed!=_72){var b=0;var c=a.firstChild;while(c){if(c.nodeType==1&&c.nodeName!="!"){c.b2_index=++b}c=c.nextSibling}a.b2_length=b;a.b2_lookup="b2_index"}a.b2_indexed=_72;return a};Selector.parse=function(a){if(!_78[a]){_73=[];var b="";var c=_79.escape(a).split(",");for(var i=0;i<c.length;i++){_75=_74=_76=0;_77=c.length>1?2:0;var d=_79.exec(c[i])||"throw;";if(_75&&_30){d+=format("if(e%1.nodeName!='!'){",_74)}var e=(_77>1)?_68:"";d+=format(e+_69,_74);d+=Array(match(d,/\{/g).length+1).join("}");b+=d}eval(format(_70,_73)+_79.unescape(b)+"return s?null:r}");_78[a]=_71}return _78[a]}};Document.implement(DocumentSelector);Element.implement(ElementSelector);var HTMLDocument=Document.extend(null,{"@(document.activeElement===undefined)":{bind:function(b){b.activeElement=null;EventTarget.addEventListener(b,"focus",function(a){b.activeElement=a.target},false);return this.base(b)}}});var HTMLElement=Element.extend({addClass:function(a,b){if(!this.hasClass(a,b)){a.className+=(a.className?" ":"")+b}},hasClass:function(a,b){var c=new RegExp("(^|\\s)"+b+"(\\s|$)");return c.test(a.className)},removeClass:function(a,b){var c=new RegExp("(^|\\s)"+b+"(\\s|$)","g");a.className=trim(a.className.replace(c,"$2"))},toggleClass:function(a,b){if(this.hasClass(a,b)){this.removeClass(a,b)}else{this.addClass(a,b)}}},{bindings:{},tags:"*",bind:function(a){CSSStyleDeclaration.bind(a.style);return this.base(a)},extend:function(){var b=base(this,arguments);var c=(b.tags||"").toUpperCase().split(",");forEach(c,function(a){HTMLElement.bindings[a]=b});return b},"@!(element.ownerDocument)":{bind:function(a){a.ownerDocument=Traversal.getOwnerDocument(a);return this.base(a)}}});HTMLElement.extend(null,{tags:"APPLET,EMBED",bind:I});eval(this.exports)};
base2.JavaScript.bind(window);if(!Array.prototype.clear){Array.prototype.clear=function(){while(this.length>0){this.pop()}}}(function(){$package("gara");$class("Package",{exports:"",namespace:"",name:"",version:"",$constructor:function(C){this.name=C.name||"gara";this.imports=C.imports||"";this.exports=C.exports||"";if(this.name!="gara"){gara.namespace+="var "+this.name+"=gara."+this.name;this.name="gara."+this.name}var B=this.exports.split(",");B.forEach(function(F,E,D){this.namespace+="var "+F+"="+this.name+"."+F+";"},this)}});$class("EventManager",{_instance:$static(null),_listeners:$static({}),$constructor:function(){base2.DOM.EventTarget(window);window.addEventListener("unload",this,false)},getInstance:$static(function(){if(this._instance==null){this._instance=new gara.EventManager()}return this._instance}),addListener:$static(function(C,B,E){C.addEventListener(B,E,false);var H=new Date();var G=""+H.getDay()+H.getHours()+H.getMinutes()+H.getSeconds()+H.getMilliseconds();if(!C._garaHash){C._garaHash=C.toString()+G}if(!E.hasOwnProperty("_garaHash")){E._garaHash=E.toString()+G}var F=""+C._garaHash+B+E._garaHash;var D={domNode:C,type:B,listener:E};this._listeners[F]=D;return D}),handleEvent:function(B){this._unregisterAllEvents()},removeListener:$static(function(C,B,D){C.removeEventListener(B,D,false);if(C._garaHash&&D.hasOwnProperty("_garaHash")){var E=C._garaHash+B+D._garaHash;if(this._listeners[E]){delete this._listeners[E]}}}),_unregisterAllEvents:function(){var C,B;for(C in gara.EventManager._listeners){B=gara.EventManager._listeners[C];gara.EventManager.removeListener(B.domNode,B.type,B.listener)}},toString:function(){return"[gara.EventManager]"}});gara.eventManager=gara.EventManager.getInstance();$class("OutOfBoundsException",{$extends:Exception,$constructor:function(B){this.message=String(B);this.name=$class.typeOf(this)}});$class("I18n",{$constructor:function(){this._map={ok:"Ok",cancel:"Cancel",yes:"Yes",no:"No",retry:"Retry",abort:"Abort",ignore:"Ignore"}},get:function(B){if(this._map.hasOwnProperty(B)){return this._map[B]}return null},set:function(B,C){this._map[B]=C}});gara.i18n=new gara.I18n();var A=new gara.Package({exports:"Package,EventManager,OutOfBoundsException",name:"gara"});gara.namespace=A.namespace;gara.toString=function(){return"[gara]"};$package("")})();(function(){$package("gara.jswt");$class("JSWT",{ABORT:$static(1<<9),APPLICATION_MODAL:$static(1<<16),BAR:$static(1<<1),BOTTOM:$static(1<<10),CANCEL:$static(1<<8),CASCADE:$static(1<<6),CHECK:$static(1<<5),CLOSE:$static(1<<6),DEFAULT:$static(0),DOWN:$static(1<<10),DRAG:$static(1),DROP_DOWN:$static(1<<2),ERROR_MENU_NOT_DROP_DOWN:$static(21),ERROR_WIDGET_DISPOSED:$static(24),ERROR_MENUITEM_NOT_CASCADE:$static(27),FULL_SELECTION:$static(1<<16),ICON_ERROR:$static(1),ICON_INFORMATION:$static(1<<1),ICON_QUESTION:$static(1<<2),ICON_WARNING:$static(1<<3),ICON_WORKING:$static(1<<4),IGNORE:$static(1<<11),MENU:$static(1<<6),MULTI:$static(1<<1),NO:$static(1<<7),NONE:$static(0),OK:$static(1<<5),POP_UP:$static(1<<3),RETRY:$static(1<<10),SEPARATOR:$static(1<<1),SINGLE:$static(1<<2),SYSTEM_MODAL:$static(1<<17),TOP:$static(1<<7),UP:$static(1<<7),YES:$static(1<<6),$constructor:function(){}});var JSWT=gara.jswt.JSWT;$interface("FocusListener",{focusGained:function(){},focusLost:function(){},toString:function(){return"[gara.jswt.FocusListener]"}});$interface("SelectionListener",{widgetSelected:function(widget){},toString:function(){return"[gara.jswt.SelectionListener]"}});$interface("MenuListener",{menuHidden:function(widget){},menuShown:function(widget){},toString:function(){return"[gara.jswt.MenuListener]"}});$class("ItemNotExistsException",{$extends:Exception,$constructor:function(message){this.message=String(message);this.name=$class.typeOf(this)}});$class("JSWTException",{$extends:Exception,code:null,$constructor:function(codeOrMessage,message){var code;if(typeof (message)=="undefined"){message=codeOrMessage}else{code=codeOrMessage}this.code=code;this.message=String(message);this.name=$class.typeOf(this)}});function strReplace(string,search,replace){output=""+string;while(output.indexOf(search)>-1){pos=output.indexOf(search);output=""+(output.substring(0,pos)+replace+output.substring((pos+search.length),output.length))}return output}$class("Widget",{domref:null,$constructor:function(parent,style){this.domref=null;this._parent=parent;this._parentNode=null;this._style=typeof (style)=="undefined"?JSWT.DEFAULT:style;this._data=null;this._dataMap={};this._className="";this._baseClass="";this._listener={};this._disposed=false;this._disposeListener=[]},addClassName:function(className){this._className+=" "+className;this._changed=true},addDisposeListener:function(listener){if(!$class.instanceOf(listener,gara.jswt.DisposeListener)){throw new TypeError("listener not instance of gara.jswt.DisposeListener")}if(!this._disposeListener.contains(listener)){this._disposeListener.push(listener)}},addListener:function(eventType,listener){if(!this._listener.hasOwnProperty(eventType)){this._listener[eventType]=new Array()}this._listener[eventType].push(listener);this._registerListener(eventType,listener)},checkWidget:function(){if(this.isDisposed()){throw new gara.jswt.JSWTException(JSWT.ERROR_WIDGET_DISPOSED)}},dispose:function(){this._disposed=true;this._disposeListener.forEach(function(item,index,arr){item.widgetDisposed(this)},this);for(var type in this._listener){this._listener[type].forEach(function(item,index,arr){this.removeListener(type,item)},this)}},getClassName:function(){return this._className},getData:function(key){if(typeof (key)=="undefined"){return this._data}else{if(this._dataMap.hasOwnProperty(key)){return this._dataMap[key]}}return null},getParent:function(){return this._parent},getStyle:function(){return this._style},hasClassName:function(className){return this._className.indexOf(className)!=-1},isDisposed:function(){return this._disposed},_notifyExternalKeyboardListener:function(e,obj,control){if(this._listener.hasOwnProperty(e.type)){var keydownListener=this._listener[e.type];keydownListener.forEach(function(item,index,arr){e.target.obj=obj;e.target.control=control;if(typeof (item)=="object"&&item.handleEvent){item.handleEvent(e)}else{if(typeof (item)=="function"){eval(item+"()")}}})}},_registerListener:$abstract(function(eventType,listener){}),removeClassName:function(className){this._className=strReplace(this._className,className,"");this._changed=true},removeDisposeListener:function(listener){if(!$class.instanceOf(listener,gara.jswt.DisposeListener)){throw new TypeError("listener not instance of gara.jswt.DisposeListener")}if(this._disposeListener.contains(listener)){this._disposeListener.remove(listener)}},removeListener:function(eventType,listener){if(this._listener.hasOwnProperty(eventType)&&this._listener[eventType].contains(listener)){this._listener[eventType].remove(listener);this._unregisterListener(eventType,listener)}},setData:function(key,data){if(typeof (data)=="undefined"){this._data=key}else{this._dataMap[key]=data}},_setParentNode:function(parentNode){this._parentNode=parentNode},toString:function(){return"[gara.jswt.Widget]"},_unregisterListener:$abstract(function(eventType,listener){})});$class("Control",{$extends:gara.jswt.Widget,$constructor:function(parent,style){this.$base(parent,style);this._focusListener=[];this._hasFocus=false;this._menu=null;gara.jswt.ControlManager.getInstance().addControl(this);this.addFocusListener(gara.jswt.ControlManager.getInstance())},addFocusListener:function(listener){if(!$class.implementationOf(listener,gara.jswt.FocusListener)){throw new TypeError("listener is not a gara.jswt.FocusListener")}this._focusListener.push(listener)},forceFocus:function(){this._hasFocus=true;this.removeClassName(this._baseClass+"Inactive");this.addClassName(this._baseClass+"Active");this.update();for(var i=0,len=this._focusListener.length;i<len;++i){this._focusListener[i].focusGained(this)}},handleContextMenu:function(e){switch(e.type){case"contextmenu":if(this._menu!=null){this._menu.setLocation(e.clientX,e.clientY);this._menu.setVisible(true);e.preventDefault()}break;case"mousedown":if(window.opera&&(e.altKey||e.ctrlKey)&&this._menu!=null){this._menu.setLocation(e.clientX,e.clientY);this._menu.setVisible(true,e)}break}},handleEvent:$abstract(function(e){}),isFocusControl:function(){return this._hasFocus},looseFocus:function(){this._hasFocus=false;this.removeClassName(this._baseClass+"Active");this.addClassName(this._baseClass+"Inactive");this.update();for(var i=0,len=this._focusListener.length;i<len;++i){this._focusListener[i].focusLost(this)}},removeFocusListener:function(listener){if(!listener.$class.implementsInterface(gara.jswt.FocusListener)){throw new TypeError("listener is not a gara.jswt.FocusListener")}if(this._focusListener.contains(listener)){this._focusListener.remove(listener)}},setMenu:function(menu){if(!$class.instanceOf(menu,gara.jswt.Menu)){throw new TypeError("menu is not a gara.jswt.Menu")}this._menu=menu;this.addListener("contextmenu",this);this.addListener("mousedown",this)},toString:function(){return"[gara.jswt.Control"},update:$abstract(function(){})});$class("Composite",{$extends:gara.jswt.Control,$constructor:function(parent,style){this.$base(parent,style)}});$class("List",{$extends:gara.jswt.Control,$constructor:function(parent,style){this.$base(parent,style);if(this._style==JSWT.DEFAULT){this._style=JSWT.SINGLE}this._items=[];this._selection=[];this._selectionListener=[];this._activeItem=null;this._shiftItem=null;this._className=this._baseClass="jsWTList";this._className+=" jsWTListInactive"},_activateItem:function(item){this.checkWidget();if(!$class.instanceOf(item,gara.jswt.ListItem)){throw new TypeError("item is not type of gara.jswt.ListItem")}if(this._activeItem!=null&&!this._activeItem.isDisposed()){this._activeItem.setActive(false);this._activeItem.update()}this._activeItem=item;this._activeItem.setActive(true);this.update()},_addItem:function(item,index){this.checkWidget();if(!$class.instanceOf(item,gara.jswt.ListItem)){throw new TypeError("item is not type of gara.jswt.ListItem")}if(typeof (index)!="undefined"){this._items.insertAt(index,item)}else{this._items.push(item)}},addSelectionListener:function(listener){this.checkWidget();if(!$class.instanceOf(listener,gara.jswt.SelectionListener)){throw new TypeError("listener is not instance of gara.jswt.SelectionListener")}this._selectionListener.push(listener)},_create:function(){this.domref=document.createElement("ul");this.domref.obj=this;this.domref.control=this;base2.DOM.EventTarget(this.domref);var unregisteredListener={};for(var eventType in this._listener){unregisteredListener[eventType]=this._listener[eventType].concat([])}this.addListener("mousedown",this);for(var eventType in unregisteredListener){unregisteredListener[eventType].forEach(function(elem,index,arr){this._registerListener(eventType,elem)},this)}if(!$class.instanceOf(this._parent,gara.jswt.Composite)){this._parentNode=this._parent}if(this._parentNode!=null){this._parentNode.appendChild(this.domref)}},deselect:function(item){this.checkWidget();if(!$class.instanceOf(item,gara.jswt.ListItem)){throw new TypeError("item not instance of gara.jswt.ListItem")}if(this._selection.contains(item)){item._setSelected(false);this._selection.remove(item);this._shiftItem=item;this._activateItem(item);this.notifySelectionListener()}},deselectAll:function(){this.checkWidget();for(var i=0,len=this._items.length;i<len;++i){this.deselect(this._items[i])}this.update()},dispose:function(){this.deselectAll();this.$base();this._items.forEach(function(item,index,arr){item.dispose()},this);if(this._parentNode!=null){this._parentNode.removeChild(this.domref)}delete this.domref},getItem:function(index){this.checkWidget();if(index>=this._items.length){throw new gara.OutOfBoundsException("Your item lives outside of this list")}return this._items[index]},getItemCount:function(){return this._items.length},getItems:function(){return this._items},getSelection:function(){this.checkWidget();return this._selection},getSelectionCount:function(){this.checkWidget();return this._selection.length},handleEvent:function(e){this.checkWidget();var obj=e.target.obj||null;switch(e.type){case"mousedown":if(!this._hasFocus){this.forceFocus()}if($class.instanceOf(obj,gara.jswt.ListItem)){var item=obj;if(!e.ctrlKey&&!e.shiftKey){this.select(item,false)}else{if(e.ctrlKey&&e.shiftKey){this.selectRange(item,true)}else{if(e.shiftKey){this.selectRange(item,false)}else{if(e.ctrlKey){if(this._selection.contains(item)){this.deselect(item)}else{this.select(item,true)}}else{this.select(item)}}}}}break;case"keyup":case"keydown":case"keypress":if(this._activeItem!=null){this._activeItem.handleEvent(e)}this._notifyExternalKeyboardListener(e,this,this);if(e.type=="keydown"){this._handleKeyEvent(e)}break}this.handleContextMenu(e);e.stopPropagation();return false},_handleKeyEvent:function(e){if(this._activeItem==null){return }switch(e.keyCode){case 37:case 38:var prev=false;var activeIndex=this.indexOf(this._activeItem);if(activeIndex!=0){prev=this._items[activeIndex-1]}if(prev){if(!e.ctrlKey&&!e.shiftKey){this.select(prev,false)}else{if(e.ctrlKey&&e.shiftKey){this.selectRange(prev,true)}else{if(e.shiftKey){this.selectRange(prev,false)}else{if(e.ctrlKey){this._activateItem(prev)}}}}}break;case 39:case 40:var next=false;var activeIndex=this.indexOf(this._activeItem);if(activeIndex!=this._items.length-1){next=this._items[activeIndex+1]}if(next){if(!e.ctrlKey&&!e.shiftKey){this.select(next,false)}else{if(e.ctrlKey&&e.shiftKey){this.selectRange(next,true)}else{if(e.shiftKey){this.selectRange(next,false)}else{if(e.ctrlKey){this._activateItem(next)}}}}}break;case 32:if(this._selection.contains(this._activeItem)&&e.ctrlKey){this.deselect(this._activeItem)}else{this.select(this._activeItem,true)}break;case 36:if(!e.ctrlKey&&!e.shiftKey){this.select(this._items[0],false)}else{if(e.shiftKey){this.selectRange(this._items[0],false)}else{if(e.ctrlKey){this._activateItem(this._items[0])}}}break;case 35:var lastOffset=this._items.length-1;if(!e.ctrlKey&&!e.shiftKey){this.select(this._items[lastOffset],false)}else{if(e.shiftKey){this.selectRange(this._items[lastOffset],false)}else{if(e.ctrlKey){this._activateItem(this._items[lastOffset])}}}break}},indexOf:function(item){this.checkWidget();if(!$class.instanceOf(item,gara.jswt.ListItem)){throw new TypeError("item not instance of gara.jswt.ListItem")}if(!this._items.contains(item)){throw new gara.jswt.ItemNotExistsException("item ["+item+"] does not exists in this list");return }return this._items.indexOf(item)},notifySelectionListener:function(){for(var i=0,len=this._selectionListener.length;i<len;++i){this._selectionListener[i].widgetSelected(this)}},_registerListener:function(eventType,listener){if(this.domref!=null){gara.EventManager.addListener(this.domref,eventType,listener)}},remove:function(index){this.checkWidget();var item=this._items.removeAt(index)[0];item.dispose();delete item},removeRange:function(start,end){this.checkWidget();for(var i=start;i<=end;++i){this.remove(i)}},removeFromArray:function(indices){this.checkWidget();indices.forEach(function(item,index,arr){this.remove(index)},this)},removeAll:function(){this.checkWidget();while(this._items.length){this.remove(0)}},removeSelectionListener:function(listener){this.checkWidget();if(!$class.instanceOf(listener,gara.jswt.SelectionListener)){throw new TypeError("listener is not instance of gara.jswt.SelectionListener")}if(this._selectionListener.contains(listener)){this._selectionListener.remove(listener)}},select:function(item,_add){this.checkWidget();if(!$class.instanceOf(item,gara.jswt.ListItem)){throw new TypeError("item not instance of gara.jswt.ListItem")}if(!_add||(this._style&JSWT.MULTI)!=JSWT.MULTI){while(this._selection.length){var i=this._selection.pop();i._setSelected(false);i.update()}}if(!this._selection.contains(item)){item._setSelected(true);this._selection.push(item);this._shiftItem=item;this._activateItem(item);this.notifySelectionListener()}},selectAll:function(){this.checkWidget();if((this._style&JSWT.SINGLE)!=JSWT.SINGLE){for(var i=0,len=this._items.length;i<len;++i){this.select(this._items[i],true)}}},selectRange:function(item,_add){this.checkWidget();if(!$class.instanceOf(item,gara.jswt.ListItem)){throw new TypeError("item not instance of gara.jswt.ListItem")}if(!_add){while(this._selection.length){var i=this._selection.pop();i._setSelected(false);i.update()}}if((this._style&JSWT.MULTI)==JSWT.MULTI){var indexShift=this.indexOf(this._shiftItem);var indexItem=this.indexOf(item);var from=indexShift>indexItem?indexItem:indexShift;var to=indexShift<indexItem?indexItem:indexShift;for(var i=from;i<=to;++i){this._selection.push(this._items[i]);this._items[i]._setSelected(true);this._items[i].update()}this._activateItem(item);this.notifySelectionListener()}else{this.select(item)}},setItem:function(index,string){this.checkWidget();if(typeof (string)!="string"){throw new TypeError("string is not type of a String")}if(index>=this._items.length){throw new gara.OutOfBoundsException("item is not in List")}item[index].setText(string);this.update()},setItems:function(strings){this.checkWidget();if(!$class.instanceOf(strings,Array)){throw new TypeError("strings are not an Array")}for(var i=0;i<strings.length;++i){if(this._items[i]){this._items[i].setText(strings[i])}else{var item=new gara.jswt.ListItem(this);item.setText(strings[i])}}this.update()},setSelection:function(items){this.checkWidget();if($class.instanceOf(items,Array)){items.forEach(function(item,index,arr){if($class.instanceOf(item,gara.jswt.ListItem)){this.select(item,true)}else{if($class.instanceOf(item,Number)){this.select(this._items[item],true)}}},this)}else{if($class.instanceOf(items,Number)){this.select(this._items[items])}}},toString:function(){return"[gara.jswt.List]"},_unregisterListener:function(eventType,listener){if(this.domref!=null){gara.EventManager.removeListener(this.domref,eventType,listener)}},update:function(){this.checkWidget();if(this.domref==null){this._create()}this.removeClassName("jsWTListFullSelection");if((this._style&JSWT.FULL_SELECTION)==JSWT.FULL_SELECTION){this.addClassName("jsWTListFullSelection")}this.domref.className=this._className;this._items.forEach(function(item,index,arr){item._setParentNode(this.domref);item.update()},this)}});$class("Tree",{$extends:gara.jswt.Composite,$constructor:function(parent,style){this.$base(parent,style);if(this._style==JSWT.DEFAULT){this._style=JSWT.SINGLE}this._showLines=true;this._shiftItem=null;this._activeItem=null;this._className=this._baseClass="jsWTTree";this._className+=" jsWTTreeInactive";this._selection=[];this._selectionListeners=[];this._items=[];this._columns=[];this._firstLevelItems=[]},_activateItem:function(item){this.checkWidget();if(!$class.instanceOf(item,gara.jswt.TreeItem)){throw new TypeError("item is not type of gara.jswt.TreeItem")}if(this._activeItem!=null&&!this._activeItem.isDisposed()){this._activeItem.setActive(false);this._activeItem.update()}this._activeItem=item;this._activeItem.setActive(true);this._activeItem.update()},_addItem:function(item,index){this.checkWidget();if(!$class.instanceOf(item,gara.jswt.TreeItem)){throw new TypeError("item is not type of gara.jswt.TreeItem")}var parentItem=item.getParentItem();if(parentItem==null){var append=typeof (index)=="undefined";var previousItem=this._firstLevelItems[index];if(previousItem){var nextItemIndex=getDescendents(previousItem)+1;this._items.insertAt(nextItemIndex,item);this._firstLevelItems.insertAt(index,item)}else{append=true}if(append){this._items.push(item);this._firstLevelItems.push(item)}}else{index=this._items.indexOf(parentItem)+getDescendents(parentItem);this._items.insertAt(index,item)}function getDescendents(item){var childs=0;if(item.getItemCount()>0){item.getItems().forEach(function(child,index,arr){if(child.getItemCount()>0){childs+=getDescendents(child)}childs++},this)}return childs}},addSelectionListener:function(listener){if(!$class.instanceOf(listener,gara.jswt.SelectionListener)){throw new TypeError("listener is not type of gara.jswt.SelectionListener")}if(!this._selectionListeners.contains(listener)){this._selectionListeners.push(listener)}},_create:function(){this.domref=document.createElement("ul");this.domref.obj=this;this.domref.control=this;base2.DOM.EventTarget(this.domref);var unregisteredListener={};for(var eventType in this._listener){unregisteredListener[eventType]=this._listener[eventType].concat([])}this.addListener("mousedown",this);for(var eventType in unregisteredListener){unregisteredListener[eventType].forEach(function(elem,index,arr){this._registerListener(eventType,elem)},this)}if(!$class.instanceOf(this._parent,gara.jswt.Composite)){this._parentNode=this._parent}if(this._parentNode!=null){this._parentNode.appendChild(this.domref)}},_deselect:function(item){this.checkWidget();if(!$class.instanceOf(item,gara.jswt.TreeItem)){throw new TypeError("item is not type of gara.jswt.TreeItem")}if(this._selection.contains(item)){item._setSelected(false);this._selection.remove(item);this._shiftItem=item;this._activateItem(item);this._notifySelectionListener()}},deselectAll:function(){this.checkWidget();while(this._selection.length){this._deselect(this._selection[0])}this.update()},dispose:function(){this.deselectAll();this.$base();this._firstLevelItems.forEach(function(item,index,arr){item.dispose()},this);if(this._parentNode!=null){this._parentNode.removeChild(this.domref)}delete this.domref},getColumnCount:function(){return this._columns.length},getItem:function(index){this.checkWidget();if(index>=this._items.length){throw new gara.OutOfBoundsException("Your item lives outside of this Tree")}return this._firstLevelItems[index]},getItemCount:function(){return this._firstLevelItems.length},getItems:function(){return this._firstLevelItems},getLinesVisible:function(){return this._showLines},getSelection:function(){return this._selection},getSelectionCount:function(){return this._selection.length},handleEvent:function(e){this.checkWidget();var obj=e.target.obj||null;var item=null;if($class.instanceOf(obj,gara.jswt.TreeItem)){item=obj}switch(e.type){case"mousedown":if(!this._hasFocus){this.forceFocus()}if(item!=null){if(e.target!=item.toggleNode){if(e.ctrlKey&&!e.shiftKey){if(this._selection.contains(item)){this._deselect(item)}else{this._select(item,true)}}else{if(!e.ctrlKey&&e.shiftKey){this._selectShift(item,false)}else{if(e.ctrlKey&&e.shiftKey){this._selectShift(item,true)}else{this._select(item,false)}}}}}break;case"keyup":case"keydown":case"keypress":if(this._activeItem!=null){this._activeItem.handleEvent(e)}this._notifyExternalKeyboardListener(e,this,this);if(e.type=="keydown"){this._handleKeyEvent(e)}break}if(item!=null){item.handleEvent(e)}this.handleContextMenu(e);e.stopPropagation();return false},_handleKeyEvent:function(e){this.checkWidget();if(this._activeItem==null){return }switch(e.keyCode){case 38:var prev;if(this._activeItem==this._items[0]){prev=false}else{var siblings;var parentWidget=this._activeItem.getParentItem();if(parentWidget==null){siblings=this._firstLevelItems}else{siblings=parentWidget.getItems()}var sibOffset=siblings.indexOf(this._activeItem);if(sibOffset==0){prev=parentWidget}else{var prevSibling=siblings[sibOffset-1];prev=getLastItem(prevSibling)}}if(prev){if(!e.ctrlKey&&!e.shiftKey){this._select(prev,false)}else{if(e.ctrlKey&&e.shiftKey){this._selectShift(prev,true)}else{if(e.shiftKey){this._selectShift(prev,false)}else{if(e.ctrlKey){this._activateItem(prev)}}}}}break;case 40:var next;var siblings;if(this._activeItem==this._items[this._items.length-1]){next=false}else{var parentWidget=this._activeItem.getParentItem();if(parentWidget==null){siblings=this._firstLevelItems}else{siblings=parentWidget.getItems()}var sibOffset=siblings.indexOf(this._activeItem);if(this._activeItem.getItemCount()>0&&this._activeItem.getExpanded()){next=this._activeItem.getItems()[0]}else{if(this._activeItem.getItemCount()>0&&!this._activeItem.getExpanded()){next=this._items[this._items.indexOf(this._activeItem)+countItems(this._activeItem)+1]}else{next=this._items[this._items.indexOf(this._activeItem)+1]}}}if(next){if(!e.ctrlKey&&!e.shiftKey){this._select(next,false)}else{if(e.ctrlKey&&e.shiftKey){this._selectShift(next,true)}else{if(e.shiftKey){this._selectShift(next,false)}else{if(e.ctrlKey){this._activateItem(next)}}}}}break;case 37:var buffer=this._activeItem;this._activeItem.setExpanded(false);this._activateItem(buffer);this.update();break;case 39:this._activeItem.setExpanded(true);this.update();break;case 32:if(this._selection.contains(this._activeItem)&&e.ctrlKey){this._deselect(this._activeItem)}else{this._select(this._activeItem,true)}break;case 36:if(!e.ctrlKey&&!e.shiftKey){this._select(this._items[0],false)}else{if(e.shiftKey){this._selectShift(this._items[0],false)}else{if(e.ctrlKey){this._activateItem(this._items[0])}}}break;case 35:if(!e.ctrlKey&&!e.shiftKey){this._select(this._items[this._items.length-1],false)}else{if(e.shiftKey){this._selectShift(this._items[this._items.length-1],false)}else{if(e.ctrlKey){this._activateItem(this._items[this._items.length-1])}}}break}function getLastItem(item){if(item.getExpanded()&&item.getItemCount()>0){return getLastItem(item.getItems()[item.getItemCount()-1])}else{return item}}function countItems(item){var items=0;var childs=item.getItems();for(var i=0;i<childs.length;++i){items++;if(childs[i].getItemCount()>0){items+=countItems(childs[i])}}return items}},indexOf:function(item){this.checkWidget();if(!$class.instanceOf(item,gara.jswt.TreeItem)){throw new TypeError("item not instance of gara.jswt.TreeItem")}if(!this._firstLevelItems.contains(item)){throw new gara.jswt.ItemNotExistsException("item ["+item+"] does not exists in this list")}return this._firstLevelItems.indexOf(item)},_notifySelectionListener:function(){this._selectionListeners.forEach(function(item,index,arr){item.widgetSelected(this)},this)},_registerListener:function(eventType,listener){if(this.domref!=null){gara.EventManager.addListener(this.domref,eventType,listener)}},remove:function(index){this.checkWidget();var item=this._firstLevelItems.removeAt(index)[0];this._items.remove(item);if(!item.isDisposed()){item.dispose()}delete item},_removeItem:function(item){this.checkWidget();if(!$class.instanceOf(item,gara.jswt.TreeItem)){throw new TypeError("item not instance of gara.jswt.TreeItem")}this._items.remove(item)},removeRange:function(start,end){for(var i=start;i<=end;++i){this.remove(i)}},removeFromArray:function(indices){indices.forEach(function(item,index,arr){this.remove(index)},this)},removeAll:function(){while(this._firstLevelItems.length){var item=this._firstLevelItems.pop();this.domref.removeChild(item.domref);delete item}},removeSelectionListener:function(listener){if(!$class.instanceOf(listener,gara.jswt.SelectionListener)){throw new TypeError("item is not type of gara.jswt.SelectionListener")}if(this._selectionListeners.contains(listener)){this._selectionListeners.remove(listener)}},_select:function(item,_add){this.checkWidget();if(!$class.instanceOf(item,gara.jswt.TreeItem)){throw new TypeError("item is not type of gara.jswt.TreeItem")}if(!_add||(this._style&JSWT.MULTI)!=JSWT.MULTI){while(this._selection.length){var i=this._selection.pop();i._setSelected(false);i.update()}}if(!this._selection.contains(item)){item._setSelected(true);this._selection.push(item);this._shiftItem=item;this._activateItem(item);this._notifySelectionListener()}},selectAll:function(){this.checkWidget();if((this._style&JSWT.SINGLE)!=JSWT.SINGLE){this._items.forEach(function(item,index,arr){this._select(item,true)},this);this.update()}},_selectShift:function(item,_add){this.checkWidget();if(!$class.instanceOf(item,gara.jswt.TreeItem)){throw new TypeError("item is not type of gara.jswt.TreeItem")}if(!_add){while(this._selection.length){var i=this._selection.pop();i._setSelected(false);i.update()}}if((this._style&JSWT.MULTI)==JSWT.MULTI){var indexShift=this._items.indexOf(this._shiftItem);var indexItem=this._items.indexOf(item);var from=indexShift>indexItem?indexItem:indexShift;var to=indexShift<indexItem?indexItem:indexShift;for(var i=from;i<=to;++i){this._selection.push(this._items[i]);this._items[i]._setSelected(true);this._items[i].update()}this._activateItem(item);this._notifySelectionListener()}else{this._select(item)}},setLinesVisible:function(show){this._showLines=show},setSelection:function(items){this.checkWidget();if(!$class.instanceOf(items,Array)){throw new TypeError("items are not instance of an Array")}this._selection=items;this._selection.forEach(function(item,index,arr){item._setSelected(true)},this);this._notifySelectionListener()},toString:function(){return"[gara.jswt.Tree]"},_unregisterListener:function(eventType,listener){if(this.domref!=null){gara.EventManager.removeListener(this.domref,eventType,listener)}},update:function(){this.checkWidget();if(this.domref==null){this._create()}this.removeClassName("jsWTTreeNoLines");this.removeClassName("jsWTTreeLines");this.removeClassName("jsWTTreeFullSelection");if(this._showLines){this.addClassName("jsWTTreeLines")}else{this.addClassName("jsWTTreeNoLines")}if((this._style&JSWT.FULL_SELECTION)==JSWT.FULL_SELECTION){this.addClassName("jsWTTreeFullSelection")}this.domref.className=this._className;this._firstLevelItems.forEach(function(item,index,arr){if(item.isDisposed()){this.remove(index)}else{item.update()}},this)}});$class("TabFolder",{$extends:gara.jswt.Composite,$constructor:function(parent,style){this.$base(parent,style);if(this._style==JSWT.DEFAULT){this._style=JSWT.TOP}this._items=[];this._activeItem=null;this._selectionListener=[];this._selection=[];this._tabbar=null;this._clientArea=null;this._className=this._baseClass="jsWTTabFolder";this._className+=" jsWTTabFolderInactive"},_addItem:function(item){this.checkWidget();if(!$class.instanceOf(item,gara.jswt.TabItem)){throw new TypeError("item is not type of gara.jswt.TabItem")}var count=this.getItemCount();this._items.push(item)},addSelectionListener:function(listener){this.checkWidget();if(!$class.instanceOf(listener,gara.jswt.SelectionListener)){throw new TypeError("listener is not instance of gara.jswt.SelectionListener")}this._selectionListener.push(listener)},_activateItem:function(item){this.checkWidget();if(!$class.instanceOf(item,gara.jswt.TabItem)){throw new TypeError("item is not type of gara.jswt.TabItem")}if(this._activeItem!=null){this._activeItem.setActive(false)}this._activeItem=item;item._setActive(true);for(var i=0,len=this._clientArea.childNodes.length;i<len;++i){this._clientArea.removeChild(this._clientArea.childNodes[i])}if(item.getControl()!=null){item.getControl().update();this._clientArea.appendChild(item.getControl().domref)}else{if(typeof (item.getContent())=="string"){this._clientArea.appendChild(document.createTextNode(item.getContent()))}else{this._clientArea.appendChild(item.getContent())}}this.update();this._selection=[];this._selection.push(item);this._notifySelectionListener()},_create:function(){this.domref=document.createElement("div");this.domref.obj=this;this.domref.control=this;base2.DOM.EventTarget(this.domref);this._tabbar=document.createElement("ul");this._tabbar.obj=this;this._tabbar.control=this;base2.DOM.EventTarget(this._tabbar);this._clientArea=document.createElement("div");this._clientArea.className="jsWTTabClientArea";base2.DOM.EventTarget(this._clientArea);if(this._style==JSWT.TOP){this.domref.appendChild(this._tabbar);this.domref.appendChild(this._clientArea);this._tabbar.className="jsWTTabbar jsWTTabbarTop"}else{this.domref.appendChild(this._clientArea);this.domref.appendChild(this._tabbar);this._tabbar.className="jsWTTabbar jsWTTabbarBottom"}var unregisteredListener={};for(var eventType in this._listener){unregisteredListener[eventType]=this._listener[eventType].concat([])}this.addListener("mousedown",this);for(var eventType in unregisteredListener){unregisteredListener[eventType].forEach(function(elem,index,arr){this.registerListener(eventType,elem)},this)}if(!$class.instanceOf(this._parent,gara.jswt.Composite)){this._parentNode=this._parent}if(this._parentNode!=null){this._parentNode.appendChild(this.domref)}},dispose:function(){this.$base();this._items.forEach(function(item,index,arr){item.dispose()},this);this.domref.removeChild(this._tabbar);this.domref.removeChild(this._clientArea);if(this._parentNode!=null){this._parentNode.removeChild(this.domref)}delete this._tabbar;delete this._clientArea;delete this.domref},getClientArea:function(){return this._clientArea},getItem:function(index){this.checkWidget();if(index>=this._items.length){throw new gara.OutOfBoundsException("Your item lives outside of this tabfolder")}return this._items[index]},getItemCount:function(){return this._items.length},getItems:function(){return this._items},getSelection:function(){this.checkWidget();return this._selection},getSelectionIndex:function(){this.checkWidget();if(this._selection.length){return this._items.indexOf(this._selection[0])}else{return -1}},handleEvent:function(e){this.checkWidget();var obj=e.target.obj||null;switch(e.type){case"mousedown":if(!this._hasFocus){this.forceFocus()}if($class.instanceOf(obj,gara.jswt.TabItem)){var item=obj;this._activateItem(item)}break;case"keyup":case"keydown":case"keypress":if(this._activeItem!=null){this._activeItem.handleEvent(e)}this._notifyExternalKeyboardListener(e,this,this);break}this.handleContextMenu(e);if(e.target!=this.domref){e.stopPropagation()}return false},indexOf:function(item){this.checkWidget();if(!$class.instanceOf(item,gara.jswt.TabItem)){throw new TypeError("item not instance of gara.jswt.TabItem")}if(!this._items.contains(item)){throw new gara.jswt.ItemNotExistsException("item ["+item+"] does not exists in this list")}return this._items.indexOf(item)},_notifySelectionListener:function(){for(var i=0,len=this._selectionListener.length;i<len;++i){this._selectionListener[i].widgetSelected(this)}},_registerListener:function(eventType,listener){if(this.domref!=null){gara.EventManager.addListener(this.domref,eventType,listener)}},removeSelectionListener:function(listener){this.checkWidget();if(!$class.instanceOf(listener,gara.jswt.SelectionListener)){throw new TypeError("listener is not instance of gara.jswt.SelectionListener")}if(this._selectionListener.contains(listener)){this._selectionListener.remove(listener)}},setSelection:function(arg){this.checkWidget();if(typeof (arg)=="number"){if(arg>=this._items.length){throw new gara.OutOfBoundsException("Your item lives outside of this tabfolder")}this._activateItem(this._items[arg])}else{if($class.instanceOf(arg,Array)){if(arg.length){this._activateItem(arg[0])}}}},_showContent:function(item){},toString:function(){return"[gara.jswt.TabFolder]"},_unregisterListener:function(eventType,listener){if(this.domref!=null){gara.EventManager.removeListener(this.domref,eventType,listener)}},update:function(){this.checkWidget();var firstBuild=false;if(this.domref==null){this._create();firstBuild=true}this.domref.className=this._className;this._items.forEach(function(item,index,arr){if(!item.isCreated()){node=item._create();this._tabbar.appendChild(node)}if(item.hasChanged()){item.update();item.releaseChange()}},this);if(firstBuild&&this._items.length){this._activateItem(this._items[0])}}});$class("Table",{$extends:gara.jswt.Composite,$constructor:function(parent,style){this.$base(parent,style);if(this._style==JSWT.DEFAULT){this._style=JSWT.SINGLE}this._items=[];this._columns=[];this._columnOrder=[];this._headerVisible=false;this._linesVisible=false;this._thead=null;this._theadRow=null;this._tbody=null;this._className=this._baseClass="jsWTTable";this._className+=" jsWTTableInactive";this._selection=[];this._selectionListener=[];this._shiftItem=null;this._activeItem=null},_activateItem:function(item){this.checkWidget();if(!$class.instanceOf(item,gara.jswt.TableItem)){throw new TypeError("item is not type of gara.jswt.TableItem")}if(this._activeItem!=null&&!this._activeItem.isDisposed()){this._activeItem.setActive(false);this._activeItem.update()}this._activeItem=item;this._activeItem.setActive(true);this._activeItem.update()},_addItem:function(item,index){this.checkWidget();if(!$class.instanceOf(item,gara.jswt.TableItem)){throw new TypeError("item is not a gara.jswt.TableItem")}if(typeof (index)!="undefined"){this._items.insertAt(index,item)}else{this._items.push(item)}item._setParentNode(this._tbody)},_addColumn:function(column,index){this.checkWidget();if(!$class.instanceOf(column,gara.jswt.TableColumn)){throw new TypeError("column is not a gara.jswt.TableColumn")}if(index){this._columns[index]=column;if(!this._columnOrder.contains(index)){this._columnOrder.push(index)}}else{this._columns.push(column);this._columnOrder.push(this._columns.length-1)}column._setParentNode(this._theadRow)},addSelectionListener:function(listener){if(!$class.instanceOf(listener,gara.jswt.SelectionListener)){throw new TypeError("listener is not type of gara.jswt.SelectionListener")}if(!this._selectionListener.contains(listener)){this._selectionListener.push(listener)}},clear:function(index){this.checkWidget();var item=this._items[index];item.clear()},_create:function(){this.domref=document.createElement("table");this.domref.obj=this;this.domref.control=this;base2.DOM.EventTarget(this.domref);this._thead=document.createElement("thead");this._thead.obj=this;this._thead.control=this;base2.DOM.EventTarget(this._thead);this.domref.appendChild(this._thead);this._theadRow=document.createElement("tr");this._theadRow.obj=this;this._theadRow.control=this;base2.DOM.EventTarget(this._theadRow);this._thead.appendChild(this._theadRow);if((this._style&JSWT.CHECK)==JSWT.CHECK){var checkboxCol=document.createElement("th");this._theadRow.appendChild(checkboxCol)}for(var i=0,len=this._columnOrder.length;i<len;++i){this._columns[this._columnOrder[i]]._setParentNode(this._theadRow);this._columns[this._columnOrder[i]].update()}this._tbody=document.createElement("tbody");this._tbody.obj=this;this._tbody.control=this;base2.DOM.EventTarget(this._tbody);this.domref.appendChild(this._tbody);var unregisteredListener={};for(var eventType in this._listener){unregisteredListener[eventType]=this._listener[eventType].concat([])}this.addListener("mousedown",this);for(var eventType in unregisteredListener){unregisteredListener[eventType].forEach(function(elem,index,arr){this._registerListener(eventType,elem)},this)}if(!$class.instanceOf(this._parent,gara.jswt.Composite)){this._parentNode=this._parent}if(this._parentNode!=null){this._parentNode.appendChild(this.domref)}},deselect:function(item){this.checkWidget();if(!$class.instanceOf(item,gara.jswt.TableItem)){throw new TypeError("item is not type of gara.jswt.TableItem")}if(this._selection.contains(item)){item._setSelected(false);this._selection.remove(item);this._shiftItem=item;this._activateItem(item);this._notifySelectionListener()}},deselectAll:function(){this.checkWidget();while(this._selection.length){this.deselect(this._selection[0])}},dispose:function(){this.deselectAll();this.$base();this._columns.forEach(function(col,index,arr){col.dispose()},this);this._items.forEach(function(item,index,arr){item.dispose()},this);this._thead.removeChild(this._theadRow);this.domref.removeChild(this._thead);this.domref.removeChild(this._tbody);if(this._parentNode!=null){this._parentNode.removeChild(this.domref)}delete this._theadRow;delete this._thead;delete this._tbody;delete this.domref},getColumn:function(index){this.checkWidget();if(index>=0&&index<this._columns.length){return this._columns[index]}return null},getColumnCount:function(){return this._columns.length},getColumnOrder:function(){return this._columnOrder},getColumns:function(){return this._columns},getHeaderVisible:function(){return this._headerVisible},getItem:function(index){this.checkWidget();if(index>=this._items.length){throw new gara.OutOfBoundsException("The requested index exceeds the bounds")}return this._items[index]},getItemCount:function(){return this._items.length},getItems:function(){return this._items},getLinesVisible:function(){return this._linesVisible},getSelection:function(){return this._selection},getSelectionCount:function(){return this._selection.length},handleEvent:function(e){this.checkWidget();var obj=e.target.obj||null;switch(e.type){case"mousedown":if(!this._hasFocus){this.forceFocus()}if($class.instanceOf(obj,gara.jswt.TableItem)){var item=obj;if(!e.ctrlKey&&!e.shiftKey){this.select(item,false)}else{if(e.ctrlKey&&e.shiftKey){this._selectShift(item,true)}else{if(e.shiftKey){this._selectShift(item,false)}else{if(e.ctrlKey){if(this._selection.contains(item)){this.deselect(item)}else{this.select(item,true)}}else{this.select(item)}}}}}if($class.instanceOf(obj,gara.jswt.TableColumn)){obj.handleEvent(e)}break;case"keyup":case"keydown":case"keypress":if(this._activeItem!=null){this._activeItem.handleEvent(e)}this._notifyExternalKeyboardListener(e,this,this);if(e.type=="keydown"){this._handleKeyEvent(e)}break}if($class.instanceOf(obj,gara.jswt.TableItem)){this.handleContextMenu(e)}e.stopPropagation();return false},_handleKeyEvent:function(e){this.checkWidget();if(this._activeItem==null){return }switch(e.keyCode){case 38:var prev=false;var activeIndex=this.indexOf(this._activeItem);if(activeIndex!=0){prev=this._items[activeIndex-1]}if(prev){if(!e.ctrlKey&&!e.shiftKey){this.select(prev,false)}else{if(e.ctrlKey&&e.shiftKey){this._selectShift(prev,true)}else{if(e.shiftKey){this._selectShift(prev,false)}else{if(e.ctrlKey){this._activateItem(prev)}}}}}break;case 40:var next=false;var activeIndex=this.indexOf(this._activeItem);if(activeIndex!=this._items.length-1){next=this._items[activeIndex+1]}if(next){if(!e.ctrlKey&&!e.shiftKey){this.select(next,false)}else{if(e.ctrlKey&&e.shiftKey){this._selectShift(next,true)}else{if(e.shiftKey){this._selectShift(next,false)}else{if(e.ctrlKey){this._activateItem(next)}}}}}break;case 32:if(this._selection.contains(this._activeItem)&&e.ctrlKey){this.deselect(this._activeItem)}else{this.select(this._activeItem,true)}break;case 36:if(!e.ctrlKey&&!e.shiftKey){this.select(this._items[0],false)}else{if(e.shiftKey){this._selectShift(this._items[0],false)}else{if(e.ctrlKey){this._activateItem(this._items[0])}}}break;case 35:var lastOffset=this._items.length-1;if(!e.ctrlKey&&!e.shiftKey){this.select(this._items[lastOffset],false)}else{if(e.shiftKey){this._selectShift(this._items[lastOffset],false)}else{if(e.ctrlKey){this._activateItem(this._items[lastOffset])}}}break}},indexOf:function(item){this.checkWidget();if(!$class.instanceOf(item,gara.jswt.TableItem)){throw new TypeError("item not instance of gara.jswt.TableItem")}if(!this._items.contains(item)){throw new gara.jswt.ItemNotExistsException("item ["+item+"] does not exists in this list")}return this._items.indexOf(item)},_notifySelectionListener:function(){this._selectionListener.forEach(function(item,index,arr){item.widgetSelected(this)},this)},_registerListener:function(eventType,listener){if(this.domref){gara.EventManager.addListener(this.domref,eventType,listener)}},remove:function(index){this.checkWidget();var item=this._items.removeAt(index)[0];item.dispose();delete item},removeRange:function(start,end){this.checkWidget();for(var i=start;i<=end;++i){this.remove(start)}},removeFromArray:function(indices){this.checkWidget();indices.forEach(function(item,index,arr){this.remove(index)},this)},removeAll:function(){this.checkWidget();while(this._items.length){var item=this._items.pop();this.domref.removeChild(item.domref);delete item}},removeSelectionListener:function(listener){if(!$class.instanceOf(listener,gara.jswt.SelectionListener)){throw new TypeError("listener is not type of gara.jswt.SelectionListener")}if(this._selectionListener.contains(listener)){this._selectionListener.remove(listener)}},select:function(item,_add){this.checkWidget();if(!$class.instanceOf(item,gara.jswt.TableItem)){throw new TypeError("item not instance of gara.jswt.TableItem")}if(!_add||(this._style&JSWT.MULTI)!=JSWT.MULTI){while(this._selection.length){var i=this._selection.pop();i._setSelected(false);i.update()}}if(!this._selection.contains(item)){this._selection.push(item);item._setSelected(true);this._shiftItem=item;this._activateItem(item);this._notifySelectionListener()}},_selectShift:function(item,_add){this.checkWidget();if(!$class.instanceOf(item,gara.jswt.TableItem)){throw new TypeError("item is not type of gara.jswt.TableItem")}if(!_add){while(this._selection.length){var i=this._selection.pop();i._setSelected(false);i.update()}}if((this._style&JSWT.MULTI)==JSWT.MULTI){var indexShift=this.indexOf(this._shiftItem);var indexItem=this.indexOf(item);var from=indexShift>indexItem?indexItem:indexShift;var to=indexShift<indexItem?indexItem:indexShift;for(var i=from;i<=to;++i){this._selection.push(this._items[i]);this._items[i]._setSelected(true);this._items[i].update()}this._activateItem(item);this._notifySelectionListener()}else{this.select(item)}},setColumnOrder:function(order){this._columnOrder=order},setHeaderVisible:function(show){this._headerVisible=show},setLinesVisible:function(show){this._linesVisible=show},toString:function(){return"[gara.jswt.Table]"},_unregisterListener:function(eventType,listener){if(this.domref!=null){gara.EventManager.removeListener(this.domref,eventType,listener)}},update:function(){this.checkWidget();if(this.domref==null){this._create()}while(this._theadRow.childNodes.length){this._theadRow.removeChild(this._theadRow.childNodes[0])}if((this._style&JSWT.CHECK)==JSWT.CHECK){var checkboxCol=document.createElement("th");checkboxCol.className="jsWTTableCheckboxCol";this._theadRow.appendChild(checkboxCol)}for(var i=0,len=this._columnOrder.length;i<len;++i){this._columns[this._columnOrder[i]].update();this._theadRow.appendChild(this._columns[this._columnOrder[i]].domref)}if(this._headerVisible){this._thead.style.display=document.all?"block":"table-row-group"}else{this._thead.style.display="none"}this._tbody.className="";this.removeClassName("jsWTTableNoLines");this.removeClassName("jsWTTableLines");this.addClassName("jsWTTable"+(this._linesVisible?"":"No")+"Lines");if((this._style&JSWT.FULL_SELECTION)==JSWT.FULL_SELECTION){this._tbody.className="jsWTTableFullSelection"}this.domref.className=this._className;this._updateItems()},_updateItems:function(){this._items.forEach(function(item,index,arr){item._setParentNode(this._tbody);item.update()},this)}});$class("Item",{$extends:gara.jswt.Widget,$constructor:function(parent,style){this.$base(parent,style);this._changed=false;this._image=null;this._text=""},getImage:function(){return this._image},getText:function(){return this._text},hasChanged:function(){return this._changed},isCreated:function(){return this.domref!=null},releaseChange:function(){this._changed=false},setActive:function(active){this._active=active;if(active){this.addClassName("active")}else{this.removeClassName("active")}this._changed=true},setImage:function(image){this._image=image;this._changed=true},setText:function(text){this._text=text;this._changed=true},toString:function(){return"[gara.jswt.Item]"}});$class("ListItem",{$extends:gara.jswt.Item,$constructor:function(parent,style,index){if(!$class.instanceOf(parent,gara.jswt.List)){throw new TypeError("parent is not type of gara.jswt.List")}this.$base(parent,style);this._parent=parent;this._list=parent;this._list._addItem(this,index);this._span=null;this._spanText=null;this._img=null;this._checkbox=null;this._selected=false;this._grayed=false;this._checked=false},_create:function(){this.domref=document.createElement("li");this.domref.className=this._className;this.domref.obj=this;this.domref.control=this._list;this._checkbox=document.createElement("input");this._checkbox.type="checkbox";this._checkbox.obj=this;this._checkbox.control=this._list;this._checkbox.style.display="none";if(this._grayed){this._checkbox.disabled=true}if(this._checked){this._checkbox.checked=true}if((this._list.getStyle()&JSWT.CHECK)==JSWT.CHECK){this._checkbox.style.display="inline"}this.domref.appendChild(this._checkbox);this._img=null;if(this._image!=null){this._img=document.createElement("img");this._img.obj=this;this._img.control=this._list;this._img.src=this._image.src;this.domref.appendChild(this._img);base2.DOM.EventTarget(this._img)}this._spanText=document.createTextNode(this._text);this._span=document.createElement("span");this._span.obj=this;this._span.control=this._list;this._span.appendChild(this._spanText);this.domref.appendChild(this._span);base2.DOM.EventTarget(this.domref);base2.DOM.EventTarget(this._span);for(var eventType in this._listener){this._listener[eventType].forEach(function(elem,index,arr){this._registerListener(eventType,elem)},this)}var items=this._list.getItems();var index=items.indexOf(this);var nextNode=index==0?this._parentNode.firstChild:items[index-1].domref.nextSibling;if(!nextNode){this._parentNode.appendChild(this.domref)}else{this._parentNode.insertBefore(this.domref,nextNode)}},dispose:function(){this.$base();if(this._img!=null){this.domref.removeChild(this._img);delete this._img;this._image=null}this.domref.removeChild(this._span);if(this._parentNode!=null){this._parentNode.removeChild(this.domref)}delete this._span;delete this.domref},getChecked:function(){this.checkWidget();this._checked=this._checkbox.checked;return this._checked},getGrayed:function(){this.checkWidget();return this._grayed},handleEvent:function(e){this.checkWidget();switch(e.type){case"keyup":case"keydown":case"keypress":this._notifyExternalKeyboardListener(e,this,this._list);break}},_registerListener:function(eventType,listener){if(this._img!=null){gara.EventManager.addListener(this._img,eventType,listener)}if(this._span!=null){gara.EventManager.addListener(this._span,eventType,listener)}},setChecked:function(checked){if(!this._grayed){this._checked=checked;if(this._checked){this._checkbox.checked=true}else{this._checkbox.checked=false}}},setGrayed:function(grayed){this._grayed=grayed;if(this._grayed){this._checkbox.disabled=true}else{this._checkbox.disabled=false}},_setSelected:function(selected){this.checkWidget();this._selected=selected},toString:function(){return"[gara.jswt.ListItem]"},_unregisterListener:function(eventType,listener){if(this._img!=null){gara.EventManager.removeListener(this._img,eventType,listener)}if(this._span!=null){gara.EventManager.removeListener(this._span,eventType,listener)}},update:function(){this.checkWidget();if(this.domref==null){this._create()}else{if(this._image!=null&&this._img==null){this._img=document.createElement("img");this._img.obj=this;this._img.control=this._list;this._img.alt=this._text;this._img.src=this._image.src;this.domref.insertBefore(this._img,this._span);base2.DOM.EventTarget(this._img);for(var eventType in this._listener){this._listener[eventType].forEach(function(elem,index,arr){this.registerListener(this._img,eventType,elem)},this)}}else{if(this._image!=null){this._img.src=this._image.src;this._img.alt=this._text}else{if(this._img!=null&&this._image==null){this.domref.removeChild(this._img);this._img=null;for(var eventType in this._listener){this._listener[eventType].forEach(function(elem,index,arr){gara.EventManager.removeListener(this._img,eventType,elem)},this)}}}}if((this._list.getStyle()&JSWT.CHECK)==JSWT.CHECK){this._checkbox.style.display="inline"}else{this._checkbox.style.display="none"}this._spanText.nodeValue=this._text}this.removeClassName("selected");if(this._selected){this.addClassName("selected")}this.domref.className=this._className;this.releaseChange()}});$class("TreeItem",{$extends:gara.jswt.Item,toggleNode:null,$constructor:function(parent,style,index){if(!($class.instanceOf(parent,gara.jswt.Tree)||$class.instanceOf(parent,gara.jswt.TreeItem))){throw new TypeError("parent is neither a gara.jswt.Tree or gara.jswt.TreeItem")}this.$base(parent,style);this._images=[];this._texts=[];this._items=new Array();this._expanded=true;this._checked=false;this._grayed=false;this._selected=false;this._changed=false;this._parent=parent;this._tree=null;if($class.instanceOf(parent,gara.jswt.Tree)){this._tree=parent}else{if($class.instanceOf(parent,gara.jswt.TreeItem)){this._tree=parent.getParent();parent._addItem(this,index)}}this._tree._addItem(this,index);this._img=null;this._span=null;this._spanText=null;this._toggleNode=null;this._childContainer=null;this._checkbox=null},_addItem:function(item,index){this.checkWidget();if(!$class.instanceOf(item,gara.jswt.TreeItem)){throw new TypeError("item is not type of gara.jswt.TreeItem")}if(typeof (index)!="undefined"){this._items.insertAt(index,item)}else{this._items.push(item)}this._changed=true},_create:function(){if($class.instanceOf(this._parent,gara.jswt.Tree)){this._parentNode=this._parent.domref}else{if($class.instanceOf(this._parent,gara.jswt.TreeItem)){this._parentNode=this._parent._getChildContainer()}}var parentItems=this._parent.getItems();this.removeClassName("bottom");if(parentItems.indexOf(this)==parentItems.length-1){this.addClassName("bottom")}this.domref=document.createElement("li");this.domref.className=this._className;this.domref.obj=this;this.domref.control=this._tree;base2.DOM.EventTarget(this.domref);this._toggleNode=document.createElement("span");this._toggleNode.obj=this;this._toggleNode.control=this._tree;base2.DOM.EventTarget(this._toggleNode);this._toggleNode.className="toggler";this._toggleNode.className+=this._hasChilds()?(this._expanded?" togglerExpanded":" togglerCollapsed"):"";this.domref.appendChild(this._toggleNode);this._checkbox=document.createElement("input");this._checkbox.type="checkbox";this._checkbox.obj=this;this._checkbox.control=this._list;this._checkbox.style.display="none";if(this._grayed){this._checkbox.disabled=true}if(this._checked){this._checkbox.checked=true}if((this._tree.getStyle()&JSWT.CHECK)==JSWT.CHECK){this._checkbox.style.display="inline"}this.domref.appendChild(this._checkbox);if(this.getImage()!=null){this._img=document.createElement("img");this._img.obj=this;this._img.src=this.getImage().src;this._img.control=this._tree;base2.DOM.EventTarget(this._img);this.domref.appendChild(this._img)}this._span=document.createElement("span");this._span.obj=this;this._span.control=this._tree;this._span.className="text";this._spanText=document.createTextNode(this.getText());this._span.appendChild(this._spanText);base2.DOM.EventTarget(this._span);this.domref.appendChild(this._span);if(this._hasChilds()){this._createChildContainer()}for(var eventType in this._listeners){this._listeners[eventType].forEach(function(elem,index,arr){this._registerListener(eventType,elem)},this)}this._parentNode.appendChild(this.domref)},_createChildContainer:function(){this.checkWidget();this._childContainer=document.createElement("ul");base2.DOM.EventTarget(this._childContainer);if(this.getClassName().indexOf("bottom")!=-1){this._childContainer.className="bottom"}if(this._expanded){this._childContainer.style.display="block"}else{this._childContainer.style.display="none"}this.domref.appendChild(this._childContainer)},_deselectItems:function(){this.checkWidget();this._items.forEach(function(child,index,arr){if(child._hasChilds()){child._deselectItems()}this._tree._deselect(child)},this)},dispose:function(){this.$base();if(this._childContainer!=null){this._items.forEach(function(item,index,arr){item.dispose()},this);this.domref.removeChild(this._childContainer);delete this._childContainer}if(this._img!=null){this.domref.removeChild(this._img);delete this._img;this._image=null}this.domref.removeChild(this._toggleNode);this.domref.removeChild(this._span);if(this._parentNode!=null){this._parentNode.removeChild(this.domref)}delete this._toggleNode;delete this._span;delete this._spanText;delete this.domref},_getChildContainer:function(){if(this._childContainer==null){this._createChildContainer()}return this._childContainer},getChecked:function(){this.checkWidget();this._checked=this._checkbox.checked;return this._checked},getExpanded:function(){this.checkWidget();return this._expanded},getGrayed:function(){this.checkWidget();return this._grayed},getImage:function(columnIndex){this.checkWidget();if(typeof (columnIndex)=="undefined"){columnIndex=0}return this._images[columnIndex]},getItem:function(index){this.checkWidget();if(index>=this._items.length){throw new gara.OutOfBoundsException("Your item lives outside of this Tree")}return this._items[index]},getItemCount:function(){return this._items.length},getItems:function(){return this._items},getParent:function(){return this._tree},getParentItem:function(){if(this._parent==this._tree){return null}else{return this._parent}},getText:function(columnIndex){this.checkWidget();if(typeof (columnIndex)=="undefined"){columnIndex=0}return this._texts[columnIndex]},_hasChilds:function(){return this._items.length>0},handleEvent:function(e){this.checkWidget();var obj=e.target.obj||null;switch(e.type){case"mousedown":if($class.instanceOf(obj,gara.jswt.TreeItem)){var item=obj;if(e.target==this._toggleNode){if(this._expanded){this.setExpanded(false)}else{this.setExpanded(true)}this._tree.update()}}break;case"dblclick":break;case"keyup":case"keydown":case"keypress":this._notifyExternalKeyboardListener(e,this,this._tree);break}},indexOf:function(item){this.checkWidget();if(!$class.instanceOf(item,gara.jswt.TreeItem)){throw new TypeError("item not instance of gara.jswt.TreeItem")}if(!this._items.contains(item)){throw new gara.jswt.ItemNotExistsException("item ["+item+"] does not exists in this list");return }return this._items.indexOf(item)},_registerListener:function(eventType,listener){if(this._img!=null){gara.EventManager.addListener(this._img,eventType,listener)}if(this._span!=null){gara.EventManager.addListener(this._span,eventType,listener)}},remove:function(index){this.checkWidget();var item=this._items.removeAt(index)[0];this._tree._removeItem(item);if(!item.isDisposed()){item.dispose()}delete item},removeRange:function(start,end){this.checkWidget();for(var i=start;i<=end;++i){this.remove(i)}},removeFromArray:function(indices){this.checkWidget();indices.forEach(function(item,index,arr){this.remove(index)},this)},removeAll:function(){this.checkWidget();while(this._items.length){var item=this._items.pop();this.domref.removeChild(item.domref);delete item}},setActive:function(active){this.checkWidget();this._active=active},setChecked:function(checked){if(!this._grayed){this._checked=checked;if(this._checked){this._checkbox.checked=true}else{this._checkbox.checked=false}}},setExpanded:function(expanded){this.checkWidget();this._expanded=expanded;if(!expanded){this._deselectItems()}this._changed=true},setGrayed:function(grayed){this._grayed=grayed;if(this._grayed){this._checkbox.disabled=true}else{this._checkbox.disabled=false}},setImage:function(columnIndex,image){if(typeof (image)=="undefined"){image=columnIndex;columnIndex=0}this._images[columnIndex]=image},_setSelected:function(selected){this.checkWidget();this._selected=selected},setText:function(columnIndex,text){if(typeof (columnIndex)=="string"){text=columnIndex;columnIndex=0}this._texts[columnIndex]=text},toString:function(){return"[gara.jswt.TreeItem]"},_unregisterListener:function(eventType,listener){if(this._img!=null){gara.EventManager.removeListener(this._img,eventType,listener)}if(this._span!=null){gara.EventManager.removeListener(this._span,eventType,listener)}},update:function(){this.checkWidget();if(this.domref==null){this._create()}else{if(this.hasChanged()){if(this._hasChilds()){this._toggleNode.className=strReplace(this._toggleNode.className," togglerCollapsed","");this._toggleNode.className=strReplace(this._toggleNode.className," togglerExpanded","");if(this._expanded){this._toggleNode.className+=" togglerExpanded"}else{this._toggleNode.className+=" togglerCollapsed"}}else{if(!this._hasChilds()&&this._childContainer!=null){this._toggleNode.className="toggler"}}if(this.getImage()!=null&&this._img==null){this._img=document.createElement("img");this._img.obj=this;this._img.control=this._tree;this._img.alt=this.getText();this._img.src=this.getImage().src;this.domref.insertBefore(this._img,this._span);base2.DOM.EventTarget(this._img)}else{if(this.getImage()!=null){this._img.src=this.getImage().src;this._img.alt=this._text}else{if(this._img!=null&&this.getImage()==null){this.domref.removeChild(this._img);this._img=null}}}if(this._hasChilds()&&this._childContainer==null){this._createChildContainer()}if(this._childContainer!=null){if(this._expanded){this._childContainer.style.display="block"}else{this._childContainer.style.display="none"}}else{if(!this._hasChilds()&&this._childContainer!=null){this.domref.removeChild(this._childContainer);this._childContainer=null}}var parentItems=this._parent.getItems();this.removeClassName("bottom");if(parentItems.indexOf(this)==parentItems.length-1){this.addClassName("bottom")}if((this._tree.getStyle()&JSWT.CHECK)==JSWT.CHECK){this._checkbox.style.display="inline"}else{this._checkbox.style.display="none"}this._spanText.nodeValue=this.getText();this.domref.className=this._className;this.releaseChange()}}if(this._selected){this._span.className="text selected"}else{this._span.className="text"}if(this._active){this._span.className+=" active"}else{this._span.className=this._span.className.replace(/ *active/,"")}this._items.forEach(function(item,index,arr){if(item.isDisposed()){this.remove(index)}else{item.update()}},this)}});$class("TabItem",{$extends:gara.jswt.Item,$constructor:function(parent,style){if(!$class.instanceOf(parent,gara.jswt.TabFolder)){throw new TypeError("parentWidget is neither a gara.jswt.TabFolder")}this.$base(parent,style);this._active=false;this._content=null;this._control=null;this._toolTipText=null;this._span=null;this._img=null;this._parent._addItem(this)},_create:function(){this.domref=document.createElement("li");this.domref.className=this._className;this.domref.obj=this;this.domref.control=this._parent;if(this._toolTipText!=null){this.domref.title=this._toolTipText}base2.DOM.EventTarget(this.domref);if(this._image!=null){this._img=document.createElement("img");this._img.obj=this;this._img.control=this._parent;this._img.src=this._image.src;this._img.alt=this._text;base2.DOM.EventTarget(this._img);this.domref.appendChild(this._img)}this._spanText=document.createTextNode(this._text);this._span=document.createElement("span");this._span.obj=this;this._span.control=this._parent;this._span.appendChild(this._spanText);this.domref.appendChild(this._span);base2.DOM.EventTarget(this._span);for(var eventType in this._listener){this._listener[eventType].forEach(function(elem,index,arr){this.registerListener(eventType,elem)},this)}this._changed=false;return this.domref},dispose:function(){this.$base();if(this._img!=null){this.domref.removeChild(this._img);delete this._img;this._image=null}this.domref.removeChild(this._span);if(this._parentNode!=null){this._parentNode.removeChild(this.domref)}if(this._control!=null){this._control.dispose()}delete this._span;delete this.domref},getContent:function(){this.checkWidget();return this._content},getControl:function(){this.checkWidget();return this._control},getToolTipText:function(){this.checkWidget();return this._toolTipText},handleEvent:function(e){this.checkWidget();switch(e.type){case"keyup":case"keydown":case"keypress":this._notifyExternalKeyboardListener(e,this,this._parent);break}},_registerListener:function(){if(this.domref!=null){gara.EventManager.addListener(this.domref,eventType,listener)}},_setActive:function(active){this.checkWidget();this._active=active;if(active){this._className+=" active"}else{this._className=this._className.replace(/ *active/,"")}this._changed=true},setContent:function(content){this.checkWidget();this._content=content;this._changed=true},setControl:function(control){this.checkWidget();if(!$class.instanceOf(control,gara.jswt.Control)){throw new TypeError("control is not instance of gara.jswt.Control")}this._control=control},setToolTipText:function(text){this._toolTipText=text;this._changed=true},toString:function(){return"[gara.jswt.TabItem]"},_unregisterListener:function(eventType,listener){if(this.domref!=null){gara.EventManager.removeListener(this.domref,eventType,listener)}},update:function(){this.checkWidget();if(this._image!=null&&this._img==null){this._img=document.createElement("img");this._img.obj=this;this._img.control=this._parent;this._img.alt=this._text;this._img.src=this._image.src;this.domref.insertBefore(this._img,this._span);base2.DOM.EventTarget(this._img);for(var eventType in this._listener){this._listener[eventType].forEach(function(elem,index,arr){this.registerListener(this._img,eventType,elem)},this)}}else{if(this._image!=null){this._img.src=this._image.src;this._img.alt=this._text}else{if(this._img!=null&&this._image==null){this.domref.removeChild(this._img);this._img=null;for(var eventType in this._listener){this._listener[eventType].forEach(function(elem,index,arr){gara.EventManager.removeListener(this._img,eventType,elem)},this)}}}}this._spanText.nodeValue=this._text;this.domref.className=this._className;if(this._toolTipText!=null){this.domref.title=this._toolTipText}}});function getStyle(el,styleProp,ieStyleProp){var x=el;if(x.currentStyle){var y=x.currentStyle[ieStyleProp]}else{if(window.getComputedStyle){var y=document.defaultView.getComputedStyle(x,null).getPropertyValue(styleProp)}}return y}$class("TableColumn",{$extends:gara.jswt.Item,$constructor:function(parent,style,index){if(!$class.instanceOf(parent,gara.jswt.Table)){throw new TypeError("parent is not a gara.jswt.Table")}this.$base(parent,style);this._table=parent;this._table._addColumn(this,index);this._shadow=null;this._width=null;this._img=null;this._span=null;this._spanText=null;this._operator=null;this._moveable=true;this._resizable=true;this._isMoving=false;this._isResizing=false},_create:function(){this.domref=document.createElement("th");this.domref.obj=this;this.domref.control=this._table;if(this._image!=null){this._img=document.createElement("img");this._img.obj=this;this._img.control=this._table;this._img.src=this._image.src;base2.DOM.EventTarget(this._img);this.domref.appendChild(this._img)}this._operator=document.createElement("span");this._operator.className="mover";this._operator.obj=this;this._operator.control=this._table;this.domref.appendChild(this._operator);this._span=document.createElement("span");this._span.obj=this;this._span.control=this._table;this._span.className="text";this._spanText=document.createTextNode(this._text);this._span.appendChild(this._spanText);this.domref.appendChild(this._span);base2.DOM.EventTarget(this.domref);base2.DOM.EventTarget(this._operator);base2.DOM.EventTarget(this._span);if(this._parentNode!=null){this._parentNode.appendChild(this.domref)}},_computeWidth:function(){this.checkWidget();if(this.domref!=null&&this.domref.style.display!="none"){var paddingLeft=getStyle(this.domref,"padding-left","paddingLeft");var paddingRight=getStyle(this.domref,"padding-right","paddingRight");this._width=this.domref.clientWidth-parseInt(paddingLeft)-parseInt(paddingRight)}},dispose:function(){this.$base();if(this._img!=null){this.domref.removeChild(this._img);delete this._img;delete this._image}this.domref.removeChild(this._operator);this.domref.removeChild(this._span);if(this._parentNode!=null){this._parentNode.removeChild(this.domref)}delete this._operator;delete this._span;delete this.domref},getWidth:function(){this.checkWidget();if(this._width==null||this._width=="auto"){this._computeWidth()}return this._width},handleEvent:function(e){this.checkWidget();switch(e.type){case"mousedown":if(e.target==this._operator&&this._resizable){this._isResizing=true;this.allColsWidth=0;var columns=this._table.getColumns();columns.forEach(function(item,index,arr){var width=item.getWidth();item.domref.style.width=width+"px";this.allColsWidth+=width},this);var order=this._table.getColumnOrder();var thisColumnIndex=columns.indexOf(this);var thisColumnOrder=order.indexOf(thisColumnIndex);this.nextColumn=columns[order[thisColumnOrder+1]];this.nextColumn.domref.style.width="auto";this.lessColsWidth=this.allColsWidth-this.getWidth()-this.nextColumn.getWidth();this.resizeStart=e.clientX;this.startWidth=this._width;gara.EventManager.addListener(document,"mousemove",this);gara.EventManager.addListener(document,"mouseup",this)}if(e.target==this.domref&&this._moveable){this._isMoving=true;var shadowWidth=null;var order=this._table.getColumns();var offset=order.indexOf(this);this._shadow=new gara.jswt.Table(document.getElementsByTagName("body")[0],this._table.getStyle()&~JSWT.CHECK);this._shadow.setHeaderVisible(this._table.getHeaderVisible());this._table.getColumns().forEach(function(col,index,arr){if(index==offset){var c=new gara.jswt.TableColumn(this._shadow);shadowWidth=col.getWidth();c.setText(col.getText());c.setWidth(shadowWidth)}},this);this._table.getItems().forEach(function(item,index,arr){var i=new gara.jswt.TableItem(this._shadow);i.setText(item.getText(offset));i.setImage(item.getImage(offset))},this);this._shadow.update();this._shadow.domref.style.position="absolute";this._shadow.domref.style.left=e.clientX+16+"px";this._shadow.domref.style.top=e.clientY+16+"px";this._shadow.domref.style.opacity="0.3";this._shadow.domref.style.width=shadowWidth+"px";gara.EventManager.addListener(document,"mousemove",this);gara.EventManager.addListener(document,"mouseup",this)}break;case"mousemove":if(this._isResizing){var minWidth=2;var delta=e.clientX-this.resizeStart;this._width=this.startWidth+delta;if(this._width>minWidth){this.domref.style.width=this._width+"px"}}if(this._isMoving){this._shadow.domref.style.left=e.clientX+16+"px";this._shadow.domref.style.top=e.clientY+16+"px"}break;case"mouseup":if(this._isResizing){var nextWidth=this.allColsWidth-(this.lessColsWidth+this.getWidth());this.nextColumn.setWidth(nextWidth);this.nextColumn.domref.style.width=nextWidth+"px";gara.EventManager.removeListener(document,"mousemove",this);gara.EventManager.removeListener(document,"mouseup",this);this._isResizing=false}if(this._isMoving){gara.EventManager.removeListener(document,"mousemove",this);gara.EventManager.removeListener(document,"mouseup",this);this._isMoving=false;this._shadow.dispose();delete this._shadow;this._shadow=null;if(e.target.obj&&$class.instanceOf(e.target.obj,gara.jswt.TableColumn)&&e.target.obj.getParent()==this._table){var col=e.target.obj;var colOrder=this._table.getColumnOrder();var colIndex=this._table.getColumns().indexOf(col);var orderIndex=colOrder.indexOf(colIndex);var thisColIndex=this._table.getColumns().indexOf(this);colOrder.remove(thisColIndex);colOrder.insertAt(orderIndex,thisColIndex);this._table.update()}}break}},_registerListener:function(){},setWidth:function(width){this.checkWidget();this._width=width},toString:function(){return"[gara.jswt.TableColumn]"},_unregisterListener:function(eventType,listener){},update:function(){this.checkWidget();if(this.domref==null){this._create()}if(this.hasChanged()){if(this._image!=null&&this._img==null){this._img=document.createElement("img");this._img.obj=this;this._img.control=this._table;this._img.src=this._image.src;this.domref.insertBefore(this._img,this._operator);base2.DOM.EventTarget(this._img)}else{if(this._image!=null){this._img.src=this._image.src}else{if(this._img!=null&&this._image==null){this.domref.removeChild(this._img);this._img=null}}}this._spanText.nodeValue=this._text}this.removeClassName("operator");var columnOrder=this._table.getColumnOrder();if(this._table.getColumns()[columnOrder[columnOrder.length-1]]!=this){this.addClassName("operator")}this.domref.className=this._className;if(!isNaN(this._width)&&this._width!=null){this.domref.style.width=this._width+"px"}this.releaseChange()}});$class("TableItem",{$extends:gara.jswt.Item,$constructor:function(parent,style,index){if(!$class.instanceOf(parent,gara.jswt.Table)){throw new TypeError("parent is not a gara.jswt.Table")}this.$base(parent,style);this._table=parent;this._table._addItem(this,index);this._cells=[];this._checkboxTd=null;this._checkbox=null;this._active=false;this._checked=false;this._grayed=false;this._selected=false;this.domref=null},clear:function(){this.checkWidget();this._text="";this._image=null;this._cells=[];this._active=this._checked=false},_create:function(){this.domref=document.createElement("tr");this.domref.obj=this;this.domref.control=this._table;base2.DOM.EventTarget(this.domref);this._checkbox=document.createElement("input");this._checkbox.type="checkbox";this._checkbox.obj=this;this._checkbox.control=this._table;if(this._grayed){this._checkbox.disabled=true}if(this._checked){this._checkbox.checked=true}this._checkboxTd=document.createElement("td");this._checkboxTd.appendChild(this._checkbox);if((this._table.getStyle()&JSWT.CHECK)==JSWT.CHECK){this.domref.appendChild(this._checkboxTd)}var order=this._table.getColumnOrder();for(var i=0,len=order.length;i<len;++i){var cell=this._cells[order[i]];cell.td=document.createElement("td");cell.td.obj=this;cell.td.control=this._table;base2.DOM.EventTarget(cell.td);this.domref.appendChild(cell.td);if(cell.image){cell.img=document.createElement("img");cell.img.obj=this;cell.img.control=this._table;cell.img.src=cell.image.src;base2.DOM.EventTarget(cell.img);cell.td.appendChild(cell.img)}cell.textNode=document.createTextNode(cell.text);cell.td.appendChild(cell.textNode)}this._changed=false;if(this._parentNode!=null){this._parentNode.appendChild(this.domref)}},dispose:function(){this.$base();var cell;for(var i=0,len=this._cells.length;i<len;i++){cell=this._cells[i];if(cell.img){cell.td.removeChild(cell.img);delete cell.img;cell.image=null}this.domref.removeChild(cell.td);delete cell.td}this._cells.clear();delete this._cells;if(this._parentNode!=null){this._parentNode.removeChild(this.domref)}delete this.domref},getChecked:function(){this.checkWidget();this._checked=this._checkbox.checked;return this._checked},getGrayed:function(){this.checkWidget();return this._grayed},getText:function(index){this.checkWidget();if(this._cells[index]){return this._cells[index].text}return null},getImage:function(index){this.checkWidget();if(this._cells[index]){return this._cells[index].image}return null},handleEvent:function(e){},_registerListener:function(eventType,listener){},setActive:function(active){this._active=active},setChecked:function(checked){if(!this._grayed){this._checked=checked;if(this._checked){this._checkbox.checked=true}else{this._checkbox.checked=false}}},setGrayed:function(grayed){this._grayed=grayed;if(this._grayed){this._checkbox.disabled=true}else{this._checkbox.disabled=false}},setImage:function(index,image){if(!image){image=index}if(typeof (image)=="undefined"||image==null){return }if($class.instanceOf(image,Array)){image.forEach(function(image,index,arr){if(!this._cells[index]){this._cells[index]={}}this._cells[index].image=image},this)}else{if(!isNaN(index)){if(!this._cells[index]){this._cells[index]={}}this._cells[index].image=image}else{if(!this._cells[0]){this._cells[0]={}}this._cells[0].image=image}}this._changed=true},_setSelected:function(selected){this.checkWidget();this._selected=selected;this._changed=true},setText:function(index,text){this.checkWidget();if(typeof (text)=="undefined"){text=index}if($class.instanceOf(text,Array)){text.forEach(function(text,index,arr){if(!this._cells[index]){this._cells[index]={}}this._cells[index].text=text},this)}else{if(!isNaN(index)){if(!this._cells[index]){this._cells[index]={}}this._cells[index].text=text}else{if(!this._cells[0]){this._cells[0]={}}this._cells[0].text=text}}this._changed=true},toString:function(){return"[gara.jswt.TableItem]"},_unregisterListener:function(eventType,listener){},update:function(){this.checkWidget();if(this.domref==null){this._create()}else{while(this.domref.childNodes.length){this.domref.removeChild(this.domref.childNodes[0])}if((this._table.getStyle()&JSWT.CHECK)==JSWT.CHECK){this.domref.appendChild(this._checkboxTd)}var order=this._table.getColumnOrder();for(var i=0,len=order.length;i<len;++i){var cell=this._cells[order[i]];if(this.hasChanged()){if(!cell.td){cell.td=document.createElement("td");cell.td.obj=this;cell.td.control=this._table;base2.DOM.EventTarget(cell.td);cell.textNode=document.createTextNode(cell.text);cell.td.appendChild(cell.textNode)}if(cell.image){if(!cell.img){cell.img=document.createElement("img");cell.img.obj=this;cell.img.control=this._table;base2.DOM.EventTarget(cell.img);cell.td.insertBefore(cell.img,cell.textNode)}cell.img.src=cell.image.src}cell.td.className="";if(this._selected&&i==0){cell.td.className="selected"}cell.textNode.nodeValue=cell.text}this.domref.appendChild(cell.td)}}this.removeClassName("selected");if(this._selected){this.addClassName("selected")}this.domref.className=this._className;this.releaseChange()}});$class("ControlManager",{$implements:gara.jswt.FocusListener,_instance:$static(null),$constructor:function(){this._activeControl=null;this._controls=[];base2.DOM.EventTarget(document);gara.EventManager.addListener(document,"keydown",this);gara.EventManager.addListener(document,"mousedown",this)},getInstance:$static(function(){if(this._instance==null){this._instance=new gara.jswt.ControlManager()}return this._instance}),addControl:function(control){if(!this._controls.contains(control)){this._controls.push(control)}},focusGained:function(control){if(!$class.instanceOf(control,gara.jswt.Control)){throw new TypeError("control is not a gara.jswt.Control")}if(this._activeControl!=null&&this._activeControl!=control){this._activeControl.looseFocus()}this._activeControl=control},focusLost:function(control){if(!$class.instanceOf(control,gara.jswt.Control)){throw new TypeError("control is not a gara.jswt.Control")}if(this._activeControl==control){this._activeControl=null}},handleEvent:function(e){switch(e.type){case"mousedown":if(this._activeControl!=null&&(e.target.control?e.target.control!=this._activeControl:true)){this._activeControl.looseFocus();this._activeControl=null}break;case"keydown":if(this._activeControl!=null&&this._activeControl.handleEvent){this._activeControl.handleEvent(e)}break}},removeControl:function(control){if(!$class.instanceOf(control,gara.jswt.Control)){throw new TypeError("control is not a gara.jswt.Control")}if(this._controls.contains(control)){if(this._activeControl==control){this._activeControl=null}this._controls.remove(control)}},toString:function(){return"[gara.jswt.ControlManager]"}});$class("Menu",{$extends:gara.jswt.Widget,$constructor:function(parent,style){this.$base(parent,style);if((this._style&JSWT.DEFAULT)==JSWT.DEFAULT){this._style=JSWT.BAR}if($class.instanceOf(parent,gara.jswt.Control)){this._style=JSWT.POP_UP}if($class.instanceOf(parent,gara.jswt.MenuItem)&&(parent.getStyle()&JSWT.CASCADE)!=JSWT.CASCADE){throw new Exception("parent has no JSWT.CASCADE style!")}if($class.instanceOf(parent,gara.jswt.MenuItem)){this._style=JSWT.DROP_DOWN}this._items=[];this._menuListener=[];this._x=0;this._y=0;this._enabled=false;this._visible=true;if((this._style&JSWT.POP_UP)==JSWT.POP_UP){this._visible=false}this._className=this._baseClass="jsWTMenu"},_addItem:function(item,index){this.checkWidget();if(!$class.instanceOf(item,gara.jswt.MenuItem)){throw new TypeError("item is not instance of gara.jswt.MenuItem")}if(typeof (index)!="undefined"){this._items.insertAt(index,item)}else{this._items.push(item)}},addMenuListener:function(listener){this.checkWidget();if(!$class.instanceOf(listener,gara.jswt.MenuListener)){throw new TypeError("listener is not instance of gara.jswt.MenuListener")}if(!this._menuListener.contains(listener)){this._menuListener.push(listener)}},_create:function(){this.domref=document.createElement("ul");this.domref.obj=this;this.domref.control=this;base2.DOM.EventTarget(this.domref);if((this._style&JSWT.BAR)==JSWT.BAR){this.addClassName("jsWTMenuBar");this._parentNode=this._parent}if((this._style&JSWT.POP_UP)==JSWT.POP_UP){this.addClassName("jsWTMenuPopUp");this.domref.style.display="none";this.domref.style.position="absolute";this._parentNode=document.getElementsByTagName("body")[0]}if((this._style&JSWT.DROP_DOWN)==JSWT.DROP_DOWN){this.addClassName("jsWTMenuDropDown");this.domref.style.position="absolute";this._parentNode=this._parent.domref}var unregisteredListener={};for(var eventType in this._listener){unregisteredListener[eventType]=this._listener[eventType].concat([])}this.addListener("click",this);for(var eventType in unregisteredListener){unregisteredListener[eventType].forEach(function(elem,index,arr){this._registerListener(eventType,elem)},this)}this._parentNode.appendChild(this.domref)},dispose:function(){this.$base();this._items.forEach(function(item,index,arr){item.dispose()},this);if(this._parentNode!=null){this._parentNode.removeChild(this.domref)}delete this.domref},getItem:function(index){this.checkWidget();if(index>this._items.length||index<0){throw new gara.OutOfBoundsException("Menu doesn't have that much items")}return this._items[index]},getItemCount:function(){return this._items.length},getItems:function(){return this._items},getParent:function(){return this._parent},getParentItem:function(){return this._parent},getVisible:function(){return this._visible},handleEvent:function(e){this.checkWidget();switch(e.type){case"mousedown":if((e.target.control?e.target.control!=this:true)&&(this.getStyle()&JSWT.POP_UP)==JSWT.POP_UP&&!$class.instanceOf(e.target.obj,gara.jswt.MenuItem)){this.setVisible(false)}break;case"click":if(e.target.obj&&$class.instanceOf(e.target.obj,gara.jswt.MenuItem)){e.target.obj._select()}break}e.stopPropagation()},indexOf:function(item){this.checkWidget();if(!$class.instanceOf(item,gara.jswt.MenuItem)){throw new TypeError("item is not instance of gara.jswt.MenuItem")}return this._items.indexOf(item)},isVisible:function(){return this._visible},_registerListener:function(eventType,listener){if(this.domref!=null){gara.EventManager.addListener(this.domref,eventType,listener)}},removeMenuListener:function(listener){this.checkWidget();if(!$class.instanceOf(listener,gara.jswt.MenuListener)){throw new TypeError("listener is not instance of gara.jswt.MenuListener")}if(this._menuListener.contains(listener)){this._menuListener.remove(listener)}},setLocation:function(x,y){this._x=x;this._y=y},setVisible:function(visible,event){this.checkWidget();this._visible=visible;this.update();if(visible){gara.EventManager.addListener(document,"mousedown",this);if($class.instanceOf(this._parent,gara.jswt.Control)){this._parent.addListener("mousedown",this)}this._menuListener.forEach(function(listener,index,arr){listener.menuShown(this)},this)}else{gara.EventManager.removeListener(document,"mousedown",this);if($class.instanceOf(this._parent,gara.jswt.Control)){this._parent.removeListener("mousedown",this)}this._menuListener.forEach(function(listener,index,arr){listener.menuHidden(this)},this)}},toString:function(){return"[gara.jswt.Menu]"},_unregisterListener:function(eventType,listener){if(this.domref!=null){gara.EventManager.removeListener(this.domref,eventType,listener)}},update:function(){this.checkWidget();if(!this.domref){this._create()}if((this._style&JSWT.POP_UP)==JSWT.POP_UP){this.domref.style.top=this._y+"px";this.domref.style.left=this._x+"px"}if(this._visible){this.domref.style.display="block"}else{this.domref.style.display="none"}this.domref.className=this._className;this._items.forEach(function(item,index,arr){item.update()},this)}});$class("MenuItem",{$extends:gara.jswt.Item,$constructor:function(parent,style,index){if(!$class.instanceOf(parent,gara.jswt.Menu)){throw new TypeError("parent is not type of gara.jswt.Menu")}this.$base(parent,style);this._parent=parent;this._parent._addItem(this,index);this._span=null;this._spanText=null;this._img=null;this._hr=null;this._selectionListener=[];this._menu=null;this._enabled=true;this._selected=false},addSelectionListener:function(listener){this.checkWidget();if(!$class.instanceOf(listener,gara.jswt.SelectionListener)){throw new TypeError("listener is not instance of gara.jswt.SelectionListener")}if(!this._selectionListener.contains(listener)){this._selectionListener.push(listener)}},_create:function(){this.domref=document.createElement("li");this.domref.obj=this;this.domref.control=this._parent;if((this._style&JSWT.SEPARATOR)==JSWT.SEPARATOR){this.domref.className="jsWTMenuItemSeparator";if((this._parent.getStyle()&JSWT.BAR)!=JSWT.BAR){this._hr=document.createElement("hr");this.domref.appendChild(this._hr)}}else{this._img=null;if(this._image!=null){this._img=document.createElement("img");this._img.obj=this;this._img.control=this._parent;this._img.src=this._image.src;this._img.alt=this._text;this.domref.appendChild(this._img);base2.DOM.EventTarget(this._img)}this._spanText=document.createTextNode(this._text);this._span=document.createElement("span");this._span.obj=this;this._span.control=this._parent;this._span.appendChild(this._spanText);this.domref.appendChild(this._span);base2.DOM.EventTarget(this.domref);base2.DOM.EventTarget(this._span);var unregisteredListener={};for(var eventType in this._listener){unregisteredListener[eventType]=this._listener[eventType].concat([])}try{var node=this.domref;this.domref.attachEvent("onmouseover",function(){node.className+=" hover"});this.domref.attachEvent("onmouseout",function(){node.className=node.className.replace(new RegExp("\\shover","g"),"")})}catch(e){}for(var eventType in unregisteredListener){unregisteredListener[eventType].forEach(function(elem,index,arr){this.registerListener(eventType,elem)},this)}if(this._menu!=null){this.addClassName("jsWTMenuItemCascade");this._menu.update()}if(!this._enabled){this.addClassName("disabled")}if(this._selected){this.addClassName("checked")}this.domref.className=this._className}this._changed=false;this.domref;var index=this._parent.indexOf(this);var parentItems=this._parent.getItems();var parentDomref=this._parent.domref;var nextNode=index==0?parentDomref.firstChild:parentItems[index-1].domref.nextSibling;if(!nextNode){parentDomref.appendChild(this.domref)}else{parentDomref.insertBefore(this.domref,nextNode)}},dispose:function(){this.$base();if(this._menu!=null){this._menu.dispose();delete this._menu}if(this._img!=null){this.domref.removeChild(this._img);delete this._img;this._image=null}if(this._hr!=null){this.domref.removeChild(this._hr)}if(this._span!=null){this.domref.removeChild(this._span)}if(this._parentNode!=null){this._parentNode.removeChild(this.domref)}delete this._hr;delete this._span;delete this.domref},getEnabled:function(){return this._enabled},getMenu:function(){return this._menu},getParent:function(){return this._parent},getSelection:function(){return this._selected},_registerListener:function(eventType,listener){if(this.domref!=null){gara.EventManager.addListener(this.domref,eventType,listener)}if(this._img!=null){gara.EventManager.addListener(this._img,eventType,listener)}if(this._span!=null){gara.EventManager.addListener(this._span,eventType,listener)}},removeSelectionListener:function(listener){this.checkWidget();if(!$class.instanceOf(listener,gara.jswt.SelectionListener)){throw new TypeError("listener is not instance of gara.jswt.SelectionListener")}if(this._selectionListener.contains(listener)){this._selectionListener.remove(listener)}},_select:function(){if((this._style&JSWT.SEPARATOR)==JSWT.SEPARATOR||!this._enabled){return }if((this._style&JSWT.CHECK)==JSWT.CHECK){this._selected=!this._selected;this._changed=true}this.update();var parent=this;while(parent.getParent&&parent.getParent()!=null&&($class.instanceOf(parent.getParent(),gara.jswt.Menu)||$class.instanceOf(parent.getParent(),gara.jswt.MenuItem))){parent=parent.getParent()}if((parent.getStyle()&JSWT.POP_UP)==JSWT.POP_UP){parent.setVisible(false)}this._selectionListener.forEach(function(listener,index,arr){listener.widgetSelected(this)},this)},setEnabled:function(enabled){this._enabled=enabled;this._changed=true;if(this.domref!=null){this.update()}},setImage:function(image){this.$base(image);if(this.domref!=null){this.update()}},setMenu:function(menu){this.checkWidget();if(!$class.instanceOf(menu,gara.jswt.Menu)){throw new TypeError("menu is not instance of gara.jswt.Menu")}this._menu=menu;this._changed=true},setSelection:function(selected){this._selected=selected},setText:function(text){this.$base(text);if(this.domref!=null){this.update()}},toString:function(){return"[gara.jswt.MenuItem]"},_unregisterListener:function(eventType,listener){if(this.domref!=null){gara.EventManager.removeListener(this.domref,eventType,listener)}if(this._img!=null){gara.EventManager.removeListener(this._img,eventType,listener)}if(this._span!=null){gara.EventManager.removeListener(this._span,eventType,listener)}},update:function(){if(!this.domref){this._create()}else{if(this._changed){this.checkWidget();if(this._image!=null&&this._img==null){this._img=document.createElement("img");this._img.obj=this;this._img.control=this._menu;this._img.alt=this._text;this._img.src=this._image.src;this.domref.insertBefore(this._img,this._span);base2.DOM.EventTarget(this._img);for(var eventType in this._listener){this._listener[eventType].forEach(function(elem,index,arr){this.registerListener(this._img,eventType,elem)},this)}}else{if(this._image!=null){this._img.src=this._image.src;this._img.alt=this._text}else{if(this._img!=null&&this._image==null){this.domref.removeChild(this._img);this._img=null;for(var eventType in this._listener){this._listener[eventType].forEach(function(elem,index,arr){gara.EventManager.removeListener({domNode:this._img,type:eventType,listener:elem})},this)}}}}this.removeClassName("disabled");this.removeClassName("checked");this.removeClassName("jsWTMenuItemCascade");if(this._menu!=null){this.addClassName("jsWTMenuItemCascade");this._menu.update()}if(!this._enabled){this.addClassName("disabled")}if(this._selected){this.addClassName("checked")}this._spanText.nodeValue=this._text;this.domref.className=this._className;this._changed=false}}if(this._menu!=null){this._menu.update()}}});$class("DialogManager",{_instance:$static(null),$constructor:function(){this._activeDialog=null;this._dialogs=[];base2.DOM.EventTarget(document);gara.EventManager.addListener(document,"keydown",this)},getInstance:$static(function(){if(this._instance==null){this._instance=new gara.jswt.DialogManager()}return this._instance}),activate:function(dialog){if(!$class.instanceOf(dialog,gara.jswt.Dialog)){throw new TypeError("dialog is not a gara.jswt.Dialog")}if(this._activeDialog!=dialog){if(this._activeDialog!=null){this._activeDialog.domref.style.zIndex=600}this._activeDialog=dialog;this._activeDialog.domref.style.zIndex=601}},addDialog:function(dialog){if(!$class.instanceOf(dialog,gara.jswt.Dialog)){throw new TypeError("dialog is not a gara.jswt.Dialog")}if(!this._dialogs.contains(dialog)){this._dialogs.push(dialog)}},getActiveDialog:function(){if(this._activeDialog!=null){return this._activeDialog}return null},getDialogs:function(){return this._dialogs},handleEvent:function(e){switch(e.type){case"mousedown":if(e.target.obj&&$class.instanceOf(e.target.obj,gara.jswt.Dialog)){console.log("DialogMananger.handleEvent(mousedown)");this.activate(e.target.obj)}break;case"keydown":if(this._activeDialog!=null&&e.keyCode==9){return false}break}},removeDialog:function(dialog){if(!$class.instanceOf(dialog,gara.jswt.Dialog)){throw new TypeError("dialog is not a gara.jswt.Dialog")}if(this._dialogs.contains(dialog)){if(this._activeDialog==dialog){this._activeDialog=null}this._dialogs.remove(dialog)}},toString:function(){return"[gara.jswt.DialogManager]"}});$class("Dialog",{$constructor:function(style){this._style=style;this._disposed=false;this._text=" ";this.domref=null;this._parentWindow=window;this._modalLayer=null;this._dialogBar;this._dialogBarLeft;this._dialogBarText;this._dialogBarButtons;this._dialogContent;this._barCancelButton;this._dX;this._dY;this._tabIndexes=[];this._tabbableTags=["A","BUTTON","TEXTAREA","INPUT","IFRAME"];gara.jswt.DialogManager.getInstance().addDialog(this)},_create:function(){if((this._style&JSWT.APPLICATION_MODAL)==JSWT.APPLICATION_MODAL){this._disableTabIndexes();var modalLayer;if(modalLayer=document.getElementById("jsWTModalLayer")){modalLayer.style.display="block"}else{modalLayer=document.createElement("div");modalLayer.id="jsWTModalLayer";document.getElementsByTagName("body")[0].appendChild(modalLayer)}modalLayer.style.width=this._getViewportWidth()+"px";modalLayer.style.height=this._getViewportHeight()+"px"}this._parent=this._parentWindow.document.getElementsByTagName("body")[0];this.domref=document.createElement("div");this.domref.className="jsWTDialog";this.domref.obj=this;this._dialogBar=document.createElement("div");this._dialogBar.className="jsWTDialogBar";this._dialogContent=document.createElement("div");this._dialogContent.className="jsWTDialogContent";this._dialogBarLeft=document.createElement("div");this._dialogBarLeft.className="jsWTDialogBarLeft";this._dialogBarText=document.createElement("div");this._dialogBarText.className="jsWTDialogBarText";this._dialogBarButtons=document.createElement("div");this._dialogBarButtons.className="jsWTDialogBarButtons";var clearer=document.createElement("div");clearer.className="jsWTDialogBarClearer";this._barCancelButton=document.createElement("span");this._barCancelButton.className="jsWTDialogCancelButton";this._dialogContent=document.createElement("div");this._dialogContent.className="jsWTDialogContent";this.domref.appendChild(this._dialogBar);this.domref.appendChild(this._dialogContent);this._dialogBar.appendChild(this._dialogBarLeft);this._dialogBar.appendChild(this._dialogBarText);this._dialogBar.appendChild(this._dialogBarButtons);this._dialogBarText.appendChild(document.createTextNode(this._text));this._dialogBarButtons.appendChild(this._barCancelButton);this._dialogBar.appendChild(clearer);base2.DOM.EventTarget(this._parentWindow);base2.DOM.EventTarget(this._parentWindow.document);base2.DOM.EventTarget(this.domref);base2.DOM.EventTarget(this._dialogBar);base2.DOM.EventTarget(this._barCancelButton);gara.EventManager.addListener(this.domref,"mousedown",this);gara.EventManager.addListener(this._barCancelButton,"mousedown",this);gara.EventManager.addListener(this._parentWindow,"resize",this);this._parent.appendChild(this.domref);gara.jswt.DialogManager.getInstance().activate(this)},_disableTabIndexes:function(){if(document.all){var i=0;for(var j=0;j<this._tabbableTags.length;j++){var tagElements=document.getElementsByTagName(this._tabbableTags[j]);for(var k=0;k<tagElements.length;k++){this._tabIndexes[i]=tagElements[k].tabIndex;tagElements[k].tabIndex="-1";i++}}}},dispose:function(){gara.EventManager.removeListener(this.domref,"mousedown",this);gara.EventManager.removeListener(this._barCancelButton,"mousedown",this);gara.EventManager.removeListener(window,"resize",this);if((this._style&JSWT.APPLICATION_MODAL)==JSWT.APPLICATION_MODAL){this._restoreTabIndexes()}gara.jswt.DialogManager.getInstance().removeDialog(this);this.domref.obj=null;this._parent.removeChild(this.domref);if((this._style&JSWT.APPLICATION_MODAL)==JSWT.APPLICATION_MODAL){document.getElementById("jsWTModalLayer").style.display="none"}this._disposed=true},getText:function(){return this._text},_getViewportHeight:function(){if(window.innerHeight!=window.undefined){return window.innerHeight}if(document.compatMode=="CSS1Compat"){return document.documentElement.clientHeight}if(document.body){return document.body.clientHeight}return window.undefined},_getViewportWidth:function(){if(window.innerWidth!=window.undefined){return window.innerWidth}if(document.compatMode=="CSS1Compat"){return document.documentElement.clientWidth}if(document.body){return document.body.clientWidth}return window.undefined},handleEvent:function(e){switch(e.type){case"mousedown":gara.jswt.DialogManager.getInstance().activate(this);if(e.target==this._barCancelButton){this.dispose()}else{if(e.target==this._dialogBar||e.target==this._dialogBarText||e.target==this._dialogBarButtons){gara.EventManager.addListener(this._parentWindow.document,"mousemove",this);gara.EventManager.addListener(this._dialogBar,"mouseup",this);this._dX=e.clientX-this.domref.offsetLeft;this._dY=e.clientY-this.domref.offsetTop}}break;case"mouseup":gara.EventManager.removeListener(this._parentWindow.document,"mousemove",this);gara.EventManager.removeListener(this._dialogBar,"mouseup",this);break;case"mousemove":this.domref.style.left=(e.clientX-this._dX)+"px";this.domref.style.top=(e.clientY-this._dY)+"px";break;case"resize":if(modalLayer=document.getElementById("jsWTModalLayer")){modalLayer.style.width=this._getViewportWidth()+"px";modalLayer.style.height=this._getViewportHeight()+"px"}break}},isDisposed:function(){return this._disposed},open:$abstract(function(){}),_restoreTabIndexes:function(){if(document.all){var i=0;for(var j=0;j<this._tabbableTags.length;j++){var tagElements=document.getElementsByTagName(this._tabbableTags[j]);for(var k=0;k<tagElements.length;k++){tagElements[k].tabIndex=this._tabIndexes[i];tagElements[k].tabEnabled=true;i++}}}},setText:function(text){this._text=text},toString:function(){return"[gara.jswt.Dialog]"}});function getStyle(el,styleProp,ieStyleProp){var x=el;if(x.currentStyle){var y=x.currentStyle[ieStyleProp]}else{if(window.getComputedStyle){var y=document.defaultView.getComputedStyle(x,null).getPropertyValue(styleProp)}}return y}$class("InputDialog",{$extends:gara.jswt.Dialog,$constructor:function(style){this.$base(style);this._callback=null;this._context=window;this._message="";this._value="";this._style|=JSWT.APPLICATION_MODAL;this._input;this._btnOk;this._btnCancel},_create:function(){this.$base();this.domref.className+=" jsWTInputDialog";var text=document.createElement("div");text.className="jsWTInputDialogContentText";text.appendChild(document.createTextNode(this._message));this._input=document.createElement("input");this._input.type="text";this._input.value=this._value;base2.DOM.EventTarget(this._input);gara.EventManager.addListener(this._input,"keydown",this);text.appendChild(this._input);this._dialogContent.appendChild(text);var buttons=document.createElement("div");buttons.className="jsWTInputDialogButtonBar";this._btnOk=document.createElement("input");this._btnOk.type="button";this._btnOk.value=gara.i18n.get("ok");base2.DOM.EventTarget(this._btnOk);buttons.appendChild(this._btnOk);gara.EventManager.addListener(this._btnOk,"click",this);this._btnCancel=document.createElement("input");this._btnCancel.type="button";this._btnCancel.value=gara.i18n.get("cancel");base2.DOM.EventTarget(this._btnCancel);buttons.appendChild(this._btnCancel);gara.EventManager.addListener(this._btnCancel,"click",this);this._dialogContent.appendChild(buttons);this._input.focus();var left=this._getViewportWidth()/2-this.domref.clientWidth/2;var top=this._getViewportHeight()/2-this.domref.clientHeight/2;this.domref.style.left=left+"px";this.domref.style.top=top+"px"},getMessage:function(){return this._message},getValue:function(){return this._value},handleEvent:function(e){this.$base(e);if(this._disposed&&this._callback!=null){this._callback.call(this._context,null)}switch(e.type){case"keydown":if(e.target==this._input&&e.keyCode==27){this.dispose();this._callback.call(this._context,null)}if(e.target==this._input&&(e.keyCode==13||e.keyCode==10)&&this._callback!=null){this.dispose();this._callback.call(this._context,this._input.value)}break;case"click":var response;switch(e.target){case this._btnOk:response=this._input.value;break;default:case this._btnCancel:response=null;break}this.dispose();if(this._callback!=null){this._callback.call(this._context,response)}break}},open:function(callback,context){this._create();this._callback=callback;this._context=context||window},setMessage:function(message){this._message=message},setValue:function(value){this._value=value},toString:function(){return"[gara.jswt.MessageBox]"}});function getStyle(el,styleProp,ieStyleProp){var x=el;if(x.currentStyle){var y=x.currentStyle[ieStyleProp]}else{if(window.getComputedStyle){var y=document.defaultView.getComputedStyle(x,null).getPropertyValue(styleProp)}}return y}$class("IframeDialog",{$extends:gara.jswt.Dialog,$constructor:function(style){this.$base(style);this._width=0;this._height=0;this._title="";this._iframe;this._overlay;this._iDoc=null},_create:function(src){this.$base();this._overlay=document.createElement("div");this._overlay.style.position="absolute";this._overlay.style.left="0";this._overlay.style.right="0";this._overlay.style.top="0";this._overlay.style.bottom="0";this.domref.className+=" jsWTIframeDialog";this._iframe=document.createElement("iframe");this._iframe.src=src;this._iframe.style.width="100%";this._iframe.style.height="100%";this._dialogContent.appendChild(this._iframe);this.domref.style.width=this._width+"px";this._dialogContent.style.height=this._height+"px";this._dialogContent.style.position="relative";base2.DOM.EventTarget(this._iframe);base2.DOM.EventTarget(this._dialogContent);gara.EventManager.addListener(this._iframe,"load",this);this._dialogBarText.appendChild(document.createTextNode(this._title));this._dialogBarText.style.width=(this._width-40)+"px";var left=this._getViewportWidth()/2-this.domref.clientWidth/2;var top=this._getViewportHeight()/2-this.domref.clientHeight/2;this.domref.style.left=left+"px";this.domref.style.top=top+"px"},getHeight:function(){return this._height},getTitle:function(){return this._title},getWidth:function(){return this._width},handleEvent:function(e){this.$base(e);switch(e.type){case"load":if(this._iDoc==null){try{this._iDoc=this._iframe.contentDocument}catch(e){try{this._iDoc=this._iframe.document}catch(e){}}}if(this._iDoc!=null){try{this._iDoc.obj=this;base2.DOM.EventTarget(this._iDoc);gara.EventManager.addListener(this._iDoc,"mousedown",this)}catch(e){}}break;case"mousedown":gara.jswt.DialogManager.getInstance().activate(this);if(e.target==this._dialogBar||e.target==this._dialogBarText||e.target==this._dialogBarButtons){gara.jswt.DialogManager.getInstance().getDialogs().forEach(function(diag,index,arr){if($class.instanceOf(diag,gara.jswt.IframeDialog)){diag._showOverlay()}},this)}break;case"mouseup":gara.jswt.DialogManager.getInstance().getDialogs().forEach(function(diag,index,arr){if($class.instanceOf(diag,gara.jswt.IframeDialog)){diag._hideOverlay()}},this);break}},_hideOverlay:function(){this._dialogContent.removeChild(this._overlay)},open:function(src,parentWindow){if(typeof (parentWindow)=="undefined"){this._parentWindow=window.top}this._create(src)},_showOverlay:function(){this._dialogContent.appendChild(this._overlay)},setHeight:function(height){this._height=height},setTitle:function(title){this._title=title},setWidth:function(width){this._width=width},toString:function(){return"[gara.jswt.IframeDialog]"}});function getStyle(el,styleProp,ieStyleProp){var x=el;if(x.currentStyle){var y=x.currentStyle[ieStyleProp]}else{if(window.getComputedStyle){var y=document.defaultView.getComputedStyle(x,null).getPropertyValue(styleProp)}}return y}$class("MessageBox",{$extends:gara.jswt.Dialog,$constructor:function(style){this.$base(style);this._callback=null;this._context=window;this._message="";this._style|=JSWT.APPLICATION_MODAL;this._btnOk;this._btnYes;this._btnNo;this._btnAbort;this._btnRetry;this._btnIgnore;this._btnCancel},_create:function(){this.$base();this.domref.className+=" jsWTMessageBox";var text=document.createElement("div");text.className="jsWTMessageBoxContentText";text.appendChild(document.createTextNode(this._message));if((this._style&JSWT.ICON_ERROR)==JSWT.ICON_ERROR){text.className+=" jsWTIconError"}if((this._style&JSWT.ICON_INFORMATION)==JSWT.ICON_INFORMATION){text.className+=" jsWTIconInformation"}if((this._style&JSWT.ICON_QUESTION)==JSWT.ICON_QUESTION){text.className+=" jsWTIconQuestion"}if((this._style&JSWT.ICON_WARNING)==JSWT.ICON_WARNING){text.className+=" jsWTIconWarning"}if((this._style&JSWT.ICON_WORKING)==JSWT.ICON_WORKING){text.className+=" jsWTIconWorking"}this._dialogContent.appendChild(text);var buttons=document.createElement("div");buttons.className="jsWTMessageBoxButtonBar";if((this._style&JSWT.OK)==JSWT.OK){this._btnOk=document.createElement("input");this._btnOk.type="button";this._btnOk.value=gara.i18n.get("ok");base2.DOM.EventTarget(this._btnOk);buttons.appendChild(this._btnOk);gara.EventManager.addListener(this._btnOk,"click",this)}if((this._style&JSWT.YES)==JSWT.YES){this._btnYes=document.createElement("input");this._btnYes.type="button";this._btnYes.value=gara.i18n.get("yes");base2.DOM.EventTarget(this._btnYes);buttons.appendChild(this._btnYes);gara.EventManager.addListener(this._btnYes,"click",this)}if((this._style&JSWT.NO)==JSWT.NO){this._btnNo=document.createElement("input");this._btnNo.type="button";this._btnNo.value=gara.i18n.get("no");base2.DOM.EventTarget(this._btnNo);buttons.appendChild(this._btnNo);gara.EventManager.addListener(this._btnNo,"click",this)}if((this._style&JSWT.ABORT)==JSWT.ABORT){this._btnAbort=document.createElement("input");this._btnAbort.type="button";this._btnAbort.value=gara.i18n.get("abort");base2.DOM.EventTarget(this._btnAbort);buttons.appendChild(this._btnAbort);gara.EventManager.addListener(this._btnAbort,"click",this)}if((this._style&JSWT.RETRY)==JSWT.RETRY){this._btnRetry=document.createElement("input");this._btnRetry.type="button";this._btnRetry.value=gara.i18n.get("retry");base2.DOM.EventTarget(this._btnRetry);buttons.appendChild(this._btnRetry);gara.EventManager.addListener(this._btnRetry,"click",this)}if((this._style&JSWT.IGNORE)==JSWT.IGNORE){this._btnIgnore=document.createElement("input");this._btnIgnore.type="button";this._btnIgnore.value=gara.i18n.get("ignore");base2.DOM.EventTarget(this._btnIgnore);buttons.appendChild(this._btnIgnore);gara.EventManager.addListener(this._btnIgnore,"click",this)}if((this._style&JSWT.CANCEL)==JSWT.CANCEL){this._btnCancel=document.createElement("input");this._btnCancel.type="button";this._btnCancel.value=gara.i18n.get("cancel");base2.DOM.EventTarget(this._btnCancel);buttons.appendChild(this._btnCancel);gara.EventManager.addListener(this._btnCancel,"click",this)}this._dialogContent.appendChild(buttons);var left=this._getViewportWidth()/2-this.domref.clientWidth/2;var top=this._getViewportHeight()/2-this.domref.clientHeight/2;this.domref.style.left=left+"px";this.domref.style.top=top+"px"},getMessage:function(){return this._message},handleEvent:function(e){this.$base(e);if(this._disposed&&this._callback!=null){this._callback.call(this._context,JSWT.CANCEL)}switch(e.type){case"click":var response;switch(e.target){case this._btnOk:response=JSWT.OK;break;case this._btnYes:response=JSWT.YES;break;case this._btnNo:response=JSWT.NO;break;case this._btnAbort:response=JSWT.ABORT;break;case this._btnRetry:response=JSWT.RETRY;break;case this._btnIgnore:response=JSWT.IGNORE;break;default:case this._btnCancel:response=JSWT.CANCEL;break}this.dispose();if(this._callback!=null){this._callback.call(this._context,response)}break}},open:function(callback,context){this._create();this._callback=callback||null;this._context=context||window},setMessage:function(message){this._message=message},toString:function(){return"[gara.jswt.MessageBox]"}});var jswtPkg=new gara.Package({name:"jswt",exports:"JSWT,ControlManager,Widget,Control,Composite,Item,List,ListItem,Tree,TreeItem,TabFolder,TabItem,FocusListener,SelectionListener"});gara.jswt.namespace=jswtPkg.namespace;gara.jswt.toString=function(){return"[gara.jswt]"};$package("")})();(function(){$package("gara.jsface");$interface("IBaseLabelProvider",{isLabelProperty:function(B,C){}});$interface("ILabelProvider",{$extends:gara.jsface.IBaseLabelProvider,getImage:function(B){},getText:function(B){}});$interface("ITableLabelProvider",{$extends:gara.jsface.IBaseLabelProvider,getColumnImage:function(B,C){},getColumnText:function(B,C){}});$interface("ILabelProviderListener",{labelProviderChanged:function(){}});$class("LabelProvider",{$implements:gara.jsface.ILabelProvider,$constructor:function(){},getImage:function(){},getText:function(){},isLabelProperty:function(B,C){},toString:function(){return"[gara.jsface.LabelProvider]"}});$class("BaseLabelProvider",{$implements:[gara.jsface.IBaseLabelProvider],$constructor:function(){this.$base();this._listener=null},addListener:function(B){if(!$class.instanceOf(B,gara.jsface.ILabelProviderListener)){throw new TypeError("listener not type of gara.jsface.ILabelProviderListener")}if(this._listener==null){this._listener=[]}this._listener.add(B)},isLabelProperty:function(B,C){return true},removeListener:function(B){if(!$class.instanceOf(B,gara.jsface.ILabelProviderListener)){throw new TypeError("listener not type of gara.jsface.ILabelProviderListener")}if(this._listener!=null&&this._listener.contains(B)){this._listener.remove(B)}}});$class("CellLabelProvider",{$extends:gara.jsface.BaseLabelProvider,$constructor:function(){this.$base()},createViewerLabelProvider:$static(function(B){if($class.instanceOf(B,gara.jsface.ITableLabelProvider)){return new gara.jsface.TableColumnViewerLabelProvider(B)}if($class.instanceOf(B,gara.jsface.CellLabelProvider)){return B}return new gara.jsface.WrappedViewerLabelProvider(B)}),update:$abstract(function(B){})});$class("ColumnLabelProvider",{$extends:gara.jsface.CellLabelProvider,$implements:[gara.jsface.ILabelProvider],$constructor:function(){this.$base()},getImage:function(B){return null},getText:function(B){return B==null?"":B.toString()},isLabelProperty:function(B,C){return true},update:function(B){if(!$class.instanceOf(B,gara.jsface.ViewerCell)){throw new TypeError("cell is not instance of gara.jsface.ViewerCell")}var C=B.getElement();B.setText(this.getText(C));B.setImage(this.getImage(C))}});$class("WrappedViewerLabelProvider",{$extends:gara.jsface.ColumnLabelProvider,defaultLabelProvider:$static(new gara.jsface.LabelProvider()),$constructor:function(B){this.$base();this._labelProvider=this.defaultLabelProvider;this._tableLabelProvider;this._viewerLabelProvider;this.setProviders(B)},getLabelProvider:function(){return this._labelProvider},getImage:function(B){return this.getLabelProvider().getImage(B)},getText:function(B){return this.getLabelProvider().getText(B)},setProviders:function(B){if($class.instanceOf(B,gara.jsface.ILabelProvider)){this._labelProvider=B}},update:function(B){if(!$class.instanceOf(B,gara.jsface.ViewerCell)){throw new TypeError("cell is not instance of gara.jsface.ViewerCell")}var C=B.getElement();B.setText(this.getText(C));B.setImage(this.getImage(C))}});$class("TableColumnViewerLabelProvider",{$extends:gara.jsface.WrappedViewerLabelProvider,$constructor:function(B){this.$base(B);if($class.instanceOf(B,gara.jsface.ITableLabelProvider)){this._tableLabelProvider=B}},update:function(B){if(!$class.instanceOf(B,gara.jsface.ViewerCell)){throw new TypeError("cell is not instance of gara.jsface.ViewerCell")}var D=B.getElement();var C=B.getColumnIndex();if(this._tableLabelProvider==null){B.setText(this.getLabelProvider().getText(D));B.setImage(this.getLabelProvider().getImage(D))}else{B.setText(this._tableLabelProvider.getColumnText(D,C));B.setImage(this._tableLabelProvider.getColumnImage(D,C))}}});$interface("IContentProvider",{inputChanged:function(D,C,B){}});$interface("IStructuredContentProvider",{$extends:gara.jsface.IContentProvider,getElements:function(B){}});$interface("ITreeContentProvider",{$extends:gara.jsface.IStructuredContentProvider,getChildren:function(B){},getParent:function(B){},hasChildren:function(B){}});$interface("ICheckStateListener",{checkStateChanged:function(B){}});$interface("ICheckable",{addCheckStateListener:function(B){},getChecked:function(B){},removeCheckStateListener:function(B){},setChecked:function(B,C){}});$class("Viewer",{$constructor:function(){},getControl:$abstract(function(){}),getInput:$abstract(function(){}),inputChange:function(B,C){},refresh:$abstract(function(){}),setInput:$abstract(function(B){})});$class("ContentViewer",{$extends:gara.jsface.Viewer,$constructor:function(){this._input=null;this._contentProvider=null;this._labelProvider=null},getContentProvider:function(){return this._contentProvider},getInput:function(){return this._input},getLabelProvider:function(){return this._labelProvider},inputChanged:$abstract(function(){}),setContentProvider:function(B){if(!$class.instanceOf(B,gara.jsface.IContentProvider)){throw new TypeError("contentProvider is not type of gara.jsface.IContentProvider")}this._contentProvider=B},setInput:function(B){var C=this.getInput();this._contentProvider.inputChanged(this,C,B);this._input=B;this.inputChanged(this._input,C)},setLabelProvider:function(B){if(!$class.instanceOf(B,gara.jsface.IBaseLabelProvider)){throw new TypeError("labelProvider is not type of gara.jsface.IBaseLabelProvider")}this._labelProvider=B}});$class("StructuredViewer",{$extends:gara.jsface.ContentViewer,$constructor:function(){this._map=[];this._items=[];this._sorter=null;this._filters=[];this._elementMap=null},addFilter:function(B){if(!$class.instanceOf(B,gara.jsface.ViewerFilter)){throw new TypeError("filter not instance of gara.jsface.ViewerFilter")}if(!this._filters.contains(B)){this._filters.push(B)}this.refresh()},_associate:function(B,C){var D=C.getData();if(D!=B){if(D!=null){this._disassociate(C)}C.setData(B)}this._mapElement(B,C)},_disassociate:function(C){var B=C.getData();this._unmapElement(B,C);C.setData(null)},_doUpdateItem:$abstract(function(C,B){}),_doFindInputItem:$abstract(function(B){}),_findItem:$final(function(C){var B=this._findItems(C);return B.length==0?null:B[0]}),_findItems:$final(function(C){if(!C.hasOwnProperty("__garaUID")){return[]}var B=this._doFindInputItem(C);if(B!=null){return[B]}if(this._usingElementMap()){var D=null;if(C.hasOwnProperty("__garaUID")&&this._elementMap.hasOwnProperty(C.__garaUID)){D=this._elementMap[C.__garaUID]}if(D==null){return[]}else{if($class.instanceOf(D,gara.jswt.Widget)){return[D]}else{return D}}}return[]}),_getRawChildren:function(C){var B=null;if(C!=null){var D=this.getContentProvider();if(D!=null){B=D.getElements(C)}}return(B!=null&&$class.instanceOf(B,Array))?B:[]},_getItemFromElementMap:function(B){if(B==null){return null}var C;if(typeof (B)=="object"&&B.hasOwnProperty("__garaUID")){C=B.__garaUID}else{C=B}if(this._elementMap.hasOwnProperty(C)){return this._elementMap[C]}return null},_getFilteredChildren:function(C){var B=this._getRawChildren(C);this._filters.forEach(function(F,E,D){B=F.filter(this,C,B)},this);return B},_getSortedChildren:function(C){var B=this._getFilteredChildren(C);if(this._sorter!=null){B=this._sorter.sort(this,B)}return B},getSorter:function(){if($class.instanceOf(this._sorter,gara.jsface.ViewerSorter)){return this._sorter}return null},_getRoot:function(){return this._input},_internalRefresh:$abstract(function(B,C){}),_mapElement:function(B,C){if(this._elementMap==null){this._elementMap={}}var D=new Date();var E=D.valueOf();if(typeof (B)=="object"){if(!B.hasOwnProperty("__garaUID")){B.__garaUID=E}else{E=B.__garaUID}}else{E=B}this._elementMap[E]=C},refresh:function(E,B){var C,D;if(typeof (E)=="boolean"){D=E}else{if(typeof (E)=="object"){C=E}}if(typeof (B)=="boolean"){D=B}this._internalRefresh(C,D)},setFilters:function(B){if(B.length==0){this._filters=[]}else{B.forEach(function(E,D,C){this.addFilter(E)},this)}},setInput:function(B){this._unmapAllElements();this.$base(B)},setSorter:function(B){if(!$class.instanceOf(B,gara.jsface.ViewerSorter)){throw new TypeError("sorter not instance of gara.jsface.ViewerSorter")}this._sorter=B;this.refresh()},_unmapAllElements:function(){this._elementMap={}},_unmapElement:function(B,C){if(this._elementMap==null||B==null||!(typeof (B)=="object"&&B.hasOwnProperty("__garaUID"))){return }var D;if(typeof (B)=="object"&&B.hasOwnProperty("__garaUID")){D=B.__garaUID}else{D=B}if($class.instanceOf(C,Array)){this._elementMap[D]=C}else{delete this._elementMap[D]}},_updateItem:function(C,B){this._doUpdateItem(C,B)},_usingElementMap:function(){return this._elementMap!=null}});$class("AbstractListViewer",{$extends:gara.jsface.StructuredViewer,$constructor:function(){this._storedSelection=[]},_createListItem:$abstract(function(C,D,B){}),_doFindInputItem:function(C){var B=this._getRoot();if(B==null){return null}if(B==C){return this.getControl()}return null},_doUpdateItem:function(C,B){if(C.isDisposed()){this._unmapElement(B,C);return }C.setText(this._getLabelProviderText(this.getLabelProvider(),B));C.setImage(this.getLabelProvider().getImage(B));this._associate(B,C)},getControl:$abstract(function(){}),_getLabelProviderText:function(C,B){var D=C.getText(B);if(D==null){D=""}return D},inputChanged:function(B,C){this._listRemoveAll();this.getControl().setSelection([]);this._internalRefresh()},_internalRefresh:function(G,M){if(G==null||G==this._getRoot()){var D=this.getControl().getSelection();var C=this._getSortedChildren(this._getRoot());var K=this.getControl().getItems();var B=K.length;var E=Math.min(C.length,K.length);for(var H=0;H<E;++H){var L=K[H];var I=L.getData();if(I!=null){var J=C[H];if(J!=I){if(J==I){var F=L.getData();if(F!=null){this._unmapElement(F,L)}L.setData(J);this._mapElement(J,L)}else{this._disassociate(L);L.setImage(null);L.setText("");if(D.contains(K[H])){D.remove(K[H])}}}}}for(var H=0;H<E;++H){var L=K[H];var J=C[H];if(L.getData()==null){this._associate(J,L);this._updateItem(L,J)}else{if(M){this._updateItem(L,J)}}}if(E<C.length){for(var H=E;H<C.length;++H){var L=this._createListItem(C[H],gara.jswt.JSWT.DEFAULT,H);this._associate(C[H],L)}}for(var H=0;(E+H)<B;++H){this.getControl().remove(E)}this.getControl().setSelection(D)}else{var L=this._getItemFromElementMap(G);if(L!=null){this._updateItem(L,G)}}this.getControl().update()},_listRemoveAll:$abstract(function(){}),_listSetItems:$abstract(function(){})});$class("ListViewer",{$extends:gara.jsface.AbstractListViewer,$constructor:function(C,B){this._list=new gara.jswt.List(C,B)},_createListItem:function(D,C,B){var E=new gara.jswt.ListItem(this._list,C,B);E.setText(this._getLabelProviderText(this.getLabelProvider(),D));E.setImage(this.getLabelProvider().getImage(D));E.setData(D);return E},getControl:function(){return this._list},getList:function(){return this._list},_listRemoveAll:function(){this._list.removeAll()},_listSetItems:function(B){this._list.setItems(B)}});$class("ColumnViewer",{$extends:gara.jsface.StructuredViewer,$constructor:function(){this._cell=new gara.jsface.ViewerCell(null,0,null)},_createViewerColumn:function(B,D){if(!$class.instanceOf(D,gara.jsface.CellLabelProvider)){throw new TypeError("labelProvider not instance of gara.jsface.CellLabelProvider")}var C=new gara.jsface.ViewerColumn(this,B);C.setLabelProvider(D,false);return C},_getColumnViewerOwner:$abstract(function(B){}),_getViewerColumn:function(C){var B=this._getColumnViewerOwner(C);if(B==null){return null}var D=B.getData(gara.jsface.ViewerColumn.COLUMN_VIEWER_KEY);if(D==null){D=this._createViewerColumn(B,gara.jsface.CellLabelProvider.createViewerLabelProvider(this.getLabelProvider()))}return D},_getViewerRowFromItem:$abstract(function(B){}),setLabelProvider:function(B){if(!($class.instanceOf(B,gara.jsface.ITableLabelProvider)||$class.instanceOf(B,gara.jsface.ILabelProvider)||$class.instanceOf(B,gara.jsface.CellLabelProvider))){throw new TypeError("labelProvider is not instance of either gara.jsface.ITableLabelProvider, gara.jsface.ILabelProvider or gara.jsface.CellLabelProvider")}this._updateColumnParts(B);this.$base(B)},toString:function(){return"[gara.jsface.ColumnViewer]"},_updateCell:function(D,C,B){this._cell.update(D,C,B);return this._cell},_updateColumnParts:function(D){var C,B=0;while((C=this._getViewerColumn(B++))!=null){C.setLabelProvider(gara.jsface.CellLabelProvider.createViewerLabelProvider(D),false)}}});$class("AbstractTreeViewer",{$extends:gara.jsface.ColumnViewer,$constructor:function(){},_createTreeItem:function(D,C,B){var E=this._newItem(D,gara.jswt.JSWT.NULL,B);this._updateItem(E,C)},_disassociate:function(B){this.$base(B);this._disassociateChildren(B)},_disassociateChildren:function(D){var B=this._getChildren(D);for(var C=0;C<B.length;C++){if(B[C].getData()!=null){this._disassociate(B[C])}}},_doGetColumnCount:function(){return 0},_doFindInputItem:function(C){var B=this._getRoot();if(B==null){return null}if(B==C){return this.getControl()}return null},_doFindItem:function(E){var B=getRoot();if(B==null){return null}var C=this._getChildren(this.getControl());if(C!=null){for(var D=0;D<C.length;D++){var F=this._internalFindItem(C[D],E);if(F!=null){return F}}}return null},_doUpdateItem:function(F,C){if(F.isDisposed()){this._unmapElement(C,F);return }var H=this._getViewerRowFromItem(F);var G=this._doGetColumnCount();if(G==0){G=1}for(var D=0;D<G;D++){var E=this._getViewerColumn(D);var B=this._updateCell(H,D,C);E.refresh(B);if(F.isDisposed()){this._unmapElement(C,F);return }}this._associate(C,F)},_getChildren:$abstract(function(){}),getControl:$abstract(function(){}),_getExpanded:$abstract(function(B){}),_getLabelProviderText:function(C,B){var D=C.getText(B);if(D==null){D=""}return D},_getRawChildren:function(C){var D=this.getContentProvider();if(C==this._getRoot()){return this.$base(C)}else{if($class.instanceOf(D,gara.jsface.ITreeContentProvider)){var B=D.getChildren(C);if(B!=null){return B}}}return[]},inputChanged:function(B,C){this._treeRemoveAll();this._internalRefresh()},_internalFindItem:function(F,E){var H=F.getData();if(H!=null){if(H==E){return F}}var C=this._getChildren(F);for(var D=0;D<C.length;D++){var G=C[D];var B=this._internalFindItem(G,E);if(B!=null){return B}}return null},_internalRefresh:function(D,G){var H;var F=[];var E=this.getControl().getSelection();for(var C=0;C<E.length;++C){F.push(E[C].getData());H=E[C].getData()}if(D==null||D==this._getRoot()){this._internalRefreshItems(this.getControl(),this._getRoot(),G)}else{var B=this._findItems(D);if(B.length!=0){for(var C=0;C<B.length;C++){this._internalRefreshItems(B[C],D,G)}}}var E=[];F.forEach(function(L,J,I){var K=this._getItemFromElementMap(L);if(K!=null){E.push(K)}},this);this.getControl().update();this.getControl().setSelection(E);this.getControl().update()},_internalRefreshItems:function(G,D,H){this._updateChildren(G,D,H);var C=this._getChildren(G);if(C!=null){for(var B=0;B<C.length;B++){var E=C[B];var F=E.getData();if(F!=null){this._internalRefreshItems(E,F,H)}}}},_newItem:$abstract(function(D,C,B){}),_setExpanded:$abstract(function(C,B){}),_treeRemoveAll:$abstract(function(){}),_updateChildren:function(I,M,O){var P=this._getSortedChildren(M);var Q=this.getControl();var L=this._getChildren(I);var K=[];for(var G=0;G<L.length;++G){if(this._getExpanded(L[G])){var F=L[G].getData();if(F!=null){K.push(F)}}}var C=Math.min(P.length,L.length);var E=L.length-C;if(E>0){var B=[];for(var G=0;G<P.length;G++){B.push(P[G])}var G=0;while(E>0&&G<L.length){var D=L[G].getData();if(D==null||L.length-G<=E||!B.contains(D)){if(D!=null){this._disassociate(L[G])}L[G].dispose();L.removeAt(G);E--}else{G++}}}for(var G=0;G<C;++G){var N=L[G];var H=N.getData();if(H!=null){var J=P[G];if(J==H){var D=N.getData();if(D!=null){this._unmapElement(D,N)}N.setData(J);this._mapElement(J,N)}else{this._disassociate(N);N.setImage(null);N.setText("")}}}for(var G=0;G<C;++G){var N=L[G];var J=P[G];if(N.getData()==null){this._associate(J,N);this._updateItem(N,J)}else{if(O){this._updateItem(N,J)}}}for(var G=0;G<C;++G){var N=L[G];var J=P[G];this._setExpanded(N,K.contains(J))}if(C<P.length){for(var G=C;G<P.length;++G){this._createTreeItem(I,P[G],G)}if(K.length>0){L=this._getChildren(I);for(var G=C;G<P.length;++G){if(K.contains(P[G])){this._setExpanded(L[G],true)}}}}},setContentProvider:function(B){if(!$class.instanceOf(B,gara.jsface.ITreeContentProvider)){throw new TypeError("contentProvider is not type of gara.jsface.ITreeContentProvider")}this._contentProvider=B}});$class("TreeViewer",{$extends:gara.jsface.AbstractTreeViewer,$constructor:function(C,B){this._tree=new gara.jswt.Tree(C,B);this._cachedRow=null},_createNewRowPart:function(C,B,D){if(C==null){if(D>=0){return this._getViewerRowFromItem(new gara.jswt.TreeItem(this._tree,B,D))}return this._getViewerRowFromItem(new gara.jswt.TreeItem(this._tree,B))}if(D>=0){return this._getViewerRowFromItem(new gara.jswt.TreeItem(C.getItem(),gara.jswt.JSWT.NONE,D))}return this._getViewerRowFromItem(new gara.jswt.TreeItem(C.getItem(),gara.jswt.JSWT.NONE))},_getColumnViewerOwner:function(B){if(B<0||(B>0&&B>=this._tree.getColumnCount())){return null}if(this._tree.getColumnCount()==0){return this._tree}return this._tree.getColumn(B)},doGetColumnCount:function(){return this._tree.getColumnCount()},_getChildren:function(B){if($class.instanceOf(B,gara.jswt.TreeItem)||$class.instanceOf(B,gara.jswt.Tree)){return B.getItems().concat([])}return null},getControl:function(){return this._tree},_getExpanded:function(B){return B.getExpanded()},_getViewerRowFromItem:function(B){if(this._cachedRow==null){this._cachedRow=new gara.jsface.TreeViewerRow(B)}else{this._cachedRow.setItem(B)}return this._cachedRow},getTree:function(){return this._tree},_newItem:function(D,C,B){var E;if($class.instanceOf(D,gara.jswt.TreeItem)){E=this._createNewRowPart(this._getViewerRowFromItem(D),C,B).getItem()}else{E=this._createNewRowPart(null,C,B).getItem()}return E},_setExpanded:function(C,B){C.setExpanded(B)},_treeRemoveAll:function(){this._tree.removeAll()}});$class("AbstractTableViewer",{$extends:gara.jsface.ColumnViewer,$constructor:function(){this.$base()},_createItem:function(C,B){this._updateItem(this._internalCreateNewRowPart(gara.jswt.JSWT.NONE,B).getItem(),C)},_doFindInputItem:function(C){var B=this._getRoot();if(B==null){return null}if(B==C){return this.getControl()}return null},_doClear:$abstract(function(B){}),_doGetColumn:$abstract(function(){}),_doGetColumnCount:$abstract(function(){}),_doGetItems:$abstract(function(){}),_doRemoveRange:$abstract(function(C,B){}),_doUpdateItem:function(F,E){if($class.instanceOf(F,gara.jswt.Item)){var J=F;if(J.isDisposed()){this._unmapElement(E,J);return }var D=J.getData();if(D!=null){this._unmapElement(D,J)}J.setData(E);this._mapElement(E,J);var G=this._doGetColumnCount();if(G==0){G=1}var H=this._getViewerRowFromItem(J);for(var C=0;C<G||C==0;C++){var B=this._getViewerColumn(C);var I=this._updateCell(H,C,E);B.refresh(I)}}},_getColumnViewerOwner:function(B){var C=this._doGetColumnCount();if(B<0||(B>0&&B>=C)){return null}if(C==0){return this.getControl()}return this._doGetColumn(B)},inputChanged:function(B,C){this._internalRefresh()},_internalCreateNewRowPart:$abstract(function(C,B){}),_internalRefresh:function(C,D){if(C==null||C==this._getRoot()){this._internalRefreshAll()}else{var B=this._findItem(C);if(B!=null){this._updateItem(B,C)}}this.getControl().update()},_internalRefreshAll:function(){var E=this._getSortedChildren(this._getRoot());var B=this._doGetItems();var D=Math.min(E.length,B.length);for(var C=0;C<D;++C){var F=B[C];if(E[C]==F.getData()){this._updateItem(F,E[C]);this._associate(E[C],F)}else{this._disassociate(F);this._doClear(C)}}if(D<B.length){for(var C=D;C<B.length;++C){this._disassociate(B[C])}this._doRemoveRange(D,B.length-1)}for(var C=0;C<D;++C){var F=B[C];if(F.getData()==null){this._updateItem(F,E[C])}}for(var C=D;C<E.length;++C){this._createItem(E[C],C)}}});$class("TableViewer",{$extends:gara.jsface.AbstractTableViewer,$constructor:function(C,B){this._table=new gara.jswt.Table(C,B)},_doClear:function(B){this._table.clear(B)},_doGetColumn:function(B){return this._table.getColumn(B)},_doGetColumnCount:function(){return this._table.getColumnCount()},_doGetItems:function(){return this._table.getItems()},_doRemoveRange:function(C,B){this._table.removeRange(C,B)},getControl:function(){return this._table},getTable:function(){return this._table},_getViewerRowFromItem:function(B){if(this._cachedRow==null){this._cachedRow=new gara.jsface.TableViewerRow(B)}else{this._cachedRow.setItem(B)}return this._cachedRow},_internalCreateNewRowPart:function(B,D){var C;if(D>=0){C=new gara.jswt.TableItem(this._table,B,D)}else{C=new gara.jswt.TableItem(this._table,B)}return this._getViewerRowFromItem(C)},refresh:function(B){if(typeof (B)=="undefined"){B=null}this._internalRefresh(B)},_tableRemoveAll:function(){this._table.removeAll()}});$class("CheckboxListViewer",{$extends:gara.jsface.ListViewer,$implements:[gara.jsface.ICheckable],$constructor:function(B){if(!$class.instanceOf(B,gara.jswt.List)){throw new TypeError("list not instance of gara.jswt.List")}this._list=B},newCheckList:$static(function(C,B){var D=new gara.jswt.List(C,B|gara.jswt.JSWT.CHECK);return new gara.jsface.CheckboxListViewer(D)}),addCheckStateListener:function(B){},getChecked:function(B){var C=this._getItemFromElementMap(B);if(C!=null){return C.getChecked()}return null},getCheckedElements:function(){var C=this._list.getItems();var B=[];C.forEach(function(F,E,D){if(F.getChecked()){B.push(F.getData())}},this);return B},getGrayed:function(B){var C=this._getItemFromElementMap(B);if(C!=null){return C.getGrayed()}return null},getGrayedElements:function(){var C=this._list.getItems();var B=[];C.forEach(function(F,E,D){if(F.getGrayed()){B.push(F.getData())}},this);return B},removeCheckStateListener:function(B){},setAllChecked:function(C){var B=this._list.getItems();B.forEach(function(F,E,D){F.setChecked(C)},this)},setAllGrayed:function(C){var B=this._list.getItems();B.forEach(function(F,E,D){F.setGrayed(C)},this)},setChecked:function(B,D){var C=this._getItemFromElementMap(B);if(C!=null){C.setChecked(D);return true}return false},setCheckedElements:function(C){var B=this._list.getItems();B.forEach(function(H,F,D){var G=H.getData();if(G!=null){var E=C.contains(G);if(H.getChecked()!=E){H.setChecked(E)}}})},setGrayed:function(B,D){var C=this._getItemFromElementMap(B);if(C!=null){C.setGrayed(D);return true}return false},setGrayedElements:function(C){var B=this._list.getItems();B.forEach(function(H,F,D){var G=H.getData();if(G!=null){var E=C.contains(G);if(H.getGrayed()!=E){H.setGrayed(E)}}})},});$class("ViewerCell",{$constructor:function(D,C,B){this._row=D;this._columnIndex=C;this._element=B},getColumnIndex:function(){return this._columnIndex},getControl:function(){return this._row.getControl()},getElement:function(){if(this._element!=null){return this._element}return this._row.getElement()},getText:function(){return this._row.getText(columnIndex)},getImage:function(){return this._row.getImage(columnIndex)},getItem:function(){return this._row.getItem()},getViewerRow:function(){return this._row},setText:function(B){this._row.setText(this._columnIndex,B)},setImage:function(B){this._row.setImage(this._columnIndex,B)},setColumn:function(B){this._columnIndex=B},update:function(D,C,B){this._row=D;this._columnIndex=C;this._element=B}});$class("ViewerColumn",{COLUMN_VIEWER_KEY:$static("jsface.columnViewer"),$constructor:function(C,B){if(!$class.instanceOf(C,gara.jsface.ColumnViewer)){throw new TypeError("viewer not instance of gara.jsface.ColumnViewer")}if(!$class.instanceOf(B,gara.jswt.Widget)){throw new TypeError("columnOwner not instance of gara.jswt.Widget")}B.setData(this.COLUMN_VIEWER_KEY,this);this._labelProvider=null},getLabelProvider:function(){return this._labelProvider},setLabelProvider:function(B,C){if(!$class.instanceOf(B,gara.jsface.CellLabelProvider)){throw new TypeError("labelProvider not instance of gara.jsface.CellLabelProvider")}this._labelProvider=B},refresh:function(B){if(!$class.instanceOf(B,gara.jsface.ViewerCell)){throw new TypeError("cell not instance of gara.jsface.ViewerCell")}this.getLabelProvider().update(B)}});$class("ViewerRow",{$constructor:function(){this.$base()},getItem:$abstract(function(){}),getColumnCount:$abstract(function(){}),getImage:$abstract(function(B){}),setImage:$abstract(function(B,C){}),getText:$abstract(function(B){}),setText:$abstract(function(B,C){}),getCell:function(B){if(B>=0){return new gara.jsface.ViewerCell(this,B,this.getElement())}return null},getElement:$abstract(function(){}),getControl:$abstract(function(){})});$class("TableViewerRow",{$extends:gara.jsface.ViewerRow,$constructor:function(B){if(!$class.instanceOf(B,gara.jswt.TableItem)){throw new TypeError("item is not instance of gara.jswt.TableItem")}this._item=B},getItem:function(){return this._item},getColumnCount:function(){return this._item.getParent().getColumnCount()},getImage:function(B){return this._item.getImage(B)},getText:function(B){return this._item.getText(B)},getElement:function(){return this._item.getData()},getControl:function(){return this._item.getParent()},setText:function(B,C){this._item.setText(B,C==null?"":C)},setImage:function(C,D){var B=this._item.getImage(C);if(B!=D){this._item.setImage(C,D)}},setItem:function(B){if(!$class.instanceOf(B,gara.jswt.TableItem)){throw new TypeError("item is not instance of gara.jswt.TableItem")}this._item=B}});$class("TreeViewerRow",{$extends:gara.jsface.ViewerRow,$constructor:function(B){if(!$class.instanceOf(B,gara.jswt.TreeItem)){throw new TypeError("item is not instance of gara.jswt.TreeItem")}this._item=B},getItem:function(){return this._item},getColumnCount:function(){return this._item.getParent().getColumnCount()},getImage:function(B){return this._item.getImage(B)},getText:function(B){return this._item.getText(B)},getElement:function(){return this._item.getData()},getControl:function(){return this._item.getParent()},setText:function(B,C){this._item.setText(B,C==null?"":C)},setImage:function(C,D){var B=this._item.getImage(C);if(B!=D){this._item.setImage(C,D)}},setItem:function(B){if(!$class.instanceOf(B,gara.jswt.TreeItem)){throw new TypeError("item is not instance of gara.jswt.TreeItem")}this._item=B}});$class("ViewerComparator",{$constructor:function(){},category:function(B){return 0},compare:function(E,D){var C=E.toString().toLowerCase();var B=D.toString().toLowerCase();if(C<B){return -1}else{if(C>B){return 1}}return 0},isSorterProperty:function(B,C){return false},sort:function(C,B){console.log("sort");return B.sort(this.compare)},toString:function(){return"[gara.jsface.ViewerComparator]"}});$class("ViewerSorter",{$extends:gara.jsface.ViewerComparator,$constructor:function(){},toString:function(){return"[gara.jsface.ViewerSorter]"}});$class("ViewerFilter",{$constructor:function(){},filter:function(D,B,C){out=[];C.forEach(function(G,F,E){if(this.select(D,B,G)){out.push(G)}},this);return out},isFilterProperty:function(B,C){return false},select:$abstract(function(D,B,C){}),toString:function(){return"[gara.jsface.ViewerFilter]"}});$class("PatternFilter",{$extends:gara.jsface.ViewerFilter,$constructor:function(){this._pattern=""},isElementVisible:function(C,B){return this._isParentMatch(C,B)||this._isLeafMatch(C,B)},_isLeafMatch:function(H,E){var C=H.getLabelProvider();if($class.instanceOf(C,gara.jsface.ITableLabelProvider)){var G=H.getControl().getColumnCount();for(var D=0;D<G;++D){var F=C.getColumnText(E,D);if(F!=null){var B=this._match(F);if(B){return B}}}return false}else{var F=C.getText(E);if(F==null){return false}return this._match(F)}},_isParentMatch:function(G,D){var E=G.getContentProvider();if($class.instanceOf(E,gara.jsface.ITreeContentProvider)){var C=E.getChildren(D);if(C!=null&&C.length>0){var F=false;for(var B=0;B<C.length&&!F;B++){F=this.isElementVisible(G,C[B])}return F}}return false},_match:function(B){return B.indexOf(this._pattern)!=-1},select:function(E,C,D){if(this._pattern==""){return true}var B=this.isElementVisible(E,D);return B},setPattern:function(B){this._pattern=B},toString:function(){return"[gara.jsface.PatternFilter]"}});var A=new gara.Package({name:"jswt",exports:"IBaseLabelProvider,ILabelProvider,ITableLabelProvider,LabelProvider"});gara.jsface.namespace=A.namespace;gara.jsface.toString=function(){return"[gara.jsface]"};$package("")})();

