Skip to content

Commit

Permalink
several updates in Wt
Browse files Browse the repository at this point in the history
  • Loading branch information
Koen Deforche committed Sep 26, 2014
1 parent 392022a commit 26f8a85
Show file tree
Hide file tree
Showing 29 changed files with 501 additions and 200 deletions.
Expand Up @@ -1579,7 +1579,7 @@
<span class="k">this</span><span class="o">.</span><span class="na">map_</span><span class="o">.</span><span class="na">setMapTypeControl</span><span class="o">((</span><span class="n">WGoogleMap</span><span class="o">.</span><span class="na">MapTypeControl</span><span class="o">)</span> <span class="n">mtc</span><span class="o">);</span>
<span class="o">}</span>

<span class="n">List</span><span class="o">&lt;</span><span class="n">WGoogleMap</span><span class="o">.</span><span class="na">Coordinate</span><span class="o">&gt;</span> <span class="n">getRoadDescription</span><span class="o">()</span> <span class="o">{</span>
<span class="n">List</span><span class="o">&lt;</span><span class="n">WGoogleMap</span><span class="o">.</span><span class="na">Coordinate</span><span class="o">&gt;</span> <span class="nf">getRoadDescription</span><span class="o">()</span> <span class="o">{</span>
<span class="n">List</span><span class="o">&lt;</span><span class="n">WGoogleMap</span><span class="o">.</span><span class="na">Coordinate</span><span class="o">&gt;</span> <span class="n">result</span> <span class="o">=</span> <span class="k">new</span> <span class="n">ArrayList</span><span class="o">&lt;</span><span class="n">WGoogleMap</span><span class="o">.</span><span class="na">Coordinate</span><span class="o">&gt;();</span>
<span class="n">result</span><span class="o">.</span><span class="na">add</span><span class="o">(</span><span class="k">new</span> <span class="n">WGoogleMap</span><span class="o">.</span><span class="na">Coordinate</span><span class="o">(</span><span class="mf">50.9082</span><span class="o">,</span> <span class="mf">4.66056</span><span class="o">));</span>
<span class="n">result</span><span class="o">.</span><span class="na">add</span><span class="o">(</span><span class="k">new</span> <span class="n">WGoogleMap</span><span class="o">.</span><span class="na">Coordinate</span><span class="o">(</span><span class="mf">50.90901</span><span class="o">,</span> <span class="mf">4.66426</span><span class="o">));</span>
Expand Down
52 changes: 21 additions & 31 deletions src/eu/webtoolkit/jwt/DomElement.java
Expand Up @@ -1002,13 +1002,9 @@ public void asHTML(final EscapeOStream out, final EscapeOStream javaScript,
.entrySet().iterator(); i_it.hasNext();) {
Map.Entry<Property, String> i = i_it.next();
switch (i.getKey()) {
case PropertyText:
case PropertyInnerHTML:
innerHTML += i.getValue();
break;
case PropertyScript:
innerHTML += "/*<![CDATA[*/\n" + i.getValue() + "\n/* ]]> */";
break;
case PropertyDisabled:
if (i.getValue().equals("true")) {
out.append(" disabled=\"disabled\"");
Expand Down Expand Up @@ -1096,10 +1092,6 @@ public void asHTML(final EscapeOStream out, final EscapeOStream javaScript,
} else {
if (openingTagOnly) {
out.append('>');
if (innerHTML.length() != 0) {
DomElement self = this;
self.childrenHtml_.append(innerHTML);
}
return;
}
if (!isSelfClosingTag(renderedType)) {
Expand Down Expand Up @@ -1383,7 +1375,6 @@ public void updateInnerHtmlOnly() {
.entrySet().iterator(); i_it.hasNext();) {
Map.Entry<Property, String> i = i_it.next();
if (i.getKey() == Property.PropertyInnerHTML
|| i.getKey() == Property.PropertyText
|| i.getKey() == Property.PropertyTarget) {
} else {
i_it.remove();
Expand Down Expand Up @@ -1515,6 +1506,13 @@ private void setJavaScriptProperties(final EscapeOStream out,
switch (i.getKey()) {
case PropertyInnerHTML:
case PropertyAddedInnerHTML:
if (this.mode_ == DomElement.Mode.ModeCreate
&& (this.type_ == DomElementType.DomElement_DIV
&& app.getEnvironment().getAgent() == WEnvironment.UserAgent.IE6
|| !this.childrenToAdd_.isEmpty() || !this.childrenHtml_
.isEmpty())) {
break;
}
out.append("Wt3_3_2.setHtml(").append(this.var_).append(',');
if (!pushed) {
escaped
Expand All @@ -1529,17 +1527,6 @@ private void setJavaScriptProperties(final EscapeOStream out,
}
out.append(");");
break;
case PropertyScript:
out.append(this.var_).append(".innerHTML=");
if (!pushed) {
escaped
.pushEscape(EscapeOStream.RuleSet.JsStringLiteralSQuote);
pushed = true;
}
fastJsStringLiteral(out, escaped, "/*<![CDATA[*/\n"
+ i.getValue() + "\n/* ]]> */");
out.append(';');
break;
case PropertyValue:
out.append(this.var_).append(".value=");
if (!pushed) {
Expand Down Expand Up @@ -1618,16 +1605,6 @@ private void setJavaScriptProperties(final EscapeOStream out,
fastJsStringLiteral(out, escaped, i.getValue());
out.append(';');
break;
case PropertyText:
out.append(this.var_).append(".text=");
if (!pushed) {
escaped
.pushEscape(EscapeOStream.RuleSet.JsStringLiteralSQuote);
pushed = true;
}
fastJsStringLiteral(out, escaped, i.getValue());
out.append(';');
break;
case PropertyStyleFloat:
out.append(this.var_).append(".style.");
if (app.getEnvironment().agentIsIE()) {
Expand Down Expand Up @@ -1795,15 +1772,28 @@ private void renderInnerHtmlJS(final EscapeOStream out, WApplication app) {
this.declare(out);
out.append("Wt3_3_2.setHtml(").append(this.var_).append(",'");
out.pushEscape(EscapeOStream.RuleSet.JsStringLiteralSQuote);
out.append(this.childrenHtml_.toString());
List<DomElement.TimeoutEvent> timeouts = new ArrayList<DomElement.TimeoutEvent>();
EscapeOStream js = new EscapeOStream();
for (int i = 0; i < this.childrenToAdd_.size(); ++i) {
this.childrenToAdd_.get(i).child.asHTML(out, js, timeouts);
}
String innerHTML = "";
{
String i = this.properties_.get(Property.PropertyInnerHTML);
if (i != null) {
innerHTML += i;
}
i = this.properties_.get(Property.PropertyAddedInnerHTML);
if (i != null) {
innerHTML += i;
}
}
out.append(innerHTML);
out.append(this.childrenHtml_.toString());
if (this.type_ == DomElementType.DomElement_DIV
&& app.getEnvironment().getAgent() == WEnvironment.UserAgent.IE6
&& this.childrenToAdd_.isEmpty()
&& innerHTML.length() == 0
&& this.childrenHtml_.isEmpty()) {
out.append("&nbsp;");
}
Expand Down
2 changes: 1 addition & 1 deletion src/eu/webtoolkit/jwt/Grid.java
Expand Up @@ -56,7 +56,7 @@ public Item(WLayoutItem item, EnumSet<AlignmentFlag> alignment) {
this.item_ = item;
this.rowSpan_ = 1;
this.colSpan_ = 1;
this.update_ = false;
this.update_ = true;
this.alignment_ = alignment;
}

Expand Down
2 changes: 1 addition & 1 deletion src/eu/webtoolkit/jwt/Property.java
Expand Up @@ -25,7 +25,7 @@
* This is an internal API, subject to change.
*/
public enum Property {
PropertyInnerHTML, PropertyAddedInnerHTML, PropertyValue, PropertyDisabled, PropertyChecked, PropertySelected, PropertySelectedIndex, PropertyMultiple, PropertyTarget, PropertyIndeterminate, PropertySrc, PropertyText, PropertyScript, PropertyColSpan, PropertyRowSpan, PropertyReadOnly, PropertyTabIndex, PropertyLabel, PropertyClass, PropertyStyle, PropertyStyleWidthExpression, PropertyStylePosition, PropertyStyleZIndex, PropertyStyleFloat, PropertyStyleClear, PropertyStyleWidth, PropertyStyleHeight, PropertyStyleLineHeight, PropertyStyleMinWidth, PropertyStyleMinHeight, PropertyStyleMaxWidth, PropertyStyleMaxHeight, PropertyStyleLeft, PropertyStyleRight, PropertyStyleTop, PropertyStyleBottom, PropertyStyleVerticalAlign, PropertyStyleTextAlign, PropertyStylePadding, PropertyStylePaddingTop, PropertyStylePaddingRight, PropertyStylePaddingBottom, PropertyStylePaddingLeft, PropertyStyleMarginTop, PropertyStyleMarginRight, PropertyStyleMarginBottom, PropertyStyleMarginLeft, PropertyStyleCursor, PropertyStyleBorderTop, PropertyStyleBorderRight, PropertyStyleBorderBottom, PropertyStyleBorderLeft, PropertyStyleBorderColorTop, PropertyStyleBorderColorRight, PropertyStyleBorderColorBottom, PropertyStyleBorderColorLeft, PropertyStyleBorderWidthTop, PropertyStyleBorderWidthRight, PropertyStyleBorderWidthBottom, PropertyStyleBorderWidthLeft, PropertyStyleColor, PropertyStyleOverflowX, PropertyStyleOverflowY, PropertyStyleOpacity, PropertyStyleFontFamily, PropertyStyleFontStyle, PropertyStyleFontVariant, PropertyStyleFontWeight, PropertyStyleFontSize, PropertyStyleBackgroundColor, PropertyStyleBackgroundImage, PropertyStyleBackgroundRepeat, PropertyStyleBackgroundAttachment, PropertyStyleBackgroundPosition, PropertyStyleTextDecoration, PropertyStyleWhiteSpace, PropertyStyleTableLayout, PropertyStyleBorderSpacing, PropertyStyleBorderCollapse, PropertyStylePageBreakBefore, PropertyStylePageBreakAfter, PropertyStyleZoom, PropertyStyleVisibility, PropertyStyleDisplay, PropertyStyleBoxSizing;
PropertyInnerHTML, PropertyAddedInnerHTML, PropertyValue, PropertyDisabled, PropertyChecked, PropertySelected, PropertySelectedIndex, PropertyMultiple, PropertyTarget, PropertyIndeterminate, PropertySrc, PropertyColSpan, PropertyRowSpan, PropertyReadOnly, PropertyTabIndex, PropertyLabel, PropertyClass, PropertyStyle, PropertyStyleWidthExpression, PropertyStylePosition, PropertyStyleZIndex, PropertyStyleFloat, PropertyStyleClear, PropertyStyleWidth, PropertyStyleHeight, PropertyStyleLineHeight, PropertyStyleMinWidth, PropertyStyleMinHeight, PropertyStyleMaxWidth, PropertyStyleMaxHeight, PropertyStyleLeft, PropertyStyleRight, PropertyStyleTop, PropertyStyleBottom, PropertyStyleVerticalAlign, PropertyStyleTextAlign, PropertyStylePadding, PropertyStylePaddingTop, PropertyStylePaddingRight, PropertyStylePaddingBottom, PropertyStylePaddingLeft, PropertyStyleMarginTop, PropertyStyleMarginRight, PropertyStyleMarginBottom, PropertyStyleMarginLeft, PropertyStyleCursor, PropertyStyleBorderTop, PropertyStyleBorderRight, PropertyStyleBorderBottom, PropertyStyleBorderLeft, PropertyStyleBorderColorTop, PropertyStyleBorderColorRight, PropertyStyleBorderColorBottom, PropertyStyleBorderColorLeft, PropertyStyleBorderWidthTop, PropertyStyleBorderWidthRight, PropertyStyleBorderWidthBottom, PropertyStyleBorderWidthLeft, PropertyStyleColor, PropertyStyleOverflowX, PropertyStyleOverflowY, PropertyStyleOpacity, PropertyStyleFontFamily, PropertyStyleFontStyle, PropertyStyleFontVariant, PropertyStyleFontWeight, PropertyStyleFontSize, PropertyStyleBackgroundColor, PropertyStyleBackgroundImage, PropertyStyleBackgroundRepeat, PropertyStyleBackgroundAttachment, PropertyStyleBackgroundPosition, PropertyStyleTextDecoration, PropertyStyleWhiteSpace, PropertyStyleTableLayout, PropertyStyleBorderSpacing, PropertyStyleBorderCollapse, PropertyStylePageBreakBefore, PropertyStylePageBreakAfter, PropertyStyleZoom, PropertyStyleVisibility, PropertyStyleDisplay, PropertyStyleBoxSizing;

/**
* Returns the numerical representation of this enum.
Expand Down

0 comments on commit 26f8a85

Please sign in to comment.