[isidorus-cvs] r548 - branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base

lgiessmann at common-lisp.net lgiessmann at common-lisp.net
Fri Jul 1 15:06:19 UTC 2011


Author: lgiessmann
Date: Fri Jul  1 08:06:19 2011
New Revision: 548

Log:
gdl-frontend: Widgets: implemented a method that gets the GDL overflow property;

Modified:
   branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.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	Fri Jul  1 07:58:03 2011	(r547)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java	Fri Jul  1 08:06:19 2011	(r548)
@@ -16,6 +16,7 @@
 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.user.client.ui.AbsolutePanel;
 import com.google.gwt.user.client.ui.Composite;
@@ -1093,8 +1094,36 @@
 		}	
 	}
 	
-	
-	// gdlOverflow [gdl:hover | gdl:focus | gdl:active]
+
+	// 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.gdlCursor, styleClass);
+		} else {
+			overflowOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlCursor);
+		}
+		
+		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("cursor must be set to one of visible, hidden or scroll, but is " + overflowOcc.getValue());
+			}
+		}	
+	}
 	
 	
 	public void setGdlStyle(){




More information about the Isidorus-cvs mailing list