[isidorus-cvs] r634 - 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 16 09:30:30 UTC 2011


Author: lgiessmann
Date: Sat Jul 16 02:30:29 2011
New Revision: 634

Log:
gdl-frontend: Widgets: added an href memeber to the class Reference

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	Sat Jul 16 01:01:39 2011	(r633)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlReference.java	Sat Jul 16 02:30:29 2011	(r634)
@@ -10,25 +10,9 @@
 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.dom.client.HasMouseDownHandlers;
-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.event.shared.GwtEvent;
 import com.google.gwt.event.shared.HandlerRegistration;
 import com.google.gwt.user.client.DOM;
-import com.google.gwt.user.client.Element;
 import com.google.gwt.user.client.Window;
-import com.google.gwt.user.client.ui.Composite;
-import com.google.gwt.user.client.ui.Hyperlink;
 import com.google.gwt.user.client.ui.Label;
 import com.google.gwt.user.client.ui.Widget;
 import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Occurrence;
@@ -56,8 +40,9 @@
 	public GdlReference(Topic tmRepresentative) throws InvalidGdlSchemaException, ExecutionException{
 		super(tmRepresentative);
 		// TODO: create a Reference element for each TM-elem
-		this.createReference().setText("Reference"); // TODO: remove
-		
+		Reference ref = this.createReference(); // TODO: remove
+		ref.setText("Reference"); // TODO: remove
+		ref.setHref("http://www.google.de"); // TODO: remove
 	}
 	
 	
@@ -185,6 +170,8 @@
 	protected class ReferenceClickHandler implements ClickHandler  {
 		@Override
 		public void onClick(ClickEvent event) {
+			Reference ref = (Reference)event.getSource();
+			Window.open(ref.getHref(), "new window", null);
 			/*
 			TODO: implement
 			
@@ -285,13 +272,27 @@
 	
 	// this class wraps a Label that is used as 
 	protected class Reference extends Label implements HasFocusHandlers, HasBlurHandlers {
+		private String href = "";
+		
 		public Reference(){
 			super();
 		}
 		
 		
-		public Reference(String text) {
+		public Reference(String text, String href) {
 			super(text);
+			if(href != null) this.href = href;
+		}
+		
+		
+		public String getHref(){
+			return this.href;
+		}
+		
+		
+		public void setHref(String href){
+			if(href != null) this.href = href;
+			else this.href = "";
 		}
 		
 




More information about the Isidorus-cvs mailing list