Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Furnadjiev2017-02-06 09:26:09 +0000
committerIvan Furnadjiev2017-02-06 09:26:09 +0000
commit08d6451f1e73a173c24964215d5d2c6209161edd (patch)
treebf6b31f0d711462f5dea94640e4b65f0b819a1e8
parentc402202557e3fa12dcee810c751658eaa53bc7fe (diff)
downloadorg.eclipse.rap-08d6451f1e73a173c24964215d5d2c6209161edd.tar.gz
org.eclipse.rap-08d6451f1e73a173c24964215d5d2c6209161edd.tar.xz
org.eclipse.rap-08d6451f1e73a173c24964215d5d2c6209161edd.zip
Let GridItems and GridColumns inherit the custom variant from Grid
Client changes only, no server changes necessary. Partial fix for Bug 324721 - Items should inherit custom variants Change-Id: Ib54c544aca895d18f43bfcb530f5358d908976a0
-rw-r--r--bundles/org.eclipse.rap.rwt/js/rwt/widgets/Grid.js12
-rw-r--r--bundles/org.eclipse.rap.rwt/js/rwt/widgets/GridColumn.js7
-rw-r--r--bundles/org.eclipse.rap.rwt/js/rwt/widgets/GridItem.js10
-rw-r--r--bundles/org.eclipse.rap.rwt/js/rwt/widgets/base/GridHeader.js4
4 files changed, 25 insertions, 8 deletions
diff --git a/bundles/org.eclipse.rap.rwt/js/rwt/widgets/Grid.js b/bundles/org.eclipse.rap.rwt/js/rwt/widgets/Grid.js
index 49d7a8844c..17e297cdee 100644
--- a/bundles/org.eclipse.rap.rwt/js/rwt/widgets/Grid.js
+++ b/bundles/org.eclipse.rap.rwt/js/rwt/widgets/Grid.js
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2016 Innoopract Informationssysteme GmbH and others.
+ * Copyright (c) 2010, 2017 Innoopract Informationssysteme GmbH and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -78,7 +78,8 @@ rwt.qx.Class.define( "rwt.widgets.Grid", {
_createHeader : function() {
this._header = new rwt.widgets.base.GridHeader( {
"appearance" : this.getAppearance(),
- "splitContainer" : this._hasFixedColumns
+ "splitContainer" : this._hasFixedColumns,
+ "config" : this._config
} );
this.add( this._header );
this._header.addEventListener( "showResizeLine", this._onShowResizeLine, this );
@@ -93,7 +94,8 @@ rwt.qx.Class.define( "rwt.widgets.Grid", {
this._footer = new rwt.widgets.base.GridHeader( {
"appearance" : this.getAppearance(),
"splitContainer" : this._hasFixedColumns,
- "footer" : true
+ "footer" : true,
+ "config" : this._config
} );
this.add( this._footer );
this._footer.setScrollLeft( this._adjustScrollLeft( this._horzScrollBar.getValue() ) );
@@ -369,12 +371,16 @@ rwt.qx.Class.define( "rwt.widgets.Grid", {
this.base( arguments, state );
if( state.slice( 0, 8 ) === "variant_" ) {
this._config.variant = state;
+ this._rootItem.setVariant( state );
+ this._scheduleColumnUpdate();
}
},
removeState : function( state ) {
if( this._config.variant === state ) {
this._config.variant = null;
+ this._rootItem.setVariant( null );
+ this._scheduleColumnUpdate();
}
this.base( arguments, state );
},
diff --git a/bundles/org.eclipse.rap.rwt/js/rwt/widgets/GridColumn.js b/bundles/org.eclipse.rap.rwt/js/rwt/widgets/GridColumn.js
index e3c5b1dbaf..4736b53227 100644
--- a/bundles/org.eclipse.rap.rwt/js/rwt/widgets/GridColumn.js
+++ b/bundles/org.eclipse.rap.rwt/js/rwt/widgets/GridColumn.js
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2016 Innoopract Informationssysteme GmbH and others.
+ * Copyright (c) 2007, 2017 Innoopract Informationssysteme GmbH and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -129,7 +129,10 @@ rwt.qx.Class.define( "rwt.widgets.GridColumn", {
},
getCustomVariant : function() {
- return this._customVariant;
+ if( this._customVariant ) {
+ return this._customVariant;
+ }
+ return this._grid.getRenderConfig().variant;
},
setText : function( value ) {
diff --git a/bundles/org.eclipse.rap.rwt/js/rwt/widgets/GridItem.js b/bundles/org.eclipse.rap.rwt/js/rwt/widgets/GridItem.js
index 15a1245b54..011e86955b 100644
--- a/bundles/org.eclipse.rap.rwt/js/rwt/widgets/GridItem.js
+++ b/bundles/org.eclipse.rap.rwt/js/rwt/widgets/GridItem.js
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2015 Innoopract Informationssysteme GmbH and others.
+ * Copyright (c) 2010, 2017 Innoopract Informationssysteme GmbH and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -297,7 +297,13 @@ rwt.qx.Class.define( "rwt.widgets.GridItem", {
},
getVariant : function() {
- return this._variant || null;
+ if( this._variant ) {
+ return this._variant;
+ }
+ if( this._rootItem && this._rootItem !== this ) {
+ return this._rootItem.getVariant();
+ }
+ return null;
},
setDefaultHeight : function( value ) {
diff --git a/bundles/org.eclipse.rap.rwt/js/rwt/widgets/base/GridHeader.js b/bundles/org.eclipse.rap.rwt/js/rwt/widgets/base/GridHeader.js
index 23cb797c90..13e1d47748 100644
--- a/bundles/org.eclipse.rap.rwt/js/rwt/widgets/base/GridHeader.js
+++ b/bundles/org.eclipse.rap.rwt/js/rwt/widgets/base/GridHeader.js
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2016 Innoopract Informationssysteme GmbH and others.
+ * Copyright (c) 2011, 2017 Innoopract Informationssysteme GmbH and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -23,6 +23,7 @@ rwt.qx.Class.define( "rwt.widgets.base.GridHeader", {
this._scrollLeft = 0;
this._footer = argsMap.footer ? true : false;
this._baseAppearance = argsMap.appearance;
+ this._config = argsMap.config;
this._dummyColumn = this._createDummyColumn();
this._currentDragColumn = null;
this._feedbackLabel = null;
@@ -183,6 +184,7 @@ rwt.qx.Class.define( "rwt.widgets.base.GridHeader", {
var dummyWidth = Math.max( 0, totalWidth - dummyLeft );
this._dummyColumn.setLeft( dummyLeft );
this._dummyColumn.setWidth( dummyWidth );
+ this._dummyColumn.setCustomVariant( this._config.variant );
},
_getDummyColumnLeft : function() {

Back to the top