[isidorus-cvs] r567 - in branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets: base environment text views
lgiessmann at common-lisp.net
lgiessmann at common-lisp.net
Wed Jul 6 14:19:59 UTC 2011
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);
More information about the Isidorus-cvs
mailing list