[isidorus-cvs] r593 - branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text

lgiessmann at common-lisp.net lgiessmann at common-lisp.net
Sat Jul 9 06:32:59 UTC 2011


Author: lgiessmann
Date: Fri Jul  8 23:32:58 2011
New Revision: 593

Log:
gdl-frontend: Widgets: implemented a GdlReference click handler that is responsible for the default click behavior of a GdlReference instaince defined by the GDL

Modified:
   branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlReference.java

Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlReference.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlReference.java	Fri Jul  8 23:26:35 2011	(r592)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlReference.java	Fri Jul  8 23:32:58 2011	(r593)
@@ -4,12 +4,15 @@
 
 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.HasFocusHandlers;
 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.Label;
 import com.google.gwt.user.client.ui.Widget;
 
@@ -54,8 +57,7 @@
 		reference.addMouseOutHandler(hsHandler);
 		reference.addFocusHandler(fsHandler);
 		reference.addBlurHandler(fsHandler);
-		// TODO: register a click handler that handles the reference behavior
-		reference.setText("reference !!!"); // TODO: remove
+		reference.addClickHandler(new ReferenceClickHandler());
 		super.setGdlStyle(reference);
 		return reference;
 	}
@@ -162,6 +164,28 @@
 	}
 	
 	
+	// this class is responsible for the default click behavior of a GdlReference instance
+	protected class ReferenceClickHandler implements ClickHandler  {
+		@Override
+		public void onClick(ClickEvent event) {
+			/*
+			TODO: implement
+			
+			If a gdl:Reference element is bound to a gdl:Literal-Value (cf. chapter 7.16.2).
+			The set value must be treated as a network address, i.e. if this element is clicked
+			a new tabulator or a new window must appear with the content represented
+			by the given URI.
+			If a gdl:Reference element is bound to a gdl:TM-Value (cf. chapter 7.16.4),
+			the set value must be treated as a topic value, i.e. if a gdl:Reference
+			element is clicked a new tabulator or a new window must appear with the
+			gdl:Default-Editor-View bound to the topic represented by the given URI.
+			If no gdl:Default-Topic-View is defined for the requested topic,
+			a warning must be thrown followed by a regular proceeding of the GDL-frontend. 
+			*/
+		}
+	}
+	
+	
 	// this class wraps a Label that is used as 
 	protected class Reference extends Label implements HasFocusHandlers, HasBlurHandlers {
 		public Reference(){




More information about the Isidorus-cvs mailing list