isidorus-cvs
Threads by month
- ----- 2025 -----
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
July 2011
- 1 participants
- 156 discussions

[isidorus-cvs] r576 - in branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets: base text
by lgiessmann@common-lisp.net 07 Jul '11
by lgiessmann@common-lisp.net 07 Jul '11
07 Jul '11
Author: lgiessmann
Date: Thu Jul 7 07:44:51 2011
New Revision: 576
Log:
gdl-frontend: Widgets: fixed a bug in the style-handlers, which are responsible for setting width, min-width, max-width, height, min-height and max-height for resizeable textarea elements
Modified:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java Thu Jul 7 06:50:26 2011 (r575)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java Thu Jul 7 07:44:51 2011 (r576)
@@ -26,6 +26,7 @@
import com.google.gwt.dom.client.Style.VerticalAlign;
import com.google.gwt.event.dom.client.BlurEvent;
import com.google.gwt.event.dom.client.BlurHandler;
+import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.FocusEvent;
import com.google.gwt.event.dom.client.FocusHandler;
@@ -51,7 +52,6 @@
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Panel;
-import com.google.gwt.user.client.ui.TextArea;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;
@@ -1194,202 +1194,199 @@
// sets the border-color style property of this element by using the GWT DOM class
public void setBorderColor(Widget widget, ColorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderColor", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "borderColor", value.getCssValue());
}
// sets the border-top-color style property of this element by using the GWT DOM class
public void setBorderTopColor(Widget widget, ColorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderTopColor", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "borderTopColor", value.getCssValue());
}
// sets the border-right-color style property of this element by using the GWT DOM class
public void setBorderRightColor(Widget widget, ColorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderRightColor", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "borderRightColor", value.getCssValue());
}
// sets the border-bottom-color style property of this element by using the GWT DOM class
public void setBorderBottomColor(Widget widget, ColorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderBottomColor", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "borderBottomColor", value.getCssValue());
}
// sets the border-left-color style property of this element by using the GWT DOM class
public void setBorderLeftColor(Widget widget, ColorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderLeftColor", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "borderLeftColor", value.getCssValue());
}
// sets the border-style style property of this element by using the GWT DOM class
public void setBorderStyle(Widget widget, BorderStyleValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderStyle", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "borderStyle", value.getCssValue());
}
// sets the border-top-style style property of this element by using the GWT DOM class
public void setBorderTopStyle(Widget widget, BorderStyleValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderTopStyle", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "borderTopStyle", value.getCssValue());
}
// sets the border-right-style style property of this element by using the GWT DOM class
public void setBorderRightStyle(Widget widget, BorderStyleValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderRightStyle", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "borderRightStyle", value.getCssValue());
}
// sets the border-bottom-style style property of this element by using the GWT DOM class
public void setBorderBottomStyle(Widget widget, BorderStyleValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderBottomStyle", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "borderBottomStyle", value.getCssValue());
}
// sets the border-left-style style property of this element by using the GWT DOM class
public void setBorderLeftStyle(Widget widget, BorderStyleValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderLeftStyle", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "borderLeftStyle", value.getCssValue());
}
// sets the border-width style property of this element by using the GWT DOM class
public void setBorderWidth(Widget widget, AbsoluteNumValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderWidth", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "borderWidth", value.getCssValue());
}
// sets the border-width style property of this element by using the GWT DOM class
public void setBorderTopWidth(Widget widget, AbsoluteNumValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderTopWidth", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "borderTopWidth", value.getCssValue());
}
// sets the border-width style property of this element by using the GWT DOM class@Override
public void setBorderRightWidth(Widget widget, AbsoluteNumValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderRightWidth", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "borderRightWidth", value.getCssValue());
}
// sets the border-width style property of this element by using the GWT DOM class
public void setBorderBottomWidth(Widget widget, AbsoluteNumValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderBottomWidth", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "borderBottomWidth", value.getCssValue());
}
// sets the border-width style property of this element by using the GWT DOM class
public void setBorderLeftWidth(Widget widget, AbsoluteNumValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderLeftWidth", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "borderLeftWidth", value.getCssValue());
}
// sets the border-radius style property of this element by using the GWT DOM class
public void setBorderRadius(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderRadius", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "borderRadius", value.getCssValue());
}
// sets the border-top-right-radius style property of this element by using the GWT DOM class
public void setBorderTopRightRadius(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderTopRightRadius", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "borderTopRightRadius", value.getCssValue());
}
// sets the border-bottom-right-radius style property of this element by using the GWT DOM class
public void setBorderBottomRightRadius(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderBottomRightRadius", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "borderBottomRightRadius", value.getCssValue());
}
// sets the border-bottom-left-radius style property of this element by using the GWT DOM class
public void setBorderBottomLeftRadius(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderBottomLeftRadius", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "borderBottomLeftRadius", value.getCssValue());
}
// sets the border-top-left-radius style property of this element by using the GWT DOM class
public void setBorderTopLeftRadius(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderTopLeftRadius", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "borderTopLeftRadius", value.getCssValue());
}
// sets the padding style property of this element by using the GWT DOM class
public void setPadding(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "padding", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "padding", value.getCssValue());
}
// sets the padding-top style property of this element by using the GWT DOM class
public void setPaddingTop(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "paddingTop", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "paddingTop", value.getCssValue());
}
// sets the padding-right style property of this element by using the GWT DOM class
public void setPaddingRight(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "paddingRight", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "paddingRight", value.getCssValue());
}
// sets the padding-bottom style property of this element by using the GWT DOM class
public void setPaddingBottom(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "paddingBottom", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "paddingBottom", value.getCssValue());
}
// sets the padding-left style property of this element by using the GWT DOM class
public void setPaddingLeft(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "paddingLeft", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "paddingLeft", value.getCssValue());
}
-
-
-
// sets the width style property of this element by using the GWT DOM class
public void setWidth(Widget widget, AutoNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "width", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "width", value.getCssValue());
}
// sets the min-width style property of this element by using the GWT DOM class
public void setMinWidth(Widget widget, AutoNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "minWidth", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "minWidth", value.getCssValue());
}
// sets the max-width style property of this element by using the GWT DOM class
public void setMaxWidth(Widget widget, AutoNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "maxWidth", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "maxWidth", value.getCssValue());
}
// sets the height style property of this element by using the GWT DOM class
public void setHeight(Widget widget, AutoNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "height", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "height", value.getCssValue());
}
// sets the min-height style property of this element by using the GWT DOM class
public void setMinHeight(Widget widget, AutoNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "minHeight", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "minHeight", value.getCssValue());
}
// sets the max-height style property of this element by using the GWT DOM class
public void setMaxHeight(Widget widget, AutoNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "maxHeight", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "maxHeight", value.getCssValue());
}
// sets the cursor style property of this element by using the GWT DOM class
public void setCursor(Widget widget, CursorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "cursor", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "cursor", value.getCssValue());
}
// sets the background-color style property of this element by using the GWT DOM class
public void setBackgroundColor(Widget widget, ColorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "backgroundColor", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "backgroundColor", value.getCssValue());
}
@@ -1499,7 +1496,7 @@
public MultipleHandlerRegistration addClickHandler(ClickHandler handler) {
MultipleHandlerRegistration regs = new MultipleHandlerRegistration();
for (Widget item : this.subElements) {
- regs.addHandlerRegistration(((TextArea)item).addClickHandler(handler));
+ regs.addHandlerRegistration(item.addHandler(handler, ClickEvent.getType()));
}
return regs;
}
@@ -1510,7 +1507,7 @@
public MultipleHandlerRegistration addMouseOutHandler(MouseOutHandler handler){
MultipleHandlerRegistration regs = new MultipleHandlerRegistration();
for (Widget item : this.subElements) {
- regs.addHandlerRegistration(((TextArea)item).addMouseOutHandler(handler));
+ regs.addHandlerRegistration(item.addHandler(handler, MouseOutEvent.getType()));
}
return regs;
}
@@ -1521,7 +1518,7 @@
public MultipleHandlerRegistration addMouseOverHandler(MouseOverHandler handler){
MultipleHandlerRegistration regs = new MultipleHandlerRegistration();
for (Widget item : this.subElements) {
- regs.addHandlerRegistration(((TextArea)item).addMouseOverHandler(handler));
+ regs.addHandlerRegistration(item.addHandler(handler, MouseOverEvent.getType()));
}
return regs;
}
@@ -1532,7 +1529,7 @@
public MultipleHandlerRegistration addFocusHandler(FocusHandler handler){
MultipleHandlerRegistration regs = new MultipleHandlerRegistration();
for (Widget item : this.subElements) {
- regs.addHandlerRegistration(((TextArea)item).addFocusHandler(handler));
+ regs.addHandlerRegistration(item.addHandler(handler, FocusEvent.getType()));
}
return regs;
}
@@ -1543,7 +1540,7 @@
public MultipleHandlerRegistration addMouseDownHandler(MouseDownHandler handler){
MultipleHandlerRegistration regs = new MultipleHandlerRegistration();
for (Widget item : this.subElements) {
- regs.addHandlerRegistration(((TextArea)item).addMouseDownHandler(handler));
+ regs.addHandlerRegistration(item.addHandler(handler, MouseDownEvent.getType()));
}
return regs;
}
@@ -1554,7 +1551,7 @@
public MultipleHandlerRegistration addMouseUpHandler(MouseUpHandler handler){
MultipleHandlerRegistration regs = new MultipleHandlerRegistration();
for (Widget item : this.subElements) {
- regs.addHandlerRegistration(((TextArea)item).addMouseUpHandler(handler));
+ regs.addHandlerRegistration(item.addHandler(handler, MouseUpEvent.getType()));
}
return regs;
}
@@ -1566,14 +1563,14 @@
public MultipleHandlerRegistration addBlurHandler(BlurHandler handler){
MultipleHandlerRegistration regs = new MultipleHandlerRegistration();
for (Widget item : this.subElements) {
- regs.addHandlerRegistration(((TextArea)item).addBlurHandler(handler));
+ regs.addHandlerRegistration(item.addHandler(handler, BlurEvent.getType()));
}
return regs;
}
// adds the passed handler to the list eventHandlers
- private void addEventHandler(Widget elem, EventHandler handler){
+ protected void addEventHandler(Widget elem, EventHandler handler){
if(handler == null || elem == null) return;
for (Pair<Widget, ArrayList<EventHandler>> item : this.eventHandlers) {
@@ -1591,7 +1588,7 @@
// remove the passed handler of the list eventHandlers
- private void removeEventHandler(Widget elem, EventHandler handler){
+ protected void removeEventHandler(Widget elem, EventHandler handler){
for (Pair<Widget, ArrayList<EventHandler>> item : this.eventHandlers) {
if(item.getFirst().equals(elem)){
item.getSecond().remove(handler);
@@ -1601,7 +1598,7 @@
// returns the last handler bound to the passed element.
- private EventHandler getLastHandler(Widget elem){
+ protected EventHandler getLastHandler(Widget elem){
for (Pair<Widget, ArrayList<EventHandler>> item : this.eventHandlers) {
if(item.getFirst().equals(elem)){
int idx = item.getSecond().size() - 1;
@@ -1616,7 +1613,7 @@
// applies the styles bound to hover and the passed element
- private void onHoverStart(Widget widget){
+ protected void onHoverStart(Widget widget){
for (Pair<String, String> elem : this.hoverCssNamesAndStyles) {
DOM.setStyleAttribute(widget.getElement(), elem.getFirst(), elem.getSecond());
}
@@ -1624,7 +1621,7 @@
// applies the styles bound to acitve and the passed element
- private void onActiveStart(Widget widget){
+ protected void onActiveStart(Widget widget){
for (Pair<String, String> elem : this.activeCssNamesAndStyles) {
DOM.setStyleAttribute(widget.getElement(), elem.getFirst(), elem.getSecond());
}
@@ -1632,7 +1629,7 @@
// applies the styles bound to focus and the passed element
- private void onFocusStart(Widget widget){
+ protected void onFocusStart(Widget widget){
for (Pair<String, String> elem : this.focusCssNamesAndStyles) {
DOM.setStyleAttribute(widget.getElement(), elem.getFirst(), elem.getSecond());
}
@@ -1652,7 +1649,7 @@
// shall be called when the focus event was fired
public void onHoverEnd(MouseOutEvent event, HoverStyleHandler handler) {
try{
- TextArea source = (TextArea)event.getSource();
+ Widget source = (Widget)event.getSource();
this.removeEventHandler(source, handler);
EventHandler lastHandler = this.getLastHandler(source);
if(lastHandler == null){
@@ -1696,7 +1693,7 @@
}
- // shall be called to apply the styles of the sctive class
+ // shall be called to apply the styles of the active class
public void onActiveStart(MouseDownEvent event, ActiveStyleHandler handler) {
Widget source = (Widget)event.getSource();
this.addEventHandler(source, handler);
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java Thu Jul 7 06:50:26 2011 (r575)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java Thu Jul 7 07:44:51 2011 (r576)
@@ -1,11 +1,16 @@
package us.isidor.gdl.anaToMia.Widgets.text;
import java.util.ArrayList;
+
+import com.google.gwt.event.dom.client.BlurEvent;
import com.google.gwt.event.dom.client.KeyPressEvent;
import com.google.gwt.event.dom.client.KeyPressHandler;
+import com.google.gwt.event.dom.client.MouseOutEvent;
+import com.google.gwt.event.dom.client.MouseUpEvent;
import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.TextArea;
import com.google.gwt.user.client.ui.Widget;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Occurrence;
@@ -633,5 +638,193 @@
}
- // TODO: override setWidth when invoking by any StyleHandler => if resize is true => don't set the size to its origin, but to its last value
+ // like setGdlStyle, except the width, minwidth, maxWidth, height, minHeight and maxHeight properties
+ // are not set. This method should only be invoked of the onFocusEnd, onActiveEnd and onHoverEnd
+ // to avoid the resizing of resizeable textarea elements
+ private void setCleanGdlStyle(TextArea source) throws InvalidGdlSchemaException, ExecutionException{
+ ResizeValue resize = this.getResize();
+
+ // GdlVisibleObject
+ this.setContentOrientation(source, this.getContentOrientation());
+
+ this.setVerticalAlign(source, this.getVerticalAlign(null), null);
+
+ this.setMargin(source, this.getMargin(null), null);
+ this.setMarginTop(source, this.getMarginTop(null), null);
+ this.setMarginRight(source, this.getMarginRight(null), null);
+ this.setMarginBottom(source, this.getMarginBottom(null), null);
+ this.setMarginLeft(source, this.getMarginLeft(null), null);
+
+ this.setBorderColor(source, this.getBorderColor(null), null);
+ this.setBorderTopColor(source, this.getBorderTopColor(null), null);
+ this.setBorderRightColor(source, this.getBorderRightColor(null), null);
+ this.setBorderBottomColor(source, this.getBorderBottomColor(null), null);
+ this.setBorderLeftColor(source, this.getBorderLeftColor(null), null);
+
+ this.setBorderStyle(source, this.getBorderStyle(null), null);
+ this.setBorderTopStyle(source, this.getBorderTopStyle(null), null);
+ this.setBorderRightStyle(source, this.getBorderRightStyle(null), null);
+ this.setBorderBottomStyle(source, this.getBorderBottomStyle(null), null);
+ this.setBorderLeftStyle(source, this.getBorderLeftStyle(null), null);
+
+ this.setBorderWidth(source, this.getBorderWidth(null), null);
+ this.setBorderTopWidth(source, this.getBorderTopWidth(null), null);
+ this.setBorderRightWidth(source, this.getBorderRightWidth(null), null);
+ this.setBorderBottomWidth(source, this.getBorderBottomWidth(null), null);
+ this.setBorderLeftWidth(source, this.getBorderLeftWidth(null), null);
+
+ this.setBorderRadius(source, this.getBorderRadius(null), null);
+ this.setBorderTopRightRadius(source, this.getBorderTopRightRadius(null), null);
+ this.setBorderBottomRightRadius(source, this.getBorderBottomRightRadius(null), null);
+ this.setBorderBottomLeftRadius(source, this.getBorderBottomLeftRadius(null), null);
+ this.setBorderTopLeftRadius(source, this.getBorderTopLeftRadius(null), null);
+
+ this.setCursor(source, this.getCursor(null), null);
+
+ this.setBackgroundColor(source, this.getBackgroundColor(null), null);
+
+ if(resize == ResizeValue.NONE || resize == ResizeValue.VERTICAL){
+ this.setWidth(source, this.getWidth(null), null);
+ this.setMaxWidth(source, this.getMaxWidth(null), null);
+ this.setMinWidth(source, this.getMinWidth(null), null);
+ }
+
+ if(resize == ResizeValue.NONE || resize == ResizeValue.HORIZONTAL){
+ this.setHeight(source, this.getHeight(null), null);
+ this.setMaxHeight(source, this.getMaxHeight(null), null);
+ this.setMinHeight(source, this.getMinHeight(null), null);
+ }
+
+ // GdlTextObject
+ this.setColor(source, this.getColor(null), null);
+
+ this.setDirection(source, this.getDirection(null), null);
+ this.setTextAlign(source, this.getTextAlign(null), null);
+ this.setLineHeight(source, this.getLineHeight(null), null);
+ this.setTextDecoration(source, this.getTextDecoration(null), null);
+ this.setFontFamily(source, this.getFontFamily(null), null);
+ this.setFontStyle(source, this.getFontStyle(null), null);
+ this.setFontSize(source, this.getFontSize(null), null);
+ this.setFontWeight(source, this.getFontWeight(null), null);
+ this.setLetterSpacing(source, this.getLetterSpacing(null), null);
+ this.setWordSpacing(source, this.getWordSpacing(null), null);
+ }
+
+
+ // shall be called to apply the styles of the focus class
+ public void onActiveEnd(MouseUpEvent event, ActiveStyleHandler handler) {
+ try{
+ TextArea source = (TextArea)event.getSource();
+ this.removeEventHandler(source, handler);
+ EventHandler lastHandler = this.getLastHandler(source);
+ if(lastHandler == null){
+ this.setCleanGdlStyle(source);
+ }else {
+ if(lastHandler.getClass().equals(HoverStyleHandler.class)) this.onHoverStart(source);
+ else this.onFocusStart(source);
+ }
+ }catch(Exception e){
+ Window.alert("could not apply the default CSS style >> " + e.getClass() + " >> " + e.getMessage());
+ }
+ }
+
+
+ // shall be called when the focus event was fired
+ public void onHoverEnd(MouseOutEvent event, HoverStyleHandler handler) {
+ try{
+ TextArea source = (TextArea)event.getSource();
+ this.removeEventHandler(source, handler);
+ EventHandler lastHandler = this.getLastHandler(source);
+ if(lastHandler == null){
+ this.setCleanGdlStyle(source);
+ }else {
+ if(lastHandler.getClass().equals(ActiveStyleHandler.class)) this.onActiveStart(source);
+ else this.onFocusStart(source);
+ }
+ }catch(Exception e){
+ Window.alert("could not apply the default CSS style >> " + e.getClass() + " >> " + e.getMessage());
+ e.printStackTrace();
+ }
+ }
+
+
+ // shall be called when the blur event was fired
+ public void onFocusEnd(BlurEvent event, FocusStyleHandler handler) {
+ try{
+ TextArea source = (TextArea)event.getSource();
+ this.removeEventHandler(source, handler);
+ EventHandler lastHandler = this.getLastHandler(source);
+ if(lastHandler == null){
+ this.setCleanGdlStyle(source);
+ }else {
+ if(lastHandler.getClass().equals(ActiveStyleHandler.class)) this.onActiveStart(source);
+ else this.onHoverStart(source);
+ }
+ }catch(Exception e){
+ Window.alert("could not apply the default CSS style >> " + e.getClass() + " >> " + e.getMessage());
+ }
+ }
+
+
+ // width, minWidth, maxWidth, height, minHeight, maxHeight properties are ignore for styleClasses of resizable elements
+ @Override
+ protected void setCssProperty(Widget elem, String styleClass, String cssProperty, String cssValue)throws InvalidGdlSchemaException, ExecutionException{
+ if(styleClass != null){
+ ResizeValue resize = this.getResize();
+ if(resize == ResizeValue.NONE){
+ super.setCssProperty(elem, styleClass, cssProperty, cssValue);
+ }else if(resize == ResizeValue.HORIZONTAL){
+ if(cssProperty.equals("width") || cssProperty.equals("minWidth") || cssProperty.equals("maxWidth")) {
+ // do nothing this properties are ignored for resizable textareas
+ } else {
+ super.setCssProperty(elem, styleClass, cssProperty, cssValue);
+ }
+ }else if(resize == ResizeValue.VERTICAL) {
+ if(cssProperty.equals("height") || cssProperty.equals("minHeight") || cssProperty.equals("maxHeight")) {
+ // do nothing this properties are ignored for resizable textareas
+ } else {
+ super.setCssProperty(elem, styleClass, cssProperty, cssValue);
+ }
+ }else {
+ if(cssProperty.equals("height") || cssProperty.equals("minHeight") || cssProperty.equals("maxHeight") || cssProperty.equals("width") || cssProperty.equals("minWidth") || cssProperty.equals("maxWidth")) {
+ // do nothing this properties are ignored for resizable textareas
+ } else {
+ super.setCssProperty(elem, styleClass, cssProperty, cssValue);
+ }
+ }
+ }else {
+ super.setCssProperty(elem, styleClass, cssProperty, cssValue);
+ }
+ }
+
+
+ // width, minWidth, maxWidth, height, minHeight, maxHeight properties are ignore for styleClasses of resizable elements
+ protected void setCssProperty(String styleClass, String cssProperty, String cssValue)throws InvalidGdlSchemaException, ExecutionException{
+ if(styleClass != null){
+ ResizeValue resize = this.getResize();
+ if(resize == ResizeValue.NONE){
+ super.setCssProperty(styleClass, cssProperty, cssValue);
+ }else if(resize == ResizeValue.HORIZONTAL){
+ if(cssProperty.equals("width") || cssProperty.equals("minWidth") || cssProperty.equals("maxWidth")) {
+ // do nothing this properties are ignored for resizable textareas
+ } else {
+ super.setCssProperty(styleClass, cssProperty, cssValue);
+ }
+ }else if(resize == ResizeValue.VERTICAL) {
+ if(cssProperty.equals("height") || cssProperty.equals("minHeight") || cssProperty.equals("maxHeight")) {
+ // do nothing this properties are ignored for resizable textareas
+ } else {
+ super.setCssProperty(styleClass, cssProperty, cssValue);
+ }
+ }else {
+ if(cssProperty.equals("height") || cssProperty.equals("minHeight") || cssProperty.equals("maxHeight") || cssProperty.equals("width") || cssProperty.equals("minWidth") || cssProperty.equals("maxWidth")) {
+ // do nothing this properties are ignored for resizable textareas
+ } else {
+ super.setCssProperty(styleClass, cssProperty, cssValue);
+ }
+ }
+ }else {
+ super.setCssProperty(styleClass, cssProperty, cssValue);
+ }
+ }
}
1
0

[isidorus-cvs] r575 - in branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets: base text
by lgiessmann@common-lisp.net 07 Jul '11
by lgiessmann@common-lisp.net 07 Jul '11
07 Jul '11
Author: lgiessmann
Date: Thu Jul 7 06:50:26 2011
New Revision: 575
Log:
gdl-frontend: Widgets: foxed a bug in the style-handlers, which are responsible for setting the css properties of active, hover and focus
Modified:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java Thu Jul 7 05:58:31 2011 (r574)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java Thu Jul 7 06:50:26 2011 (r575)
@@ -65,7 +65,7 @@
protected ArrayList<Pair<String, String>> focusCssNamesAndStyles = new ArrayList<Pair<String,String>>();
protected ArrayList<Pair<String, String>> hoverCssNamesAndStyles = new ArrayList<Pair<String,String>>();
protected ArrayList<Widget> subElements = new ArrayList<Widget>();
- protected ArrayList<Pair<TextArea, ArrayList<EventHandler>>> eventHandlers = new ArrayList<Pair<TextArea, ArrayList<EventHandler>>>();
+ protected ArrayList<Pair<Widget, ArrayList<EventHandler>>> eventHandlers = new ArrayList<Pair<Widget, ArrayList<EventHandler>>>();
// some constructors
@@ -1573,39 +1573,36 @@
// adds the passed handler to the list eventHandlers
- private void addEventHandler(TextArea elem, EventHandler handler){
+ private void addEventHandler(Widget elem, EventHandler handler){
if(handler == null || elem == null) return;
- for (Pair<TextArea, ArrayList<EventHandler>> item : this.eventHandlers) {
+ for (Pair<Widget, ArrayList<EventHandler>> item : this.eventHandlers) {
if(item.getFirst().equals(elem)){
- item.getSecond().add(handler);
- return;
+ if(!item.getSecond().contains(handler)){
+ item.getSecond().add(handler);
+ return;
+ }
}
}
ArrayList<EventHandler> newHandlerList = new ArrayList<EventHandler>();
newHandlerList.add(handler);
- this.eventHandlers.add(new Pair<TextArea, ArrayList<EventHandler>>(elem, newHandlerList));
+ this.eventHandlers.add(new Pair<Widget, ArrayList<EventHandler>>(elem, newHandlerList));
}
// remove the passed handler of the list eventHandlers
- private void removeEventHandler(TextArea elem, EventHandler handler){
- for (Pair<TextArea, ArrayList<EventHandler>> item : this.eventHandlers) {
+ private void removeEventHandler(Widget elem, EventHandler handler){
+ for (Pair<Widget, ArrayList<EventHandler>> item : this.eventHandlers) {
if(item.getFirst().equals(elem)){
- for (EventHandler handlerItem : item.getSecond()) {
- if(handlerItem.equals(handler)){
- item.getSecond().remove(handlerItem);
- return;
- }
- }
+ item.getSecond().remove(handler);
}
}
}
// returns the last handler bound to the passed element.
- private EventHandler getLastHandler(TextArea elem){
- for (Pair<TextArea, ArrayList<EventHandler>> item : this.eventHandlers) {
+ private EventHandler getLastHandler(Widget elem){
+ for (Pair<Widget, ArrayList<EventHandler>> item : this.eventHandlers) {
if(item.getFirst().equals(elem)){
int idx = item.getSecond().size() - 1;
if(idx >= 0){
@@ -1617,6 +1614,7 @@
return null;
}
+
// applies the styles bound to hover and the passed element
private void onHoverStart(Widget widget){
for (Pair<String, String> elem : this.hoverCssNamesAndStyles) {
@@ -1643,7 +1641,7 @@
// some handler for applying the css style bound to the pseudo classes hover, active and focus
public void onHoverStart(MouseOverEvent event, HoverStyleHandler handler) {
- TextArea source = (TextArea)event.getSource();
+ Widget source = (Widget)event.getSource();
this.addEventHandler(source, handler);
for (Pair<String, String> elem : this.hoverCssNamesAndStyles) {
DOM.setStyleAttribute(source.getElement(), elem.getFirst(), elem.getSecond());
@@ -1672,7 +1670,7 @@
// shall be called to apply the styles of the focus class
public void onFocusStart(FocusEvent event, FocusStyleHandler handler) {
- TextArea source = (TextArea)event.getSource();
+ Widget source = (Widget)event.getSource();
this.addEventHandler(source, handler);
for (Pair<String, String> elem : this.focusCssNamesAndStyles) {
DOM.setStyleAttribute(source.getElement(), elem.getFirst(), elem.getSecond());
@@ -1683,7 +1681,7 @@
// shall be called when the blur event was fired
public void onFocusEnd(BlurEvent event, FocusStyleHandler handler) {
try{
- TextArea source = (TextArea)event.getSource();
+ Widget source = (Widget)event.getSource();
this.removeEventHandler(source, handler);
EventHandler lastHandler = this.getLastHandler(source);
if(lastHandler == null){
@@ -1700,7 +1698,7 @@
// shall be called to apply the styles of the sctive class
public void onActiveStart(MouseDownEvent event, ActiveStyleHandler handler) {
- TextArea source = (TextArea)event.getSource();
+ Widget source = (Widget)event.getSource();
this.addEventHandler(source, handler);
for (Pair<String, String> elem : this.activeCssNamesAndStyles) {
DOM.setStyleAttribute(source.getElement(), elem.getFirst(), elem.getSecond());
@@ -1711,7 +1709,7 @@
// shall be called to apply the styles of the focus class
public void onActiveEnd(MouseUpEvent event, ActiveStyleHandler handler) {
try{
- TextArea source = (TextArea)event.getSource();
+ Widget source = (Widget)event.getSource();
this.removeEventHandler(source, handler);
EventHandler lastHandler = this.getLastHandler(source);
if(lastHandler == null){
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java Thu Jul 7 05:58:31 2011 (r574)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java Thu Jul 7 06:50:26 2011 (r575)
@@ -70,7 +70,7 @@
// removes the passed element and all its handlers from the outer element
protected void removeTextArea(TextArea elem) throws InvalidGdlSchemaException, ExecutionException{
- for (Pair<TextArea, ArrayList<EventHandler>> item : this.eventHandlers) {
+ for (Pair<Widget, ArrayList<EventHandler>> item : this.eventHandlers) {
if(item.getFirst().equals(elem)){
this.eventHandlers.remove(item);
break;
1
0

[isidorus-cvs] r574 - in branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets: base text
by lgiessmann@common-lisp.net 07 Jul '11
by lgiessmann@common-lisp.net 07 Jul '11
07 Jul '11
Author: lgiessmann
Date: Thu Jul 7 05:58:31 2011
New Revision: 574
Log:
gdl-frontend: Widgets: implemented the behavior for gdl:ContentOrientation
Modified:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java Thu Jul 7 00:58:04 2011 (r573)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java Thu Jul 7 05:58:31 2011 (r574)
@@ -49,12 +49,16 @@
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.AbsolutePanel;
import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.HorizontalPanel;
+import com.google.gwt.user.client.ui.Panel;
import com.google.gwt.user.client.ui.TextArea;
+import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;
public abstract class GdlVisibleObject extends Composite implements GdlDescriptor, HasClickHandlers, HasMouseOutHandlers, HasMouseOverHandlers, HasFocusHandlers, HasMouseDownHandlers, HasMouseUpHandlers, HasBlurHandlers{
protected AbsolutePanel mainPanel = new AbsolutePanel();
+ protected Panel containerPanel = null;
protected Topic tmRepresentative = null;
protected TopicMap tm = null;
protected ArrayList<Pair<String, String>> activeCssNamesAndStyles = new ArrayList<Pair<String,String>>();
@@ -85,6 +89,17 @@
return this.tmRepresentative;
}
+
+ // this method should be invoked if a new sub-element is added to this instance
+ protected void addToContainerPanel(Widget widget){
+ if(this.containerPanel == null){
+ this.containerPanel = new VerticalPanel();
+ this.mainPanel.add(this.containerPanel);
+ }
+
+ this.containerPanel.add(widget);
+ }
+
// a helper method that returns all occurrences of the type bound to the passed PSI
protected JsArray<Occurrence> getOccurrences(String occurrenceType){
@@ -1123,10 +1138,10 @@
// sets the float style property of all sub elements by using the GWT DOM class
public void setContentOrientation(Widget widget, ContentOrientationValue value) throws InvalidGdlSchemaException, ExecutionException {
- // TODO: use a VerticalPanel or HorizontalPanel instead of setting the display property
- String valueStr = "inline";
- if(value != null && value == ContentOrientationValue.VERTICAL) valueStr = "block";
- this.setCssProperty(widget, null, "display", valueStr);
+ if(value == ContentOrientationValue.HORIZONTAL && this.containerPanel == null) this.containerPanel = new HorizontalPanel();
+ else if(this.containerPanel == null) this.containerPanel = new VerticalPanel();
+
+ this.mainPanel.add(this.containerPanel);
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java Thu Jul 7 00:58:04 2011 (r573)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java Thu Jul 7 05:58:31 2011 (r574)
@@ -5,7 +5,6 @@
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
import us.isidor.gdl.anaToMia.Widgets.isidorus.LoadSchemaCallback;
import us.isidor.gdl.anaToMia.Widgets.text.GdlText;
-import us.isidor.gdl.anaToMia.Widgets.text.GdlTextObject;
import us.isidor.gdl.anaToMia.Widgets.values.CursorValue;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.event.dom.client.ClickEvent;
@@ -104,7 +103,7 @@
tmpRepresentative.createOccurrence(gdlFontSize, "15pt", null);
tmpRepresentative.createOccurrence(gdlTextDecoration, "underline", null);
tmpRepresentative.createOccurrence(gdlDisplay, "inline", null);
- tmpRepresentative.createOccurrence(gdlContentOrientation, "horizontal", null);
+ tmpRepresentative.createOccurrence(gdlContentOrientation, "vertical", null);
Occurrence bgcHover = tmpRepresentative.createOccurrence(gdlBackgroundColor, "green", null);
bgcHover.addTheme(gdlHover);
Occurrence bgcActive = tmpRepresentative.createOccurrence(gdlBackgroundColor, "purple", null);
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java Thu Jul 7 00:58:04 2011 (r573)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java Thu Jul 7 05:58:31 2011 (r574)
@@ -63,7 +63,7 @@
elem.addFocusHandler(fsHandler);
elem.addBlurHandler(fsHandler);
this.subElements.add(elem);
- super.mainPanel.add(elem);
+ super.addToContainerPanel(elem);
return elem;
}
1
0

[isidorus-cvs] r573 - in branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets: base text values views
by lgiessmann@common-lisp.net 07 Jul '11
by lgiessmann@common-lisp.net 07 Jul '11
07 Jul '11
Author: lgiessmann
Date: Thu Jul 7 00:58:04 2011
New Revision: 573
Log:
gdl-frontend: Widgets: simplified te behavior of the superclass GdlVisibleObject
Modified:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlTextObject.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/values/ContentOrientationValue.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlCreatorAssociationView.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlDefaultCreatorTopicView.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlEditorAssociationView.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialCreatorTopicView.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialEditorTopicView.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlView.java
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java Wed Jul 6 13:36:01 2011 (r572)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java Thu Jul 7 00:58:04 2011 (r573)
@@ -23,12 +23,10 @@
import com.google.gwt.core.client.JsArray;
import com.google.gwt.dom.client.Style.Display;
import com.google.gwt.dom.client.Style.Float;
-import com.google.gwt.dom.client.Style.Overflow;
import com.google.gwt.dom.client.Style.VerticalAlign;
import com.google.gwt.event.dom.client.BlurEvent;
import com.google.gwt.event.dom.client.BlurHandler;
import com.google.gwt.event.dom.client.ClickHandler;
-import com.google.gwt.event.dom.client.DomEvent;
import com.google.gwt.event.dom.client.FocusEvent;
import com.google.gwt.event.dom.client.FocusHandler;
import com.google.gwt.event.dom.client.HasBlurHandlers;
@@ -46,9 +44,12 @@
import com.google.gwt.event.dom.client.MouseOverHandler;
import com.google.gwt.event.dom.client.MouseUpEvent;
import com.google.gwt.event.dom.client.MouseUpHandler;
+import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.AbsolutePanel;
import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.TextArea;
import com.google.gwt.user.client.ui.Widget;
@@ -59,6 +60,8 @@
protected ArrayList<Pair<String, String>> activeCssNamesAndStyles = new ArrayList<Pair<String,String>>();
protected ArrayList<Pair<String, String>> focusCssNamesAndStyles = new ArrayList<Pair<String,String>>();
protected ArrayList<Pair<String, String>> hoverCssNamesAndStyles = new ArrayList<Pair<String,String>>();
+ protected ArrayList<Widget> subElements = new ArrayList<Widget>();
+ protected ArrayList<Pair<TextArea, ArrayList<EventHandler>>> eventHandlers = new ArrayList<Pair<TextArea, ArrayList<EventHandler>>>();
// some constructors
@@ -155,7 +158,7 @@
// If no gdl:display occurrence is set, the default value is returned
public Display getDisplay() throws InvalidGdlSchemaException {
Occurrence displayOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlDisplay);
-
+
if(displayOcc != null){
String value = displayOcc.getValue().toLowerCase();
if(value.equals("none")){
@@ -238,7 +241,7 @@
throw new InvalidGdlSchemaException("The occurrence " + GdlPsis.OccurrenceType.gdlContentOrientation + " must be set to one of \"horizontal\" or \"vertical\", but is \"" + orientationOcc.getValue() + "\"");
}
} else {
- return ContentOrientationValue.Vertical;
+ return ContentOrientationValue.VERTICAL;
}
}
@@ -1119,8 +1122,13 @@
// sets the float style property of all sub elements by using the GWT DOM class
- public abstract void setContentOrientation(Widget widget, ContentOrientationValue value) throws InvalidGdlSchemaException, ExecutionException;
-
+ public void setContentOrientation(Widget widget, ContentOrientationValue value) throws InvalidGdlSchemaException, ExecutionException {
+ // TODO: use a VerticalPanel or HorizontalPanel instead of setting the display property
+ String valueStr = "inline";
+ if(value != null && value == ContentOrientationValue.VERTICAL) valueStr = "block";
+ this.setCssProperty(widget, null, "display", valueStr);
+ }
+
// sets the clear style property of this element by using the GWT DOM class
public void setClear(ClearValue value){
@@ -1131,160 +1139,244 @@
// sets the vertical-align style property of this element and all it's sub-elements by using the GWT DOM class
- public abstract void setVerticalAlign(Widget widget, VerticalAlign value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
-
+ public void setVerticalAlign(Widget widget, VerticalAlign value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null){
+ this.setCssProperty( widget, styleClass, "verticalAlign", value.getCssName());
+ this.setCssProperty(styleClass, "verticalAlign", value.getCssName());
+ }
+ }
+
// sets the margin style property of this element by using the GWT DOM class
- public abstract void setMargin(Widget widget, NumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
+ public void setMargin(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty(widget, styleClass, "margin", value.getCssValue());
+ }
// sets the margin-top style property of this element by using the GWT DOM class
- public abstract void setMarginTop(Widget widget, NumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
+ public void setMarginTop(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty(widget, styleClass, "marginTop", value.getCssValue());
+ }
// sets the margin-right style property of this element by using the GWT DOM class
- public abstract void setMarginRight(Widget widget, NumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
+ public void setMarginRight(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty(widget, styleClass, "marginRight", value.getCssValue());
+ }
// sets the margin-bottom style property of this element by using the GWT DOM class
- public abstract void setMarginBottom(Widget widget, NumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
+ public void setMarginBottom(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty(widget, styleClass, "marginBottom", value.getCssValue());
+ }
// sets the margin-left style property of this element by using the GWT DOM class
- public abstract void setMarginLeft(Widget widget, NumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
-
-
+ public void setMarginLeft(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty(widget, styleClass, "marginLeft", value.getCssValue());
+ }
+
+
// sets the border-color style property of this element by using the GWT DOM class
- public abstract void setBorderColor(Widget widget, ColorValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
+ public void setBorderColor(Widget widget, ColorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderColor", value.getCssValue());
+ }
// sets the border-top-color style property of this element by using the GWT DOM class
- public abstract void setBorderTopColor(Widget widget, ColorValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
+ public void setBorderTopColor(Widget widget, ColorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderTopColor", value.getCssValue());
+ }
// sets the border-right-color style property of this element by using the GWT DOM class
- public abstract void setBorderRightColor(Widget widget, ColorValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
+ public void setBorderRightColor(Widget widget, ColorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderRightColor", value.getCssValue());
+ }
// sets the border-bottom-color style property of this element by using the GWT DOM class
- public abstract void setBorderBottomColor(Widget widget, ColorValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
+ public void setBorderBottomColor(Widget widget, ColorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderBottomColor", value.getCssValue());
+ }
// sets the border-left-color style property of this element by using the GWT DOM class
- public abstract void setBorderLeftColor(Widget widget, ColorValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
-
-
+ public void setBorderLeftColor(Widget widget, ColorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderLeftColor", value.getCssValue());
+ }
+
+
// sets the border-style style property of this element by using the GWT DOM class
- public abstract void setBorderStyle(Widget widget, BorderStyleValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
+ public void setBorderStyle(Widget widget, BorderStyleValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderStyle", value.getCssValue());
+ }
// sets the border-top-style style property of this element by using the GWT DOM class
- public abstract void setBorderTopStyle(Widget widget, BorderStyleValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
+ public void setBorderTopStyle(Widget widget, BorderStyleValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderTopStyle", value.getCssValue());
+ }
// sets the border-right-style style property of this element by using the GWT DOM class
- public abstract void setBorderRightStyle(Widget widget, BorderStyleValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
+ public void setBorderRightStyle(Widget widget, BorderStyleValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderRightStyle", value.getCssValue());
+ }
// sets the border-bottom-style style property of this element by using the GWT DOM class
- public abstract void setBorderBottomStyle(Widget widget, BorderStyleValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
+ public void setBorderBottomStyle(Widget widget, BorderStyleValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderBottomStyle", value.getCssValue());
+ }
// sets the border-left-style style property of this element by using the GWT DOM class
- public abstract void setBorderLeftStyle(Widget widget, BorderStyleValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
-
+ public void setBorderLeftStyle(Widget widget, BorderStyleValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderLeftStyle", value.getCssValue());
+ }
+
// sets the border-width style property of this element by using the GWT DOM class
- public abstract void setBorderWidth(Widget widget, AbsoluteNumValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
-
+ public void setBorderWidth(Widget widget, AbsoluteNumValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderWidth", value.getCssValue());
+ }
- // sets the border-width style property of this element by using the GWT DOM class
- public abstract void setBorderTopWidth(Widget widget, AbsoluteNumValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
-
// sets the border-width style property of this element by using the GWT DOM class
- public abstract void setBorderRightWidth(Widget widget, AbsoluteNumValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
-
+ public void setBorderTopWidth(Widget widget, AbsoluteNumValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderTopWidth", value.getCssValue());
+ }
- // sets the border-width style property of this element by using the GWT DOM class
- public abstract void setBorderBottomWidth(Widget widget, AbsoluteNumValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
+ // sets the border-width style property of this element by using the GWT DOM class@Override
+ public void setBorderRightWidth(Widget widget, AbsoluteNumValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderRightWidth", value.getCssValue());
+ }
// sets the border-width style property of this element by using the GWT DOM class
- public abstract void setBorderLeftWidth(Widget widget, AbsoluteNumValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
+ public void setBorderBottomWidth(Widget widget, AbsoluteNumValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderBottomWidth", value.getCssValue());
+ }
+ // sets the border-width style property of this element by using the GWT DOM class
+ public void setBorderLeftWidth(Widget widget, AbsoluteNumValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderLeftWidth", value.getCssValue());
+ }
+
+
// sets the border-radius style property of this element by using the GWT DOM class
- public abstract void setBorderRadius(Widget widget, NumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
+ public void setBorderRadius(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderRadius", value.getCssValue());
+ }
// sets the border-top-right-radius style property of this element by using the GWT DOM class
- public abstract void setBorderTopRightRadius(Widget widget, NumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
+ public void setBorderTopRightRadius(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderTopRightRadius", value.getCssValue());
+ }
// sets the border-bottom-right-radius style property of this element by using the GWT DOM class
- public abstract void setBorderBottomRightRadius(Widget widget, NumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
+ public void setBorderBottomRightRadius(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderBottomRightRadius", value.getCssValue());
+ }
// sets the border-bottom-left-radius style property of this element by using the GWT DOM class
- public abstract void setBorderBottomLeftRadius(Widget widget, NumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
+ public void setBorderBottomLeftRadius(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderBottomLeftRadius", value.getCssValue());
+ }
// sets the border-top-left-radius style property of this element by using the GWT DOM class
- public abstract void setBorderTopLeftRadius(Widget widget, NumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
-
-
+ public void setBorderTopLeftRadius(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderTopLeftRadius", value.getCssValue());
+ }
+
+
+
// sets the padding style property of this element by using the GWT DOM class
- public abstract void setPadding(Widget widget, NumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
+ public void setPadding(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "padding", value.getCssValue());
+ }
// sets the padding-top style property of this element by using the GWT DOM class
- public abstract void setPaddingTop(Widget widget, NumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
+ public void setPaddingTop(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "paddingTop", value.getCssValue());
+ }
// sets the padding-right style property of this element by using the GWT DOM class
- public abstract void setPaddingRight(Widget widget, NumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
+ public void setPaddingRight(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "paddingRight", value.getCssValue());
+ }
// sets the padding-bottom style property of this element by using the GWT DOM class
- public abstract void setPaddingBottom(Widget widget, NumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
+ public void setPaddingBottom(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "paddingBottom", value.getCssValue());
+ }
// sets the padding-left style property of this element by using the GWT DOM class
- public abstract void setPaddingLeft(Widget widget, NumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
-
+ public void setPaddingLeft(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "paddingLeft", value.getCssValue());
+ }
+
+
+
+
// sets the width style property of this element by using the GWT DOM class
- public abstract void setWidth(Widget widget, AutoNumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
+ public void setWidth(Widget widget, AutoNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "width", value.getCssValue());
+ }
// sets the min-width style property of this element by using the GWT DOM class
- public abstract void setMinWidth(Widget widget, AutoNumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
+ public void setMinWidth(Widget widget, AutoNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "minWidth", value.getCssValue());
+ }
// sets the max-width style property of this element by using the GWT DOM class
- public abstract void setMaxWidth(Widget widget, AutoNumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
+ public void setMaxWidth(Widget widget, AutoNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "maxWidth", value.getCssValue());
+ }
// sets the height style property of this element by using the GWT DOM class
- public abstract void setHeight(Widget widget, AutoNumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
+ public void setHeight(Widget widget, AutoNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "height", value.getCssValue());
+ }
// sets the min-height style property of this element by using the GWT DOM class
- public abstract void setMinHeight(Widget widget, AutoNumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
+ public void setMinHeight(Widget widget, AutoNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "minHeight", value.getCssValue());
+ }
// sets the max-height style property of this element by using the GWT DOM class
- public abstract void setMaxHeight(Widget widget, AutoNumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
-
-
+ public void setMaxHeight(Widget widget, AutoNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "maxHeight", value.getCssValue());
+ }
+
+
// sets the cursor style property of this element by using the GWT DOM class
- public abstract void setCursor(Widget widget, CursorValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
+ public void setCursor(Widget widget, CursorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "cursor", value.getCssValue());
+ }
// sets the background-color style property of this element by using the GWT DOM class
- public abstract void setBackgroundColor(Widget widget, ColorValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
-
+ public void setBackgroundColor(Widget widget, ColorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "backgroundColor", value.getCssValue());
+ }
+
// sets the passed css style porperty to the passed css value.
// If a styleClass is given, the style is applied to either active, hover or focus
@@ -1304,7 +1396,79 @@
throw new InvalidGdlSchemaException("GDL defines only the style classes " + values + ", but found " + styleClass);
}
}
+
+
+ // sets a given css property and css value of this element's sub element
+ protected void setCssProperty(Widget elem, String styleClass, String cssProperty, String cssValue)throws InvalidGdlSchemaException, ExecutionException{
+ if(cssValue == null || cssProperty == null) return;
+ if(styleClass == null){
+ DOM.setStyleAttribute(elem.getElement(), cssProperty, cssValue);
+ } else if(styleClass.equals(GdlPsis.Scope.gdlActive)){
+ this.activeCssNamesAndStyles.add(new Pair<String, String>(cssProperty, cssValue));
+ } else if(styleClass.equals(GdlPsis.Scope.gdlFocus)){
+ this.focusCssNamesAndStyles.add(new Pair<String, String>(cssProperty, cssValue));
+ } else if (styleClass.equals(GdlPsis.Scope.gdlHover)){
+ this.hoverCssNamesAndStyles.add(new Pair<String, String>(cssProperty, cssValue));
+ } else {
+ String values = GdlPsis.Scope.gdlActive + ", " + GdlPsis.Scope.gdlFocus + ", " + GdlPsis.Scope.gdlHover;
+ throw new InvalidGdlSchemaException("GDL defines only the style classes " + values + ", but found " + styleClass);
+ }
+ }
+
+
+ // sets all GDL styles that are defined by the topic map representative to tha passed widget
+ public void setGdlStyle(Widget widget) throws InvalidGdlSchemaException, ExecutionException {
+ this.setContentOrientation(widget, this.getContentOrientation());
+
+ String[] styleClasses = new String[]{null, GdlPsis.Scope.gdlActive, GdlPsis.Scope.gdlFocus, GdlPsis.Scope.gdlHover};
+ for (String styleClass : styleClasses) {
+ this.setVerticalAlign(widget, this.getVerticalAlign(styleClass), styleClass);
+
+ this.setMargin(widget, this.getMargin(styleClass), styleClass);
+ this.setMarginTop(widget, this.getMarginTop(styleClass), styleClass);
+ this.setMarginRight(widget, this.getMarginRight(styleClass), styleClass);
+ this.setMarginBottom(widget, this.getMarginBottom(styleClass), styleClass);
+ this.setMarginLeft(widget, this.getMarginLeft(styleClass), styleClass);
+
+ this.setBorderColor(widget, this.getBorderColor(styleClass), styleClass);
+ this.setBorderTopColor(widget, this.getBorderTopColor(styleClass), styleClass);
+ this.setBorderRightColor(widget, this.getBorderRightColor(styleClass), styleClass);
+ this.setBorderBottomColor(widget, this.getBorderBottomColor(styleClass), styleClass);
+ this.setBorderLeftColor(widget, this.getBorderLeftColor(styleClass), styleClass);
+
+ this.setBorderStyle(widget, this.getBorderStyle(styleClass), styleClass);
+ this.setBorderTopStyle(widget, this.getBorderTopStyle(styleClass), styleClass);
+ this.setBorderRightStyle(widget, this.getBorderRightStyle(styleClass), styleClass);
+ this.setBorderBottomStyle(widget, this.getBorderBottomStyle(styleClass), styleClass);
+ this.setBorderLeftStyle(widget, this.getBorderLeftStyle(styleClass), styleClass);
+
+ this.setBorderWidth(widget, this.getBorderWidth(styleClass), styleClass);
+ this.setBorderTopWidth(widget, this.getBorderTopWidth(styleClass), styleClass);
+ this.setBorderRightWidth(widget, this.getBorderRightWidth(styleClass), styleClass);
+ this.setBorderBottomWidth(widget, this.getBorderBottomWidth(styleClass), styleClass);
+ this.setBorderLeftWidth(widget, this.getBorderLeftWidth(styleClass), styleClass);
+
+ this.setBorderRadius(widget, this.getBorderRadius(styleClass), styleClass);
+ this.setBorderTopRightRadius(widget, this.getBorderTopRightRadius(styleClass), styleClass);
+ this.setBorderBottomRightRadius(widget, this.getBorderBottomRightRadius(styleClass), styleClass);
+ this.setBorderBottomLeftRadius(widget, this.getBorderBottomLeftRadius(styleClass), styleClass);
+ this.setBorderTopLeftRadius(widget, this.getBorderTopLeftRadius(styleClass), styleClass);
+
+ this.setCursor(widget, this.getCursor(styleClass), styleClass);
+
+ this.setWidth(widget, this.getWidth(styleClass), styleClass);
+ this.setMaxWidth(widget, this.getMaxWidth(styleClass), styleClass);
+ this.setMinWidth(widget, this.getMinWidth(styleClass), styleClass);
+
+ this.setHeight(widget, this.getHeight(styleClass), styleClass);
+ this.setMaxHeight(widget, this.getMaxHeight(styleClass), styleClass);
+ this.setMinHeight(widget, this.getMinHeight(styleClass), styleClass);
+
+ this.setBackgroundColor(widget, this.getBackgroundColor(styleClass), styleClass);
+ }
+ }
+
// sets all GDL styles that are defined by the topic map representative
protected void setGdlStyle() throws InvalidGdlSchemaException, ExecutionException {
@@ -1317,59 +1481,232 @@
// registers a click handler to all sub-elements of this element
@Override
- public abstract MultipleHandlerRegistration addClickHandler(ClickHandler handler);
+ public MultipleHandlerRegistration addClickHandler(ClickHandler handler) {
+ MultipleHandlerRegistration regs = new MultipleHandlerRegistration();
+ for (Widget item : this.subElements) {
+ regs.addHandlerRegistration(((TextArea)item).addClickHandler(handler));
+ }
+ return regs;
+ }
// registers a mouse-out handler to all sub-elements of this element
@Override
- public abstract MultipleHandlerRegistration addMouseOutHandler(MouseOutHandler handler);
+ public MultipleHandlerRegistration addMouseOutHandler(MouseOutHandler handler){
+ MultipleHandlerRegistration regs = new MultipleHandlerRegistration();
+ for (Widget item : this.subElements) {
+ regs.addHandlerRegistration(((TextArea)item).addMouseOutHandler(handler));
+ }
+ return regs;
+ }
// registers a mouse-over handler to all sub-elements of this element
@Override
- public abstract MultipleHandlerRegistration addMouseOverHandler(MouseOverHandler handler);
+ public MultipleHandlerRegistration addMouseOverHandler(MouseOverHandler handler){
+ MultipleHandlerRegistration regs = new MultipleHandlerRegistration();
+ for (Widget item : this.subElements) {
+ regs.addHandlerRegistration(((TextArea)item).addMouseOverHandler(handler));
+ }
+ return regs;
+ }
// registers a focus handler to all sub-elements of this element
@Override
- public abstract MultipleHandlerRegistration addFocusHandler(FocusHandler handler);
+ public MultipleHandlerRegistration addFocusHandler(FocusHandler handler){
+ MultipleHandlerRegistration regs = new MultipleHandlerRegistration();
+ for (Widget item : this.subElements) {
+ regs.addHandlerRegistration(((TextArea)item).addFocusHandler(handler));
+ }
+ return regs;
+ }
// registers a mouse-down handler to all sub-elements of this element
@Override
- public abstract MultipleHandlerRegistration addMouseDownHandler(MouseDownHandler handler);
+ public MultipleHandlerRegistration addMouseDownHandler(MouseDownHandler handler){
+ MultipleHandlerRegistration regs = new MultipleHandlerRegistration();
+ for (Widget item : this.subElements) {
+ regs.addHandlerRegistration(((TextArea)item).addMouseDownHandler(handler));
+ }
+ return regs;
+ }
// registers a mouse-up handler to all sub-elements of this element
@Override
- public abstract MultipleHandlerRegistration addMouseUpHandler(MouseUpHandler handler);
+ public MultipleHandlerRegistration addMouseUpHandler(MouseUpHandler handler){
+ MultipleHandlerRegistration regs = new MultipleHandlerRegistration();
+ for (Widget item : this.subElements) {
+ regs.addHandlerRegistration(((TextArea)item).addMouseUpHandler(handler));
+ }
+ return regs;
+ }
+
// registers a blur handler to all sub-elements of this element
@Override
- public abstract MultipleHandlerRegistration addBlurHandler(BlurHandler handler);
+ public MultipleHandlerRegistration addBlurHandler(BlurHandler handler){
+ MultipleHandlerRegistration regs = new MultipleHandlerRegistration();
+ for (Widget item : this.subElements) {
+ regs.addHandlerRegistration(((TextArea)item).addBlurHandler(handler));
+ }
+ return regs;
+ }
- // shall be called, if a sub-element of this element is hovered
- public abstract void onHoverStart(@SuppressWarnings("rawtypes") DomEvent event, HoverStyleHandler handler);
+ // adds the passed handler to the list eventHandlers
+ private void addEventHandler(TextArea elem, EventHandler handler){
+ if(handler == null || elem == null) return;
+
+ for (Pair<TextArea, ArrayList<EventHandler>> item : this.eventHandlers) {
+ if(item.getFirst().equals(elem)){
+ item.getSecond().add(handler);
+ return;
+ }
+ }
+ ArrayList<EventHandler> newHandlerList = new ArrayList<EventHandler>();
+ newHandlerList.add(handler);
+ this.eventHandlers.add(new Pair<TextArea, ArrayList<EventHandler>>(elem, newHandlerList));
+ }
- // shall be called, if a sub-element of this element is hovered
- public abstract void onHoverEnd(@SuppressWarnings("rawtypes") DomEvent event, HoverStyleHandler handler);
+ // remove the passed handler of the list eventHandlers
+ private void removeEventHandler(TextArea elem, EventHandler handler){
+ for (Pair<TextArea, ArrayList<EventHandler>> item : this.eventHandlers) {
+ if(item.getFirst().equals(elem)){
+ for (EventHandler handlerItem : item.getSecond()) {
+ if(handlerItem.equals(handler)){
+ item.getSecond().remove(handlerItem);
+ return;
+ }
+ }
+ }
+ }
+ }
+
+
+ // returns the last handler bound to the passed element.
+ private EventHandler getLastHandler(TextArea elem){
+ for (Pair<TextArea, ArrayList<EventHandler>> item : this.eventHandlers) {
+ if(item.getFirst().equals(elem)){
+ int idx = item.getSecond().size() - 1;
+ if(idx >= 0){
+ return item.getSecond().get(idx);
+ }
+ }
+ }
+
+ return null;
+ }
+ // applies the styles bound to hover and the passed element
+ private void onHoverStart(Widget widget){
+ for (Pair<String, String> elem : this.hoverCssNamesAndStyles) {
+ DOM.setStyleAttribute(widget.getElement(), elem.getFirst(), elem.getSecond());
+ }
+ }
- // shall be called, if a sub-element of this element is focused
- public abstract void onFocusStart(@SuppressWarnings("rawtypes") DomEvent event, FocusStyleHandler handler);
+ // applies the styles bound to acitve and the passed element
+ private void onActiveStart(Widget widget){
+ for (Pair<String, String> elem : this.activeCssNamesAndStyles) {
+ DOM.setStyleAttribute(widget.getElement(), elem.getFirst(), elem.getSecond());
+ }
+ }
- // shall be called, if a sub-element of this element is focused
- public abstract void onFocusEnd(@SuppressWarnings("rawtypes") DomEvent event, FocusStyleHandler handler);
+ // applies the styles bound to focus and the passed element
+ private void onFocusStart(Widget widget){
+ for (Pair<String, String> elem : this.focusCssNamesAndStyles) {
+ DOM.setStyleAttribute(widget.getElement(), elem.getFirst(), elem.getSecond());
+ }
+ }
- // shall be called, if a sub-element of this element is focused
- public abstract void onActiveStart(@SuppressWarnings("rawtypes") DomEvent event, ActiveStyleHandler handler);
+ // some handler for applying the css style bound to the pseudo classes hover, active and focus
+ public void onHoverStart(MouseOverEvent event, HoverStyleHandler handler) {
+ TextArea source = (TextArea)event.getSource();
+ this.addEventHandler(source, handler);
+ for (Pair<String, String> elem : this.hoverCssNamesAndStyles) {
+ DOM.setStyleAttribute(source.getElement(), elem.getFirst(), elem.getSecond());
+ }
+ }
+
- // shall be called, if a sub-element of this element is focused
- public abstract void onActiveEnd(@SuppressWarnings("rawtypes") DomEvent event, ActiveStyleHandler handler);
+ // shall be called when the focus event was fired
+ public void onHoverEnd(MouseOutEvent event, HoverStyleHandler handler) {
+ try{
+ TextArea source = (TextArea)event.getSource();
+ this.removeEventHandler(source, handler);
+ EventHandler lastHandler = this.getLastHandler(source);
+ if(lastHandler == null){
+ this.setGdlStyle(source);
+ }else {
+ if(lastHandler.getClass().equals(ActiveStyleHandler.class)) this.onActiveStart(source);
+ else this.onFocusStart(source);
+ }
+ }catch(Exception e){
+ Window.alert("could not apply the default CSS style >> " + e.getClass() + " >> " + e.getMessage());
+ e.printStackTrace();
+ }
+ }
+
+
+ // shall be called to apply the styles of the focus class
+ public void onFocusStart(FocusEvent event, FocusStyleHandler handler) {
+ TextArea source = (TextArea)event.getSource();
+ this.addEventHandler(source, handler);
+ for (Pair<String, String> elem : this.focusCssNamesAndStyles) {
+ DOM.setStyleAttribute(source.getElement(), elem.getFirst(), elem.getSecond());
+ }
+ }
+
+
+ // shall be called when the blur event was fired
+ public void onFocusEnd(BlurEvent event, FocusStyleHandler handler) {
+ try{
+ TextArea source = (TextArea)event.getSource();
+ this.removeEventHandler(source, handler);
+ EventHandler lastHandler = this.getLastHandler(source);
+ if(lastHandler == null){
+ this.setGdlStyle(source);
+ }else {
+ if(lastHandler.getClass().equals(ActiveStyleHandler.class)) this.onActiveStart(source);
+ else this.onHoverStart(source);
+ }
+ }catch(Exception e){
+ Window.alert("could not apply the default CSS style >> " + e.getClass() + " >> " + e.getMessage());
+ }
+ }
+
+
+ // shall be called to apply the styles of the sctive class
+ public void onActiveStart(MouseDownEvent event, ActiveStyleHandler handler) {
+ TextArea source = (TextArea)event.getSource();
+ this.addEventHandler(source, handler);
+ for (Pair<String, String> elem : this.activeCssNamesAndStyles) {
+ DOM.setStyleAttribute(source.getElement(), elem.getFirst(), elem.getSecond());
+ }
+ }
+
+
+ // shall be called to apply the styles of the focus class
+ public void onActiveEnd(MouseUpEvent event, ActiveStyleHandler handler) {
+ try{
+ TextArea source = (TextArea)event.getSource();
+ this.removeEventHandler(source, handler);
+ EventHandler lastHandler = this.getLastHandler(source);
+ if(lastHandler == null){
+ this.setGdlStyle(source);
+ }else {
+ if(lastHandler.getClass().equals(HoverStyleHandler.class)) this.onHoverStart(source);
+ else this.onFocusStart(source);
+ }
+ }catch(Exception e){
+ Window.alert("could not apply the default CSS style >> " + e.getClass() + " >> " + e.getMessage());
+ }
+ }
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java Wed Jul 6 13:36:01 2011 (r572)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java Thu Jul 7 00:58:04 2011 (r573)
@@ -80,6 +80,8 @@
Topic gdlReadonly = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.OccurrenceType.gdlReadonly));
Topic gdlResize = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.OccurrenceType.gdlResize));
Topic gdlTextDecoration = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.OccurrenceType.gdlTextDecoration));
+ Topic gdlDisplay = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.OccurrenceType.gdlDisplay));
+ Topic gdlContentOrientation = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.OccurrenceType.gdlContentOrientation));
tmpRepresentative.createOccurrence(gdlId, "ID_1", null);
tmpRepresentative.createOccurrence(gdlBackgroundColor, "red", null);
@@ -101,6 +103,8 @@
tmpRepresentative.createOccurrence(gdlResize, "both", null);
tmpRepresentative.createOccurrence(gdlFontSize, "15pt", null);
tmpRepresentative.createOccurrence(gdlTextDecoration, "underline", null);
+ tmpRepresentative.createOccurrence(gdlDisplay, "inline", null);
+ tmpRepresentative.createOccurrence(gdlContentOrientation, "horizontal", null);
Occurrence bgcHover = tmpRepresentative.createOccurrence(gdlBackgroundColor, "green", null);
bgcHover.addTheme(gdlHover);
Occurrence bgcActive = tmpRepresentative.createOccurrence(gdlBackgroundColor, "purple", null);
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java Wed Jul 6 13:36:01 2011 (r572)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java Thu Jul 7 00:58:04 2011 (r573)
@@ -1,22 +1,11 @@
package us.isidor.gdl.anaToMia.Widgets.text;
import java.util.ArrayList;
-import com.google.gwt.dom.client.Style.FontStyle;
-import com.google.gwt.dom.client.Style.VerticalAlign;
-import com.google.gwt.event.dom.client.BlurHandler;
-import com.google.gwt.event.dom.client.ClickHandler;
-import com.google.gwt.event.dom.client.DomEvent;
-import com.google.gwt.event.dom.client.FocusHandler;
import com.google.gwt.event.dom.client.KeyPressEvent;
import com.google.gwt.event.dom.client.KeyPressHandler;
-import com.google.gwt.event.dom.client.MouseDownHandler;
-import com.google.gwt.event.dom.client.MouseOutHandler;
-import com.google.gwt.event.dom.client.MouseOverHandler;
-import com.google.gwt.event.dom.client.MouseUpHandler;
import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.user.client.DOM;
-import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.TextArea;
import com.google.gwt.user.client.ui.Widget;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Occurrence;
@@ -29,31 +18,19 @@
import us.isidor.gdl.anaToMia.Widgets.environment.FocusStyleHandler;
import us.isidor.gdl.anaToMia.Widgets.environment.HoverStyleHandler;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
-import us.isidor.gdl.anaToMia.Widgets.environment.MultipleHandlerRegistration;
import us.isidor.gdl.anaToMia.Widgets.environment.Pair;
import us.isidor.gdl.anaToMia.Widgets.values.AbsoluteNumValue;
-import us.isidor.gdl.anaToMia.Widgets.values.AutoNumUnitValue;
import us.isidor.gdl.anaToMia.Widgets.values.BorderStyleValue;
import us.isidor.gdl.anaToMia.Widgets.values.ColorValue;
-import us.isidor.gdl.anaToMia.Widgets.values.ContentOrientationValue;
-import us.isidor.gdl.anaToMia.Widgets.values.CursorValue;
-import us.isidor.gdl.anaToMia.Widgets.values.DirectionValue;
-import us.isidor.gdl.anaToMia.Widgets.values.FontWeightValue;
-import us.isidor.gdl.anaToMia.Widgets.values.NormalNumUnitValue;
import us.isidor.gdl.anaToMia.Widgets.values.NumUnitValue;
-import us.isidor.gdl.anaToMia.Widgets.values.PositiveNumUnitValue;
import us.isidor.gdl.anaToMia.Widgets.values.ResizeValue;
-import us.isidor.gdl.anaToMia.Widgets.values.TextAlignValue;
-import us.isidor.gdl.anaToMia.Widgets.values.TextDecorationValue;
import us.isidor.gdl.anaToMia.Widgets.values.TextTypeValue;
public class GdlText extends GdlTextObject implements IGdlHasValue{
- protected ArrayList<TextArea> textElements = new ArrayList<TextArea>();
protected ArrayList<PasswordKeyPressHandler> passwordKeyPressHandler = null;
protected ArrayList<HandlerRegistration> passwordKeyPressRegistrations = null;
- protected ArrayList<Pair<TextArea, ArrayList<EventHandler>>> eventHandlers = new ArrayList<Pair<TextArea, ArrayList<EventHandler>>>();
// some constructors
@@ -66,6 +43,7 @@
super(tmRepresentative);
// TODO: create a text element for each TM-elem
this.createNewTextArea(); // TODO: remove only for debugging
+ this.createNewTextArea(); // TODO: remove only for debugging
}
@@ -73,7 +51,7 @@
// and applies the styles on it
protected TextArea createNewTextArea() throws InvalidGdlSchemaException, ExecutionException {
TextArea elem = new TextArea();
- DOM.setElementAttribute(elem.getElement(), "id", this.getId() + "__GDL_" + this.textElements.size());
+ DOM.setElementAttribute(elem.getElement(), "id", this.getId() + "__GDL_" + this.subElements.size());
this.setGdlStyle((Widget)elem);
ActiveStyleHandler asHandler = new ActiveStyleHandler(this);
FocusStyleHandler fsHandler = new FocusStyleHandler(this);
@@ -84,7 +62,7 @@
elem.addMouseOutHandler(hsHandler);
elem.addFocusHandler(fsHandler);
elem.addBlurHandler(fsHandler);
- this.textElements.add(elem);
+ this.subElements.add(elem);
super.mainPanel.add(elem);
return elem;
}
@@ -98,7 +76,7 @@
break;
}
}
- this.textElements.remove(elem);
+ this.subElements.remove(elem);
elem.removeFromParent();
}
@@ -520,25 +498,6 @@
}
- // sets a given css property and css value of this element's text area element
- private void setCssProperty(TextArea elem, String styleClass, String cssProperty, String cssValue)throws InvalidGdlSchemaException, ExecutionException{
- if(cssValue == null || cssProperty == null) return;
-
- if(styleClass == null){
- DOM.setStyleAttribute(elem.getElement(), cssProperty, cssValue);
- } else if(styleClass.equals(GdlPsis.Scope.gdlActive)){
- super.activeCssNamesAndStyles.add(new Pair<String, String>(cssProperty, cssValue));
- } else if(styleClass.equals(GdlPsis.Scope.gdlFocus)){
- super.focusCssNamesAndStyles.add(new Pair<String, String>(cssProperty, cssValue));
- } else if (styleClass.equals(GdlPsis.Scope.gdlHover)){
- super.hoverCssNamesAndStyles.add(new Pair<String, String>(cssProperty, cssValue));
- } else {
- String values = GdlPsis.Scope.gdlActive + ", " + GdlPsis.Scope.gdlFocus + ", " + GdlPsis.Scope.gdlHover;
- throw new InvalidGdlSchemaException("GDL defines only the style classes " + values + ", but found " + styleClass);
- }
- }
-
-
// sets the resize style property.
// If gdl:readonly is set to true, this property is set to none, i.e. the passed value is ignored.
// IF gdl:readonly is set to false, this property is set to the passed argument.
@@ -565,9 +524,9 @@
this.passwordKeyPressHandler = new ArrayList<PasswordKeyPressHandler>();
this.passwordKeyPressRegistrations = new ArrayList<HandlerRegistration>();
- for (TextArea item : this.textElements) {
+ for (Widget item : this.subElements) {
PasswordKeyPressHandler handler = new PasswordKeyPressHandler();
- this.passwordKeyPressRegistrations.add(item.addKeyPressHandler(handler));
+ this.passwordKeyPressRegistrations.add(((TextArea)item).addKeyPressHandler(handler));
}
}
}else {
@@ -600,481 +559,25 @@
// cols is only treated if width is not set
if(widthOcc == null) DOM.setElementAttribute(widget.getElement(), "cols", String.valueOf(value));
}
-
-
- @Override
- public void setDirection(Widget widget, DirectionValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "direction", value.getCssValue());
- }
-
-
- @Override
- public void setTextAlign(Widget widget, TextAlignValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "textAlign", value.getCssValue());
- }
-
-
- @Override
- public void setLineHeight(Widget widget, NormalNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "lineHeight", value.getCssValue());
- }
-
-
- @Override
- public void setTextDecoration(Widget widget, TextDecorationValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "textDecoration", value.getCssValue());
- }
-
-
- @Override
- public void setColor(Widget widget, ColorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "color", value.getCssValue());
- }
-
-
- @Override
- public void setFontFamily(Widget widget, String value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "fontFamily", value);
- }
-
-
- @Override
- public void setFontStyle(Widget widget, FontStyle value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "fontStyle", value.getCssName());
- }
-
-
- @Override
- public void setFontSize(Widget widget, PositiveNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "fontSize", value.getCssValue());
- }
-
-
- @Override
- public void setFontWeight(Widget widget, FontWeightValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "fontWeight", value.getCssValue());
- }
-
-
- @Override
- public void setLetterSpacing(Widget widget, NormalNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "letterSpacing", value.getCssValue());
- }
-
-
- @Override
- public void setWordSpacing(Widget widget, NormalNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "wordSpacing", value.getCssValue());
- }
-
-
- @Override
- public void setContentOrientation(Widget widget, ContentOrientationValue value) throws InvalidGdlSchemaException, ExecutionException {
- String valueStr = "inline";
- if(value != null && value == ContentOrientationValue.Vertical) valueStr = "block";
- this.setCssProperty((TextArea)widget, null, "display", valueStr);
- }
-
-
- @Override
- public void setMargin(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "margin", value.getCssValue());
- }
-
-
- @Override
- public void setMarginTop(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "marginTop", value.getCssValue());
- }
-
-
- @Override
- public void setMarginRight(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "marginRight", value.getCssValue());
- }
-
-
- @Override
- public void setMarginBottom(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "marginBottom", value.getCssValue());
- }
-
-
- @Override
- public void setMarginLeft(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "marginLeft", value.getCssValue());
- }
-
-
- @Override
- public void setBorderColor(Widget widget, ColorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderColor", value.getCssValue());
- }
-
-
- @Override
- public void setBorderTopColor(Widget widget, ColorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderTopColor", value.getCssValue());
- }
-
-
- @Override
- public void setBorderRightColor(Widget widget, ColorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderRightColor", value.getCssValue());
- }
-
-
- @Override
- public void setBorderBottomColor(Widget widget, ColorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderBottomColor", value.getCssValue());
- }
-
-
- @Override
- public void setBorderLeftColor(Widget widget, ColorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderLeftColor", value.getCssValue());
- }
-
-
- @Override
- public void setBorderStyle(Widget widget, BorderStyleValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderStyle", value.getCssValue());
- }
-
-
- @Override
- public void setBorderTopStyle(Widget widget, BorderStyleValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderTopStyle", value.getCssValue());
- }
-
-
- @Override
- public void setBorderRightStyle(Widget widget, BorderStyleValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderRightStyle", value.getCssValue());
- }
-
-
- @Override
- public void setBorderBottomStyle(Widget widget, BorderStyleValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderBottomStyle", value.getCssValue());
- }
-
-
- @Override
- public void setBorderLeftStyle(Widget widget, BorderStyleValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderLeftStyle", value.getCssValue());
- }
-
-
- @Override
- public void setBorderWidth(Widget widget, AbsoluteNumValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderWidth", value.getCssValue());
- }
-
-
- @Override
- public void setBorderTopWidth(Widget widget, AbsoluteNumValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderTopWidth", value.getCssValue());
- }
-
-
- @Override
- public void setBorderRightWidth(Widget widget, AbsoluteNumValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderRightWidth", value.getCssValue());
- }
-
-
- @Override
- public void setBorderBottomWidth(Widget widget, AbsoluteNumValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderBottomWidth", value.getCssValue());
- }
-
-
- @Override
- public void setBorderLeftWidth(Widget widget, AbsoluteNumValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderLeftWidth", value.getCssValue());
- }
-
-
- @Override
- public void setBorderRadius(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderRadius", value.getCssValue());
- }
-
-
- @Override
- public void setBorderTopRightRadius(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderTopRightRadius", value.getCssValue());
- }
-
-
- @Override
- public void setBorderBottomRightRadius(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderBottomRightRadius", value.getCssValue());
- }
-
-
- @Override
- public void setBorderBottomLeftRadius(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderBottomLeftRadius", value.getCssValue());
- }
-
-
- @Override
- public void setBorderTopLeftRadius(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderTopLeftRadius", value.getCssValue());
- }
-
-
- @Override
- public void setPadding(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "padding", value.getCssValue());
- }
-
-
- @Override
- public void setPaddingTop(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "paddingTop", value.getCssValue());
- }
-
-
- @Override
- public void setPaddingRight(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "paddingRight", value.getCssValue());
- }
-
-
- @Override
- public void setPaddingBottom(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "paddingBottom", value.getCssValue());
- }
-
-
- @Override
- public void setPaddingLeft(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "paddingLeft", value.getCssValue());
- }
-
-
- @Override
- public void setWidth(Widget widget, AutoNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "width", value.getCssValue());
- }
-
-
- @Override
- public void setMinWidth(Widget widget, AutoNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "minWidth", value.getCssValue());
- }
-
-
- @Override
- public void setMaxWidth(Widget widget, AutoNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "maxWidth", value.getCssValue());
- }
-
-
- @Override
- public void setHeight(Widget widget, AutoNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "height", value.getCssValue());
- }
-
-
- @Override
- public void setMinHeight(Widget widget, AutoNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "minHeight", value.getCssValue());
- }
-
-
- @Override
- public void setMaxHeight(Widget widget, AutoNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "maxHeight", value.getCssValue());
- }
-
-
- @Override
- public void setCursor(Widget widget, CursorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "cursor", value.getCssValue());
- }
-
-
- @Override
- public void setBackgroundColor(Widget widget, ColorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "backgroundColor", value.getCssValue());
- }
- public void setVerticalAlign(Widget widget, VerticalAlign value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null){
- this.setCssProperty((TextArea) widget, styleClass, "verticalAlign", value.getCssName());
- super.setCssProperty(styleClass, "verticalAlign", value.getCssName());
- }
- }
-
-
- public void setGdlStyle(Widget widget) throws InvalidGdlSchemaException, ExecutionException {
- this.setContentOrientation(widget, this.getContentOrientation());
-
- String[] styleClasses = new String[]{null, GdlPsis.Scope.gdlActive, GdlPsis.Scope.gdlFocus, GdlPsis.Scope.gdlHover};
- for (String styleClass : styleClasses) {
- this.setReadonly(widget, this.getReadonly());
- this.setResize(widget, this.getResize());
- this.setTextType(this.getTextType());
- this.setRows(widget, this.getRows());
- this.setCols(widget, this.getCols());
-
- this.setVerticalAlign(widget, this.getVerticalAlign(styleClass), styleClass);
-
- this.setMargin(widget, this.getMargin(styleClass), styleClass);
- this.setMarginTop(widget, this.getMarginTop(styleClass), styleClass);
- this.setMarginRight(widget, this.getMarginRight(styleClass), styleClass);
- this.setMarginBottom(widget, this.getMarginBottom(styleClass), styleClass);
- this.setMarginLeft(widget, this.getMarginLeft(styleClass), styleClass);
-
- this.setBorderColor(widget, this.getBorderColor(styleClass), styleClass);
- this.setBorderTopColor(widget, this.getBorderTopColor(styleClass), styleClass);
- this.setBorderRightColor(widget, this.getBorderRightColor(styleClass), styleClass);
- this.setBorderBottomColor(widget, this.getBorderBottomColor(styleClass), styleClass);
- this.setBorderLeftColor(widget, this.getBorderLeftColor(styleClass), styleClass);
-
- this.setBorderStyle(widget, this.getBorderStyle(styleClass), styleClass);
- this.setBorderTopStyle(widget, this.getBorderTopStyle(styleClass), styleClass);
- this.setBorderRightStyle(widget, this.getBorderRightStyle(styleClass), styleClass);
- this.setBorderBottomStyle(widget, this.getBorderBottomStyle(styleClass), styleClass);
- this.setBorderLeftStyle(widget, this.getBorderLeftStyle(styleClass), styleClass);
-
- this.setBorderWidth(widget, this.getBorderWidth(styleClass), styleClass);
- this.setBorderTopWidth(widget, this.getBorderTopWidth(styleClass), styleClass);
- this.setBorderRightWidth(widget, this.getBorderRightWidth(styleClass), styleClass);
- this.setBorderBottomWidth(widget, this.getBorderBottomWidth(styleClass), styleClass);
- this.setBorderLeftWidth(widget, this.getBorderLeftWidth(styleClass), styleClass);
-
- this.setBorderRadius(widget, this.getBorderRadius(styleClass), styleClass);
- this.setBorderTopRightRadius(widget, this.getBorderTopRightRadius(styleClass), styleClass);
- this.setBorderBottomRightRadius(widget, this.getBorderBottomRightRadius(styleClass), styleClass);
- this.setBorderBottomLeftRadius(widget, this.getBorderBottomLeftRadius(styleClass), styleClass);
- this.setBorderTopLeftRadius(widget, this.getBorderTopLeftRadius(styleClass), styleClass);
-
- this.setCursor(widget, this.getCursor(styleClass), styleClass);
-
- this.setWidth(widget, this.getWidth(styleClass), styleClass);
- this.setMaxWidth(widget, this.getMaxWidth(styleClass), styleClass);
- this.setMinWidth(widget, this.getMinWidth(styleClass), styleClass);
-
- this.setHeight(widget, this.getHeight(styleClass), styleClass);
- this.setMaxHeight(widget, this.getMaxHeight(styleClass), styleClass);
- this.setMinHeight(widget, this.getMinHeight(styleClass), styleClass);
-
- this.setBackgroundColor(widget, this.getBackgroundColor(styleClass), styleClass);
- this.setColor(widget, this.getColor(styleClass), styleClass);
-
- this.setDirection(widget, this.getDirection(styleClass), styleClass);
- this.setTextAlign(widget, this.getTextAlign(styleClass), styleClass);
- this.setLineHeight(widget, this.getLineHeight(styleClass), styleClass);
- this.setTextDecoration(widget, this.getTextDecoration(styleClass), styleClass);
- this.setFontFamily(widget, this.getFontFamily(styleClass), styleClass);
- this.setFontStyle(widget, this.getFontStyle(styleClass), styleClass);
- this.setFontSize(widget, this.getFontSize(styleClass), styleClass);
- this.setFontWeight(widget, this.getFontWeight(styleClass), styleClass);
- this.setLetterSpacing(widget, this.getLetterSpacing(styleClass), styleClass);
- this.setWordSpacing(widget, this.getWordSpacing(styleClass), styleClass);
- }
- }
-
- // calls the super applies the GdlStyle for eaver TextAre item of this instance
+ // calls the super applies the GdlStyle for every TextArea item of this instance
@Override
protected void setGdlStyle() throws InvalidGdlSchemaException, ExecutionException{
- if(this.textElements != null){
- for (TextArea item : this.textElements) {
- this.setGdlStyle((Widget)item);
+ if(this.subElements != null){
+ for (Widget item : this.subElements) {
+ this.setGdlStyle(item);
}
}
}
- // registers a passed mouse down handler to each text element of this item
- @Override
- public MultipleHandlerRegistration addMouseDownHandler(MouseDownHandler handler){
- MultipleHandlerRegistration regs = new MultipleHandlerRegistration();
- for (TextArea item : this.textElements) {
- regs.addHandlerRegistration(item.addMouseDownHandler(handler));
- }
- return regs;
- }
-
-
- // registers a passed mouse up handler to each text element of this item
- @Override
- public MultipleHandlerRegistration addMouseUpHandler(MouseUpHandler handler){
- MultipleHandlerRegistration regs = new MultipleHandlerRegistration();
- for (TextArea item : this.textElements) {
- regs.addHandlerRegistration(item.addMouseUpHandler(handler));
- }
- return regs;
- }
-
-
- // registers a passed focus handler to each text element of this item
- @Override
- public MultipleHandlerRegistration addFocusHandler(FocusHandler handler){
- MultipleHandlerRegistration regs = new MultipleHandlerRegistration();
- for (TextArea item : this.textElements) {
- regs.addHandlerRegistration(item.addFocusHandler(handler));
- }
- return regs;
- }
-
-
- // registers a passed blur handler to each text element of this item
- @Override
- public MultipleHandlerRegistration addBlurHandler(BlurHandler handler){
- MultipleHandlerRegistration regs = new MultipleHandlerRegistration();
- for (TextArea item : this.textElements) {
- regs.addHandlerRegistration(item.addBlurHandler(handler));
- }
- return regs;
- }
-
-
- // registers a passed mouse out handler to each text element of this item
- @Override
- public MultipleHandlerRegistration addMouseOutHandler(MouseOutHandler handler){
- MultipleHandlerRegistration regs = new MultipleHandlerRegistration();
- for (TextArea item : this.textElements) {
- regs.addHandlerRegistration(item.addMouseOutHandler(handler));
- }
- return regs;
- }
-
-
- // registers a passed mouse over handler to each text element of this item
- @Override
- public MultipleHandlerRegistration addMouseOverHandler(MouseOverHandler handler){
- MultipleHandlerRegistration regs = new MultipleHandlerRegistration();
- for (TextArea item : this.textElements) {
- regs.addHandlerRegistration(item.addMouseOverHandler(handler));
- }
- return regs;
- }
-
-
- // registers a passed click handler to each text element of this item
- @Override
- public MultipleHandlerRegistration addClickHandler(ClickHandler handler) {
- MultipleHandlerRegistration regs = new MultipleHandlerRegistration();
- for (TextArea item : this.textElements) {
- regs.addHandlerRegistration(item.addClickHandler(handler));
- }
- return regs;
- }
-
-
// returns the results of all text area elements
@Override
public ArrayList<String> getStringValue() {
ArrayList<String> results = new ArrayList<String>();
- for (TextArea item : this.textElements) {
- results.add(item.getValue());
+ for (Widget item : this.subElements) {
+ results.add(((TextArea)item).getValue());
}
return results;
}
@@ -1092,162 +595,21 @@
// TODO: implement
return false;
}
-
-
- // adds the passed handler to the list eventHandlers
- private void addEventHandler(TextArea elem, EventHandler handler){
- if(handler == null || elem == null) return;
-
- for (Pair<TextArea, ArrayList<EventHandler>> item : this.eventHandlers) {
- if(item.getFirst().equals(elem)){
- item.getSecond().add(handler);
- return;
- }
- }
- ArrayList<EventHandler> newHandlerList = new ArrayList<EventHandler>();
- newHandlerList.add(handler);
- this.eventHandlers.add(new Pair<TextArea, ArrayList<EventHandler>>(elem, newHandlerList));
- }
-
-
- // remove the passed handler of the list eventHandlers
- private void removeEventHandler(TextArea elem, EventHandler handler){
- for (Pair<TextArea, ArrayList<EventHandler>> item : this.eventHandlers) {
- if(item.getFirst().equals(elem)){
- for (EventHandler handlerItem : item.getSecond()) {
- if(handlerItem.equals(handler)){
- item.getSecond().remove(handlerItem);
- return;
- }
- }
- }
- }
- }
-
-
- // returns the last handler bound to the passed element.
- private EventHandler getLastHandler(TextArea elem){
- for (Pair<TextArea, ArrayList<EventHandler>> item : this.eventHandlers) {
- if(item.getFirst().equals(elem)){
- int idx = item.getSecond().size() - 1;
- if(idx >= 0){
- return item.getSecond().get(idx);
- }
- }
- }
-
- return null;
- }
-
-
- // applies the styles bound to hover and the passed element
- private void onHoverStart(Widget widget){
- for (Pair<String, String> elem : this.hoverCssNamesAndStyles) {
- DOM.setStyleAttribute(widget.getElement(), elem.getFirst(), elem.getSecond());
- }
- }
- // applies the styles bound to acitve and the passed element
- private void onActiveStart(Widget widget){
- for (Pair<String, String> elem : this.activeCssNamesAndStyles) {
- DOM.setStyleAttribute(widget.getElement(), elem.getFirst(), elem.getSecond());
- }
- }
-
-
- // applies the styles bound to focus and the passed element
- private void onFocusStart(Widget widget){
- for (Pair<String, String> elem : this.focusCssNamesAndStyles) {
- DOM.setStyleAttribute(widget.getElement(), elem.getFirst(), elem.getSecond());
- }
- }
-
-
- // some handler for applying the css style bound to the pseudo classes hover, active and focus
- @Override
- public void onHoverStart(@SuppressWarnings("rawtypes") DomEvent event, HoverStyleHandler handler) {
- TextArea source = (TextArea)event.getSource();
- this.addEventHandler(source, handler);
- for (Pair<String, String> elem : this.hoverCssNamesAndStyles) {
- DOM.setStyleAttribute(source.getElement(), elem.getFirst(), elem.getSecond());
- }
- }
-
-
- @Override
- public void onHoverEnd(@SuppressWarnings("rawtypes") DomEvent event, HoverStyleHandler handler) {
- try{
- TextArea source = (TextArea)event.getSource();
- this.removeEventHandler(source, handler);
- EventHandler lastHandler = this.getLastHandler(source);
- if(lastHandler == null){
- this.setGdlStyle(source);
- }else {
- if(lastHandler.getClass().equals(ActiveStyleHandler.class)) this.onActiveStart(source);
- else this.onFocusStart(source);
- }
- }catch(Exception e){
- Window.alert("could not apply the default CSS style >> " + e.getClass() + " >> " + e.getMessage());
- e.printStackTrace();
- }
- }
-
-
- @Override
- public void onFocusStart(@SuppressWarnings("rawtypes") DomEvent event, FocusStyleHandler handler) {
- TextArea source = (TextArea)event.getSource();
- this.addEventHandler(source, handler);
- for (Pair<String, String> elem : this.focusCssNamesAndStyles) {
- DOM.setStyleAttribute(source.getElement(), elem.getFirst(), elem.getSecond());
- }
- }
-
-
+ // sets the css properties, by calling the super class's method and the local
+ // method, which sets some specific properties for the GdlText instance
@Override
- public void onFocusEnd(@SuppressWarnings("rawtypes") DomEvent event, FocusStyleHandler handler) {
- try{
- TextArea source = (TextArea)event.getSource();
- this.removeEventHandler(source, handler);
- EventHandler lastHandler = this.getLastHandler(source);
- if(lastHandler == null){
- this.setGdlStyle(source);
- }else {
- if(lastHandler.getClass().equals(ActiveStyleHandler.class)) this.onActiveStart(source);
- else this.onHoverStart(source);
- }
- }catch(Exception e){
- Window.alert("could not apply the default CSS style >> " + e.getClass() + " >> " + e.getMessage());
- }
- }
-
+ public void setGdlStyle(Widget widget) throws InvalidGdlSchemaException, ExecutionException {
+ super.setGdlStyle(widget);
- @Override
- public void onActiveStart(@SuppressWarnings("rawtypes") DomEvent event, ActiveStyleHandler handler) {
- TextArea source = (TextArea)event.getSource();
- this.addEventHandler(source, handler);
- for (Pair<String, String> elem : this.activeCssNamesAndStyles) {
- DOM.setStyleAttribute(source.getElement(), elem.getFirst(), elem.getSecond());
- }
+ this.setReadonly(widget, this.getReadonly());
+ this.setResize(widget, this.getResize());
+ this.setTextType(this.getTextType());
+ this.setRows(widget, this.getRows());
+ this.setCols(widget, this.getCols());
}
-
- @Override
- public void onActiveEnd(@SuppressWarnings("rawtypes") DomEvent event, ActiveStyleHandler handler) {
- try{
- TextArea source = (TextArea)event.getSource();
- this.removeEventHandler(source, handler);
- EventHandler lastHandler = this.getLastHandler(source);
- if(lastHandler == null){
- this.setGdlStyle(source);
- }else {
- if(lastHandler.getClass().equals(HoverStyleHandler.class)) this.onHoverStart(source);
- else this.onFocusStart(source);
- }
- }catch(Exception e){
- Window.alert("could not apply the default CSS style >> " + e.getClass() + " >> " + e.getMessage());
- }
- }
// this class catches all keypress events and transforms the visible
@@ -1264,9 +626,12 @@
realValue += (char)event.getCharCode() + "";
}
-
+
public String getValue(){
return this.realValue;
}
}
+
+
+ // TODO: override setWidth when invoking by any StyleHandler => if resize is true => don't set the size to its origin, but to its last value
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlTextObject.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlTextObject.java Wed Jul 6 13:36:01 2011 (r572)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlTextObject.java Thu Jul 7 00:58:04 2011 (r573)
@@ -2,6 +2,7 @@
import com.google.gwt.dom.client.Style.FontStyle;
+import com.google.gwt.user.client.ui.TextArea;
import com.google.gwt.user.client.ui.Widget;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Occurrence;
@@ -281,45 +282,86 @@
// sets the direction style property of this element by using the GWT DOM class
- public abstract void setDirection(Widget widget, DirectionValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException;
+ public void setDirection(Widget widget, DirectionValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "direction", value.getCssValue());
+ }
// sets the text-align style property of this element by using the GWT DOM class
- public abstract void setTextAlign(Widget widget, TextAlignValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException;
+ public void setTextAlign(Widget widget, TextAlignValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "textAlign", value.getCssValue());
+ }
// sets the line-height style property of this element by using the GWT DOM class
- public abstract void setLineHeight(Widget widget, NormalNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException;
+ public void setLineHeight(Widget widget, NormalNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "lineHeight", value.getCssValue());
+ }
// sets the text-decoration style property of this element by using the GWT DOM class
- public abstract void setTextDecoration(Widget widget, TextDecorationValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException;
+ public void setTextDecoration(Widget widget, TextDecorationValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "textDecoration", value.getCssValue());
+ }
// sets the color style property of this element by using the GWT DOM class
- public abstract void setColor(Widget widget, ColorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException;
+ public void setColor(Widget widget, ColorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "color", value.getCssValue());
+ }
// sets the font-family style property of this element by using the GWT DOM class
- public abstract void setFontFamily(Widget widget, String value, String styleClass) throws InvalidGdlSchemaException, ExecutionException;
+ public void setFontFamily(Widget widget, String value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "fontFamily", value);
+ }
// sets the font-style style property of this element by using the GWT DOM class
- public abstract void setFontStyle(Widget widget, FontStyle value, String styleClass) throws InvalidGdlSchemaException, ExecutionException;
+ public void setFontStyle(Widget widget, FontStyle value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "fontStyle", value.getCssName());
+ }
// sets the font-size style property of this element by using the GWT DOM class
- public abstract void setFontSize(Widget widget, PositiveNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException;
+ public void setFontSize(Widget widget, PositiveNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "fontSize", value.getCssValue());
+ }
// sets the font-weight style property of this element by using the GWT DOM class
- public abstract void setFontWeight(Widget widget, FontWeightValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException;
+ public void setFontWeight(Widget widget, FontWeightValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "fontWeight", value.getCssValue());
+ }
// sets the letter-spacing style property of this element by using the GWT DOM class
- public abstract void setLetterSpacing(Widget widget, NormalNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException;
-
+ public void setLetterSpacing(Widget widget, NormalNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "letterSpacing", value.getCssValue());
+ }
// sets the word-spacing style property of this element by using the GWT DOM class
- public abstract void setWordSpacing(Widget widget, NormalNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException;
+ public void setWordSpacing(Widget widget, NormalNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "wordSpacing", value.getCssValue());
+ }
+
+
+ public void setGdlStyle(Widget widget) throws InvalidGdlSchemaException, ExecutionException {
+ super.setGdlStyle(widget);
+ String[] styleClasses = new String[]{null, GdlPsis.Scope.gdlActive, GdlPsis.Scope.gdlFocus, GdlPsis.Scope.gdlHover};
+ for (String styleClass : styleClasses) {
+ this.setColor(widget, this.getColor(styleClass), styleClass);
+
+ this.setDirection(widget, this.getDirection(styleClass), styleClass);
+ this.setTextAlign(widget, this.getTextAlign(styleClass), styleClass);
+ this.setLineHeight(widget, this.getLineHeight(styleClass), styleClass);
+ this.setTextDecoration(widget, this.getTextDecoration(styleClass), styleClass);
+ this.setFontFamily(widget, this.getFontFamily(styleClass), styleClass);
+ this.setFontStyle(widget, this.getFontStyle(styleClass), styleClass);
+ this.setFontSize(widget, this.getFontSize(styleClass), styleClass);
+ this.setFontWeight(widget, this.getFontWeight(styleClass), styleClass);
+ this.setLetterSpacing(widget, this.getLetterSpacing(styleClass), styleClass);
+ this.setWordSpacing(widget, this.getWordSpacing(styleClass), styleClass);
+ }
+ }
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/values/ContentOrientationValue.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/values/ContentOrientationValue.java Wed Jul 6 13:36:01 2011 (r572)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/values/ContentOrientationValue.java Thu Jul 7 00:58:04 2011 (r573)
@@ -1,8 +1,8 @@
package us.isidor.gdl.anaToMia.Widgets.values;
public enum ContentOrientationValue implements CssValue{
- Horizontal,
- Vertical;
+ HORIZONTAL,
+ VERTICAL;
@Override
public String getCssValue() {
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlCreatorAssociationView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlCreatorAssociationView.java Wed Jul 6 13:36:01 2011 (r572)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlCreatorAssociationView.java Thu Jul 7 00:58:04 2011 (r573)
@@ -384,40 +384,38 @@
}
-
-
@Override
- public void onHoverStart(DomEvent event, HoverStyleHandler handler) {
+ public void onHoverStart(MouseOverEvent event, HoverStyleHandler handler) {
// TODO Auto-generated method stub
}
@Override
- public void onHoverEnd(DomEvent event, HoverStyleHandler handler) {
+ public void onHoverEnd(MouseOutEvent event, HoverStyleHandler handler) {
// TODO Auto-generated method stub
}
@Override
- public void onFocusStart(DomEvent event, FocusStyleHandler handler) {
+ public void onFocusStart(FocusEvent event, FocusStyleHandler handler) {
// TODO Auto-generated method stub
}
@Override
- public void onFocusEnd(DomEvent event, FocusStyleHandler handler) {
+ public void onFocusEnd(BlurEvent event, FocusStyleHandler handler) {
// TODO Auto-generated method stub
}
@Override
- public void onActiveStart(DomEvent event, ActiveStyleHandler handler) {
+ public void onActiveStart(MouseDownEvent event, ActiveStyleHandler handler) {
// TODO Auto-generated method stub
}
@Override
- public void onActiveEnd(DomEvent event, ActiveStyleHandler handler) {
+ public void onActiveEnd(MouseUpEvent event, ActiveStyleHandler handler) {
// TODO Auto-generated method stub
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlDefaultCreatorTopicView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlDefaultCreatorTopicView.java Wed Jul 6 13:36:01 2011 (r572)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlDefaultCreatorTopicView.java Thu Jul 7 00:58:04 2011 (r573)
@@ -419,49 +419,46 @@
// TODO Auto-generated method stub
}
-
-
+
@Override
- public void onHoverStart(DomEvent event, HoverStyleHandler handler) {
+ public void onHoverStart(MouseOverEvent event, HoverStyleHandler handler) {
// TODO Auto-generated method stub
}
@Override
- public void onHoverEnd(DomEvent event, HoverStyleHandler handler) {
+ public void onHoverEnd(MouseOutEvent event, HoverStyleHandler handler) {
// TODO Auto-generated method stub
}
@Override
- public void onFocusStart(DomEvent event, FocusStyleHandler handler) {
+ public void onFocusStart(FocusEvent event, FocusStyleHandler handler) {
// TODO Auto-generated method stub
}
@Override
- public void onFocusEnd(DomEvent event, FocusStyleHandler handler) {
+ public void onFocusEnd(BlurEvent event, FocusStyleHandler handler) {
// TODO Auto-generated method stub
}
@Override
- public void onActiveStart(DomEvent event, ActiveStyleHandler handler) {
+ public void onActiveStart(MouseDownEvent event, ActiveStyleHandler handler) {
// TODO Auto-generated method stub
}
@Override
- public void onActiveEnd(DomEvent event, ActiveStyleHandler handler) {
+ public void onActiveEnd(MouseUpEvent event, ActiveStyleHandler handler) {
// TODO Auto-generated method stub
}
-
-
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlEditorAssociationView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlEditorAssociationView.java Wed Jul 6 13:36:01 2011 (r572)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlEditorAssociationView.java Thu Jul 7 00:58:04 2011 (r573)
@@ -421,48 +421,49 @@
// TODO Auto-generated method stub
}
-
-
+
@Override
- public void onHoverStart(DomEvent event, HoverStyleHandler handler) {
+ public void onHoverStart(MouseOverEvent event, HoverStyleHandler handler) {
// TODO Auto-generated method stub
}
@Override
- public void onHoverEnd(DomEvent event, HoverStyleHandler handler) {
+ public void onHoverEnd(MouseOutEvent event, HoverStyleHandler handler) {
// TODO Auto-generated method stub
}
@Override
- public void onFocusStart(DomEvent event, FocusStyleHandler handler) {
+ public void onFocusStart(FocusEvent event, FocusStyleHandler handler) {
// TODO Auto-generated method stub
}
@Override
- public void onFocusEnd(DomEvent event, FocusStyleHandler handler) {
+ public void onFocusEnd(BlurEvent event, FocusStyleHandler handler) {
// TODO Auto-generated method stub
}
@Override
- public void onActiveStart(DomEvent event, ActiveStyleHandler handler) {
+ public void onActiveStart(MouseDownEvent event, ActiveStyleHandler handler) {
// TODO Auto-generated method stub
}
@Override
- public void onActiveEnd(DomEvent event, ActiveStyleHandler handler) {
+ public void onActiveEnd(MouseUpEvent event, ActiveStyleHandler handler) {
// TODO Auto-generated method stub
}
+
+
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialCreatorTopicView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialCreatorTopicView.java Wed Jul 6 13:36:01 2011 (r572)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialCreatorTopicView.java Thu Jul 7 00:58:04 2011 (r573)
@@ -422,47 +422,47 @@
// TODO Auto-generated method stub
}
-
-
+
+
@Override
- public void onHoverStart(DomEvent event, HoverStyleHandler handler) {
+ public void onHoverStart(MouseOverEvent event, HoverStyleHandler handler) {
// TODO Auto-generated method stub
}
@Override
- public void onHoverEnd(DomEvent event, HoverStyleHandler handler) {
+ public void onHoverEnd(MouseOutEvent event, HoverStyleHandler handler) {
// TODO Auto-generated method stub
}
@Override
- public void onFocusStart(DomEvent event, FocusStyleHandler handler) {
+ public void onFocusStart(FocusEvent event, FocusStyleHandler handler) {
// TODO Auto-generated method stub
}
@Override
- public void onFocusEnd(DomEvent event, FocusStyleHandler handler) {
+ public void onFocusEnd(BlurEvent event, FocusStyleHandler handler) {
// TODO Auto-generated method stub
}
@Override
- public void onActiveStart(DomEvent event, ActiveStyleHandler handler) {
+ public void onActiveStart(MouseDownEvent event, ActiveStyleHandler handler) {
// TODO Auto-generated method stub
}
@Override
- public void onActiveEnd(DomEvent event, ActiveStyleHandler handler) {
+ public void onActiveEnd(MouseUpEvent event, ActiveStyleHandler handler) {
// TODO Auto-generated method stub
}
-
+
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialEditorTopicView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialEditorTopicView.java Wed Jul 6 13:36:01 2011 (r572)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialEditorTopicView.java Thu Jul 7 00:58:04 2011 (r573)
@@ -424,49 +424,47 @@
// TODO Auto-generated method stub
}
-
@Override
- public void onHoverStart(DomEvent event, HoverStyleHandler handler) {
+ public void onHoverStart(MouseOverEvent event, HoverStyleHandler handler) {
// TODO Auto-generated method stub
}
@Override
- public void onHoverEnd(DomEvent event, HoverStyleHandler handler) {
+ public void onHoverEnd(MouseOutEvent event, HoverStyleHandler handler) {
// TODO Auto-generated method stub
}
@Override
- public void onFocusStart(DomEvent event, FocusStyleHandler handler) {
+ public void onFocusStart(FocusEvent event, FocusStyleHandler handler) {
// TODO Auto-generated method stub
}
@Override
- public void onFocusEnd(DomEvent event, FocusStyleHandler handler) {
+ public void onFocusEnd(BlurEvent event, FocusStyleHandler handler) {
// TODO Auto-generated method stub
}
@Override
- public void onActiveStart(DomEvent event, ActiveStyleHandler handler) {
+ public void onActiveStart(MouseDownEvent event, ActiveStyleHandler handler) {
// TODO Auto-generated method stub
}
@Override
- public void onActiveEnd(DomEvent event, ActiveStyleHandler handler) {
+ public void onActiveEnd(MouseUpEvent event, ActiveStyleHandler handler) {
// TODO Auto-generated method stub
}
-
-
+
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlView.java Wed Jul 6 13:36:01 2011 (r572)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlView.java Thu Jul 7 00:58:04 2011 (r573)
@@ -80,60 +80,6 @@
}
- // registers a click handler to all sub-elements of this element
- @Override
- public MultipleHandlerRegistration addClickHandler(ClickHandler handler){
- // TODO: implement
- return null;
- }
-
-
- // registers a mouse-out handler to all sub-elements of this element
- @Override
- public MultipleHandlerRegistration addMouseOutHandler(MouseOutHandler handler){
- // TODO: implement
- return null;
- }
-
-
- // registers a mouse-over handler to all sub-elements of this element
- @Override
- public MultipleHandlerRegistration addMouseOverHandler(MouseOverHandler handler){
- // TODO: implement
- return null;
- }
-
-
- // registers a focus handler to all sub-elements of this element
- @Override
- public MultipleHandlerRegistration addFocusHandler(FocusHandler handler){
- // TODO: implement
- return null;
- }
-
-
- // registers a mouse-down handler to all sub-elements of this element
- @Override
- public MultipleHandlerRegistration addMouseDownHandler(MouseDownHandler handler){
- // TODO: implement
- return null;
- }
-
-
- // registers a mouse-up handler to all sub-elements of this element
- @Override
- public MultipleHandlerRegistration addMouseUpHandler(MouseUpHandler handler){
- // TODO: implement
- return null;
- }
-
-
- // registers a blur handler to all sub-elements of this element
- @Override
- public MultipleHandlerRegistration addBlurHandler(BlurHandler handler){
- // TODO: implement
- return null;
- }
1
0

[isidorus-cvs] r572 - in branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets: base text views
by lgiessmann@common-lisp.net 06 Jul '11
by lgiessmann@common-lisp.net 06 Jul '11
06 Jul '11
Author: lgiessmann
Date: Wed Jul 6 13:36:01 2011
New Revision: 572
Log:
gdl-frontend: Widgets: remove gdl:overlow from teh spec and impl
Modified:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlPsis.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlCreatorAssociationView.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlDefaultCreatorTopicView.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlEditorAssociationView.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialCreatorTopicView.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialEditorTopicView.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlView.java
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlPsis.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlPsis.java Wed Jul 6 12:33:40 2011 (r571)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlPsis.java Wed Jul 6 13:36:01 2011 (r572)
@@ -128,7 +128,6 @@
public final static String gdlClear = gdl + "clear";
public final static String gdlFloat = gdl + "float";
public final static String gdlBackgroundColor = gdl + "background-color";
- public final static String gdlOverflow = gdl + "overflow";
public final static String gdlOrdered = gdl + "ordered";
public final static String gdlListstyleType = gdl + "list-style-type";
public final static String gdlListStylePosition = gdl + "list-style-position";
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java Wed Jul 6 12:33:40 2011 (r571)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java Wed Jul 6 13:36:01 2011 (r572)
@@ -1085,37 +1085,6 @@
}
}
-
- // returns an Overflow instance that represents the overflow property of this element.
- // If a styleClass is set, only the corresponding value of the scoped occurrence is returned
- // null, null otherwise. If the styleClass is null and no occurrence was found, the default value for this
- // property is returned.
- public Overflow getOverflow(String styleClass) throws InvalidGdlSchemaException {
- Occurrence overflowOcc = null;
- if(styleClass != null){
- overflowOcc = getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlOverflow, styleClass);
- } else {
- overflowOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlOverflow);
- }
-
- if(overflowOcc == null && styleClass != null){
- return null;
- } else if(overflowOcc == null) {
- return Overflow.SCROLL;
- } else {
- String value = overflowOcc.getValue().toUpperCase();
- if(value.equals("VISIBLE")){
- return Overflow.VISIBLE;
- }else if(value.equals("HIDDEN")){
- return Overflow.HIDDEN;
- }else if(value.equals("SCROLL")){
- return Overflow.SCROLL;
- }else {
- throw new InvalidGdlSchemaException("overflow must be set to one of visible, hidden or scroll, but is " + overflowOcc.getValue());
- }
- }
- }
-
// sets the id property of this element by using the GWT DOM class
public void setId(String id){
@@ -1316,16 +1285,7 @@
// sets the background-color style property of this element by using the GWT DOM class
public abstract void setBackgroundColor(Widget widget, ColorValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
-
- // sets the width, height and overflow property of this element depending on the amount
- // of sub-elements
- protected abstract void adjustSize();
-
- // sets the overflow style property of this element by using the GWT DOM class
- public abstract void setOverflow(Widget widget, Overflow value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
-
-
// sets the passed css style porperty to the passed css value.
// If a styleClass is given, the style is applied to either active, hover or focus
protected void setCssProperty(String styleClass, String cssProperty, String cssValue)throws InvalidGdlSchemaException, ExecutionException{
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java Wed Jul 6 12:33:40 2011 (r571)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java Wed Jul 6 13:36:01 2011 (r572)
@@ -79,18 +79,14 @@
Topic gdlFocus = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.Scope.gdlFocus));
Topic gdlReadonly = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.OccurrenceType.gdlReadonly));
Topic gdlResize = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.OccurrenceType.gdlResize));
- Topic gdlOverflow = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.OccurrenceType.gdlOverflow));
Topic gdlTextDecoration = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.OccurrenceType.gdlTextDecoration));
tmpRepresentative.createOccurrence(gdlId, "ID_1", null);
- /*
tmpRepresentative.createOccurrence(gdlBackgroundColor, "red", null);
- */
tmpRepresentative.createOccurrence(gdlWidth, "300px", null);
tmpRepresentative.createOccurrence(gdlHeight, "300px", null);
tmpRepresentative.createOccurrence(gdlBorderRadius, "30px", null);
tmpRepresentative.createOccurrence(gdlBorderBottomRightRadius, "2%", null);
- /*
tmpRepresentative.createOccurrence(gdlPadding, "5px", null);
tmpRepresentative.createOccurrence(gdlPaddingLeft, "5%", null);
tmpRepresentative.createOccurrence(gdlCursor, CursorValue.HELP.getCssValue(), null);
@@ -103,7 +99,6 @@
tmpRepresentative.createOccurrence(gdlBorderWidth, "5px", null);
tmpRepresentative.createOccurrence(gdlReadonly, "false", null);
tmpRepresentative.createOccurrence(gdlResize, "both", null);
- tmpRepresentative.createOccurrence(gdlOverflow, "hidden", null);
tmpRepresentative.createOccurrence(gdlFontSize, "15pt", null);
tmpRepresentative.createOccurrence(gdlTextDecoration, "underline", null);
Occurrence bgcHover = tmpRepresentative.createOccurrence(gdlBackgroundColor, "green", null);
@@ -114,7 +109,6 @@
bgcFocus.addTheme(gdlFocus);
Occurrence fsHover = tmpRepresentative.createOccurrence(gdlFontSize, "25pt", null);
fsHover.addTheme(gdlHover);
- */
GdlText tmp = new GdlText(tmpRepresentative){};
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java Wed Jul 6 12:33:40 2011 (r571)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java Wed Jul 6 13:36:01 2011 (r572)
@@ -2,7 +2,6 @@
import java.util.ArrayList;
import com.google.gwt.dom.client.Style.FontStyle;
-import com.google.gwt.dom.client.Style.Overflow;
import com.google.gwt.dom.client.Style.VerticalAlign;
import com.google.gwt.event.dom.client.BlurHandler;
import com.google.gwt.event.dom.client.ClickHandler;
@@ -87,13 +86,12 @@
elem.addBlurHandler(fsHandler);
this.textElements.add(elem);
super.mainPanel.add(elem);
- this.adjustSize();
return elem;
}
// removes the passed element and all its handlers from the outer element
- protected void removeTextArea(TextArea elem){
+ protected void removeTextArea(TextArea elem) throws InvalidGdlSchemaException, ExecutionException{
for (Pair<TextArea, ArrayList<EventHandler>> item : this.eventHandlers) {
if(item.getFirst().equals(elem)){
this.eventHandlers.remove(item);
@@ -102,7 +100,6 @@
}
this.textElements.remove(elem);
elem.removeFromParent();
- this.adjustSize();
}
@@ -551,8 +548,6 @@
} else{
DOM.setStyleAttribute(widget.getElement(), "resize", value.getCssValue());
}
-
- // TODO: if resize == true => set width/height of the outer/container element after the resize operation
}
@@ -594,9 +589,6 @@
// rows is only treated if height is not set
if(heightOcc == null) ((TextArea)widget).setVisibleLines(value);
-
- // set the outer element (the panel to the correct size if it is not set
- //TODO: super.setHeight(new AutoNumUnitValue(this.textElement.getOffsetHeight() + "px"), null);
}
@@ -607,9 +599,6 @@
// cols is only treated if width is not set
if(widthOcc == null) DOM.setElementAttribute(widget.getElement(), "cols", String.valueOf(value));
-
- // set the outer element (the panel to the correct size if it is not set
- //TODO: super.setWidth(new AutoNumUnitValue(this.textElement.getOffsetWidth() + "px"), null);
}
@@ -921,11 +910,6 @@
super.setCssProperty(styleClass, "verticalAlign", value.getCssName());
}
}
-
-
- public void setOverflow(Widget widget, Overflow value, String styleClass)throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "overflow", value.getCssName());
- }
public void setGdlStyle(Widget widget) throws InvalidGdlSchemaException, ExecutionException {
@@ -938,9 +922,7 @@
this.setTextType(this.getTextType());
this.setRows(widget, this.getRows());
this.setCols(widget, this.getCols());
-
- this.setOverflow(widget, this.getOverflow(styleClass), styleClass);
-
+
this.setVerticalAlign(widget, this.getVerticalAlign(styleClass), styleClass);
this.setMargin(widget, this.getMargin(styleClass), styleClass);
@@ -1008,32 +990,8 @@
this.setGdlStyle((Widget)item);
}
}
-
- this.adjustSize();
- }
-
-
- // resets the size of this element depending on the amount of inner sub-elements
- @Override
- protected void adjustSize(){
-
-
-
- // if width is not set => auto
- // if width is set => offset width of the biggest sub-elements || width of sub-elements
- // if min-width is not set => auto
- // if min-width is set => offset width of the biggest sub-elements || min-width of sub-elements
- // if max-width is not set => auto
- // if max-width is set => offset width of the biggest sub-elements || max-width of sub-elements
-
-
-
-
-
- // TODO: set overflow of the element
}
-
// registers a passed mouse down handler to each text element of this item
@Override
public MultipleHandlerRegistration addMouseDownHandler(MouseDownHandler handler){
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlCreatorAssociationView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlCreatorAssociationView.java Wed Jul 6 12:33:40 2011 (r571)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlCreatorAssociationView.java Wed Jul 6 13:36:01 2011 (r572)
@@ -385,10 +385,6 @@
}
- @Override
- protected void adjustSize() {
- // ignore this method, since all instances of gdl:View have a static size
- }
@Override
public void onHoverStart(DomEvent event, HoverStyleHandler handler) {
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlDefaultCreatorTopicView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlDefaultCreatorTopicView.java Wed Jul 6 12:33:40 2011 (r571)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlDefaultCreatorTopicView.java Wed Jul 6 13:36:01 2011 (r572)
@@ -421,11 +421,6 @@
}
- @Override
- protected void adjustSize() {
- // ignore this method, since all instances of gdl:View have a static size
- }
-
@Override
public void onHoverStart(DomEvent event, HoverStyleHandler handler) {
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlEditorAssociationView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlEditorAssociationView.java Wed Jul 6 12:33:40 2011 (r571)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlEditorAssociationView.java Wed Jul 6 13:36:01 2011 (r572)
@@ -423,11 +423,6 @@
}
- @Override
- protected void adjustSize() {
- // ignore this method, since all instances of gdl:View have a static size
- }
-
@Override
public void onHoverStart(DomEvent event, HoverStyleHandler handler) {
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialCreatorTopicView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialCreatorTopicView.java Wed Jul 6 12:33:40 2011 (r571)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialCreatorTopicView.java Wed Jul 6 13:36:01 2011 (r572)
@@ -425,12 +425,6 @@
@Override
- protected void adjustSize() {
- // ignore this method, since all instances of gdl:View have a static size
- }
-
-
- @Override
public void onHoverStart(DomEvent event, HoverStyleHandler handler) {
// TODO Auto-generated method stub
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialEditorTopicView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialEditorTopicView.java Wed Jul 6 12:33:40 2011 (r571)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialEditorTopicView.java Wed Jul 6 13:36:01 2011 (r572)
@@ -425,11 +425,6 @@
}
-
- @Override
- protected void adjustSize() {
- // ignore this method, since all instances of gdl:View have a static size
- }
@Override
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlView.java Wed Jul 6 12:33:40 2011 (r571)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlView.java Wed Jul 6 13:36:01 2011 (r572)
@@ -74,11 +74,6 @@
}
- @Override
- public void setOverflow(Widget widget, Overflow value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- // TODO: implement
- }
-
public void setContentOrientation(Widget widget, ContentOrientationValue value){
// do nothing - since all content elements are positioned vie the GDL positioning concept
1
0

[isidorus-cvs] r571 - in branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets: base text
by lgiessmann@common-lisp.net 06 Jul '11
by lgiessmann@common-lisp.net 06 Jul '11
06 Jul '11
Author: lgiessmann
Date: Wed Jul 6 12:33:40 2011
New Revision: 571
Log:
gdl-frontend: Widgets: fixed a bug when applying the readonly property
Modified:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java Wed Jul 6 11:55:37 2011 (r570)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java Wed Jul 6 12:33:40 2011 (r571)
@@ -82,13 +82,15 @@
Topic gdlOverflow = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.OccurrenceType.gdlOverflow));
Topic gdlTextDecoration = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.OccurrenceType.gdlTextDecoration));
-
- tmpRepresentative.createOccurrence(gdlBackgroundColor, "red", null);
tmpRepresentative.createOccurrence(gdlId, "ID_1", null);
+ /*
+ tmpRepresentative.createOccurrence(gdlBackgroundColor, "red", null);
+ */
tmpRepresentative.createOccurrence(gdlWidth, "300px", null);
tmpRepresentative.createOccurrence(gdlHeight, "300px", null);
tmpRepresentative.createOccurrence(gdlBorderRadius, "30px", null);
tmpRepresentative.createOccurrence(gdlBorderBottomRightRadius, "2%", null);
+ /*
tmpRepresentative.createOccurrence(gdlPadding, "5px", null);
tmpRepresentative.createOccurrence(gdlPaddingLeft, "5%", null);
tmpRepresentative.createOccurrence(gdlCursor, CursorValue.HELP.getCssValue(), null);
@@ -112,7 +114,7 @@
bgcFocus.addTheme(gdlFocus);
Occurrence fsHover = tmpRepresentative.createOccurrence(gdlFontSize, "25pt", null);
fsHover.addTheme(gdlHover);
-
+ */
GdlText tmp = new GdlText(tmpRepresentative){};
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java Wed Jul 6 11:55:37 2011 (r570)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java Wed Jul 6 12:33:40 2011 (r571)
@@ -545,11 +545,11 @@
// sets the resize style property.
// If gdl:readonly is set to true, this property is set to none, i.e. the passed value is ignored.
// IF gdl:readonly is set to false, this property is set to the passed argument.
- public void setResize(ResizeValue value) throws InvalidGdlSchemaException, ExecutionException{
+ public void setResize(Widget widget, ResizeValue value) throws InvalidGdlSchemaException, ExecutionException{
if(value == null || getReadonly() == true){
- for (TextArea elem : this.textElements) this.setCssProperty(elem, null, "resize", "none");
+ DOM.setStyleAttribute(widget.getElement(), "resize", "none");
} else{
- for (TextArea elem : this.textElements) this.setCssProperty(elem, null, "resize", value.getCssValue());
+ DOM.setStyleAttribute(widget.getElement(), "resize", value.getCssValue());
}
// TODO: if resize == true => set width/height of the outer/container element after the resize operation
@@ -557,8 +557,8 @@
// sets the readonly property of this element's text are element
- public void setReadonly(boolean value){
- for (TextArea item : this.textElements) item.setReadOnly(value);
+ public void setReadonly(Widget widget, boolean value){
+ ((TextArea)widget).setReadOnly(value);
}
@@ -588,12 +588,12 @@
// sets the rows property if gdl:width is not set
- public void setRows(int value) throws InvalidGdlSchemaException, ExecutionException {
+ public void setRows(Widget widget, int value) throws InvalidGdlSchemaException, ExecutionException {
if(value < 0) throw new InvalidGdlSchemaException("The occurrence " + GdlPsis.OccurrenceType.gdlRows + " must be set to a positive integer, but is \"" + value + "\"");
Occurrence heightOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlHeight);
// rows is only treated if height is not set
- if(heightOcc == null) this.setRows(value);
+ if(heightOcc == null) ((TextArea)widget).setVisibleLines(value);
// set the outer element (the panel to the correct size if it is not set
//TODO: super.setHeight(new AutoNumUnitValue(this.textElement.getOffsetHeight() + "px"), null);
@@ -601,12 +601,12 @@
// sets the cols property if gdl:height is not set
- public void setCols(int value) throws InvalidGdlSchemaException, ExecutionException {
+ public void setCols(Widget widget, int value) throws InvalidGdlSchemaException, ExecutionException {
if(value < 0) throw new InvalidGdlSchemaException("The occurrence " + GdlPsis.OccurrenceType.gdlRows + " must be set to a positive integer, but is \"" + value + "\"");
Occurrence widthOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlWidth);
// cols is only treated if width is not set
- if(widthOcc == null) this.setCols(value);
+ if(widthOcc == null) DOM.setElementAttribute(widget.getElement(), "cols", String.valueOf(value));
// set the outer element (the panel to the correct size if it is not set
//TODO: super.setWidth(new AutoNumUnitValue(this.textElement.getOffsetWidth() + "px"), null);
@@ -929,15 +929,16 @@
public void setGdlStyle(Widget widget) throws InvalidGdlSchemaException, ExecutionException {
- this.setReadonly(this.getReadonly());
- this.setResize(this.getResize());
- this.setTextType(this.getTextType());
- this.setRows(this.getRows());
- this.setCols(this.getCols());
this.setContentOrientation(widget, this.getContentOrientation());
String[] styleClasses = new String[]{null, GdlPsis.Scope.gdlActive, GdlPsis.Scope.gdlFocus, GdlPsis.Scope.gdlHover};
for (String styleClass : styleClasses) {
+ this.setReadonly(widget, this.getReadonly());
+ this.setResize(widget, this.getResize());
+ this.setTextType(this.getTextType());
+ this.setRows(widget, this.getRows());
+ this.setCols(widget, this.getCols());
+
this.setOverflow(widget, this.getOverflow(styleClass), styleClass);
this.setVerticalAlign(widget, this.getVerticalAlign(styleClass), styleClass);
@@ -1015,7 +1016,21 @@
// resets the size of this element depending on the amount of inner sub-elements
@Override
protected void adjustSize(){
- // TODO: implement => width, height, overflow of the mainpanel
+
+
+
+ // if width is not set => auto
+ // if width is set => offset width of the biggest sub-elements || width of sub-elements
+ // if min-width is not set => auto
+ // if min-width is set => offset width of the biggest sub-elements || min-width of sub-elements
+ // if max-width is not set => auto
+ // if max-width is set => offset width of the biggest sub-elements || max-width of sub-elements
+
+
+
+
+
+ // TODO: set overflow of the element
}
1
0

[isidorus-cvs] r570 - in branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets: environment text
by lgiessmann@common-lisp.net 06 Jul '11
by lgiessmann@common-lisp.net 06 Jul '11
06 Jul '11
Author: lgiessmann
Date: Wed Jul 6 11:55:37 2011
New Revision: 570
Log:
gdl-frontend: Widgets: fixed a bug when applying the styles for CSS active, hover and focus
Modified:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/environment/FocusStyleHandler.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/environment/FocusStyleHandler.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/environment/FocusStyleHandler.java Wed Jul 6 11:09:04 2011 (r569)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/environment/FocusStyleHandler.java Wed Jul 6 11:55:37 2011 (r570)
@@ -5,7 +5,7 @@
import com.google.gwt.event.dom.client.BlurHandler;
import com.google.gwt.event.dom.client.FocusEvent;
import com.google.gwt.event.dom.client.FocusHandler;
-import com.google.gwt.user.client.ui.Widget;
+
public class FocusStyleHandler implements FocusHandler, BlurHandler{
GdlVisibleObject widget = null;
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java Wed Jul 6 11:09:04 2011 (r569)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java Wed Jul 6 11:55:37 2011 (r570)
@@ -4,21 +4,15 @@
import com.google.gwt.dom.client.Style.FontStyle;
import com.google.gwt.dom.client.Style.Overflow;
import com.google.gwt.dom.client.Style.VerticalAlign;
-import com.google.gwt.event.dom.client.BlurEvent;
import com.google.gwt.event.dom.client.BlurHandler;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.DomEvent;
-import com.google.gwt.event.dom.client.FocusEvent;
import com.google.gwt.event.dom.client.FocusHandler;
import com.google.gwt.event.dom.client.KeyPressEvent;
import com.google.gwt.event.dom.client.KeyPressHandler;
-import com.google.gwt.event.dom.client.MouseDownEvent;
import com.google.gwt.event.dom.client.MouseDownHandler;
-import com.google.gwt.event.dom.client.MouseOutEvent;
import com.google.gwt.event.dom.client.MouseOutHandler;
-import com.google.gwt.event.dom.client.MouseOverEvent;
import com.google.gwt.event.dom.client.MouseOverHandler;
-import com.google.gwt.event.dom.client.MouseUpEvent;
import com.google.gwt.event.dom.client.MouseUpHandler;
import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.HandlerRegistration;
@@ -72,7 +66,7 @@
public GdlText(Topic tmRepresentative) throws InvalidGdlSchemaException, ExecutionException{
super(tmRepresentative);
// TODO: create a text element for each TM-elem
- this.createNewTextArea();
+ this.createNewTextArea(); // TODO: remove only for debugging
}
@@ -1109,7 +1103,6 @@
for (TextArea item : this.textElements) {
results.add(item.getValue());
}
-
return results;
}
@@ -1174,6 +1167,30 @@
}
+ // applies the styles bound to hover and the passed element
+ private void onHoverStart(Widget widget){
+ for (Pair<String, String> elem : this.hoverCssNamesAndStyles) {
+ DOM.setStyleAttribute(widget.getElement(), elem.getFirst(), elem.getSecond());
+ }
+ }
+
+
+ // applies the styles bound to acitve and the passed element
+ private void onActiveStart(Widget widget){
+ for (Pair<String, String> elem : this.activeCssNamesAndStyles) {
+ DOM.setStyleAttribute(widget.getElement(), elem.getFirst(), elem.getSecond());
+ }
+ }
+
+
+ // applies the styles bound to focus and the passed element
+ private void onFocusStart(Widget widget){
+ for (Pair<String, String> elem : this.focusCssNamesAndStyles) {
+ DOM.setStyleAttribute(widget.getElement(), elem.getFirst(), elem.getSecond());
+ }
+ }
+
+
// some handler for applying the css style bound to the pseudo classes hover, active and focus
@Override
public void onHoverStart(@SuppressWarnings("rawtypes") DomEvent event, HoverStyleHandler handler) {
@@ -1194,8 +1211,8 @@
if(lastHandler == null){
this.setGdlStyle(source);
}else {
- if(lastHandler.getClass().equals(ActiveStyleHandler.class)) this.onActiveStart(event, null);
- else this.onFocusStart(null, null);
+ if(lastHandler.getClass().equals(ActiveStyleHandler.class)) this.onActiveStart(source);
+ else this.onFocusStart(source);
}
}catch(Exception e){
Window.alert("could not apply the default CSS style >> " + e.getClass() + " >> " + e.getMessage());
@@ -1223,8 +1240,8 @@
if(lastHandler == null){
this.setGdlStyle(source);
}else {
- if(lastHandler.getClass().equals(ActiveStyleHandler.class)) this.onActiveStart(event, null);
- else this.onHoverStart(null, null);
+ if(lastHandler.getClass().equals(ActiveStyleHandler.class)) this.onActiveStart(source);
+ else this.onHoverStart(source);
}
}catch(Exception e){
Window.alert("could not apply the default CSS style >> " + e.getClass() + " >> " + e.getMessage());
@@ -1251,8 +1268,8 @@
if(lastHandler == null){
this.setGdlStyle(source);
}else {
- if(lastHandler.getClass().equals(HoverStyleHandler.class)) this.onHoverStart(event, null);
- else this.onFocusStart(null, null);
+ if(lastHandler.getClass().equals(HoverStyleHandler.class)) this.onHoverStart(source);
+ else this.onFocusStart(source);
}
}catch(Exception e){
Window.alert("could not apply the default CSS style >> " + e.getClass() + " >> " + e.getMessage());
1
0

[isidorus-cvs] r569 - in branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets: base environment text views
by lgiessmann@common-lisp.net 06 Jul '11
by lgiessmann@common-lisp.net 06 Jul '11
06 Jul '11
Author: lgiessmann
Date: Wed Jul 6 11:09:04 2011
New Revision: 569
Log:
gdl-frontend: Widgets: changed the behavior of registering the event handlers for the realisation of the css pseudo classes active, hover and focus
Deleted:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/environment/CssStyleHandler.java
Modified:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/environment/ActiveStyleHandler.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/environment/FocusStyleHandler.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/environment/HoverStyleHandler.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlCreatorAssociationView.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlDefaultCreatorTopicView.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlEditorAssociationView.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialCreatorTopicView.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialEditorTopicView.java
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java Wed Jul 6 07:41:45 2011 (r568)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java Wed Jul 6 11:09:04 2011 (r569)
@@ -4,9 +4,13 @@
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Occurrence;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMap;
+import us.isidor.gdl.anaToMia.Widgets.environment.ActiveStyleHandler;
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
+import us.isidor.gdl.anaToMia.Widgets.environment.FocusStyleHandler;
+import us.isidor.gdl.anaToMia.Widgets.environment.HoverStyleHandler;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
import us.isidor.gdl.anaToMia.Widgets.environment.MultipleHandlerRegistration;
+import us.isidor.gdl.anaToMia.Widgets.environment.Pair;
import us.isidor.gdl.anaToMia.Widgets.values.AutoNumUnitValue;
import us.isidor.gdl.anaToMia.Widgets.values.AutoNumValue;
import us.isidor.gdl.anaToMia.Widgets.values.BorderStyleValue;
@@ -21,8 +25,11 @@
import com.google.gwt.dom.client.Style.Float;
import com.google.gwt.dom.client.Style.Overflow;
import com.google.gwt.dom.client.Style.VerticalAlign;
+import com.google.gwt.event.dom.client.BlurEvent;
import com.google.gwt.event.dom.client.BlurHandler;
import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.event.dom.client.DomEvent;
+import com.google.gwt.event.dom.client.FocusEvent;
import com.google.gwt.event.dom.client.FocusHandler;
import com.google.gwt.event.dom.client.HasBlurHandlers;
import com.google.gwt.event.dom.client.HasClickHandlers;
@@ -31,9 +38,13 @@
import com.google.gwt.event.dom.client.HasMouseOutHandlers;
import com.google.gwt.event.dom.client.HasMouseOverHandlers;
import com.google.gwt.event.dom.client.HasMouseUpHandlers;
+import com.google.gwt.event.dom.client.MouseDownEvent;
import com.google.gwt.event.dom.client.MouseDownHandler;
+import com.google.gwt.event.dom.client.MouseOutEvent;
import com.google.gwt.event.dom.client.MouseOutHandler;
+import com.google.gwt.event.dom.client.MouseOverEvent;
import com.google.gwt.event.dom.client.MouseOverHandler;
+import com.google.gwt.event.dom.client.MouseUpEvent;
import com.google.gwt.event.dom.client.MouseUpHandler;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.ui.AbsolutePanel;
@@ -45,7 +56,10 @@
protected AbsolutePanel mainPanel = new AbsolutePanel();
protected Topic tmRepresentative = null;
protected TopicMap tm = null;
-
+ protected ArrayList<Pair<String, String>> activeCssNamesAndStyles = new ArrayList<Pair<String,String>>();
+ protected ArrayList<Pair<String, String>> focusCssNamesAndStyles = new ArrayList<Pair<String,String>>();
+ protected ArrayList<Pair<String, String>> hoverCssNamesAndStyles = new ArrayList<Pair<String,String>>();
+
// some constructors
protected GdlVisibleObject() {
@@ -229,8 +243,6 @@
}
-
-
// returns a VerticalAlign instance of a gdl:vertical-align occurrence
// or the default value for this property if no gdl:vertical-align occurrence
// is available. The styleClass attribute is used as scope for expressing
@@ -1322,14 +1334,11 @@
if(styleClass == null){
DOM.setStyleAttribute(this.getElement(), cssProperty, cssValue);
} else if(styleClass.equals(GdlPsis.Scope.gdlActive)){
- //this.activeStyleHandler.addCssStyle(new Pair<String, String>(cssProperty, cssValue));
- // Ignore is only set in the inheriting classes
+ this.activeCssNamesAndStyles.add(new Pair<String, String>(cssProperty, cssValue));
} else if(styleClass.equals(GdlPsis.Scope.gdlFocus)){
- //this.focusStyleHandler.addCssStyle(new Pair<String, String>(cssProperty, cssValue));
- // Ignore is only set in the inheriting classes
+ this.focusCssNamesAndStyles.add(new Pair<String, String>(cssProperty, cssValue));
} else if (styleClass.equals(GdlPsis.Scope.gdlHover)){
- //this.hoverStyleHandler.addCssStyle(new Pair<String, String>(cssProperty, cssValue));
- // Ignore is only set in the inheriting classes
+ this.hoverCssNamesAndStyles.add(new Pair<String, String>(cssProperty, cssValue));
} else {
String values = GdlPsis.Scope.gdlActive + ", " + GdlPsis.Scope.gdlFocus + ", " + GdlPsis.Scope.gdlHover;
throw new InvalidGdlSchemaException("GDL defines only the style classes " + values + ", but found " + styleClass);
@@ -1378,5 +1387,29 @@
// registers a blur handler to all sub-elements of this element
@Override
- public abstract MultipleHandlerRegistration addBlurHandler(BlurHandler handler);
+ public abstract MultipleHandlerRegistration addBlurHandler(BlurHandler handler);
+
+
+ // shall be called, if a sub-element of this element is hovered
+ public abstract void onHoverStart(@SuppressWarnings("rawtypes") DomEvent event, HoverStyleHandler handler);
+
+
+ // shall be called, if a sub-element of this element is hovered
+ public abstract void onHoverEnd(@SuppressWarnings("rawtypes") DomEvent event, HoverStyleHandler handler);
+
+
+ // shall be called, if a sub-element of this element is focused
+ public abstract void onFocusStart(@SuppressWarnings("rawtypes") DomEvent event, FocusStyleHandler handler);
+
+
+ // shall be called, if a sub-element of this element is focused
+ public abstract void onFocusEnd(@SuppressWarnings("rawtypes") DomEvent event, FocusStyleHandler handler);
+
+
+ // shall be called, if a sub-element of this element is focused
+ public abstract void onActiveStart(@SuppressWarnings("rawtypes") DomEvent event, ActiveStyleHandler handler);
+
+
+ // shall be called, if a sub-element of this element is focused
+ public abstract void onActiveEnd(@SuppressWarnings("rawtypes") DomEvent event, ActiveStyleHandler handler);
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java Wed Jul 6 07:41:45 2011 (r568)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java Wed Jul 6 11:09:04 2011 (r569)
@@ -104,14 +104,14 @@
tmpRepresentative.createOccurrence(gdlOverflow, "hidden", null);
tmpRepresentative.createOccurrence(gdlFontSize, "15pt", null);
tmpRepresentative.createOccurrence(gdlTextDecoration, "underline", null);
- //Occurrence bgcHover = tmpRepresentative.createOccurrence(gdlBackgroundColor, "green", null);
- //bgcHover.addTheme(gdlHover);
- //Occurrence bgcActive = tmpRepresentative.createOccurrence(gdlBackgroundColor, "purple", null);
- //bgcActive.addTheme(gdlActive);
- //Occurrence bgcFocus = tmpRepresentative.createOccurrence(gdlBackgroundColor, "silver", null);
- //bgcFocus.addTheme(gdlFocus);
- //Occurrence fsHover = tmpRepresentative.createOccurrence(gdlFontSize, "25pt", null);
- //fsHover.addTheme(gdlHover);
+ Occurrence bgcHover = tmpRepresentative.createOccurrence(gdlBackgroundColor, "green", null);
+ bgcHover.addTheme(gdlHover);
+ Occurrence bgcActive = tmpRepresentative.createOccurrence(gdlBackgroundColor, "purple", null);
+ bgcActive.addTheme(gdlActive);
+ Occurrence bgcFocus = tmpRepresentative.createOccurrence(gdlBackgroundColor, "silver", null);
+ bgcFocus.addTheme(gdlFocus);
+ Occurrence fsHover = tmpRepresentative.createOccurrence(gdlFontSize, "25pt", null);
+ fsHover.addTheme(gdlHover);
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/environment/ActiveStyleHandler.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/environment/ActiveStyleHandler.java Wed Jul 6 07:41:45 2011 (r568)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/environment/ActiveStyleHandler.java Wed Jul 6 11:09:04 2011 (r569)
@@ -1,28 +1,30 @@
package us.isidor.gdl.anaToMia.Widgets.environment;
import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject;
-
import com.google.gwt.event.dom.client.MouseDownEvent;
import com.google.gwt.event.dom.client.MouseDownHandler;
import com.google.gwt.event.dom.client.MouseUpEvent;
import com.google.gwt.event.dom.client.MouseUpHandler;
+import com.google.gwt.user.client.ui.Widget;
-public class ActiveStyleHandler extends CssStyleHandler implements MouseDownHandler, MouseUpHandler{
- public ActiveStyleHandler() {
- super();
- }
+
+
+public class ActiveStyleHandler implements MouseDownHandler, MouseUpHandler{
+ GdlVisibleObject widget = null;
+ public ActiveStyleHandler(GdlVisibleObject widget) {
+ this.widget = widget;
+ }
+
@Override
public void onMouseUp(MouseUpEvent event) {
- GdlVisibleObject widget = (GdlVisibleObject)event.getSource();
- super.unsetStyles(widget);
+ widget.onActiveEnd(event, this);
}
@Override
public void onMouseDown(MouseDownEvent event) {
- GdlVisibleObject widget = (GdlVisibleObject)event.getSource();
- super.setStyles(widget);
+ widget.onActiveStart(event, this);
}
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/environment/FocusStyleHandler.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/environment/FocusStyleHandler.java Wed Jul 6 07:41:45 2011 (r568)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/environment/FocusStyleHandler.java Wed Jul 6 11:09:04 2011 (r569)
@@ -1,29 +1,29 @@
package us.isidor.gdl.anaToMia.Widgets.environment;
import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject;
-import us.isidor.gdl.anaToMia.Widgets.environment.CssStyleHandler;
import com.google.gwt.event.dom.client.BlurEvent;
import com.google.gwt.event.dom.client.BlurHandler;
import com.google.gwt.event.dom.client.FocusEvent;
import com.google.gwt.event.dom.client.FocusHandler;
+import com.google.gwt.user.client.ui.Widget;
-public class FocusStyleHandler extends CssStyleHandler implements FocusHandler, BlurHandler{
+public class FocusStyleHandler implements FocusHandler, BlurHandler{
+ GdlVisibleObject widget = null;
+
// this class is used to set the style of focused elements
- public FocusStyleHandler() {
- super();
+ public FocusStyleHandler(GdlVisibleObject widget) {
+ this.widget = widget;
}
-
+
@Override
public void onFocus(FocusEvent event) {
- GdlVisibleObject widget = (GdlVisibleObject)event.getSource();
- super.setStyles(widget);;
+ widget.onFocusStart(event, this);
}
@Override
public void onBlur(BlurEvent event) {
- GdlVisibleObject widget = (GdlVisibleObject)event.getSource();
- super.unsetStyles(widget);
+ widget.onFocusEnd(event, this);
}
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/environment/HoverStyleHandler.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/environment/HoverStyleHandler.java Wed Jul 6 07:41:45 2011 (r568)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/environment/HoverStyleHandler.java Wed Jul 6 11:09:04 2011 (r569)
@@ -1,28 +1,30 @@
package us.isidor.gdl.anaToMia.Widgets.environment;
-import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject;
+import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject;
import com.google.gwt.event.dom.client.MouseOutEvent;
import com.google.gwt.event.dom.client.MouseOutHandler;
import com.google.gwt.event.dom.client.MouseOverEvent;
import com.google.gwt.event.dom.client.MouseOverHandler;
-public class HoverStyleHandler extends CssStyleHandler implements MouseOverHandler, MouseOutHandler{
- public HoverStyleHandler() {
- super();
- }
+
+public class HoverStyleHandler implements MouseOverHandler, MouseOutHandler{
+ GdlVisibleObject widget = null;
+ public HoverStyleHandler(GdlVisibleObject widget){
+ this.widget = widget;
+ }
+
+
@Override
public void onMouseOut(MouseOutEvent event) {
- GdlVisibleObject widget = (GdlVisibleObject)event.getSource();
- super.unsetStyles(widget);
+ widget.onHoverEnd(event, this);
}
@Override
public void onMouseOver(MouseOverEvent event) {
- GdlVisibleObject widget = (GdlVisibleObject)event.getSource();
- super.setStyles(widget);
+ widget.onHoverStart(event, this);
}
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java Wed Jul 6 07:41:45 2011 (r568)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java Wed Jul 6 11:09:04 2011 (r569)
@@ -4,17 +4,26 @@
import com.google.gwt.dom.client.Style.FontStyle;
import com.google.gwt.dom.client.Style.Overflow;
import com.google.gwt.dom.client.Style.VerticalAlign;
+import com.google.gwt.event.dom.client.BlurEvent;
import com.google.gwt.event.dom.client.BlurHandler;
import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.event.dom.client.DomEvent;
+import com.google.gwt.event.dom.client.FocusEvent;
import com.google.gwt.event.dom.client.FocusHandler;
import com.google.gwt.event.dom.client.KeyPressEvent;
import com.google.gwt.event.dom.client.KeyPressHandler;
+import com.google.gwt.event.dom.client.MouseDownEvent;
import com.google.gwt.event.dom.client.MouseDownHandler;
+import com.google.gwt.event.dom.client.MouseOutEvent;
import com.google.gwt.event.dom.client.MouseOutHandler;
+import com.google.gwt.event.dom.client.MouseOverEvent;
import com.google.gwt.event.dom.client.MouseOverHandler;
+import com.google.gwt.event.dom.client.MouseUpEvent;
import com.google.gwt.event.dom.client.MouseUpHandler;
+import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.TextArea;
import com.google.gwt.user.client.ui.Widget;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Occurrence;
@@ -22,7 +31,10 @@
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.environment.ActiveStyleHandler;
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
+import us.isidor.gdl.anaToMia.Widgets.environment.FocusStyleHandler;
+import us.isidor.gdl.anaToMia.Widgets.environment.HoverStyleHandler;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
import us.isidor.gdl.anaToMia.Widgets.environment.MultipleHandlerRegistration;
import us.isidor.gdl.anaToMia.Widgets.environment.Pair;
@@ -48,9 +60,7 @@
protected ArrayList<TextArea> textElements = new ArrayList<TextArea>();
protected ArrayList<PasswordKeyPressHandler> passwordKeyPressHandler = null;
protected ArrayList<HandlerRegistration> passwordKeyPressRegistrations = null;
- // TODO: protected ArrayList<Pair<TextArea, ActiveStyleHandler>> activeStyleHandler = new ArrayList<Pair<TextArea,ActiveStyleHandler>>();
- // TODO: protected ArrayList<Pair<TextArea, FocusStyleHandler>> focusStyleHandler = new ArrayList<Pair<TextArea,FocusStyleHandler>>();
- // TODO: protected ArrayList<Pair<TextArea, HoverStyleHandler>> hoverStyleHandler = new ArrayList<Pair<TextArea,HoverStyleHandler>>();
+ protected ArrayList<Pair<TextArea, ArrayList<EventHandler>>> eventHandlers = new ArrayList<Pair<TextArea, ArrayList<EventHandler>>>();
// some constructors
@@ -71,9 +81,18 @@
protected TextArea createNewTextArea() throws InvalidGdlSchemaException, ExecutionException {
TextArea elem = new TextArea();
DOM.setElementAttribute(elem.getElement(), "id", this.getId() + "__GDL_" + this.textElements.size());
+ this.setGdlStyle((Widget)elem);
+ ActiveStyleHandler asHandler = new ActiveStyleHandler(this);
+ FocusStyleHandler fsHandler = new FocusStyleHandler(this);
+ HoverStyleHandler hsHandler = new HoverStyleHandler(this);
+ elem.addMouseDownHandler(asHandler);
+ elem.addMouseUpHandler(asHandler);
+ elem.addMouseOverHandler(hsHandler);
+ elem.addMouseOutHandler(hsHandler);
+ elem.addFocusHandler(fsHandler);
+ elem.addBlurHandler(fsHandler);
this.textElements.add(elem);
super.mainPanel.add(elem);
- this.setGdlStyle((Widget)elem);
this.adjustSize();
return elem;
}
@@ -81,27 +100,12 @@
// removes the passed element and all its handlers from the outer element
protected void removeTextArea(TextArea elem){
- // TODO: implement
- /*for (Pair<TextArea, ActiveStyleHandler> item : this.activeStyleHandler) {
- if(item.getFirst().equals(elem)){
- this.activeStyleHandler.remove(item);
- break;
- }
- }
- for (Pair<TextArea, FocusStyleHandler> item : this.focusStyleHandler) {
+ for (Pair<TextArea, ArrayList<EventHandler>> item : this.eventHandlers) {
if(item.getFirst().equals(elem)){
- this.focusStyleHandler.remove(item);
+ this.eventHandlers.remove(item);
break;
}
}
- for (Pair<TextArea, HoverStyleHandler> item : this.hoverStyleHandler) {
- if(item.getFirst().equals(elem)){
- this.hoverStyleHandler.remove(item);
- break;
- }
- }
- */
-
this.textElements.remove(elem);
elem.removeFromParent();
this.adjustSize();
@@ -532,31 +536,11 @@
if(styleClass == null){
DOM.setStyleAttribute(elem.getElement(), cssProperty, cssValue);
} else if(styleClass.equals(GdlPsis.Scope.gdlActive)){
- /* TODO: implement
- if(item.getFirst().equals(elem)){
- item.getSecond().addCssStyle(new Pair<String, String>(cssProperty, cssValue));
- break;
- }
- }
- */
+ super.activeCssNamesAndStyles.add(new Pair<String, String>(cssProperty, cssValue));
} else if(styleClass.equals(GdlPsis.Scope.gdlFocus)){
- /* TODO: implement
- for (Pair<TextArea, FocusStyleHandler> item : this.focusStyleHandler) {
- if(item.getFirst().equals(elem)){
- item.getSecond().addCssStyle(new Pair<String, String>(cssProperty, cssValue));
- break;
- }
- }
- */
+ super.focusCssNamesAndStyles.add(new Pair<String, String>(cssProperty, cssValue));
} else if (styleClass.equals(GdlPsis.Scope.gdlHover)){
- /* TODO: implement
- for (Pair<TextArea, HoverStyleHandler> item : this.hoverStyleHandler) {
- if(item.getFirst().equals(elem)){
- item.getSecond().addCssStyle(new Pair<String, String>(cssProperty, cssValue));
- break;
- }
- }
- */
+ super.hoverCssNamesAndStyles.add(new Pair<String, String>(cssProperty, cssValue));
} else {
String values = GdlPsis.Scope.gdlActive + ", " + GdlPsis.Scope.gdlFocus + ", " + GdlPsis.Scope.gdlHover;
throw new InvalidGdlSchemaException("GDL defines only the style classes " + values + ", but found " + styleClass);
@@ -1142,6 +1126,138 @@
// TODO: implement
return false;
}
+
+
+ // adds the passed handler to the list eventHandlers
+ private void addEventHandler(TextArea elem, EventHandler handler){
+ if(handler == null || elem == null) return;
+
+ for (Pair<TextArea, ArrayList<EventHandler>> item : this.eventHandlers) {
+ if(item.getFirst().equals(elem)){
+ item.getSecond().add(handler);
+ return;
+ }
+ }
+ ArrayList<EventHandler> newHandlerList = new ArrayList<EventHandler>();
+ newHandlerList.add(handler);
+ this.eventHandlers.add(new Pair<TextArea, ArrayList<EventHandler>>(elem, newHandlerList));
+ }
+
+
+ // remove the passed handler of the list eventHandlers
+ private void removeEventHandler(TextArea elem, EventHandler handler){
+ for (Pair<TextArea, ArrayList<EventHandler>> item : this.eventHandlers) {
+ if(item.getFirst().equals(elem)){
+ for (EventHandler handlerItem : item.getSecond()) {
+ if(handlerItem.equals(handler)){
+ item.getSecond().remove(handlerItem);
+ return;
+ }
+ }
+ }
+ }
+ }
+
+
+ // returns the last handler bound to the passed element.
+ private EventHandler getLastHandler(TextArea elem){
+ for (Pair<TextArea, ArrayList<EventHandler>> item : this.eventHandlers) {
+ if(item.getFirst().equals(elem)){
+ int idx = item.getSecond().size() - 1;
+ if(idx >= 0){
+ return item.getSecond().get(idx);
+ }
+ }
+ }
+
+ return null;
+ }
+
+
+ // some handler for applying the css style bound to the pseudo classes hover, active and focus
+ @Override
+ public void onHoverStart(@SuppressWarnings("rawtypes") DomEvent event, HoverStyleHandler handler) {
+ TextArea source = (TextArea)event.getSource();
+ this.addEventHandler(source, handler);
+ for (Pair<String, String> elem : this.hoverCssNamesAndStyles) {
+ DOM.setStyleAttribute(source.getElement(), elem.getFirst(), elem.getSecond());
+ }
+ }
+
+
+ @Override
+ public void onHoverEnd(@SuppressWarnings("rawtypes") DomEvent event, HoverStyleHandler handler) {
+ try{
+ TextArea source = (TextArea)event.getSource();
+ this.removeEventHandler(source, handler);
+ EventHandler lastHandler = this.getLastHandler(source);
+ if(lastHandler == null){
+ this.setGdlStyle(source);
+ }else {
+ if(lastHandler.getClass().equals(ActiveStyleHandler.class)) this.onActiveStart(event, null);
+ else this.onFocusStart(null, null);
+ }
+ }catch(Exception e){
+ Window.alert("could not apply the default CSS style >> " + e.getClass() + " >> " + e.getMessage());
+ e.printStackTrace();
+ }
+ }
+
+
+ @Override
+ public void onFocusStart(@SuppressWarnings("rawtypes") DomEvent event, FocusStyleHandler handler) {
+ TextArea source = (TextArea)event.getSource();
+ this.addEventHandler(source, handler);
+ for (Pair<String, String> elem : this.focusCssNamesAndStyles) {
+ DOM.setStyleAttribute(source.getElement(), elem.getFirst(), elem.getSecond());
+ }
+ }
+
+
+ @Override
+ public void onFocusEnd(@SuppressWarnings("rawtypes") DomEvent event, FocusStyleHandler handler) {
+ try{
+ TextArea source = (TextArea)event.getSource();
+ this.removeEventHandler(source, handler);
+ EventHandler lastHandler = this.getLastHandler(source);
+ if(lastHandler == null){
+ this.setGdlStyle(source);
+ }else {
+ if(lastHandler.getClass().equals(ActiveStyleHandler.class)) this.onActiveStart(event, null);
+ else this.onHoverStart(null, null);
+ }
+ }catch(Exception e){
+ Window.alert("could not apply the default CSS style >> " + e.getClass() + " >> " + e.getMessage());
+ }
+ }
+
+
+ @Override
+ public void onActiveStart(@SuppressWarnings("rawtypes") DomEvent event, ActiveStyleHandler handler) {
+ TextArea source = (TextArea)event.getSource();
+ this.addEventHandler(source, handler);
+ for (Pair<String, String> elem : this.activeCssNamesAndStyles) {
+ DOM.setStyleAttribute(source.getElement(), elem.getFirst(), elem.getSecond());
+ }
+ }
+
+
+ @Override
+ public void onActiveEnd(@SuppressWarnings("rawtypes") DomEvent event, ActiveStyleHandler handler) {
+ try{
+ TextArea source = (TextArea)event.getSource();
+ this.removeEventHandler(source, handler);
+ EventHandler lastHandler = this.getLastHandler(source);
+ if(lastHandler == null){
+ this.setGdlStyle(source);
+ }else {
+ if(lastHandler.getClass().equals(HoverStyleHandler.class)) this.onHoverStart(event, null);
+ else this.onFocusStart(null, null);
+ }
+ }catch(Exception e){
+ Window.alert("could not apply the default CSS style >> " + e.getClass() + " >> " + e.getMessage());
+ }
+ }
// this class catches all keypress events and transforms the visible
@@ -1163,5 +1279,4 @@
return this.realValue;
}
}
-
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlCreatorAssociationView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlCreatorAssociationView.java Wed Jul 6 07:41:45 2011 (r568)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlCreatorAssociationView.java Wed Jul 6 11:09:04 2011 (r569)
@@ -2,7 +2,14 @@
import com.google.gwt.dom.client.Style.Float;
import com.google.gwt.dom.client.Style.Overflow;
+import com.google.gwt.event.dom.client.BlurEvent;
import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.event.dom.client.DomEvent;
+import com.google.gwt.event.dom.client.FocusEvent;
+import com.google.gwt.event.dom.client.MouseDownEvent;
+import com.google.gwt.event.dom.client.MouseOutEvent;
+import com.google.gwt.event.dom.client.MouseOverEvent;
+import com.google.gwt.event.dom.client.MouseUpEvent;
import com.google.gwt.user.client.ui.Widget;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Association;
@@ -10,7 +17,10 @@
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMap;
import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject;
+import us.isidor.gdl.anaToMia.Widgets.environment.ActiveStyleHandler;
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
+import us.isidor.gdl.anaToMia.Widgets.environment.FocusStyleHandler;
+import us.isidor.gdl.anaToMia.Widgets.environment.HoverStyleHandler;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
import us.isidor.gdl.anaToMia.Widgets.values.AbsoluteNumValue;
import us.isidor.gdl.anaToMia.Widgets.values.AutoNumUnitValue;
@@ -379,4 +389,41 @@
protected void adjustSize() {
// ignore this method, since all instances of gdl:View have a static size
}
+
+ @Override
+ public void onHoverStart(DomEvent event, HoverStyleHandler handler) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void onHoverEnd(DomEvent event, HoverStyleHandler handler) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void onFocusStart(DomEvent event, FocusStyleHandler handler) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void onFocusEnd(DomEvent event, FocusStyleHandler handler) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void onActiveStart(DomEvent event, ActiveStyleHandler handler) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void onActiveEnd(DomEvent event, ActiveStyleHandler handler) {
+ // TODO Auto-generated method stub
+
+ }
+
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlDefaultCreatorTopicView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlDefaultCreatorTopicView.java Wed Jul 6 07:41:45 2011 (r568)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlDefaultCreatorTopicView.java Wed Jul 6 11:09:04 2011 (r569)
@@ -1,11 +1,21 @@
package us.isidor.gdl.anaToMia.Widgets.views;
+import com.google.gwt.event.dom.client.BlurEvent;
import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.event.dom.client.DomEvent;
+import com.google.gwt.event.dom.client.FocusEvent;
+import com.google.gwt.event.dom.client.MouseDownEvent;
+import com.google.gwt.event.dom.client.MouseOutEvent;
+import com.google.gwt.event.dom.client.MouseOverEvent;
+import com.google.gwt.event.dom.client.MouseUpEvent;
import com.google.gwt.user.client.ui.Widget;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMap;
import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject;
+import us.isidor.gdl.anaToMia.Widgets.environment.ActiveStyleHandler;
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
+import us.isidor.gdl.anaToMia.Widgets.environment.FocusStyleHandler;
+import us.isidor.gdl.anaToMia.Widgets.environment.HoverStyleHandler;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
import us.isidor.gdl.anaToMia.Widgets.values.AbsoluteNumValue;
import us.isidor.gdl.anaToMia.Widgets.values.AutoNumUnitValue;
@@ -415,4 +425,48 @@
protected void adjustSize() {
// ignore this method, since all instances of gdl:View have a static size
}
+
+
+ @Override
+ public void onHoverStart(DomEvent event, HoverStyleHandler handler) {
+ // TODO Auto-generated method stub
+
+ }
+
+
+ @Override
+ public void onHoverEnd(DomEvent event, HoverStyleHandler handler) {
+ // TODO Auto-generated method stub
+
+ }
+
+
+ @Override
+ public void onFocusStart(DomEvent event, FocusStyleHandler handler) {
+ // TODO Auto-generated method stub
+
+ }
+
+
+ @Override
+ public void onFocusEnd(DomEvent event, FocusStyleHandler handler) {
+ // TODO Auto-generated method stub
+
+ }
+
+
+ @Override
+ public void onActiveStart(DomEvent event, ActiveStyleHandler handler) {
+ // TODO Auto-generated method stub
+
+ }
+
+
+ @Override
+ public void onActiveEnd(DomEvent event, ActiveStyleHandler handler) {
+ // TODO Auto-generated method stub
+
+ }
+
+
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlEditorAssociationView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlEditorAssociationView.java Wed Jul 6 07:41:45 2011 (r568)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlEditorAssociationView.java Wed Jul 6 11:09:04 2011 (r569)
@@ -2,7 +2,14 @@
import com.google.gwt.dom.client.Style.Float;
import com.google.gwt.dom.client.Style.Overflow;
+import com.google.gwt.event.dom.client.BlurEvent;
import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.event.dom.client.DomEvent;
+import com.google.gwt.event.dom.client.FocusEvent;
+import com.google.gwt.event.dom.client.MouseDownEvent;
+import com.google.gwt.event.dom.client.MouseOutEvent;
+import com.google.gwt.event.dom.client.MouseOverEvent;
+import com.google.gwt.event.dom.client.MouseUpEvent;
import com.google.gwt.user.client.ui.Widget;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Association;
@@ -10,7 +17,10 @@
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMap;
import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject;
+import us.isidor.gdl.anaToMia.Widgets.environment.ActiveStyleHandler;
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
+import us.isidor.gdl.anaToMia.Widgets.environment.FocusStyleHandler;
+import us.isidor.gdl.anaToMia.Widgets.environment.HoverStyleHandler;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
import us.isidor.gdl.anaToMia.Widgets.values.AbsoluteNumValue;
import us.isidor.gdl.anaToMia.Widgets.values.AutoNumUnitValue;
@@ -417,4 +427,47 @@
protected void adjustSize() {
// ignore this method, since all instances of gdl:View have a static size
}
+
+
+ @Override
+ public void onHoverStart(DomEvent event, HoverStyleHandler handler) {
+ // TODO Auto-generated method stub
+
+ }
+
+
+ @Override
+ public void onHoverEnd(DomEvent event, HoverStyleHandler handler) {
+ // TODO Auto-generated method stub
+
+ }
+
+
+ @Override
+ public void onFocusStart(DomEvent event, FocusStyleHandler handler) {
+ // TODO Auto-generated method stub
+
+ }
+
+
+ @Override
+ public void onFocusEnd(DomEvent event, FocusStyleHandler handler) {
+ // TODO Auto-generated method stub
+
+ }
+
+
+ @Override
+ public void onActiveStart(DomEvent event, ActiveStyleHandler handler) {
+ // TODO Auto-generated method stub
+
+ }
+
+
+ @Override
+ public void onActiveEnd(DomEvent event, ActiveStyleHandler handler) {
+ // TODO Auto-generated method stub
+
+ }
+
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialCreatorTopicView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialCreatorTopicView.java Wed Jul 6 07:41:45 2011 (r568)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialCreatorTopicView.java Wed Jul 6 11:09:04 2011 (r569)
@@ -2,14 +2,24 @@
import com.google.gwt.dom.client.Style.Float;
import com.google.gwt.dom.client.Style.Overflow;
+import com.google.gwt.event.dom.client.BlurEvent;
import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.event.dom.client.DomEvent;
+import com.google.gwt.event.dom.client.FocusEvent;
+import com.google.gwt.event.dom.client.MouseDownEvent;
+import com.google.gwt.event.dom.client.MouseOutEvent;
+import com.google.gwt.event.dom.client.MouseOverEvent;
+import com.google.gwt.event.dom.client.MouseUpEvent;
import com.google.gwt.user.client.ui.Widget;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Construct;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMap;
import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject;
+import us.isidor.gdl.anaToMia.Widgets.environment.ActiveStyleHandler;
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
+import us.isidor.gdl.anaToMia.Widgets.environment.FocusStyleHandler;
+import us.isidor.gdl.anaToMia.Widgets.environment.HoverStyleHandler;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
import us.isidor.gdl.anaToMia.Widgets.values.AbsoluteNumValue;
import us.isidor.gdl.anaToMia.Widgets.values.AutoNumUnitValue;
@@ -418,4 +428,47 @@
protected void adjustSize() {
// ignore this method, since all instances of gdl:View have a static size
}
+
+
+ @Override
+ public void onHoverStart(DomEvent event, HoverStyleHandler handler) {
+ // TODO Auto-generated method stub
+
+ }
+
+
+ @Override
+ public void onHoverEnd(DomEvent event, HoverStyleHandler handler) {
+ // TODO Auto-generated method stub
+
+ }
+
+
+ @Override
+ public void onFocusStart(DomEvent event, FocusStyleHandler handler) {
+ // TODO Auto-generated method stub
+
+ }
+
+
+ @Override
+ public void onFocusEnd(DomEvent event, FocusStyleHandler handler) {
+ // TODO Auto-generated method stub
+
+ }
+
+
+ @Override
+ public void onActiveStart(DomEvent event, ActiveStyleHandler handler) {
+ // TODO Auto-generated method stub
+
+ }
+
+
+ @Override
+ public void onActiveEnd(DomEvent event, ActiveStyleHandler handler) {
+ // TODO Auto-generated method stub
+
+ }
+
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialEditorTopicView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialEditorTopicView.java Wed Jul 6 07:41:45 2011 (r568)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialEditorTopicView.java Wed Jul 6 11:09:04 2011 (r569)
@@ -2,14 +2,24 @@
import com.google.gwt.dom.client.Style.Float;
import com.google.gwt.dom.client.Style.Overflow;
+import com.google.gwt.event.dom.client.BlurEvent;
import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.event.dom.client.DomEvent;
+import com.google.gwt.event.dom.client.FocusEvent;
+import com.google.gwt.event.dom.client.MouseDownEvent;
+import com.google.gwt.event.dom.client.MouseOutEvent;
+import com.google.gwt.event.dom.client.MouseOverEvent;
+import com.google.gwt.event.dom.client.MouseUpEvent;
import com.google.gwt.user.client.ui.Widget;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Construct;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMap;
import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject;
+import us.isidor.gdl.anaToMia.Widgets.environment.ActiveStyleHandler;
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
+import us.isidor.gdl.anaToMia.Widgets.environment.FocusStyleHandler;
+import us.isidor.gdl.anaToMia.Widgets.environment.HoverStyleHandler;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
import us.isidor.gdl.anaToMia.Widgets.values.AbsoluteNumValue;
import us.isidor.gdl.anaToMia.Widgets.values.AutoNumUnitValue;
@@ -420,4 +430,48 @@
protected void adjustSize() {
// ignore this method, since all instances of gdl:View have a static size
}
+
+
+ @Override
+ public void onHoverStart(DomEvent event, HoverStyleHandler handler) {
+ // TODO Auto-generated method stub
+
+ }
+
+
+ @Override
+ public void onHoverEnd(DomEvent event, HoverStyleHandler handler) {
+ // TODO Auto-generated method stub
+
+ }
+
+
+ @Override
+ public void onFocusStart(DomEvent event, FocusStyleHandler handler) {
+ // TODO Auto-generated method stub
+
+ }
+
+
+ @Override
+ public void onFocusEnd(DomEvent event, FocusStyleHandler handler) {
+ // TODO Auto-generated method stub
+
+ }
+
+
+ @Override
+ public void onActiveStart(DomEvent event, ActiveStyleHandler handler) {
+ // TODO Auto-generated method stub
+
+ }
+
+
+ @Override
+ public void onActiveEnd(DomEvent event, ActiveStyleHandler handler) {
+ // TODO Auto-generated method stub
+
+ }
+
+
}
1
0

[isidorus-cvs] r568 - in branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets: base text
by lgiessmann@common-lisp.net 06 Jul '11
by lgiessmann@common-lisp.net 06 Jul '11
06 Jul '11
Author: lgiessmann
Date: Wed Jul 6 07:41:45 2011
New Revision: 568
Log:
gdl-frontend: Widgets: changed the behavior of setting default style properties of GdlText
Modified:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java Wed Jul 6 07:19:57 2011 (r567)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java Wed Jul 6 07:41:45 2011 (r568)
@@ -35,7 +35,6 @@
import com.google.gwt.event.dom.client.MouseOutHandler;
import com.google.gwt.event.dom.client.MouseOverHandler;
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.ui.AbsolutePanel;
import com.google.gwt.user.client.ui.Composite;
@@ -721,7 +720,9 @@
radiusOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlBorderTopLeftRadius);
}
- if(radiusOcc == null){
+ if(radiusOcc == null && styleClass != null){
+ return null;
+ } else if(radiusOcc == null){
return null;
} else {
return new NumUnitValue(radiusOcc.getValue());
@@ -740,7 +741,9 @@
radiusOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlBorderTopRightRadius);
}
- if(radiusOcc == null){
+ if(radiusOcc == null && styleClass != null){
+ return null;
+ } else if(radiusOcc == null){
return null;
} else {
return new NumUnitValue(radiusOcc.getValue());
@@ -759,7 +762,9 @@
radiusOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlBorderBottomLeftRadius);
}
- if(radiusOcc == null){
+ if(radiusOcc == null && styleClass != null){
+ return null;
+ } else if(radiusOcc == null){
return null;
} else {
return new NumUnitValue(radiusOcc.getValue());
@@ -778,7 +783,9 @@
radiusOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlBorderBottomRightRadius);
}
- if(radiusOcc == null){
+ if(radiusOcc == null && styleClass != null){
+ return null;
+ } else if(radiusOcc == null){
return null;
} else {
return new NumUnitValue(radiusOcc.getValue());
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java Wed Jul 6 07:19:57 2011 (r567)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java Wed Jul 6 07:41:45 2011 (r568)
@@ -108,6 +108,331 @@
}
+ // returns only a value if it was set, so the browsers default value is set
+ @Override
+ public AbsoluteNumValue getBorderWidth(String styleClass) throws InvalidGdlSchemaException {
+ Occurrence widthOcc = null;
+ if(styleClass != null){
+ widthOcc = getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlBorderWidth, styleClass);
+ } else {
+ widthOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlBorderWidth);
+ }
+
+ if(widthOcc == null) return null;
+ else return new AbsoluteNumValue(widthOcc.getValue());
+ }
+
+
+ // returns only a value if it was set, so the browsers default value is set
+ @Override
+ public AbsoluteNumValue getBorderTopWidth(String styleClass) throws InvalidGdlSchemaException {
+ Occurrence widthOcc = null;
+ if(styleClass != null){
+ widthOcc = getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlBorderTopWidth, styleClass);
+ } else {
+ widthOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlBorderTopWidth);
+ }
+
+ if(widthOcc == null) return null;
+ else return new AbsoluteNumValue(widthOcc.getValue());
+ }
+
+
+ // returns only a value if it was set, so the browsers default value is set
+ @Override
+ public AbsoluteNumValue getBorderRightWidth(String styleClass) throws InvalidGdlSchemaException {
+ Occurrence widthOcc = null;
+ if(styleClass != null){
+ widthOcc = getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlBorderRightWidth, styleClass);
+ } else {
+ widthOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlBorderRightWidth);
+ }
+
+ if(widthOcc == null) return null;
+ else return new AbsoluteNumValue(widthOcc.getValue());
+ }
+
+
+ // returns only a value if it was set, so the browsers default value is set
+ @Override
+ public AbsoluteNumValue getBorderBottomWidth(String styleClass) throws InvalidGdlSchemaException {
+ Occurrence widthOcc = null;
+ if(styleClass != null){
+ widthOcc = getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlBorderBottomWidth, styleClass);
+ } else {
+ widthOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlBorderBottomWidth);
+ }
+
+ if(widthOcc == null) return null;
+ else return new AbsoluteNumValue(widthOcc.getValue());
+ }
+
+
+ // returns only a value if it was set, so the browsers default value is set
+ @Override
+ public AbsoluteNumValue getBorderLeftWidth(String styleClass) throws InvalidGdlSchemaException {
+ Occurrence widthOcc = null;
+ if(styleClass != null){
+ widthOcc = getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlBorderLeftWidth, styleClass);
+ } else {
+ widthOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlBorderLeftWidth);
+ }
+
+ if(widthOcc == null) return null;
+ else return new AbsoluteNumValue(widthOcc.getValue());
+ }
+
+
+ // returns only a value if it was set, so the browsers default value is set
+ public NumUnitValue getBorderRadius(String styleClass) throws InvalidGdlSchemaException {
+ Occurrence radiusOcc = null;
+ if(styleClass != null){
+ radiusOcc = getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlBorderRadius, styleClass);
+ } else {
+ radiusOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlBorderRadius);
+ }
+
+ if(radiusOcc == null) return null;
+ else return new NumUnitValue(radiusOcc.getValue());
+ }
+
+
+ // returns only a value if it was set, so the browsers default value is set
+ public NumUnitValue getBorderTopLeftRadius(String styleClass) throws InvalidGdlSchemaException {
+ Occurrence radiusOcc = null;
+ if(styleClass != null){
+ radiusOcc = getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlBorderTopLeftRadius, styleClass);
+ } else {
+ radiusOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlBorderTopLeftRadius);
+ }
+
+ if(radiusOcc == null) return null;
+ else return new NumUnitValue(radiusOcc.getValue());
+ }
+
+
+ // returns only a value if it was set, so the browsers default value is set
+ public NumUnitValue getBorderTopRightRadius(String styleClass) throws InvalidGdlSchemaException {
+ Occurrence radiusOcc = null;
+ if(styleClass != null){
+ radiusOcc = getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlBorderTopRightRadius, styleClass);
+ } else {
+ radiusOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlBorderTopRightRadius);
+ }
+
+ if(radiusOcc == null) return null;
+ else return new NumUnitValue(radiusOcc.getValue());
+ }
+
+
+ // returns only a value if it was set, so the browsers default value is set
+ public NumUnitValue getBorderBottomLeftRadius(String styleClass) throws InvalidGdlSchemaException {
+ Occurrence radiusOcc = null;
+ if(styleClass != null){
+ radiusOcc = getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlBorderBottomLeftRadius, styleClass);
+ } else {
+ radiusOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlBorderBottomLeftRadius);
+ }
+
+ if(radiusOcc == null) return null;
+ else return new NumUnitValue(radiusOcc.getValue());
+ }
+
+
+ // returns only a value if it was set, so the browsers default value is set
+ public NumUnitValue getBorderBottomRightRadius(String styleClass) throws InvalidGdlSchemaException {
+ Occurrence radiusOcc = null;
+ if(styleClass != null){
+ radiusOcc = getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlBorderBottomRightRadius, styleClass);
+ } else {
+ radiusOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlBorderBottomRightRadius);
+ }
+
+ if(radiusOcc == null) return null;
+ else return new NumUnitValue(radiusOcc.getValue());
+ }
+
+
+ // returns only a value if it was set, so the browsers default value is set
+ public ColorValue getBorderColor(String styleClass) throws InvalidGdlSchemaException {
+ Occurrence colorOcc = null;
+ if(styleClass != null){
+ colorOcc = getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlBorderColor, styleClass);
+ } else {
+ colorOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlBorderColor);
+ }
+
+ if(colorOcc == null ) return null;
+ else return new ColorValue(colorOcc.getValue());
+ }
+
+
+ // returns only a value if it was set, so the browsers default value is set
+ public ColorValue getBorderTopColor(String styleClass) throws InvalidGdlSchemaException {
+ Occurrence colorOcc = null;
+ if(styleClass != null){
+ colorOcc = getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlBorderTopColor, styleClass);
+ } else {
+ colorOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlBorderTopColor);
+ }
+
+ if(colorOcc == null ) return null;
+ else return new ColorValue(colorOcc.getValue());
+ }
+
+
+ // returns only a value if it was set, so the browsers default value is set
+ public ColorValue getBorderRightColor(String styleClass) throws InvalidGdlSchemaException {
+ Occurrence colorOcc = null;
+ if(styleClass != null){
+ colorOcc = getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlBorderRightColor, styleClass);
+ } else {
+ colorOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlBorderRightColor);
+ }
+
+ if(colorOcc == null ) return null;
+ else return new ColorValue(colorOcc.getValue());
+ }
+
+
+ // returns only a value if it was set, so the browsers default value is set
+ public ColorValue getBorderBottomColor(String styleClass) throws InvalidGdlSchemaException {
+ Occurrence colorOcc = null;
+ if(styleClass != null){
+ colorOcc = getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlBorderBottomColor, styleClass);
+ } else {
+ colorOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlBorderBottomColor);
+ }
+
+ if(colorOcc == null ) return null;
+ else return new ColorValue(colorOcc.getValue());
+ }
+
+
+ // returns only a value if it was set, so the browsers default value is set
+ public ColorValue getBorderLeftColor(String styleClass) throws InvalidGdlSchemaException {
+ Occurrence colorOcc = null;
+ if(styleClass != null){
+ colorOcc = getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlBorderLeftColor, styleClass);
+ } else {
+ colorOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlBorderLeftColor);
+ }
+
+ if(colorOcc == null ) return null;
+ else return new ColorValue(colorOcc.getValue());
+ }
+
+
+ // returns only a value if it was set, so the browsers default value is set
+ public BorderStyleValue getBorderStyle(String styleClass) throws InvalidGdlSchemaException {
+ Occurrence styleOcc = null;
+ if(styleClass != null){
+ styleOcc = getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlBorderStyle, styleClass);
+ } else {
+ styleOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlBorderStyle);
+ }
+
+ if(styleOcc == null) {
+ return null;
+ } else {
+ try{
+ return BorderStyleValue.valueOf(styleOcc.getValue().toUpperCase());
+ }catch(IllegalArgumentException e){
+ String values = "none, hidden, dotted, dashed, solid, double, groove, ridge, inset, outset";
+ throw new InvalidGdlSchemaException("border-style must be set to one of " + values + ", but is " + styleOcc.getValue());
+ }
+ }
+ }
+
+
+ // returns only a value if it was set, so the browsers default value is set
+ public BorderStyleValue getBorderTopStyle(String styleClass) throws InvalidGdlSchemaException {
+ Occurrence styleOcc = null;
+ if(styleClass != null){
+ styleOcc = getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlBorderTopStyle, styleClass);
+ } else {
+ styleOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlBorderTopStyle);
+ }
+
+ if(styleOcc == null) {
+ return null;
+ } else {
+ try{
+ return BorderStyleValue.valueOf(styleOcc.getValue().toUpperCase());
+ }catch(IllegalArgumentException e){
+ String values = "none, hidden, dotted, dashed, solid, double, groove, ridge, inset, outset";
+ throw new InvalidGdlSchemaException("border-style must be set to one of " + values + ", but is " + styleOcc.getValue());
+ }
+ }
+ }
+
+
+ // returns only a value if it was set, so the browsers default value is set
+ public BorderStyleValue getBorderRightStyle(String styleClass) throws InvalidGdlSchemaException {
+ Occurrence styleOcc = null;
+ if(styleClass != null){
+ styleOcc = getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlBorderRightStyle, styleClass);
+ } else {
+ styleOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlBorderRightStyle);
+ }
+
+ if(styleOcc == null) {
+ return null;
+ } else {
+ try{
+ return BorderStyleValue.valueOf(styleOcc.getValue().toUpperCase());
+ }catch(IllegalArgumentException e){
+ String values = "none, hidden, dotted, dashed, solid, double, groove, ridge, inset, outset";
+ throw new InvalidGdlSchemaException("border-style must be set to one of " + values + ", but is " + styleOcc.getValue());
+ }
+ }
+ }
+
+
+ // returns only a value if it was set, so the browsers default value is set
+ public BorderStyleValue getBorderBottomStyle(String styleClass) throws InvalidGdlSchemaException {
+ Occurrence styleOcc = null;
+ if(styleClass != null){
+ styleOcc = getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlBorderBottomStyle, styleClass);
+ } else {
+ styleOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlBorderBottomStyle);
+ }
+
+ if(styleOcc == null) {
+ return null;
+ } else {
+ try{
+ return BorderStyleValue.valueOf(styleOcc.getValue().toUpperCase());
+ }catch(IllegalArgumentException e){
+ String values = "none, hidden, dotted, dashed, solid, double, groove, ridge, inset, outset";
+ throw new InvalidGdlSchemaException("border-style must be set to one of " + values + ", but is " + styleOcc.getValue());
+ }
+ }
+ }
+
+
+ // returns only a value if it was set, so the browsers default value is set
+ public BorderStyleValue getBorderLeftStyle(String styleClass) throws InvalidGdlSchemaException {
+ Occurrence styleOcc = null;
+ if(styleClass != null){
+ styleOcc = getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlBorderLeftStyle, styleClass);
+ } else {
+ styleOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlBorderLeftStyle);
+ }
+
+ if(styleOcc == null) {
+ return null;
+ } else {
+ try{
+ return BorderStyleValue.valueOf(styleOcc.getValue().toUpperCase());
+ }catch(IllegalArgumentException e){
+ String values = "none, hidden, dotted, dashed, solid, double, groove, ridge, inset, outset";
+ throw new InvalidGdlSchemaException("border-style must be set to one of " + values + ", but is " + styleOcc.getValue());
+ }
+ }
+ }
+
+
// returns a TextType instance of a gdl:text-type occurrence.
// If no gdl:text-type occurrence is set, the default value is returned
public TextTypeValue getTextType() throws InvalidGdlSchemaException {
@@ -709,6 +1034,7 @@
}
+ // resets the size of this element depending on the amount of inner sub-elements
@Override
protected void adjustSize(){
// TODO: implement => width, height, overflow of the mainpanel
1
0

[isidorus-cvs] r567 - in branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets: base environment text views
by lgiessmann@common-lisp.net 06 Jul '11
by lgiessmann@common-lisp.net 06 Jul '11
06 Jul '11
Author: lgiessmann
Date: Wed Jul 6 07:19:57 2011
New Revision: 567
Log:
gdl-frontend: Widgets: changed the registration concept of handlers
Added:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/environment/ActiveStyleHandler.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/environment/CssStyleHandler.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/environment/FocusStyleHandler.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/environment/HoverStyleHandler.java
Modified:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlView.java
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java Wed Jul 6 05:16:54 2011 (r566)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java Wed Jul 6 07:19:57 2011 (r567)
@@ -6,7 +6,7 @@
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMap;
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
-import us.isidor.gdl.anaToMia.Widgets.environment.Pair;
+import us.isidor.gdl.anaToMia.Widgets.environment.MultipleHandlerRegistration;
import us.isidor.gdl.anaToMia.Widgets.values.AutoNumUnitValue;
import us.isidor.gdl.anaToMia.Widgets.values.AutoNumValue;
import us.isidor.gdl.anaToMia.Widgets.values.BorderStyleValue;
@@ -21,11 +21,8 @@
import com.google.gwt.dom.client.Style.Float;
import com.google.gwt.dom.client.Style.Overflow;
import com.google.gwt.dom.client.Style.VerticalAlign;
-import com.google.gwt.event.dom.client.BlurEvent;
import com.google.gwt.event.dom.client.BlurHandler;
-import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
-import com.google.gwt.event.dom.client.FocusEvent;
import com.google.gwt.event.dom.client.FocusHandler;
import com.google.gwt.event.dom.client.HasBlurHandlers;
import com.google.gwt.event.dom.client.HasClickHandlers;
@@ -34,17 +31,10 @@
import com.google.gwt.event.dom.client.HasMouseOutHandlers;
import com.google.gwt.event.dom.client.HasMouseOverHandlers;
import com.google.gwt.event.dom.client.HasMouseUpHandlers;
-import com.google.gwt.event.dom.client.HasScrollHandlers;
-import com.google.gwt.event.dom.client.MouseDownEvent;
import com.google.gwt.event.dom.client.MouseDownHandler;
-import com.google.gwt.event.dom.client.MouseOutEvent;
import com.google.gwt.event.dom.client.MouseOutHandler;
-import com.google.gwt.event.dom.client.MouseOverEvent;
import com.google.gwt.event.dom.client.MouseOverHandler;
-import com.google.gwt.event.dom.client.MouseUpEvent;
import com.google.gwt.event.dom.client.MouseUpHandler;
-import com.google.gwt.event.dom.client.ScrollEvent;
-import com.google.gwt.event.dom.client.ScrollHandler;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.ui.AbsolutePanel;
@@ -52,13 +42,10 @@
import com.google.gwt.user.client.ui.Widget;
-public abstract class GdlVisibleObject extends Composite implements GdlDescriptor, HasClickHandlers, HasMouseOutHandlers, HasMouseOverHandlers, HasFocusHandlers, HasMouseDownHandlers, HasMouseUpHandlers, HasBlurHandlers, HasScrollHandlers{
+public abstract class GdlVisibleObject extends Composite implements GdlDescriptor, HasClickHandlers, HasMouseOutHandlers, HasMouseOverHandlers, HasFocusHandlers, HasMouseDownHandlers, HasMouseUpHandlers, HasBlurHandlers{
protected AbsolutePanel mainPanel = new AbsolutePanel();
protected Topic tmRepresentative = null;
protected TopicMap tm = null;
- protected ActiveStyleHandler activeStyleHandler = new ActiveStyleHandler();
- protected FocusStyleHandler focusStyleHandler = new FocusStyleHandler();
- protected HoverStyleHandler hoverStyleHandler = new HoverStyleHandler();
// some constructors
@@ -1155,10 +1142,8 @@
}
- // sets the vertical-align style property of this element by using the GWT DOM class
- public void setVerticalAlign(VerticalAlign value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
- if(value != null) this.setCssProperty(styleClass, "verticalAlign", value.getCssName());
- }
+ // sets the vertical-align style property of this element and all it's sub-elements by using the GWT DOM class
+ public abstract void setVerticalAlign(Widget widget, VerticalAlign value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
// sets the margin style property of this element by using the GWT DOM class
@@ -1319,9 +1304,7 @@
// sets the overflow style property of this element by using the GWT DOM class
- public void setOverflow(Overflow value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
- if(value != null) this.setCssProperty(styleClass, "overflow", value.getCssName());
- }
+ public abstract void setOverflow(Widget widget, Overflow value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
// sets the passed css style porperty to the passed css value.
@@ -1332,11 +1315,14 @@
if(styleClass == null){
DOM.setStyleAttribute(this.getElement(), cssProperty, cssValue);
} else if(styleClass.equals(GdlPsis.Scope.gdlActive)){
- this.activeStyleHandler.addCssStyle(new Pair<String, String>(cssProperty, cssValue));
+ //this.activeStyleHandler.addCssStyle(new Pair<String, String>(cssProperty, cssValue));
+ // Ignore is only set in the inheriting classes
} else if(styleClass.equals(GdlPsis.Scope.gdlFocus)){
- this.focusStyleHandler.addCssStyle(new Pair<String, String>(cssProperty, cssValue));
+ //this.focusStyleHandler.addCssStyle(new Pair<String, String>(cssProperty, cssValue));
+ // Ignore is only set in the inheriting classes
} else if (styleClass.equals(GdlPsis.Scope.gdlHover)){
- this.hoverStyleHandler.addCssStyle(new Pair<String, String>(cssProperty, cssValue));
+ //this.hoverStyleHandler.addCssStyle(new Pair<String, String>(cssProperty, cssValue));
+ // Ignore is only set in the inheriting classes
} else {
String values = GdlPsis.Scope.gdlActive + ", " + GdlPsis.Scope.gdlFocus + ", " + GdlPsis.Scope.gdlHover;
throw new InvalidGdlSchemaException("GDL defines only the style classes " + values + ", but found " + styleClass);
@@ -1350,177 +1336,40 @@
this.setZindex(this.getZindex());
this.setFloat(this.getFloat());
this.setClear(this.getClear());
-
- String[] styleClasses = new String[]{null, GdlPsis.Scope.gdlActive, GdlPsis.Scope.gdlFocus, GdlPsis.Scope.gdlHover};
- for (String styleClass : styleClasses) {
- this.setVerticalAlign(this.getVerticalAlign(styleClass), styleClass);
- this.setOverflow(this.getOverflow(styleClass), styleClass);
- }
-
- // registers the handlers for the CSS pseudo classes
- this.addMouseDownHandler(this.activeStyleHandler);
- this.addMouseUpHandler(this.activeStyleHandler);
- this.addFocusHandler(this.focusStyleHandler);
- this.addBlurHandler(this.focusStyleHandler);
- this.addMouseOutHandler(this.hoverStyleHandler);
- this.addMouseOverHandler(this.hoverStyleHandler);
}
- // registers a click handler for this element
+ // registers a click handler to all sub-elements of this element
@Override
- public HandlerRegistration addClickHandler(ClickHandler handler) {
- return this.addDomHandler(handler, ClickEvent.getType());
- }
+ public abstract MultipleHandlerRegistration addClickHandler(ClickHandler handler);
- // registers a mouse out handler on this element
+ // registers a mouse-out handler to all sub-elements of this element
@Override
- public HandlerRegistration addMouseOutHandler(MouseOutHandler handler) {
- return this.addDomHandler(handler, MouseOutEvent.getType());
- }
+ public abstract MultipleHandlerRegistration addMouseOutHandler(MouseOutHandler handler);
- // registers a mouse over handler on this element
+ // registers a mouse-over handler to all sub-elements of this element
@Override
- public HandlerRegistration addMouseOverHandler(MouseOverHandler handler) {
- return this.addDomHandler(handler, MouseOverEvent.getType());
- }
+ public abstract MultipleHandlerRegistration addMouseOverHandler(MouseOverHandler handler);
- // registers a focus handler on this element
+ // registers a focus handler to all sub-elements of this element
@Override
- public HandlerRegistration addFocusHandler(FocusHandler handler) {
- return this.addDomHandler(handler, FocusEvent.getType());
- }
+ public abstract MultipleHandlerRegistration addFocusHandler(FocusHandler handler);
- // registers a mouse down handler on this element
+ // registers a mouse-down handler to all sub-elements of this element
@Override
- public HandlerRegistration addMouseDownHandler(MouseDownHandler handler) {
- return this.addDomHandler(handler, MouseDownEvent.getType());
- }
+ public abstract MultipleHandlerRegistration addMouseDownHandler(MouseDownHandler handler);
- // registers a scroll handler on this element
+ // registers a mouse-up handler to all sub-elements of this element
@Override
- public HandlerRegistration addScrollHandler(ScrollHandler handler) {
- return this.addDomHandler(handler, ScrollEvent.getType());
- }
+ public abstract MultipleHandlerRegistration addMouseUpHandler(MouseUpHandler handler);
- // registers a mouse down handler on this element
+ // registers a blur handler to all sub-elements of this element
@Override
- public HandlerRegistration addMouseUpHandler(MouseUpHandler handler) {
- return this.addDomHandler(handler, MouseUpEvent.getType());
- }
-
-
- // registers a blur on this element
- @Override
- public HandlerRegistration addBlurHandler(BlurHandler handler) {
- return this.addDomHandler(handler, BlurEvent.getType());
- }
-
-
- // this class is used as base for all style handlers, so a style property
- // can be added to a style handler by adding a Pair<String, String> instance
- protected class CssStyleHandler{
- private ArrayList<Pair<String, String>> cssNameAndValues = new ArrayList<Pair<String,String>>();
- private ArrayList<Pair<String, String>> cssPreviousNameAndValues = new ArrayList<Pair<String,String>>();
-
-
- public CssStyleHandler() {}
-
-
- // adds a CSS name value pair
- public void addCssStyle(Pair<String, String> cssNameAndValue) {
- if(cssNameAndValue != null && cssNameAndValue.getFirst() != null && cssNameAndValue.getSecond() != null){
- this.cssNameAndValues.add(cssNameAndValue);
- }
- }
-
-
- // sets the stored CSS name/value pairs
- public void setStyles(){
- for (Pair<String, String> cssNameValue : this.cssNameAndValues) {
- Pair<String, String> oldNameValue = null;
- String oldVal = DOM.getStyleAttribute(GdlVisibleObject.this.getElement(), cssNameValue.getFirst());
- if(oldVal != null && oldVal.length() != 0){
- oldNameValue = new Pair<String, String>(cssNameValue.getFirst(), oldVal);
- this.cssPreviousNameAndValues.add(oldNameValue);
- }
- DOM.setStyleAttribute(GdlVisibleObject.this.getElement(), cssNameValue.getFirst(), cssNameValue.getSecond());
- }
- }
-
-
- // must sets the original style that is bound to the non-pseudo-class name space
- public void unsetStyles(){
- for (Pair<String, String> oldNameValue : this.cssPreviousNameAndValues) {
- DOM.setStyleAttribute(GdlVisibleObject.this.getElement(), oldNameValue.getFirst(), oldNameValue.getSecond());
- }
- }
- }
-
-
- // this class is used to set the style of focused elements
- protected class FocusStyleHandler extends CssStyleHandler implements FocusHandler, BlurHandler{
- public FocusStyleHandler() {
- super();
- }
-
-
- @Override
- public void onFocus(FocusEvent event) {
- super.setStyles();
- }
-
-
- @Override
- public void onBlur(BlurEvent event) {
- super.unsetStyles();
- }
- }
-
-
- // this class is used to set the style of hovered elements
- protected class HoverStyleHandler extends CssStyleHandler implements MouseOverHandler, MouseOutHandler {
- public HoverStyleHandler() {
- super();
- }
-
-
- @Override
- public void onMouseOut(MouseOutEvent event) {
- super.unsetStyles();
- }
-
-
- @Override
- public void onMouseOver(MouseOverEvent event) {
- super.setStyles();
- }
- }
-
-
- // this class is used to set the style of active elements
- protected class ActiveStyleHandler extends CssStyleHandler implements MouseDownHandler, MouseUpHandler {
- public ActiveStyleHandler() {
- super();
- }
-
-
- @Override
- public void onMouseUp(MouseUpEvent event) {
- super.unsetStyles();
- }
-
-
- @Override
- public void onMouseDown(MouseDownEvent event) {
- super.setStyles();
- }
-
- }
+ public abstract MultipleHandlerRegistration addBlurHandler(BlurHandler handler);
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java Wed Jul 6 05:16:54 2011 (r566)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java Wed Jul 6 07:19:57 2011 (r567)
@@ -80,6 +80,7 @@
Topic gdlReadonly = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.OccurrenceType.gdlReadonly));
Topic gdlResize = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.OccurrenceType.gdlResize));
Topic gdlOverflow = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.OccurrenceType.gdlOverflow));
+ Topic gdlTextDecoration = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.OccurrenceType.gdlTextDecoration));
tmpRepresentative.createOccurrence(gdlBackgroundColor, "red", null);
@@ -102,6 +103,7 @@
tmpRepresentative.createOccurrence(gdlResize, "both", null);
tmpRepresentative.createOccurrence(gdlOverflow, "hidden", null);
tmpRepresentative.createOccurrence(gdlFontSize, "15pt", null);
+ tmpRepresentative.createOccurrence(gdlTextDecoration, "underline", null);
//Occurrence bgcHover = tmpRepresentative.createOccurrence(gdlBackgroundColor, "green", null);
//bgcHover.addTheme(gdlHover);
//Occurrence bgcActive = tmpRepresentative.createOccurrence(gdlBackgroundColor, "purple", null);
Added: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/environment/ActiveStyleHandler.java
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/environment/ActiveStyleHandler.java Wed Jul 6 07:19:57 2011 (r567)
@@ -0,0 +1,28 @@
+package us.isidor.gdl.anaToMia.Widgets.environment;
+
+import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject;
+
+import com.google.gwt.event.dom.client.MouseDownEvent;
+import com.google.gwt.event.dom.client.MouseDownHandler;
+import com.google.gwt.event.dom.client.MouseUpEvent;
+import com.google.gwt.event.dom.client.MouseUpHandler;
+
+public class ActiveStyleHandler extends CssStyleHandler implements MouseDownHandler, MouseUpHandler{
+ public ActiveStyleHandler() {
+ super();
+ }
+
+
+ @Override
+ public void onMouseUp(MouseUpEvent event) {
+ GdlVisibleObject widget = (GdlVisibleObject)event.getSource();
+ super.unsetStyles(widget);
+ }
+
+
+ @Override
+ public void onMouseDown(MouseDownEvent event) {
+ GdlVisibleObject widget = (GdlVisibleObject)event.getSource();
+ super.setStyles(widget);
+ }
+}
Added: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/environment/CssStyleHandler.java
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/environment/CssStyleHandler.java Wed Jul 6 07:19:57 2011 (r567)
@@ -0,0 +1,45 @@
+package us.isidor.gdl.anaToMia.Widgets.environment;
+
+import java.util.ArrayList;
+
+import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject;
+
+import com.google.gwt.user.client.DOM;
+
+public class CssStyleHandler {
+ private ArrayList<Pair<String, String>> cssNameAndValues = new ArrayList<Pair<String,String>>();
+ private ArrayList<Pair<String, String>> cssPreviousNameAndValues = new ArrayList<Pair<String,String>>();
+
+
+ public CssStyleHandler() {}
+
+
+ // adds a CSS name value pair
+ public void addCssStyle(Pair<String, String> cssNameAndValue) {
+ if(cssNameAndValue != null && cssNameAndValue.getFirst() != null && cssNameAndValue.getSecond() != null){
+ this.cssNameAndValues.add(cssNameAndValue);
+ }
+ }
+
+
+ // sets the stored CSS name/value pairs of a GdlVisibleObject
+ public void setStyles(GdlVisibleObject widget){
+ for (Pair<String, String> cssNameValue : this.cssNameAndValues) {
+ Pair<String, String> oldNameValue = null;
+ String oldVal = DOM.getStyleAttribute(widget.getElement(), cssNameValue.getFirst());
+ if(oldVal != null && oldVal.length() != 0){
+ oldNameValue = new Pair<String, String>(cssNameValue.getFirst(), oldVal);
+ this.cssPreviousNameAndValues.add(oldNameValue);
+ }
+ DOM.setStyleAttribute(widget.getElement(), cssNameValue.getFirst(), cssNameValue.getSecond());
+ }
+ }
+
+
+ // must sets the original style that is bound to the non-pseudo-class name space
+ public void unsetStyles(GdlVisibleObject widget){
+ for (Pair<String, String> oldNameValue : this.cssPreviousNameAndValues) {
+ DOM.setStyleAttribute(widget.getElement(), oldNameValue.getFirst(), oldNameValue.getSecond());
+ }
+ }
+}
Added: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/environment/FocusStyleHandler.java
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/environment/FocusStyleHandler.java Wed Jul 6 07:19:57 2011 (r567)
@@ -0,0 +1,29 @@
+package us.isidor.gdl.anaToMia.Widgets.environment;
+
+import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject;
+import us.isidor.gdl.anaToMia.Widgets.environment.CssStyleHandler;
+import com.google.gwt.event.dom.client.BlurEvent;
+import com.google.gwt.event.dom.client.BlurHandler;
+import com.google.gwt.event.dom.client.FocusEvent;
+import com.google.gwt.event.dom.client.FocusHandler;
+
+public class FocusStyleHandler extends CssStyleHandler implements FocusHandler, BlurHandler{
+ // this class is used to set the style of focused elements
+ public FocusStyleHandler() {
+ super();
+ }
+
+
+ @Override
+ public void onFocus(FocusEvent event) {
+ GdlVisibleObject widget = (GdlVisibleObject)event.getSource();
+ super.setStyles(widget);;
+ }
+
+
+ @Override
+ public void onBlur(BlurEvent event) {
+ GdlVisibleObject widget = (GdlVisibleObject)event.getSource();
+ super.unsetStyles(widget);
+ }
+}
Added: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/environment/HoverStyleHandler.java
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/environment/HoverStyleHandler.java Wed Jul 6 07:19:57 2011 (r567)
@@ -0,0 +1,28 @@
+package us.isidor.gdl.anaToMia.Widgets.environment;
+
+import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject;
+
+import com.google.gwt.event.dom.client.MouseOutEvent;
+import com.google.gwt.event.dom.client.MouseOutHandler;
+import com.google.gwt.event.dom.client.MouseOverEvent;
+import com.google.gwt.event.dom.client.MouseOverHandler;
+
+public class HoverStyleHandler extends CssStyleHandler implements MouseOverHandler, MouseOutHandler{
+ public HoverStyleHandler() {
+ super();
+ }
+
+
+ @Override
+ public void onMouseOut(MouseOutEvent event) {
+ GdlVisibleObject widget = (GdlVisibleObject)event.getSource();
+ super.unsetStyles(widget);
+ }
+
+
+ @Override
+ public void onMouseOver(MouseOverEvent event) {
+ GdlVisibleObject widget = (GdlVisibleObject)event.getSource();
+ super.setStyles(widget);
+ }
+}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java Wed Jul 6 05:16:54 2011 (r566)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java Wed Jul 6 07:19:57 2011 (r567)
@@ -2,7 +2,10 @@
import java.util.ArrayList;
import com.google.gwt.dom.client.Style.FontStyle;
+import com.google.gwt.dom.client.Style.Overflow;
+import com.google.gwt.dom.client.Style.VerticalAlign;
import com.google.gwt.event.dom.client.BlurHandler;
+import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.FocusHandler;
import com.google.gwt.event.dom.client.KeyPressEvent;
import com.google.gwt.event.dom.client.KeyPressHandler;
@@ -609,62 +612,87 @@
}
+ public void setVerticalAlign(Widget widget, VerticalAlign value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null){
+ this.setCssProperty((TextArea) widget, styleClass, "verticalAlign", value.getCssName());
+ super.setCssProperty(styleClass, "verticalAlign", value.getCssName());
+ }
+ }
+
+
+ public void setOverflow(Widget widget, Overflow value, String styleClass)throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "overflow", value.getCssName());
+ }
+
+
public void setGdlStyle(Widget widget) throws InvalidGdlSchemaException, ExecutionException {
+ this.setReadonly(this.getReadonly());
+ this.setResize(this.getResize());
+ this.setTextType(this.getTextType());
+ this.setRows(this.getRows());
+ this.setCols(this.getCols());
+ this.setContentOrientation(widget, this.getContentOrientation());
+
String[] styleClasses = new String[]{null, GdlPsis.Scope.gdlActive, GdlPsis.Scope.gdlFocus, GdlPsis.Scope.gdlHover};
for (String styleClass : styleClasses) {
+ this.setOverflow(widget, this.getOverflow(styleClass), styleClass);
+
+ this.setVerticalAlign(widget, this.getVerticalAlign(styleClass), styleClass);
+
this.setMargin(widget, this.getMargin(styleClass), styleClass);
this.setMarginTop(widget, this.getMarginTop(styleClass), styleClass);
this.setMarginRight(widget, this.getMarginRight(styleClass), styleClass);
this.setMarginBottom(widget, this.getMarginBottom(styleClass), styleClass);
this.setMarginLeft(widget, this.getMarginLeft(styleClass), styleClass);
+
+ this.setBorderColor(widget, this.getBorderColor(styleClass), styleClass);
+ this.setBorderTopColor(widget, this.getBorderTopColor(styleClass), styleClass);
+ this.setBorderRightColor(widget, this.getBorderRightColor(styleClass), styleClass);
+ this.setBorderBottomColor(widget, this.getBorderBottomColor(styleClass), styleClass);
+ this.setBorderLeftColor(widget, this.getBorderLeftColor(styleClass), styleClass);
+
+ this.setBorderStyle(widget, this.getBorderStyle(styleClass), styleClass);
+ this.setBorderTopStyle(widget, this.getBorderTopStyle(styleClass), styleClass);
+ this.setBorderRightStyle(widget, this.getBorderRightStyle(styleClass), styleClass);
+ this.setBorderBottomStyle(widget, this.getBorderBottomStyle(styleClass), styleClass);
+ this.setBorderLeftStyle(widget, this.getBorderLeftStyle(styleClass), styleClass);
+
+ this.setBorderWidth(widget, this.getBorderWidth(styleClass), styleClass);
+ this.setBorderTopWidth(widget, this.getBorderTopWidth(styleClass), styleClass);
+ this.setBorderRightWidth(widget, this.getBorderRightWidth(styleClass), styleClass);
+ this.setBorderBottomWidth(widget, this.getBorderBottomWidth(styleClass), styleClass);
+ this.setBorderLeftWidth(widget, this.getBorderLeftWidth(styleClass), styleClass);
+
+ this.setBorderRadius(widget, this.getBorderRadius(styleClass), styleClass);
+ this.setBorderTopRightRadius(widget, this.getBorderTopRightRadius(styleClass), styleClass);
+ this.setBorderBottomRightRadius(widget, this.getBorderBottomRightRadius(styleClass), styleClass);
+ this.setBorderBottomLeftRadius(widget, this.getBorderBottomLeftRadius(styleClass), styleClass);
+ this.setBorderTopLeftRadius(widget, this.getBorderTopLeftRadius(styleClass), styleClass);
+
+ this.setCursor(widget, this.getCursor(styleClass), styleClass);
+
+ this.setWidth(widget, this.getWidth(styleClass), styleClass);
+ this.setMaxWidth(widget, this.getMaxWidth(styleClass), styleClass);
+ this.setMinWidth(widget, this.getMinWidth(styleClass), styleClass);
+
+ this.setHeight(widget, this.getHeight(styleClass), styleClass);
+ this.setMaxHeight(widget, this.getMaxHeight(styleClass), styleClass);
+ this.setMinHeight(widget, this.getMinHeight(styleClass), styleClass);
+
+ this.setBackgroundColor(widget, this.getBackgroundColor(styleClass), styleClass);
+ this.setColor(widget, this.getColor(styleClass), styleClass);
+
+ this.setDirection(widget, this.getDirection(styleClass), styleClass);
+ this.setTextAlign(widget, this.getTextAlign(styleClass), styleClass);
+ this.setLineHeight(widget, this.getLineHeight(styleClass), styleClass);
+ this.setTextDecoration(widget, this.getTextDecoration(styleClass), styleClass);
+ this.setFontFamily(widget, this.getFontFamily(styleClass), styleClass);
+ this.setFontStyle(widget, this.getFontStyle(styleClass), styleClass);
+ this.setFontSize(widget, this.getFontSize(styleClass), styleClass);
+ this.setFontWeight(widget, this.getFontWeight(styleClass), styleClass);
+ this.setLetterSpacing(widget, this.getLetterSpacing(styleClass), styleClass);
+ this.setWordSpacing(widget, this.getWordSpacing(styleClass), styleClass);
}
-
- // TODO: implement
- // border-color
- // border-top-color
- // border-right-color
- // border-bottom-color
- // border-left-color
- // border-style
- // border-top-style
- // border-right-style
- // border-bottom-style
- // border-left-style
- // border-width
- // border-top-width
- // border-right-width
- // border-bottom-width
- // border-left-width
- // border-radius
- // border-top-right-radius
- // border-top-bottom-radius
- // border-bottom-left-radius
- // border-top-left-radius
- // cursor
- // width
- // max-widht
- // min-width
- // height
- // max-height
- // min-height
- // content-orientation
- // background-color
- // direction
- // text-align
- // line-height
- // text-decoration
- // color
- // font-family
- // font-style
- // font-size
- // font-weight
- // letter-spacing
- // word-spacing
- // text-type
- // readonly
- // rows
- // cols
- // resize
}
@@ -753,6 +781,17 @@
}
+ // registers a passed click handler to each text element of this item
+ @Override
+ public MultipleHandlerRegistration addClickHandler(ClickHandler handler) {
+ MultipleHandlerRegistration regs = new MultipleHandlerRegistration();
+ for (TextArea item : this.textElements) {
+ regs.addHandlerRegistration(item.addClickHandler(handler));
+ }
+ return regs;
+ }
+
+
// returns the results of all text area elements
@Override
public ArrayList<String> getStringValue() {
@@ -798,4 +837,5 @@
return this.realValue;
}
}
+
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlView.java Wed Jul 6 05:16:54 2011 (r566)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlView.java Wed Jul 6 07:19:57 2011 (r567)
@@ -1,7 +1,15 @@
package us.isidor.gdl.anaToMia.Widgets.views;
import com.google.gwt.core.client.JsArray;
+import com.google.gwt.dom.client.Style.Overflow;
+import com.google.gwt.dom.client.Style.VerticalAlign;
+import com.google.gwt.event.dom.client.BlurHandler;
import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.event.dom.client.FocusHandler;
+import com.google.gwt.event.dom.client.MouseDownHandler;
+import com.google.gwt.event.dom.client.MouseOutHandler;
+import com.google.gwt.event.dom.client.MouseOverHandler;
+import com.google.gwt.event.dom.client.MouseUpHandler;
import com.google.gwt.user.client.ui.Widget;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Construct;
@@ -13,6 +21,7 @@
import us.isidor.gdl.anaToMia.Widgets.base.IGdlContainer;
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
+import us.isidor.gdl.anaToMia.Widgets.environment.MultipleHandlerRegistration;
import us.isidor.gdl.anaToMia.Widgets.values.ContentOrientationValue;
@@ -59,12 +68,78 @@
public abstract void deregisterButtonCallback(ClickHandler handler, String id);
+ @Override
+ public void setVerticalAlign(Widget widget, VerticalAlign value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ // TODO: implement
+ }
+
+
+ @Override
+ public void setOverflow(Widget widget, Overflow value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ // TODO: implement
+ }
+
public void setContentOrientation(Widget widget, ContentOrientationValue value){
// do nothing - since all content elements are positioned vie the GDL positioning concept
}
+ // registers a click handler to all sub-elements of this element
+ @Override
+ public MultipleHandlerRegistration addClickHandler(ClickHandler handler){
+ // TODO: implement
+ return null;
+ }
+
+
+ // registers a mouse-out handler to all sub-elements of this element
+ @Override
+ public MultipleHandlerRegistration addMouseOutHandler(MouseOutHandler handler){
+ // TODO: implement
+ return null;
+ }
+
+
+ // registers a mouse-over handler to all sub-elements of this element
+ @Override
+ public MultipleHandlerRegistration addMouseOverHandler(MouseOverHandler handler){
+ // TODO: implement
+ return null;
+ }
+
+
+ // registers a focus handler to all sub-elements of this element
+ @Override
+ public MultipleHandlerRegistration addFocusHandler(FocusHandler handler){
+ // TODO: implement
+ return null;
+ }
+
+
+ // registers a mouse-down handler to all sub-elements of this element
+ @Override
+ public MultipleHandlerRegistration addMouseDownHandler(MouseDownHandler handler){
+ // TODO: implement
+ return null;
+ }
+
+
+ // registers a mouse-up handler to all sub-elements of this element
+ @Override
+ public MultipleHandlerRegistration addMouseUpHandler(MouseUpHandler handler){
+ // TODO: implement
+ return null;
+ }
+
+
+ // registers a blur handler to all sub-elements of this element
+ @Override
+ public MultipleHandlerRegistration addBlurHandler(BlurHandler handler){
+ // TODO: implement
+ return null;
+ }
+
// TODO: implement addXYZhandler(handler, id);
1
0