Author: lgiessmann Date: Fri Jul 15 04:29:35 2011 New Revision: 629
Log: gdl-frontend: Widgets: changed the type of the TitleWidget class's inner elements to com.google.gwt.user.client.Element, so the method Dm.setStyleAttribute(...) can be used
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlTitle.java
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlTitle.java ============================================================================== --- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlTitle.java Fri Jul 15 04:21:34 2011 (r628) +++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlTitle.java Fri Jul 15 04:29:35 2011 (r629) @@ -6,7 +6,6 @@ import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMapsTypes; import us.isidor.gdl.anaToMia.Widgets.base.GdlPsis; import us.isidor.gdl.anaToMia.Widgets.base.IGdlHasValue; -import us.isidor.gdl.anaToMia.Widgets.base.Utils; import us.isidor.gdl.anaToMia.Widgets.environment.ActiveStyleHandler; import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException; import us.isidor.gdl.anaToMia.Widgets.environment.FocusStyleHandler; @@ -22,7 +21,6 @@ import us.isidor.gdl.anaToMia.Widgets.value.TextAlignValue; import us.isidor.gdl.anaToMia.Widgets.value.TextDecorationValue;
-import com.google.gwt.dom.client.Element; import com.google.gwt.dom.client.Style.FontStyle; import com.google.gwt.event.dom.client.BlurEvent; import com.google.gwt.event.dom.client.BlurHandler; @@ -44,6 +42,7 @@ import com.google.gwt.event.dom.client.MouseUpHandler; import com.google.gwt.event.shared.HandlerRegistration; import com.google.gwt.user.client.DOM; +import com.google.gwt.user.client.Element; import com.google.gwt.user.client.ui.AbsolutePanel; import com.google.gwt.user.client.ui.Composite; import com.google.gwt.user.client.ui.Widget; @@ -151,7 +150,7 @@ public void setDirection(Widget widget, DirectionValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException { if(value != null && widget.getClass().equals(TitleWidget.class)) { if(styleClass == null){ - Utils.replaceStyleProperty(((TitleWidget)widget).getTitleElement(), "direction", value.getCssValue()); + DOM.setStyleAttribute(((TitleWidget)widget).getTitleElement(), "direction", value.getCssValue()); } this.addStyleToStore(styleClass, "direction", value.getCssValue()); } @@ -163,9 +162,9 @@ public void setTextAlign(Widget widget, TextAlignValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException { if(value != null && widget.getClass().equals(TitleWidget.class)) { if(styleClass == null){ - Utils.replaceStyleProperty(((TitleWidget)widget).getTitleElement(), "text-align", value.getCssValue()); + DOM.setStyleAttribute(((TitleWidget)widget).getTitleElement(), "textAlign", value.getCssValue()); } - this.addStyleToStore(styleClass, "text-align", value.getCssValue()); + this.addStyleToStore(styleClass, "textAlign", value.getCssValue()); } } @@ -175,9 +174,9 @@ public void setLineHeight(Widget widget, NormalNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException { if(value != null && widget.getClass().equals(TitleWidget.class)) { if(styleClass == null){ - Utils.replaceStyleProperty(((TitleWidget)widget).getTitleElement(), "line-height", value.getCssValue()); + DOM.setStyleAttribute(((TitleWidget)widget).getTitleElement(), "lineHeight", value.getCssValue()); } - this.addStyleToStore(styleClass, "line-height", value.getCssValue()); + this.addStyleToStore(styleClass, "lineHeight", value.getCssValue()); } } @@ -187,9 +186,9 @@ public void setTextDecoration(Widget widget, TextDecorationValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException { if(value != null && widget.getClass().equals(TitleWidget.class)) { if(styleClass == null){ - Utils.replaceStyleProperty(((TitleWidget)widget).getTitleElement(), "text-decoration", value.getCssValue()); + DOM.setStyleAttribute(((TitleWidget)widget).getTitleElement(), "textDecoration", value.getCssValue()); } - this.addStyleToStore(styleClass, "text-decoration", value.getCssValue()); + this.addStyleToStore(styleClass, "textDecoration", value.getCssValue()); } } @@ -199,7 +198,7 @@ public void setColor(Widget widget, ColorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException { if(value != null && widget.getClass().equals(TitleWidget.class)) { if(styleClass == null){ - Utils.replaceStyleProperty(((TitleWidget)widget).getTitleElement(), "color", value.getCssValue()); + DOM.setStyleAttribute(((TitleWidget)widget).getTitleElement(), "color", value.getCssValue()); } this.addStyleToStore(styleClass, "color", value.getCssValue()); } @@ -211,9 +210,9 @@ public void setFontFamily(Widget widget, String value, String styleClass) throws InvalidGdlSchemaException, ExecutionException { if(value != null && widget.getClass().equals(TitleWidget.class)) { if(styleClass == null){ - Utils.replaceStyleProperty(((TitleWidget)widget).getTitleElement(), "font-family", value); + DOM.setStyleAttribute(((TitleWidget)widget).getTitleElement(), "fontFamily", value); } - this.addStyleToStore(styleClass, "font-family", value); + this.addStyleToStore(styleClass, "fontFamily", value); } } @@ -223,9 +222,9 @@ public void setFontStyle(Widget widget, FontStyle value, String styleClass) throws InvalidGdlSchemaException, ExecutionException { if(value != null && widget.getClass().equals(TitleWidget.class)) { if(styleClass == null){ - Utils.replaceStyleProperty(((TitleWidget)widget).getTitleElement(), "font-style", value.getCssName()); + DOM.setStyleAttribute(((TitleWidget)widget).getTitleElement(), "fontStyle", value.getCssName()); } - this.addStyleToStore(styleClass, "font-style", value.getCssName()); + this.addStyleToStore(styleClass, "fontStyle", value.getCssName()); } } @@ -235,9 +234,9 @@ public void setFontSize(Widget widget, PositiveNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException { if(value != null && widget.getClass().equals(TitleWidget.class)) { if(styleClass == null){ - Utils.replaceStyleProperty(((TitleWidget)widget).getTitleElement(), "font-size", value.getCssValue()); + DOM.setStyleAttribute(((TitleWidget)widget).getTitleElement(), "fontSize", value.getCssValue()); } - this.addStyleToStore(styleClass, "font-size", value.getCssValue()); + this.addStyleToStore(styleClass, "fontSize", value.getCssValue()); } } @@ -247,9 +246,9 @@ public void setFontWeight(Widget widget, FontWeightValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException { if(value != null && widget.getClass().equals(TitleWidget.class)) { if(styleClass == null){ - Utils.replaceStyleProperty(((TitleWidget)widget).getTitleElement(), "font-weight", value.getCssValue()); + DOM.setStyleAttribute(((TitleWidget)widget).getTitleElement(), "fontWeight", value.getCssValue()); } - this.addStyleToStore(styleClass, "font-weight", value.getCssValue()); + this.addStyleToStore(styleClass, "fontWeight", value.getCssValue()); } } @@ -259,9 +258,9 @@ public void setLetterSpacing(Widget widget, NormalNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException { if(value != null && widget.getClass().equals(TitleWidget.class)) { if(styleClass == null){ - Utils.replaceStyleProperty(((TitleWidget)widget).getTitleElement(), "letter-spacing", value.getCssValue()); + DOM.setStyleAttribute(((TitleWidget)widget).getTitleElement(), "letterSpacing", value.getCssValue()); } - this.addStyleToStore(styleClass, "letter-spacing", value.getCssValue()); + this.addStyleToStore(styleClass, "letterSpacing", value.getCssValue()); } } @@ -270,9 +269,9 @@ public void setWordSpacing(Widget widget, NormalNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException { if(value != null && widget.getClass().equals(TitleWidget.class)) { if(styleClass == null){ - Utils.replaceStyleProperty(((TitleWidget)widget).getTitleElement(), "word-spacing", value.getCssValue()); + DOM.setStyleAttribute(((TitleWidget)widget).getTitleElement(), "wordSpacing", value.getCssValue()); } - this.addStyleToStore(styleClass, "word-spacing", value.getCssValue()); + this.addStyleToStore(styleClass, "wordSpacing", value.getCssValue()); } } @@ -281,7 +280,7 @@ public void setWidth(Widget widget, AutoNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException { if(value != null && widget.getClass().equals(TitleWidget.class)) { if(styleClass == null){ - Utils.replaceStyleProperty(((TitleWidget)widget).getTitleElement(), "width", value.getCssValue()); // TODO: fix + DOM.setStyleAttribute(((TitleWidget)widget).getTitleElement(), "width", value.getCssValue()); // TODO: fix } this.addStyleToStore(styleClass, "width", value.getCssValue()); super.setCssProperty(widget, styleClass, "width", value.getCssValue()); @@ -293,9 +292,9 @@ public void setMinWidth(Widget widget, AutoNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException { if(value != null && widget.getClass().equals(TitleWidget.class)) { if(styleClass == null){ - Utils.replaceStyleProperty(((TitleWidget)widget).getTitleElement(), "min-width", value.getCssValue()); + DOM.setStyleAttribute(((TitleWidget)widget).getTitleElement(), "minWidth", value.getCssValue()); } - this.addStyleToStore(styleClass, "min-width", value.getCssValue()); + this.addStyleToStore(styleClass, "minWidth", value.getCssValue()); super.setCssProperty(widget, styleClass, "minWidth", value.getCssValue()); } } @@ -305,9 +304,9 @@ public void setMaxWidth(Widget widget, AutoNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException { if(value != null && widget.getClass().equals(TitleWidget.class)) { if(styleClass == null){ - Utils.replaceStyleProperty(((TitleWidget)widget).getTitleElement(), "max-width", value.getCssValue()); + DOM.setStyleAttribute(((TitleWidget)widget).getTitleElement(), "maxWidth", value.getCssValue()); } - this.addStyleToStore(styleClass, "max-width", value.getCssValue()); + this.addStyleToStore(styleClass, "maxWidth", value.getCssValue()); super.setCssProperty(widget, styleClass, "maxWidth", value.getCssValue()); } } @@ -317,7 +316,7 @@ public void setHeight(Widget widget, AutoNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException { if(value != null && widget.getClass().equals(TitleWidget.class)) { if(styleClass == null){ - Utils.replaceStyleProperty(((TitleWidget)widget).getTitleElement(), "height", value.getCssValue()); + DOM.setStyleAttribute(((TitleWidget)widget).getTitleElement(), "height", value.getCssValue()); } this.addStyleToStore(styleClass, "height", value.getCssValue()); super.setCssProperty(widget, styleClass, "height", value.getCssValue()); @@ -329,9 +328,9 @@ public void setMinHeight(Widget widget, AutoNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException { if(value != null && widget.getClass().equals(TitleWidget.class)) { if(styleClass == null){ - Utils.replaceStyleProperty(((TitleWidget)widget).getTitleElement(), "min-height", value.getCssValue()); + DOM.setStyleAttribute(((TitleWidget)widget).getTitleElement(), "minHeight", value.getCssValue()); } - this.addStyleToStore(styleClass, "min-height", value.getCssValue()); + this.addStyleToStore(styleClass, "minHeight", value.getCssValue()); super.setCssProperty(widget, styleClass, "minHeight", value.getCssValue()); } } @@ -341,9 +340,9 @@ public void setMaxHeight(Widget widget, AutoNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException { if(value != null && widget.getClass().equals(TitleWidget.class)) { if(styleClass == null){ - Utils.replaceStyleProperty(((TitleWidget)widget).getTitleElement(), "max-height", value.getCssValue()); + DOM.setStyleAttribute(((TitleWidget)widget).getTitleElement(), "maxHeight", value.getCssValue()); } - this.addStyleToStore(styleClass, "max-height", value.getCssValue()); + this.addStyleToStore(styleClass, "maxHeight", value.getCssValue()); super.setCssProperty(widget, styleClass, "maxHeight", value.getCssValue()); } } @@ -356,7 +355,7 @@ GdlTitle.super.onHoverStart(event, handler); if(source.getClass().equals(TitleWidget.class)){ for (Pair<String, String> pair : this.titleHoverCssNamesAndStyles) { - Utils.replaceStyleProperty(((TitleWidget)source).titleElement, pair.getFirst(), pair.getSecond()); + DOM.setStyleAttribute(((TitleWidget)source).titleElement, pair.getFirst(), pair.getSecond()); } } } @@ -368,7 +367,7 @@ GdlTitle.super.onHoverStart(widget); if(widget.getClass().equals(TitleWidget.class)){ for (Pair<String, String> pair : this.titleHoverCssNamesAndStyles) { - Utils.replaceStyleProperty(((TitleWidget)widget).titleElement, pair.getFirst(), pair.getSecond()); + DOM.setStyleAttribute(((TitleWidget)widget).titleElement, pair.getFirst(), pair.getSecond()); } } } @@ -379,7 +378,7 @@ GdlTitle.super.onFocusStart(widget); if(widget.getClass().equals(TitleWidget.class)){ for (Pair<String, String> pair : this.titleFocusCssNamesAndStyles) { - Utils.replaceStyleProperty(((TitleWidget)widget).titleElement, pair.getFirst(), pair.getSecond()); + DOM.setStyleAttribute(((TitleWidget)widget).titleElement, pair.getFirst(), pair.getSecond()); } } } @@ -391,7 +390,7 @@ GdlTitle.super.onFocusStart(event, handler); if(source.getClass().equals(TitleWidget.class)){ for (Pair<String, String> pair : this.titleFocusCssNamesAndStyles) { - Utils.replaceStyleProperty(((TitleWidget)source).titleElement, pair.getFirst(), pair.getSecond()); + DOM.setStyleAttribute(((TitleWidget)source).titleElement, pair.getFirst(), pair.getSecond()); } } } @@ -402,7 +401,7 @@ GdlTitle.super.onActiveStart(widget); if(widget.getClass().equals(TitleWidget.class)){ for (Pair<String, String> pair : this.titleActiveCssNamesAndStyles) { - Utils.replaceStyleProperty(((TitleWidget)widget).titleElement, pair.getFirst(), pair.getSecond()); + DOM.setStyleAttribute(((TitleWidget)widget).titleElement, pair.getFirst(), pair.getSecond()); } } } @@ -414,7 +413,7 @@ GdlTitle.super.onActiveStart(event, handler); if(source.getClass().equals(TitleWidget.class)){ for (Pair<String, String> pair : this.titleActiveCssNamesAndStyles) { - Utils.replaceStyleProperty(((TitleWidget)source).titleElement, pair.getFirst(), pair.getSecond()); + DOM.setStyleAttribute(((TitleWidget)source).titleElement, pair.getFirst(), pair.getSecond()); } } } @@ -485,7 +484,7 @@ default: throw new ExecutionException("The title order of a GDL Title element must be 1, 2, 3 or 4"); } this.basePanel.getElement().insertFirst(this.titleElement); - Utils.replaceStyleProperty(this.titleElement, "margin", "0px"); + DOM.setStyleAttribute(this.titleElement, "margin", "0px"); }