r25048: From the archives (patch found in one of my old working trees):
[jelmer/samba4-debian.git] / webapps / qooxdoo-0.6.5-sdk / frontend / framework / source / class / qx / ui / basic / Terminator.js
1 /* ************************************************************************
2
3    qooxdoo - the new era of web development
4
5    http://qooxdoo.org
6
7    Copyright:
8      2004-2007 1&1 Internet AG, Germany, http://www.1and1.org
9
10    License:
11      LGPL: http://www.gnu.org/licenses/lgpl.html
12      EPL: http://www.eclipse.org/org/documents/epl-v10.php
13      See the LICENSE file in the project's top-level directory for details.
14
15    Authors:
16      * Sebastian Werner (wpbasti)
17      * Andreas Ecker (ecker)
18
19 ************************************************************************ */
20
21 /* ************************************************************************
22
23 #module(ui_core)
24
25 ************************************************************************ */
26
27 /*!
28   This widget is the last widget of the current child chain.
29 */
30 qx.OO.defineClass("qx.ui.basic.Terminator", qx.ui.core.Widget,
31 function() {
32   qx.ui.core.Widget.call(this);
33 });
34
35
36
37
38
39
40 /*
41 ---------------------------------------------------------------------------
42   APPLY PADDING
43 ---------------------------------------------------------------------------
44 */
45
46 qx.Proto._applyPaddingX = function(vParent, vChanges, vStyle)
47 {
48   if (vChanges.paddingLeft) {
49     this._applyRuntimePaddingLeft(this.getPaddingLeft());
50   }
51
52   if (vChanges.paddingRight) {
53     this._applyRuntimePaddingRight(this.getPaddingRight());
54   }
55 }
56
57 qx.Proto._applyPaddingY = function(vParent, vChanges, vStyle)
58 {
59   if (vChanges.paddingTop) {
60     this._applyRuntimePaddingTop(this.getPaddingTop());
61   }
62
63   if (vChanges.paddingBottom) {
64     this._applyRuntimePaddingBottom(this.getPaddingBottom());
65   }
66 }
67
68
69
70
71
72
73 /*
74 ---------------------------------------------------------------------------
75   APPLY CONTENT
76 ---------------------------------------------------------------------------
77 */
78
79 qx.Proto._applyContent = function()
80 {
81   // Small optimization: Only add innerPreferred jobs
82   // if we don't have a static width
83   if (this._computedWidthTypePixel) {
84     this._cachedPreferredInnerWidth = null;
85   } else {
86     this._invalidatePreferredInnerWidth();
87   }
88
89   // Small optimization: Only add innerPreferred jobs
90   // if we don't have a static height
91   if (this._computedHeightTypePixel) {
92     this._cachedPreferredInnerHeight = null;
93   } else {
94     this._invalidatePreferredInnerHeight();
95   }
96
97   // add load job
98   if (this._initialLayoutDone) {
99     this.addToJobQueue("load");
100   }
101 }
102
103 qx.Proto._layoutPost = function(vChanges) {
104   if (vChanges.initial || vChanges.load || vChanges.width || vChanges.height) {
105     this._postApply();
106   }
107 }
108
109 qx.Proto._postApply = qx.lang.Function.returnTrue;
110
111
112
113
114
115
116
117 /*
118 ---------------------------------------------------------------------------
119   BOX DIMENSION HELPERS
120 ---------------------------------------------------------------------------
121 */
122
123 qx.Proto._computeBoxWidthFallback = qx.Proto.getPreferredBoxWidth;
124 qx.Proto._computeBoxHeightFallback = qx.Proto.getPreferredBoxHeight;
125
126 qx.Proto._computePreferredInnerWidth = qx.lang.Function.returnZero;
127 qx.Proto._computePreferredInnerHeight = qx.lang.Function.returnZero;
128
129
130
131
132
133
134
135 /*
136 ---------------------------------------------------------------------------
137   METHODS TO GIVE THE LAYOUTERS INFORMATIONS
138 ---------------------------------------------------------------------------
139 */
140
141 qx.Proto._isWidthEssential = function()
142 {
143   if (!this._computedLeftTypeNull && !this._computedRightTypeNull) {
144     return true;
145   }
146
147   if (!this._computedWidthTypeNull && !this._computedWidthTypeAuto) {
148     return true;
149   }
150
151   if (!this._computedMinWidthTypeNull && !this._computedMinWidthTypeAuto) {
152     return true;
153   }
154
155   if (!this._computedMaxWidthTypeNull && !this._computedMaxWidthTypeAuto) {
156     return true;
157   }
158
159   if (this._borderElement) {
160     return true;
161   }
162
163   return false;
164 }
165
166 qx.Proto._isHeightEssential = function()
167 {
168   if (!this._computedTopTypeNull && !this._computedBottomTypeNull) {
169     return true;
170   }
171
172   if (!this._computedHeightTypeNull && !this._computedHeightTypeAuto) {
173     return true;
174   }
175
176   if (!this._computedMinHeightTypeNull && !this._computedMinHeightTypeAuto) {
177     return true;
178   }
179
180   if (!this._computedMaxHeightTypeNull && !this._computedMaxHeightTypeAuto) {
181     return true;
182   }
183
184   if (this._borderElement) {
185     return true;
186   }
187
188   return false;
189 }