Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Furnadjiev2013-05-27 10:11:08 +0000
committerIvan Furnadjiev2013-05-27 10:11:08 +0000
commit74258680fcce9d855ad376f2525296ef3fa31d46 (patch)
tree87ce6a8162a91a5fd11060e1b28c04777d055973 /bundles
parentef85fae4131ad988ba2988becc9f26a9d6124766 (diff)
downloadorg.eclipse.rap-74258680fcce9d855ad376f2525296ef3fa31d46.tar.gz
org.eclipse.rap-74258680fcce9d855ad376f2525296ef3fa31d46.tar.xz
org.eclipse.rap-74258680fcce9d855ad376f2525296ef3fa31d46.zip
Add a check for _preItem in Menu.js#addMenuItemAt2.1.0-RC2
The _preItem will always be at index 0. 409124: [Menu] Item is inserted in wrong position from dynamic ContributionItem https://bugs.eclipse.org/bugs/show_bug.cgi?id=409124
Diffstat (limited to 'bundles')
-rw-r--r--bundles/org.eclipse.rap.rwt/js/rwt/widgets/Menu.js6
-rw-r--r--bundles/org.eclipse.rap.rwt/resources/client.js2
2 files changed, 6 insertions, 2 deletions
diff --git a/bundles/org.eclipse.rap.rwt/js/rwt/widgets/Menu.js b/bundles/org.eclipse.rap.rwt/js/rwt/widgets/Menu.js
index b2b8a3ab01..54446edc52 100644
--- a/bundles/org.eclipse.rap.rwt/js/rwt/widgets/Menu.js
+++ b/bundles/org.eclipse.rap.rwt/js/rwt/widgets/Menu.js
@@ -187,7 +187,11 @@ rwt.qx.Class.define( "rwt.widgets.Menu", {
// it is essential that this happens before the menuItem is added
menuItem.setParentMenu( this );
}
- this._layout.addAt( menuItem, index );
+ var position = index;
+ if( this._preItem && this._preItem !== menuItem ) {
+ position++;
+ }
+ this._layout.addAt( menuItem, position );
},
scheduleMenuLayout : function() {
diff --git a/bundles/org.eclipse.rap.rwt/resources/client.js b/bundles/org.eclipse.rap.rwt/resources/client.js
index a9b994ee5d..a47091c9de 100644
--- a/bundles/org.eclipse.rap.rwt/resources/client.js
+++ b/bundles/org.eclipse.rap.rwt/resources/client.js
@@ -117,7 +117,7 @@ rwt.qx.Class.define("rwt.widgets.base.GridRowContainer",{extend:rwt.widgets.base
namespace($[558]);rwt.widgets.util.GridRowContainerWrapper=function(){this._fixedColumns=0;this._container=[];this._container[0]=new rwt.widgets.base.GridRowContainer();this._container[1]=new rwt.widgets.base.GridRowContainer();this._config=rwt.widgets.base.GridRowContainer.createRenderConfig();this._width=0;this._splitOffset=0;this._rowWidth=0;this.addEventListener($[3],this._onRowOver,this);this.addEventListener($[6],this._onRowOver,this)};rwt.widgets.util.GridRowContainerWrapper.createInstance=function(){if(!this.prototype._protoInit){for(var a=0;a<this._CONTAINER_DELEGATES.length;a++){this._createContainerDelegater(this._CONTAINER_DELEGATES[a])}for(var a=0;a<this._CONTAINER_GETTER_DELEGATES.length;a++){this._createContainerGetterDelegater(this._CONTAINER_GETTER_DELEGATES[a])}this.prototype._protoInit=true}return new rwt.widgets.util.GridRowContainerWrapper()};rwt.widgets.util.GridRowContainerWrapper._createContainerDelegater=function(a){this.prototype[a]=function(){this._container[0][a].apply(this._container[0],arguments);this._container[1][a].apply(this._container[1],arguments)}};rwt.widgets.util.GridRowContainerWrapper._createContainerGetterDelegater=function(a){this.prototype[a]=function(){return this._container[0][a].apply(this._container[0],arguments)}};rwt.widgets.util.GridRowContainerWrapper._CONTAINER_DELEGATES=["setParent",$[223],"addEventListener","removeEventListener","setSelectionProvider","setHeight","setTop","setBackgroundColor","setBackgroundImage","setRowHeight","setTopItem","renderItem","setToolTip","renderItemQueue","setBaseAppearance"];rwt.widgets.util.GridRowContainerWrapper._CONTAINER_GETTER_DELEGATES=["getTop","getHeight","getHoverItem","getElement","getChildrenLength"];rwt.widgets.util.GridRowContainerWrapper.prototype={_protoInit:false,getSubContainer:function(a){return this._container[a]||null},setFixedColumns:function(a){this._fixedColumns=a;this._updateConfig()},getFixedColumns:function(){return this._fixedColumns},getRenderConfig:function(){return this._config},setPostRenderFunction:function(){},setWidth:function(a){this._width=a;this._layoutX()},getWidth:function(){return this._width},setRowWidth:function(a){this._rowWidth=a;this._layoutX()},setScrollLeft:function(a){this._container[1].setScrollLeft(a)},findItemByRow:function(b){var a=this._container[0].findItemByRow(b);if(a==null){a=this._container[1].findItemByRow(b)}return a},updateRowLines:function(){this._container[0].getRenderConfig().linesVisible=this._config.linesVisible;this._container[0].updateRowLines();this._container[1].getRenderConfig().linesVisible=this._config.linesVisible;this._container[1].updateRowLines()},renderAll:function(){this._updateConfig();this._container[0].renderAll();this._container[1].renderAll()},_updateConfig:function(){var b=this._container[0].getRenderConfig();var g=this._container[1].getRenderConfig();for(var e in this._config){if(this._config[e] instanceof Array){b[e]=this._config[e].concat();g[e]=this._config[e].concat()}else{b[e]=this._config[e];g[e]=this._config[e]}}g.hasCheckBoxes=false;var a=this._getColumnOrder();var d=0;if(a.length>this._fixedColumns){d=this._config.itemLeft[a[this._fixedColumns]]}else{d=this._width}for(var c=0;c<a.length;c++){var f=a[c];if(c<this._fixedColumns){g.itemWidth[f]=0}else{b.itemWidth[f]=0;g.itemLeft[f]-=d;g.itemImageLeft[f]-=d;g.itemTextLeft[f]-=d}}if(this._splitOffset!==d){this._splitOffset=d;this._layoutX()}},_layoutX:function(){var a=Math.min(this._splitOffset,this._width);this._container[0].setWidth(a);this._container[0].setRowWidth(a);this._container[1].setLeft(a);this._container[1].setWidth(this._width-a);this._container[1].setRowWidth(this._rowWidth-a)},_getColumnOrder:function(){var a=[];var d=this._config.itemLeft.concat();var b=d.concat().sort(function(g,f){return g-f});for(var c=0;c<b.length;c++){var e=d.indexOf(b[c]);a[c]=e;d[e]=null}return a},_onRowOver:function(b){var c=b.getCurrentTarget();for(var a=0;a<this._container.length;a++){if(this._container[a]!==c){this._container[a].setHoverItem(c.getHoverItem())}}}};
namespace($[558]);rwt.widgets.util.GridUtil={setFixedColumns:function(a,c){var b=a.getRowContainer();if(b.setFixedColumns){b.setFixedColumns(c);a.update()}},createTreeRowContainer:function(b){var a;if(b.splitContainer){a=rwt.widgets.util.GridRowContainerWrapper.createInstance()}else{a=new rwt.widgets.base.GridRowContainer()}return a},getColumnByPageX:function(b,d){var c=b.getRowContainer();var e=c instanceof rwt.widgets.util.GridRowContainerWrapper;if(e){c=b.getRowContainer().getSubContainer(0)}var a=this._getColumnByPageX(c,d);if(a===-1&&e){c=b.getRowContainer().getSubContainer(1);a=this._getColumnByPageX(c,d)}return a},_getColumnByPageX:function(a,d){var c=a.getRenderConfig();var g=c.columnCount;var h=g===0?0:-1;var e=a.getFirstChild().getElement();var b=rwt.html.Location.getLeft(e);for(var f=0;h==-1&&f<g;f++){var j=b+c.itemLeft[f];if(d>=j&&d<j+c.itemWidth[f]){h=f}}return h}};
(function(){var b=rwt.html.Style;var a=rwt.util.Variant;rwt.qx.Class.define($[529],{extend:rwt.widgets.base.Terminator,construct:function(){arguments.callee.base.call(this);this.setSelectable(false);this.setHeight(16);this._styleMap={};this._overlayStyleMap={};this._variant=null;this._graphicsOverlay=null;this._expandElement=null;this._checkBoxElement=null;this._overlayElement=null;this._treeColumnElements=[];this._cellLabels=[];this._cellImages=[];this._cellCheckImages=[];this._cellBackgrounds=[];this._miscNodes=[];this._usedMiscNodes=0;this._cellsRendered=0},destruct:function(){this._expandElement=null;this._graphicsOverlay=null;this._checkBoxElement=null;this._treeColumnElements=null;this._cellLabels=null;this._cellImages=null;this._cellCheckImages=null;this._cellBackgrounds=null;this._miscNodes=null},events:{itemRendered:$[11]},members:{renderItem:function(g,e,f,j,i){this._usedMiscNodes=0;if(g!==null){var d=this._renderAsSelected(e,f);var c=this._renderHeight(g,e);var h=i&&!c;this._renderStates(g,e,d,j);this._renderBackground(g,e,d);if(e.treeColumn!==-1){this._renderIndention(g,e,j)}this._renderCheckBox(g,e,j,h);this._renderCells(g,e,d,j,h);this._renderOverlay(g,e);this._hideRemainingElements()}else{this.setBackgroundColor(null);this.setBackgroundImage(null);this.setBackgroundGradient(null);this._clearContent(e);if(!i&&e){this._renderAllBounds(e)}}this.dispatchSimpleEvent("itemRendered",g)},getTargetIdentifier:function(f){var e=f.getDomTarget();var d=[$[124]];if(this._expandElement!==null&&this._expandElement===e){d=[$[299]]}else{if(this._checkBoxElement!==null&&this._checkBoxElement===e){d=[$[266]]}else{if(this._cellCheckImages.indexOf(e)!==-1){var c=this._cellCheckImages.indexOf(e);d=[$[347],c]}else{while(e!==this.getElement()&&d[0]===$[124]){if(this._treeColumnElements.indexOf(e)!=-1){d=[$[265]]}e=e.parentNode}}}}return d},updateEvenState:function(c){this.setState("even",c%2===0)},_renderHeight:function(e,d){var c=false;var f=e.getOwnHeight();if(f!==this.getHeight()){this.setHeight(e.getOwnHeight());c=true}return c},_renderStates:function(e,c,d,f){this.setState($[156],e.isChecked());this.setState($[180],e.isGrayed());this.setState($[93],this._renderAsUnfocused(c));this.setState($[23],c.fullSelection?d:false);this._renderVariant(e.getVariant());this._renderOverState(f,c);this._styleMap=this._getStyleMap();this.setState($[23],d);if(c.fullSelection){this._overlayStyleMap=this._getOverlayStyleMap()}else{this._overlayStyleMap=this._getTreeColumnStyleMap()}},_renderVariant:function(c){if(this._variant!=c){if(this._variant!=null){this.setState(this._variant,false)}this._variant=c;if(this._variant!=null){this.setState(this._variant,true)}}},_renderOverState:function(e,d){var f=e!==null&&d.fullSelection;var c=e!=null&&e[0]===$[265];this.setState("over",f||c)},setState:function(d,c){if(!this.__states){this.__states={}}if(c){this.__states[d]=true}else{delete this.__states[d]}},_getStyleMap:function(){var c=rwt.theme.AppearanceManager.getInstance();return c.styleFrom(this.getAppearance(),this.__states)},_getOverlayStyleMap:function(){var c=rwt.theme.AppearanceManager.getInstance();return c.styleFrom(this.getAppearance()+"-overlay",this.__states)},_getTreeColumnStyleMap:function(){var d=rwt.theme.AppearanceManager.getInstance();var c=d.styleFrom(this.getAppearance(),this.__states);var e=d.styleFrom(this.getAppearance()+"-overlay",this.__states);e.rowForeground=c.foreground;return e},_styleFromMap:function(){},_renderBackground:function(f,d,e){var c=this._styleMap.background;var h=this._styleMap.backgroundImage;var g=this._styleMap.backgroundGradient;if(d.enabled!==false&&f!==null&&f.getBackground()!==null){c=f.getBackground();h=null;g=null}this.setBackgroundColor(c!==$[8]?c:null);this.setBackgroundImage(h!==$[8]?h:null);this.setBackgroundGradient(g!==$[8]?g:null)},_hasOverlayBackground:function(){var c=this._overlayStyleMap.background!==$[8]||this._overlayStyleMap.backgroundImage!==null||this._overlayStyleMap.backgroundGradient!==null;return c},_renderIndention:function(g,d,h){var i=this._getExpandSymbol(g,d,h);if(i!=null){var e=this._addIndentSymbol(g.getLevel(),d,i);this._expandElement=e}else{this._expandElement=null}var c=this._getLineSymbol(g,d);if(c!=null){var f=g.getParent();while(!f.isRootItem()){if(f.hasNextSibling()){this._addIndentSymbol(f.getLevel(),d,c)}f=f.getParent()}}},_getExpandSymbol:function(e,d,f){var c=this._getParentStates(d);if(e.getLevel()===0&&!e.hasPreviousSibling()){c.first=true}if(!e.hasNextSibling()){c.last=true}if(e.hasChildren()){if(e.isExpanded()){c.expanded=true}else{c.collapsed=true}}if(f&&f[0]===$[299]){c.over=true}return this._getImageFromAppearance("indent",c)},_getLineSymbol:function(e,d){var c=this._getParentStates(d);c.line=true;return this._getImageFromAppearance("indent",c)},_getParentStates:function(d){var c={};if(d.variant){c[d.variant]=true}return c},_getImageFromAppearance:function(h,d){var c=this.getAppearance()+"-"+h;var e=rwt.theme.AppearanceManager.getInstance();var g=e.styleFrom(c,d);var f=g&&g.backgroundImage;return f?g.backgroundImage:null},_addIndentSymbol:function(d,f,c){var l=null;var j=(d+1)*f.indentionWidth;var g=f.itemWidth[f.treeColumn];if(j<=g){var h=d*f.indentionWidth;var k=this.getHeight();var e=j-h;var i=this._getMiscImage();this._setImage(i,c,f.enabled);this._setBounds(i,h,0,e,k);l=i}return l},_renderCheckBox:function(j,d,h,f){if(d.hasCheckBoxes){var k=this.__states;this.setState("over",h&&h[0]===$[266]);var g=this._getImageFromAppearance($[377],k);this.setState("over",h!==null);if(this._checkBoxElement===null){this._checkBoxElement=this._createElement(3);this._checkBoxElement.style.backgroundRepeat=$[160];this._checkBoxElement.style.backgroundPosition=$[22]}this._setImage(this._checkBoxElement,g,d.enabled);if(d.treeColumn!==-1||!f){var e=this._getCheckBoxLeft(j,d);var c=this._getCheckBoxWidth(j,d);var i=this.getHeight();this._setBounds(this._checkBoxElement,e,0,c,i)}}},_renderCells:function(m,c,f,k,d){var e=this._getColumnCount(c);if(this._cellsRendered>e){this._removeCells(e,this._cellsRendered)}for(var g=0;g<e;g++){var l=this._isTreeColumn(g,c);if(this._getItemWidth(m,g,c)>0){this._renderCellBackground(m,g,c,d);this._renderCellCheckBox(m,g,c,l,d,k);var j=this._renderCellImage(m,g,c,l,d);var h=this._renderCellLabel(m,g,c,l,d);if(!c.fullSelection&&l){this._treeColumnElements=[j,h]}}else{this._removeCell(g)}}this._cellsRendered=e},_renderOverlay:function(d,c){if(d&&this._hasOverlayBackground()){this._styleOverlay(d,c);this._layoutOverlay(d,c)}else{if(this._overlayElement){this._overlayElement.style.display="none"}}},_styleOverlay:function(e,c){var d=this._getOverlayElement();var g=this._overlayStyleMap;var f=g.backgroundGradient;if(f){this._renderOverlayGradient(d,f)}else{d.style.backgroundColor=g.background;b.setOpacity(d,g.backgroundAlpha)}},_renderOverlayGradient:function(c,d){if(rwt.client.Client.supportsCss3()){b.setBackgroundGradient(c,d)}else{rwt.graphics.GraphicsUtil.setFillGradient(this._getOverlayShape(),d)}},_getOverlayShape:function(){if(!this._graphicsOverlay){var e=rwt.graphics.GraphicsUtil;var d=e.createCanvas();var c=e.createShape($[139]);e.addToCanvas(d,c);this._graphicsOverlay={canvas:d,shape:c};this._getTargetNode().replaceChild(d.node,this._overlayElement);this._overlayElement=d.node;this._overlayElement.style.zIndex=2}return this._graphicsOverlay.shape},_layoutOverlay:function(n,d){var g=this._getOverlayElement();var m=this.getHeight();var e;var c;if(d.fullSelection){e=0;c=this.getWidth()}else{var l=d.treeColumn;var k=d.selectionPadding;e=this._getItemTextLeft(n,l,d);e-=k[0];c=this._getItemTextWidth(n,l,d);c+=c>0?k[0]:0;var j=this._getVisualTextWidth(n,l,d);j+=k[0]+k[1];c=Math.min(c,j)}if(this._graphicsOverlay){var i=rwt.graphics.GraphicsUtil;var h=this._graphicsOverlay.shape;g.style.left=e+"px";g.style.top="0px";var f=[0,0,0,0];i.setRoundRectLayout(h,0,0,c,m,f)}else{this._setBounds(g,e,0,c,m)}},_renderCellBackground:function(h,c,d,i){var f=this._getCellBackgroundColor(h,c,d);var g=false;if(f!==$[8]&&f!=this._styleMap.backgroundColor){g=!i||!this._cellBackgrounds[c];var e=this._getBackgroundElement(c);e.style.backgroundColor=f}else{if(this._cellBackgrounds[c]){this._cellBackgrounds[c].style.backgroundColor=$[81];g=!i}}if(g){this._renderCellBackgroundBounds(h,c,d)}},_renderCellBackgroundBounds:function(h,d,e){var f=this._cellBackgrounds[d];if(f){var i=this._getItemLeft(h,d,e);var g=this._getItemWidth(h,d,e);var c=this.getHeight();if(this.hasState($[241])){c-=1}this._setBounds(f,i,0,g,c)}},_renderCellCheckBox:function(k,i,d,h,e,g){var f=null;var j=false;if(d.itemCellCheck[i]){this.setState($[156],k.isCellChecked(i));this.setState($[180],k.isCellGrayed(i));this.setState("over",g&&g[0]===$[347]&&g[1]===i);var c=this._getImageFromAppearance($[377],this.__states);j=h||!e||!this._cellCheckImages[i];f=this._getCellCheckImage(i);this._setImage(f,c,d.enabled)}if(j){this._renderCellCheckBounds(k,i,d)}return f},_renderCellCheckBounds:function(g,c,d){var e=this._cellCheckImages[c];if(e){var h=this._getCellCheckLeft(g,c,d);var f=this._getCellCheckWidth(g,c,d);this._setBounds(e,h,0,f,this.getHeight())}},_renderCellImage:function(h,c,e,d,j){var i=h.getImage(c);var f=null;var g=false;if(i!==null){g=d||!j||!this._cellImages[c];f=this._getCellImage(c);this._setImage(f,i,g?e.enabled:null)}else{if(this._cellImages[c]){g=d||!j;f=this._getCellImage(c);this._setImage(f,null,null)}}if(g){this._renderCellImageBounds(h,c,e)}return f},_renderCellImageBounds:function(g,c,d){var e=this._cellImages[c];if(e){var h=this._getItemImageLeft(g,c,d);var f=this._getItemImageWidth(g,c,d);this._setBounds(e,h,0,f,this.getHeight())}},_renderCellLabel:function(h,c,e,d,i){var f=null;var g=false;if(h.hasText(c)){g=d||!i||!this._cellLabels[c];f=this._getTextElement(c,e);this._renderElementContent(f,h,c,e.markupEnabled);if(g){f.style.textAlign=d?"left":this._getAlignment(c,e)}this._styleLabel(f,h,c,e)}else{if(this._cellLabels[c]){g=d||!i;f=this._getTextElement(c,e);this._renderElementContent(f,null,-1,e.markupEnabled)}}if(g){this._renderCellLabelBounds(h,c,e)}return f},_renderCellLabelBounds:function(g,c,d){var e=this._cellLabels[c];if(e){var i=this._getItemTextLeft(g,c,d);var f=this._getItemTextWidth(g,c,d);var h=this._getCellPadding(d)[0];this._setBounds(e,i,h,f,this.getHeight()-h)}},_renderElementContent:a.select($[0],{"mshtml|newmshtml":function(f,g,c,e){if(e){var d=g?g.getText(c,false):"";if(f.rap_Markup!==d){f.innerHTML=d;f.rap_Markup=d}}else{if(this.isSeeable()){f.innerText=g?g.getText(c,false):""}else{f.innerHTML=g?g.getText(c):""}}},"default":function(f,g,c,e){var d=g?g.getText(c,!e):"";if(e){if(d!==f.rap_Markup){f.innerHTML=d;f.rap_Markup=d}}else{f.innerHTML=d}}}),_styleLabel:function(e,f,c,d){this._setForeground(e,this._getCellColor(f,c,d));this._setFont(e,this._getCellFont(f,c,d));this._setTextDecoration(e,this._styleMap.textDecoration);b.setTextShadow(e,this._styleMap.textShadow)},_getCellBackgroundColor:function(f,d,e){var c;if(e.enabled===false){c=$[8]}else{c=f.getCellBackground(d)}return c},_getCellColor:function(g,e,f){var d=null;var h=this._styleMap.foreground;var c=this._overlayStyleMap.foreground;if(!f.fullSelection){if(this._isTreeColumn(e,f)){h=this._overlayStyleMap.rowForeground}else{c=$[8]}}if(c!==$[8]){d=c}else{if(f.enabled!==false&&g.getCellForeground(e)){d=g.getCellForeground(e)}else{d=h;if(d===$[8]){d=f.textColor}}}return d},_getCellFont:function(f,d,e){var c=f.getCellFont(d);if(c===null||c===""){c=e.font}return c},_getVisualTextWidth:function(i,g,d){var f=rwt.widgets.util.FontSizeCalculation;var k=0;if(this._cellLabels[g]){var e=this._getCellFont(i,g,d);var j=this._getFontProps(e);var h=this._cellLabels[g].innerHTML;var c=f.computeTextDimensions(h,j);k=c[0]}return k},_renderAsUnfocused:function(c){return !c.focused&&!this.hasState($[376])},_renderAsSelected:function(d,e){var c=(e||this.hasState($[376]))&&(!d.hideSelection||d.focused)&&!d.alwaysHideSelection;return c},_getFontProps:function(d){var c={};if(d instanceof rwt.html.Font){d.renderStyle(c)}else{var e=rwt.html.Font.fromString(d);e.renderStyle(c);e.dispose()}return c},_setFont:function(d,c){if(c===""||c===null){this._resetFont(d)}else{if(c instanceof rwt.html.Font){c.renderStyle(d.style)}else{d.style.font=c}}},_resetFont:a.select($[0],{"default":function(c){c.style.font="";c.style.fontFamily="";c.style.fontSize="";c.style.fontVariant="";c.style.fontStyle="";c.style.fontWeight=""},mshtml:function(c){c.style.fontFamily="";c.style.fontSize="";c.style.fontVariant="";c.style.fontStyle="";c.style.fontWeight=""}}),_setTextDecoration:function(d,c){if(c==null||c==="none"){d.style.textDecoration=""}else{d.style.textDecoration=c}},_setBounds:function(f,d,h,g,c){try{f.style.left=d+"px";f.style.top=h+"px";f.style.width=g+"px";f.style.height=c+"px"}catch(e){throw"setBounds failed: "+[f,d,h,g,c]}},_setForeground:function(d,c){d.style.color=c!=null?c:""},_setImage:function(e,f,d){e.style.backgroundImage=f?"URL("+f+")":"none";if(d!==null){var c=d?1:0.3;b.setOpacity(e,c)}},_getTextElement:function(d,e){var c=this._cellLabels[d];if(!c){c=this._createElement(3);c.style.verticalAlign=$[46];c.style.whiteSpace="nowrap";if(rwt.client.Client.isNewMshtml()){c.style.backgroundColor="rgba(0, 0, 0, 0)"}this._cellLabels[d]=c}return c},_getCellImage:function(d){var c=this._cellImages[d];if(!c){c=this._createElement(3);c.style.backgroundRepeat=$[160];c.style.backgroundPosition=$[22];this._cellImages[d]=c}return c},_getCellCheckImage:function(d){var c=this._cellCheckImages[d];if(!c){c=this._createElement(3);c.style.backgroundRepeat=$[160];c.style.backgroundPosition=$[22];this._cellCheckImages[d]=c}return c},_getMiscImage:function(){var c=this._getMiscElement(3);c.innerHTML="";c.style.backgroundColor="";return c},_getOverlayElement:function(){if(this._overlayElement===null){this._overlayElement=this._createElement(2)}this._overlayElement.style.display="";return this._overlayElement},_getBackgroundElement:function(d){var c=this._cellBackgrounds[d];if(!c){c=this._createElement(1);this._cellBackgrounds[d]=c}return c},_getMiscElement:function(e){var c;var d=this._getTargetNode();if(this._usedMiscNodes<this._miscNodes.length){c=this._miscNodes[this._usedMiscNodes];c.style.display="";c.style.zIndex=e}else{c=this._createElement(e);c.style.backgroundRepeat=$[160];c.style.backgroundPosition=$[22];this._miscNodes.push(c)}this._usedMiscNodes++;return c},_createElement:function(d){var c=document.createElement("div");c.style.position=$[15];c.style.overflow=$[10];c.style.zIndex=d;this._getTargetNode().appendChild(c);return c},_clearContent:function(c){for(var d=0;d<this._cellBackgrounds.length;d++){if(this._cellBackgrounds[d]){this._cellBackgrounds[d].style.backgroundColor=$[81]}}for(var d=0;d<this._cellCheckImages.length;d++){if(this._cellCheckImages[d]){this._cellCheckImages[d].style.backgroundImage=""}}for(var d=0;d<this._cellImages.length;d++){if(this._cellImages[d]){this._cellImages[d].style.backgroundImage=""}}for(var d=0;d<this._cellLabels.length;d++){if(this._cellLabels[d]){this._renderElementContent(this._cellLabels[d],null,-1,c.markupEnabled)}}if(this._checkBoxElement){this._checkBoxElement.style.backgroundImage=""}this._renderOverlay(null);this._hideRemainingElements()},_renderAllBounds:function(c){var e=this._getColumnCount(c);for(var d=0;d<e;d++){if(!this._isTreeColumn(d,c)){this._renderCellLabelBounds(null,d,c);this._renderCellImageBounds(null,d,c)}this._renderCellBackgroundBounds(null,d,c)}},_hideRemainingElements:function(){var d=this._getTargetNode();for(var c=this._usedMiscNodes;c<this._miscNodes.length;c++){this._miscNodes[c].style.display="none"}},_removeCells:function(e,d){for(var c=e;c<d;c++){this._removeCell(c)}},_removeCell:function(c){this._removeNode(this._cellBackgrounds,c);this._removeNode(this._cellImages,c);this._removeNode(this._cellCheckImages,c);this._removeNode(this._cellLabels,c)},_removeNode:function(c,e){var d=c[e];if(d){this._getTargetNode().removeChild(d);c[e]=null}},_ieFixLayoutOnAppear:a.select($[0],{mshtml:function(){arguments.callee.base.call(this);var d=this._getTargetNode();for(var c=0;c<d.childNodes.length;c++){if(d.childNodes[c].style.display==="none"){d.childNodes[c].style.display="";d.childNodes[c].style.display="none"}}},"default":rwt.util.Functions.returnTrue}),_getCheckBoxLeft:function(d,c){return this._correctOffset(c.checkBoxLeft,d,c)},_getCheckBoxWidth:function(e,d){var c=d.checkBoxWidth;var f=this._getCheckBoxLeft(e,d);return this._correctWidth(c,f,0,d)},_getItemLeft:function(e,d,c){return c.itemLeft[d]},_getItemWidth:function(e,d,c){return c.itemWidth[d]},_getItemImageLeft:function(f,e,d){var c=d.itemImageLeft[e];if(this._isTreeColumn(e,d)){c=this._correctOffset(c,f,d)}return c},_getItemImageWidth:function(f,e,d){var c=d.itemImageWidth[e];if(this._isTreeColumn(e,d)){var g=this._getItemImageLeft(f,e,d);c=this._correctWidth(c,g,e,d)}return c},_getCellCheckLeft:function(f,e,d){var c=d.itemCellCheckLeft[e];if(this._isTreeColumn(e,d)){c=this._correctOffset(c,f,d)}return c},_getCellCheckWidth:function(f,e,d){var c=d.itemCellCheckWidth[e];if(this._isTreeColumn(e,d)){var g=this._getCellCheckLeft(f,e,d);c=this._correctWidth(c,g,e,d)}return c},_getItemTextLeft:function(f,e,d){var c=d.itemTextLeft[e];if(this._isTreeColumn(e,d)){c=this._correctOffset(c,f,d)}return c},_getItemTextWidth:function(f,e,d){var c=d.itemTextWidth[e];if(this._isTreeColumn(e,d)){var g=this._getItemTextLeft(f,e,d);c=this._correctWidth(c,g,e,d)}return c},_getCellPadding:function(c){var d=rwt.theme.AppearanceManager.getInstance();return d.styleFrom(c.baseAppearance+"-cell",{}).padding},_correctOffset:function(e,d,c){return e+this._getIndentionOffset(d.getLevel()+1,c)},_correctWidth:function(g,i,f,d){var c=g;var h=d.itemLeft[f]+d.itemWidth[f];var e=i+c;if(e>h){c=Math.max(0,h-i)}return c},_getAlignment:function(d,c){return c.alignment[d]?c.alignment[d]:"left"},_getIndentionOffset:function(d,c){return c.indentionWidth*d},_getColumnCount:function(c){return Math.max(1,c.columnCount)},_isTreeColumn:function(d,c){return d===c.treeColumn},supportsDrop:function(){return true}}})}());
-rwt.qx.Class.define($[455],{extend:rwt.widgets.base.Popup,include:rwt.animation.VisibilityAnimationMixin,construct:function(){arguments.callee.base.call(this);this._layout=null;this._preItem=null;this._hasShowListener=false;this._hasHideListener=false;this._maxCellWidths=null;this._menuLayoutScheduled=false;this._opener=null;this._mnemonics=false;this._hoverItem=null;this._openTimer=null;this._closeTimer=null;this._openItem=null;this._itemsHiddenFlag=false;this._hoverFirstItemFlag=false;this.setHeight("auto");this.setWidth("auto");this._maxCellWidths=[null,null,null,null,null];this._layout=new rwt.widgets.base.VerticalBoxLayout();this._layout.set({top:0,right:0,bottom:0,left:0,anonymous:true});this.add(this._layout);this.addEventListener($[1],this._unhoverSubMenu);this.addEventListener($[6],this._onMouseOut);this.addEventListener($[3],this._onMouseOver);this.addEventListener($[5],this._onKeyPress);this.addEventListener($[7],this._onKeyDown);this._openTimer=new rwt.client.Timer(250);this._openTimer.addEventListener($[27],this._onopentimer,this);this._closeTimer=new rwt.client.Timer(250);this._closeTimer.addEventListener($[27],this._onclosetimer,this);this.addToDocument()},destruct:function(){this._disposeObjects("_openTimer","_closeTimer","_preItem","_animation");this._disposeFields("_lastActive","_lastFocus","_layout","_opener","_hoverItem","_openItem")},statics:{menuDetectedByKey:function(a){if(a.getKeyIdentifier()==="Apps"){rwt.widgets.Menu.contextMenuHandler(a)}},menuDetectedByMouse:function(a){if(a.getButton()===rwt.event.MouseEvent.C_BUTTON_RIGHT){rwt.widgets.Menu.contextMenuHandler(a)}},contextMenuHandler:function(d){var e=rwt.widgets.util.WidgetUtil.getControl(d.getTarget());var b=e?e.getContextMenu():null;if(b!=null){d.stopPropagation();d.preventDefault();var c=rwt.event.MouseEvent.getPageX();var a=rwt.event.MouseEvent.getPageY();b.setLocation(c,a);b.setOpener(e);b.show()}},getAllowContextMenu:function(c,b){var a=false;switch(c.classname){case $[292]:case $[361]:case $[529]:case $[489]:case $[396]:case"qx.ui.form.TextArea":if(c.getEnabled()!==false){if(rwt.widgets.Menu._hasNativeMenu(b)){a=c.getContextMenu()==null}}break}return a},_hasNativeMenu:function(c){var a;var b=typeof c.tagName==$[9]?c.tagName.toLowerCase():"";if(b==="a"){a=c.getAttribute("href")&&c.getAttribute("target")!=="_rwt"}else{a=b===$[70]||b===$[106]}return a}},properties:{appearance:{refine:true,init:"menu"}},events:{changeHoverItem:$[11]},members:{setOpener:function(a){this._opener=a},getOpener:function(a){return this._opener},setMnemonics:function(c){if(this._mnemonics!==c){this._mnemonics=c;var a=this._layout.getChildren();for(var b=0;b<a.length;b++){if(a[b].renderText){a[b].renderText()}}}},getMnemonics:function(){return this._mnemonics},getFocusRoot:function(){var a=null;if(this._opener){a=this._opener.getFocusRoot()}else{if(this._hasParent){a=this.getParent().getFocusRoot()}}return a},addMenuItemAt:function(b,a){if(b.setParentMenu){b.setParentMenu(this)}this._layout.addAt(b,a)},scheduleMenuLayout:function(){if(this._menuLayoutScheduled!==true){this._menuLayoutScheduled=true;var b=this._layout.getChildren();var c=b.length;for(var a=0;a<c;a++){b[a]._invalidatePreferredInnerWidth();b[a].addToQueue("layoutX")}this.addToQueue("menuLayout")}},_layoutPost:function(a){arguments.callee.base.call(this,a);if(a.menuLayout){this._menuLayoutScheduled=false;if(this.isSeeable()){this._afterAppear()}}},getMaxCellWidth:function(b){if(this._maxCellWidths[b]==null){var a=0;var d=this._layout.getChildren();var e=d.length;for(var c=0;c<e;c++){if(d[c].getPreferredCellWidth){a=Math.max(a,d[c].getPreferredCellWidth(b))}}this._maxCellWidths[b]=a}if(b===0&&this._maxCellWidths[0]===0&&this.getMaxCellWidth(1)===0){this._maxCellWidths[b]=13}return this._maxCellWidths[b]},invalidateMaxCellWidth:function(a){this._maxCellWidths[a]=null},invalidateAllMaxCellWidths:function(){for(var a=0;a<5;a++){this._maxCellWidths[a]=null}},isSubElement:function(b,e){var f=false;if((b.getParent()===this._layout)||((!e)&&(b===this))){f=true}if(!f){var d=this._layout.getChildren(),c=d.length;for(var g=0;g<c;g++){if(this.hasSubmenu(d[g])&&d[g].getMenu().isSubElement(b,e)){f=true}}}return f},setHoverItem:function(b,c){var a=b?b:this._openItem;if(this._hoverItem&&this._hoverItem!=a){this._hoverItem.removeState("over")}if(a){a.addState("over")}this._hoverItem=a;if(!c){this._openTimer.setEnabled(false);if(this.hasSubmenu(a)&&(this._openItem!=a)){this._openTimer.setEnabled(true)}if(this._openItem){if(this._openItem==a||a==null){this._closeTimer.setEnabled(false)}else{if(a!=null){this._closeTimer.setEnabled(true)}}}}this.dispatchSimpleEvent("changeHoverItem")},getHoverItem:function(){return this._hoverItem},hoverFirstItem:function(){if(this._isDisplayable&&!this._itemsHiddenFlag){this.setHoverItem(null,true);this._hoverNextItem();this.removeState($[543])}else{this.addState($[543])}},_hoverNextItem:function(){var d;var c=null;var b=this._layout.getVisibleChildren();var a=b.indexOf(this._hoverItem);var e=a;do{a++;if(a>b.length){a=-1}d=a>=0?b[a]:null;if(d&&d.isEnabled()&&d.classname==$[281]){c=d}}while(!c&&(a!=e));this.setHoverItem(c,true)},_hoverPreviousItem:function(){var d;var c=null;var b=this._layout.getVisibleChildren();var a=b.indexOf(this._hoverItem);var e=a;do{a--;if(a<-1){a=b.length}d=a>=0?b[a]:null;if(d&&d.isEnabled()&&d.classname==$[281]){c=d}}while(!c&&(a!=e));this.setHoverItem(c,true)},_makeActive:function(){this._lastActive=this.getFocusRoot().getActiveChild();this._lastFocus=this.getFocusRoot().getFocusedChild();this.getFocusRoot().setActiveChild(this)},_makeInactive:function(){var a=this.getFocusRoot();a.setActiveChild(this._lastActive);a.setFocusedChild(this._lastFocus)},_beforeAppear:function(){rwt.widgets.base.Parent.prototype._beforeAppear.call(this);rwt.widgets.util.MenuManager.getInstance().add(this);this.bringToFront();this._makeActive();this._menuShown();rwt.widgets.util.MnemonicHandler.getInstance().deactivate()},_beforeDisappear:function(){rwt.widgets.base.Parent.prototype._beforeDisappear.call(this);rwt.widgets.util.MenuManager.getInstance().remove(this);if(this.getFocusRoot()){this._makeInactive()}this.setOpenItem(null);this.setHoverItem(null);if(this._opener instanceof rwt.widgets.MenuItem){var a=this._opener.getParentMenu();if(a instanceof rwt.widgets.MenuBar){this._opener.removeState($[12]);if(a.getOpenItem()==this._opener){a.setOpenItem(null)}}}this._menuHidden()},hasSubmenu:function(a){return a&&a.getMenu&&a.getMenu()},_onopentimer:function(a){this._openTimer.stop();this.setOpenItem(this._hoverItem);this._closeTimer.stop()},_onclosetimer:function(a){this._closeTimer.stop();this.setOpenItem(null)},openByMnemonic:function(a){this.setOpenItem(a,true);this.setHoverItem(null,true)},setOpenItem:function(e,d){if(this._openItem&&this._openItem.getMenu()){this._openItem.setSubMenuOpen(false);var a=this._openItem.getMenu();a.hide();if(this.getFocusRoot()){this._makeActive()}}this._openItem=e;if(e&&e.getMenu()){var b=e.getMenu();e.setSubMenuOpen(true);b.setOpener(e);var f=e.getElement();var c=this.getElement();b.setTop(rwt.html.Location.getTop(f)-2);b.setLeft(rwt.html.Location.getLeft(c)+c.offsetWidth-3);b.setMnemonics(d===true);b.show();if(d){b.hoverFirstItem()}}},_onMouseOut:function(a){var c=a.getTarget();var b=a.getRelatedTarget();if(c==this||(b!=this&&!this.contains(b))){this.setHoverItem(null)}},_onMouseOver:function(a){var b=a.getTarget();if(b!=this){this.setHoverItem(b)}this._unhoverSubMenu()},_unhoverSubMenu:function(){if(this._openItem){var a=this._openItem.getMenu();a.setOpenItem(null);a.setHoverItem(null)}},_onKeyDown:function(d){if(this._mnemonics){var e=d.getKeyCode();var c=!isNaN(e)&&rwt.event.EventHandlerUtil.isAlphaNumericKeyCode(e);if(c){var d={type:$[114],charCode:e,success:false};var a=this._layout.getChildren();for(var b=0;b<a.length;b++){if(a[b].handleMnemonic){a[b].handleMnemonic(d)}}}}},_onKeyPress:function(a){switch(a.getKeyIdentifier()){case"Up":this._handleKeyUp(a);break;case"Down":this._handleKeyDown(a);break;case"Left":this._handleKeyLeft(a);break;case $[36]:this._handleKeyRight(a);break;case $[52]:this._handleKeyEnter(a);break}},_handleKeyUp:function(a){if(this._openItem){this._openItem.getMenu()._hoverPreviousItem()}else{this._hoverPreviousItem()}a.preventDefault();a.stopPropagation()},_handleKeyDown:function(a){if(this._openItem){this._openItem.getMenu()._hoverNextItem()}else{this._hoverNextItem()}a.preventDefault();a.stopPropagation()},_handleKeyLeft:function(c){var a=this._opener?this._opener.getParentMenu():null;if(a instanceof rwt.widgets.Menu){var b=this._opener;a.setOpenItem(null);a.setHoverItem(b,true);c.preventDefault();c.stopPropagation()}},_handleKeyRight:function(a){if(this.hasSubmenu(this._hoverItem)){this._onopentimer();this.setHoverItem(null,true);this._openItem.getMenu().hoverFirstItem();a.preventDefault();a.stopPropagation()}},_handleKeyEnter:function(a){if(this.hasSubmenu(this._hoverItem)){this._onopentimer();this.setHoverItem(null,true);this._openItem.getMenu().hoverFirstItem()}else{if(this._hoverItem){this._hoverItem.execute();rwt.widgets.util.MenuManager.getInstance().update()}}a.preventDefault();a.stopPropagation()},setHasShowListener:function(a){if(!this.hasState($[182])){this._hasShowListener=a}},setHasHideListener:function(a){if(!this.hasState($[182])){this._hasHideListener=a}},_menuShown:function(){if(!rwt.remote.EventUtil.getSuspended()){if(this._hasShowListener){if(this._preItem==null){this._preItem=new rwt.widgets.MenuItem("push");this._preItem.setText("...");this._preItem.setEnabled(false);this.addMenuItemAt(this._preItem,0)}var a=this._layout.getChildren();for(var b=0;b<a.length;b++){var c=a[b];c.setDisplay(false)}this._preItem.setDisplay(true);this._itemsHiddenFlag=true;if(this.getWidth()<60){this.setWidth(60)}rwt.remote.Server.getInstance().getRemoteObject(this).notify("Show")}else{var d=this._layout.getChildren().length!==0;this.setDisplay(d);if(d){if(this._hoverFirstItemFlag){this.hoverFirstItem()}}}}},_menuHidden:function(){if(!rwt.remote.EventUtil.getSuspended()){if(this._hasHideListener){rwt.remote.Server.getInstance().getRemoteObject(this).notify("Hide")}}},unhideItems:function(c){if(c){var a=this._layout.getChildren();for(var b=0;b<a.length;b++){a[b].setDisplay(true)}if(this._preItem){this._preItem.setDisplay(false)}this._itemsHiddenFlag=false;if(this._hoverFirstItemFlag){this.hoverFirstItem()}}else{this.hide()}this._hoverFirstItemFlag=false},showMenu:function(b,a,c){if(b!=null){b._renderAppearance();b.setLocation(a,c);b.show()}}}});
+rwt.qx.Class.define($[455],{extend:rwt.widgets.base.Popup,include:rwt.animation.VisibilityAnimationMixin,construct:function(){arguments.callee.base.call(this);this._layout=null;this._preItem=null;this._hasShowListener=false;this._hasHideListener=false;this._maxCellWidths=null;this._menuLayoutScheduled=false;this._opener=null;this._mnemonics=false;this._hoverItem=null;this._openTimer=null;this._closeTimer=null;this._openItem=null;this._itemsHiddenFlag=false;this._hoverFirstItemFlag=false;this.setHeight("auto");this.setWidth("auto");this._maxCellWidths=[null,null,null,null,null];this._layout=new rwt.widgets.base.VerticalBoxLayout();this._layout.set({top:0,right:0,bottom:0,left:0,anonymous:true});this.add(this._layout);this.addEventListener($[1],this._unhoverSubMenu);this.addEventListener($[6],this._onMouseOut);this.addEventListener($[3],this._onMouseOver);this.addEventListener($[5],this._onKeyPress);this.addEventListener($[7],this._onKeyDown);this._openTimer=new rwt.client.Timer(250);this._openTimer.addEventListener($[27],this._onopentimer,this);this._closeTimer=new rwt.client.Timer(250);this._closeTimer.addEventListener($[27],this._onclosetimer,this);this.addToDocument()},destruct:function(){this._disposeObjects("_openTimer","_closeTimer","_preItem","_animation");this._disposeFields("_lastActive","_lastFocus","_layout","_opener","_hoverItem","_openItem")},statics:{menuDetectedByKey:function(a){if(a.getKeyIdentifier()==="Apps"){rwt.widgets.Menu.contextMenuHandler(a)}},menuDetectedByMouse:function(a){if(a.getButton()===rwt.event.MouseEvent.C_BUTTON_RIGHT){rwt.widgets.Menu.contextMenuHandler(a)}},contextMenuHandler:function(d){var e=rwt.widgets.util.WidgetUtil.getControl(d.getTarget());var b=e?e.getContextMenu():null;if(b!=null){d.stopPropagation();d.preventDefault();var c=rwt.event.MouseEvent.getPageX();var a=rwt.event.MouseEvent.getPageY();b.setLocation(c,a);b.setOpener(e);b.show()}},getAllowContextMenu:function(c,b){var a=false;switch(c.classname){case $[292]:case $[361]:case $[529]:case $[489]:case $[396]:case"qx.ui.form.TextArea":if(c.getEnabled()!==false){if(rwt.widgets.Menu._hasNativeMenu(b)){a=c.getContextMenu()==null}}break}return a},_hasNativeMenu:function(c){var a;var b=typeof c.tagName==$[9]?c.tagName.toLowerCase():"";if(b==="a"){a=c.getAttribute("href")&&c.getAttribute("target")!=="_rwt"}else{a=b===$[70]||b===$[106]}return a}},properties:{appearance:{refine:true,init:"menu"}},events:{changeHoverItem:$[11]},members:{setOpener:function(a){this._opener=a},getOpener:function(a){return this._opener},setMnemonics:function(c){if(this._mnemonics!==c){this._mnemonics=c;var a=this._layout.getChildren();for(var b=0;b<a.length;b++){if(a[b].renderText){a[b].renderText()}}}},getMnemonics:function(){return this._mnemonics},getFocusRoot:function(){var a=null;if(this._opener){a=this._opener.getFocusRoot()}else{if(this._hasParent){a=this.getParent().getFocusRoot()}}return a},addMenuItemAt:function(c,b){if(c.setParentMenu){c.setParentMenu(this)}var a=b;if(this._preItem&&this._preItem!==c){a++}this._layout.addAt(c,a)},scheduleMenuLayout:function(){if(this._menuLayoutScheduled!==true){this._menuLayoutScheduled=true;var b=this._layout.getChildren();var c=b.length;for(var a=0;a<c;a++){b[a]._invalidatePreferredInnerWidth();b[a].addToQueue("layoutX")}this.addToQueue("menuLayout")}},_layoutPost:function(a){arguments.callee.base.call(this,a);if(a.menuLayout){this._menuLayoutScheduled=false;if(this.isSeeable()){this._afterAppear()}}},getMaxCellWidth:function(b){if(this._maxCellWidths[b]==null){var a=0;var d=this._layout.getChildren();var e=d.length;for(var c=0;c<e;c++){if(d[c].getPreferredCellWidth){a=Math.max(a,d[c].getPreferredCellWidth(b))}}this._maxCellWidths[b]=a}if(b===0&&this._maxCellWidths[0]===0&&this.getMaxCellWidth(1)===0){this._maxCellWidths[b]=13}return this._maxCellWidths[b]},invalidateMaxCellWidth:function(a){this._maxCellWidths[a]=null},invalidateAllMaxCellWidths:function(){for(var a=0;a<5;a++){this._maxCellWidths[a]=null}},isSubElement:function(b,e){var f=false;if((b.getParent()===this._layout)||((!e)&&(b===this))){f=true}if(!f){var d=this._layout.getChildren(),c=d.length;for(var g=0;g<c;g++){if(this.hasSubmenu(d[g])&&d[g].getMenu().isSubElement(b,e)){f=true}}}return f},setHoverItem:function(b,c){var a=b?b:this._openItem;if(this._hoverItem&&this._hoverItem!=a){this._hoverItem.removeState("over")}if(a){a.addState("over")}this._hoverItem=a;if(!c){this._openTimer.setEnabled(false);if(this.hasSubmenu(a)&&(this._openItem!=a)){this._openTimer.setEnabled(true)}if(this._openItem){if(this._openItem==a||a==null){this._closeTimer.setEnabled(false)}else{if(a!=null){this._closeTimer.setEnabled(true)}}}}this.dispatchSimpleEvent("changeHoverItem")},getHoverItem:function(){return this._hoverItem},hoverFirstItem:function(){if(this._isDisplayable&&!this._itemsHiddenFlag){this.setHoverItem(null,true);this._hoverNextItem();this.removeState($[543])}else{this.addState($[543])}},_hoverNextItem:function(){var d;var c=null;var b=this._layout.getVisibleChildren();var a=b.indexOf(this._hoverItem);var e=a;do{a++;if(a>b.length){a=-1}d=a>=0?b[a]:null;if(d&&d.isEnabled()&&d.classname==$[281]){c=d}}while(!c&&(a!=e));this.setHoverItem(c,true)},_hoverPreviousItem:function(){var d;var c=null;var b=this._layout.getVisibleChildren();var a=b.indexOf(this._hoverItem);var e=a;do{a--;if(a<-1){a=b.length}d=a>=0?b[a]:null;if(d&&d.isEnabled()&&d.classname==$[281]){c=d}}while(!c&&(a!=e));this.setHoverItem(c,true)},_makeActive:function(){this._lastActive=this.getFocusRoot().getActiveChild();this._lastFocus=this.getFocusRoot().getFocusedChild();this.getFocusRoot().setActiveChild(this)},_makeInactive:function(){var a=this.getFocusRoot();a.setActiveChild(this._lastActive);a.setFocusedChild(this._lastFocus)},_beforeAppear:function(){rwt.widgets.base.Parent.prototype._beforeAppear.call(this);rwt.widgets.util.MenuManager.getInstance().add(this);this.bringToFront();this._makeActive();this._menuShown();rwt.widgets.util.MnemonicHandler.getInstance().deactivate()},_beforeDisappear:function(){rwt.widgets.base.Parent.prototype._beforeDisappear.call(this);rwt.widgets.util.MenuManager.getInstance().remove(this);if(this.getFocusRoot()){this._makeInactive()}this.setOpenItem(null);this.setHoverItem(null);if(this._opener instanceof rwt.widgets.MenuItem){var a=this._opener.getParentMenu();if(a instanceof rwt.widgets.MenuBar){this._opener.removeState($[12]);if(a.getOpenItem()==this._opener){a.setOpenItem(null)}}}this._menuHidden()},hasSubmenu:function(a){return a&&a.getMenu&&a.getMenu()},_onopentimer:function(a){this._openTimer.stop();this.setOpenItem(this._hoverItem);this._closeTimer.stop()},_onclosetimer:function(a){this._closeTimer.stop();this.setOpenItem(null)},openByMnemonic:function(a){this.setOpenItem(a,true);this.setHoverItem(null,true)},setOpenItem:function(e,d){if(this._openItem&&this._openItem.getMenu()){this._openItem.setSubMenuOpen(false);var a=this._openItem.getMenu();a.hide();if(this.getFocusRoot()){this._makeActive()}}this._openItem=e;if(e&&e.getMenu()){var b=e.getMenu();e.setSubMenuOpen(true);b.setOpener(e);var f=e.getElement();var c=this.getElement();b.setTop(rwt.html.Location.getTop(f)-2);b.setLeft(rwt.html.Location.getLeft(c)+c.offsetWidth-3);b.setMnemonics(d===true);b.show();if(d){b.hoverFirstItem()}}},_onMouseOut:function(a){var c=a.getTarget();var b=a.getRelatedTarget();if(c==this||(b!=this&&!this.contains(b))){this.setHoverItem(null)}},_onMouseOver:function(a){var b=a.getTarget();if(b!=this){this.setHoverItem(b)}this._unhoverSubMenu()},_unhoverSubMenu:function(){if(this._openItem){var a=this._openItem.getMenu();a.setOpenItem(null);a.setHoverItem(null)}},_onKeyDown:function(d){if(this._mnemonics){var e=d.getKeyCode();var c=!isNaN(e)&&rwt.event.EventHandlerUtil.isAlphaNumericKeyCode(e);if(c){var d={type:$[114],charCode:e,success:false};var a=this._layout.getChildren();for(var b=0;b<a.length;b++){if(a[b].handleMnemonic){a[b].handleMnemonic(d)}}}}},_onKeyPress:function(a){switch(a.getKeyIdentifier()){case"Up":this._handleKeyUp(a);break;case"Down":this._handleKeyDown(a);break;case"Left":this._handleKeyLeft(a);break;case $[36]:this._handleKeyRight(a);break;case $[52]:this._handleKeyEnter(a);break}},_handleKeyUp:function(a){if(this._openItem){this._openItem.getMenu()._hoverPreviousItem()}else{this._hoverPreviousItem()}a.preventDefault();a.stopPropagation()},_handleKeyDown:function(a){if(this._openItem){this._openItem.getMenu()._hoverNextItem()}else{this._hoverNextItem()}a.preventDefault();a.stopPropagation()},_handleKeyLeft:function(c){var a=this._opener?this._opener.getParentMenu():null;if(a instanceof rwt.widgets.Menu){var b=this._opener;a.setOpenItem(null);a.setHoverItem(b,true);c.preventDefault();c.stopPropagation()}},_handleKeyRight:function(a){if(this.hasSubmenu(this._hoverItem)){this._onopentimer();this.setHoverItem(null,true);this._openItem.getMenu().hoverFirstItem();a.preventDefault();a.stopPropagation()}},_handleKeyEnter:function(a){if(this.hasSubmenu(this._hoverItem)){this._onopentimer();this.setHoverItem(null,true);this._openItem.getMenu().hoverFirstItem()}else{if(this._hoverItem){this._hoverItem.execute();rwt.widgets.util.MenuManager.getInstance().update()}}a.preventDefault();a.stopPropagation()},setHasShowListener:function(a){if(!this.hasState($[182])){this._hasShowListener=a}},setHasHideListener:function(a){if(!this.hasState($[182])){this._hasHideListener=a}},_menuShown:function(){if(!rwt.remote.EventUtil.getSuspended()){if(this._hasShowListener){if(this._preItem==null){this._preItem=new rwt.widgets.MenuItem("push");this._preItem.setText("...");this._preItem.setEnabled(false);this.addMenuItemAt(this._preItem,0)}var a=this._layout.getChildren();for(var b=0;b<a.length;b++){var c=a[b];c.setDisplay(false)}this._preItem.setDisplay(true);this._itemsHiddenFlag=true;if(this.getWidth()<60){this.setWidth(60)}rwt.remote.Server.getInstance().getRemoteObject(this).notify("Show")}else{var d=this._layout.getChildren().length!==0;this.setDisplay(d);if(d){if(this._hoverFirstItemFlag){this.hoverFirstItem()}}}}},_menuHidden:function(){if(!rwt.remote.EventUtil.getSuspended()){if(this._hasHideListener){rwt.remote.Server.getInstance().getRemoteObject(this).notify("Hide")}}},unhideItems:function(c){if(c){var a=this._layout.getChildren();for(var b=0;b<a.length;b++){a[b].setDisplay(true)}if(this._preItem){this._preItem.setDisplay(false)}this._itemsHiddenFlag=false;if(this._hoverFirstItemFlag){this.hoverFirstItem()}}else{this.hide()}this._hoverFirstItemFlag=false},showMenu:function(b,a,c){if(b!=null){b._renderAppearance();b.setLocation(a,c);b.show()}}}});
rwt.remote.HandlerRegistry.add($[455],{factory:function(b){var a;if(b.style.indexOf("BAR")!=-1){a=new rwt.widgets.MenuBar()}else{a=new rwt.widgets.Menu()}rwt.remote.HandlerUtil.addStatesForStyles(a,b.style);return a},destructor:rwt.remote.HandlerUtil.getWidgetDestructor(),getDestroyableChildren:rwt.remote.HandlerUtil.getDestroyableChildrenFinder(),properties:["parent",$[89],$[251],$[88]],propertyHandler:{parent:function(b,a){if(b.hasState($[182])){rwt.remote.HandlerUtil.callWithTarget(a,function(c){b.setParent(c)})}},bounds:function(b,a){if(b.hasState($[182])){b.setLeft(a[0]);b.setTop(a[1]);b.setWidth(a[2]);b.setHeight(a[3])}}},listeners:["Show","Hide","Help"],listenerHandler:{Help:rwt.remote.HandlerUtil.getControlListenerHandler("Help")},methods:["unhideItems","showMenu"],methodHandler:{unhideItems:function(b,a){if(!b.hasState($[182])){b.unhideItems(a.reveal)}},showMenu:function(b,a){if(b.hasState("rwt_POP_UP")){b.showMenu(b,a.x,a.y)}}}});
rwt.qx.Class.define("rwt.remote.EventUtil",{statics:{_suspended:false,setSuspended:function(a){this._suspended=a},getSuspended:function(){return this._suspended},DOUBLE_CLICK_TIME:500,_capturingWidget:null,_lastMouseDown:{widget:null,button:"",x:-1,y:-1,mouseUpCount:0},_shiftKey:false,_ctrlKey:false,_altKey:false,_metaKey:false,eventTimestamp:function(){var a=rwt.runtime.System.getInstance();return new Date().getTime()-a.getStartupTime()},widgetDefaultSelected:function(a,e){if(!rwt.remote.EventUtil.getSuspended()){var d=rwt.remote.Server.getInstance();var b={};rwt.remote.EventUtil.addModifierToProperties(b);var c=d.getRemoteObject(e?e:a.getTarget());c.notify($[112],b)}},widgetSelected:function(b){var e=b.getTarget().getLeft();var d=b.getTarget().getTop();var c=b.getTarget().getWidth();var a=b.getTarget().getHeight();rwt.remote.EventUtil.notifySelected(b.getTarget(),e,d,c,a)},notifySelected:function(h,g,f,d,a,c){if(!rwt.remote.EventUtil.getSuspended()){var e=rwt.remote.Server.getInstance();var b;if(arguments.length===2){b=g}else{b={x:g,y:f,width:d,height:a,detail:c}}rwt.remote.EventUtil.addModifierToProperties(b);e.getRemoteObject(h).notify($[31],b)}},notifyDefaultSelected:function(h,g,f,d,a,c){if(!rwt.remote.EventUtil.getSuspended()){var e=rwt.remote.Server.getInstance();var b;if(arguments.length===2){b=g}else{b={x:g,y:f,width:d,height:a,detail:c}}rwt.remote.EventUtil.addModifierToProperties(b);e.getRemoteObject(h).notify($[112],b)}},addModifierToProperties:function(a,c){var b=rwt.client.Client.getPlatform()==="mac";var d=b&&(c?c.metaKey:rwt.remote.EventUtil._metaKey)===true;a.shiftKey=c?c.shiftKey:rwt.remote.EventUtil._shiftKey;a.ctrlKey=(c?c.ctrlKey:rwt.remote.EventUtil._ctrlKey)||d;a.altKey=c?c.altKey:rwt.remote.EventUtil._altKey},_getKeyModifier:function(){var a="";var b=rwt.client.Client.getPlatform()==="mac"&&rwt.remote.EventUtil._metaKey;if(rwt.remote.EventUtil._shiftKey){a+="shift,"}if(rwt.remote.EventUtil._ctrlKey||b){a+="ctrl,"}if(rwt.remote.EventUtil._altKey){a+="alt,"}return a},focusGained:function(a){if(!rwt.remote.EventUtil.getSuspended()){var b=rwt.remote.Server.getInstance().getRemoteObject(a.getTarget());b.notify("FocusIn")}},focusLost:function(a){if(!rwt.remote.EventUtil.getSuspended()){var b=rwt.remote.Server.getInstance().getRemoteObject(a.getTarget());b.notify("FocusOut")}},mouseDown:function(a){if(!rwt.remote.EventUtil.getSuspended()&&rwt.remote.EventUtil._isRelevantMouseEvent(this,a)){rwt.remote.EventUtil._capturingWidget=this;rwt.remote.EventUtil._notifyMouseListeners(this,a,"MouseDown")}},mouseUp:function(a){if(!rwt.remote.EventUtil.getSuspended()&&rwt.remote.EventUtil._isRelevantMouseEvent(this,a)){rwt.remote.EventUtil._capturingWidget=null;rwt.remote.EventUtil._notifyMouseListeners(this,a,"MouseUp")}},mouseDoubleClick:function(a){if(!rwt.remote.EventUtil.getSuspended()&&rwt.remote.EventUtil._isRelevantMouseEvent(this,a)){rwt.remote.EventUtil._capturingWidget=this;if(rwt.remote.EventUtil._isDoubleClick(this,a)){rwt.remote.EventUtil._clearLastMouseDown();rwt.remote.EventUtil._notifyMouseListeners(this,a,$[497])}else{var b=rwt.remote.EventUtil._lastMouseDown;b.widget=this;b.button=a.getButton();b.x=a.getPageX();b.y=a.getPageY();b.mouseUpCount=0;rwt.client.Timer.once(rwt.remote.EventUtil._clearLastMouseDown,this,rwt.remote.EventUtil.DOUBLE_CLICK_TIME)}}},mouseUpCounter:function(a){if(!rwt.remote.EventUtil.getSuspended()&&rwt.remote.EventUtil._isRelevantMouseEvent(this,a)){rwt.remote.EventUtil._capturingWidget=null;rwt.remote.EventUtil._lastMouseDown.mouseUpCount+=1}},_isRelevantMouseEvent:function(c,b){var a=true;if(c!==rwt.remote.EventUtil._capturingWidget&&c!==b.getOriginalTarget()){var f=rwt.remote.WidgetManager.getInstance();var e=b.getOriginalTarget();var d=f.findEnabledControl(e);a=c===d}return a},_clearLastMouseDown:function(){var a=rwt.remote.EventUtil._lastMouseDown;a.widget=null;a.button="";a.mouseUpCount=0;a.x=-1;a.y=-1},_isDoubleClick:function(b,a){var c=rwt.remote.EventUtil._lastMouseDown;return c.mouseUpCount===1&&c.widget===b&&c.button===rwt.event.MouseEvent.C_BUTTON_LEFT&&c.button===a.getButton()},_notifyMouseListeners:function(g,b,e){var d=rwt.remote.EventUtil._determineMouseButton(b);var a=rwt.remote.EventUtil._getKeyModifier();var f=rwt.remote.Server.getInstance().getRemoteObject(g);var c={button:d,x:b.getPageX(),y:b.getPageY(),time:this.eventTimestamp()};rwt.remote.EventUtil.addModifierToProperties(c);f.notify(e,c)},_determineMouseButton:function(b){var a=0;switch(b.getButton()){case rwt.event.MouseEvent.C_BUTTON_LEFT:a=1;break;case rwt.event.MouseEvent.C_BUTTON_MIDDLE:a=2;break;case rwt.event.MouseEvent.C_BUTTON_RIGHT:a=3;break}return a},helpRequested:function(a){if(a.getKeyIdentifier()==="F1"){a.stopPropagation();a.preventDefault();var c=a.getTarget();var e=rwt.remote.WidgetManager.getInstance();var d=e.findIdByWidget(c);if(d===null){c=e.findControl(c);d=e.findIdByWidget(c)}if(d!=null){var b=rwt.remote.Server.getInstance().getRemoteObject(c);b.notify("Help")}}},menuDetectedByKey:function(b){if(b.getKeyIdentifier()==="Apps"){b.stopPropagation();b.preventDefault();var a=rwt.event.MouseEvent.getPageX();var c=rwt.event.MouseEvent.getPageY();rwt.remote.EventUtil.sendMenuDetected(b.getTarget(),a,c)}},menuDetectedByMouse:function(b){if(b.getButton()===rwt.event.MouseEvent.C_BUTTON_RIGHT){b.stopPropagation();b.preventDefault();var a=b.getPageX();var c=b.getPageY();rwt.remote.EventUtil.sendMenuDetected(b.getTarget(),a,c)}},sendMenuDetected:function(c,a,f){if(!rwt.remote.EventUtil.getSuspended()){var e=rwt.remote.WidgetManager.getInstance();while(c!=null&&!e.isControl(c)){c=c.getParent?c.getParent():null}var d=e.findIdByWidget(c);if(d!=null){var b=rwt.remote.Server.getInstance().getRemoteObject(c);b.notify("MenuDetect",{x:a,y:f})}}}}});
rwt.qx.Class.define("rwt.widgets.base.WidgetToolTip",{type:$[37],extend:rwt.widgets.base.ToolTip,include:rwt.animation.VisibilityAnimationMixin,construct:function(){arguments.callee.base.call(this);this._atom._createLabel();this._atom.getLabelObject().setMode("html")},members:{_applyBoundToWidget:function(c,a){arguments.callee.base.call(this,c,a);this.updateText(c);var b=rwt.widgets.util.ToolTipManager.getInstance();b.setCurrentToolTip(null)},updateText:function(a){this._atom.setLabel(a.getUserData($[140]))}}});

Back to the top