[isidorus-cvs] r530 - in branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets: base environment

lgiessmann at common-lisp.net lgiessmann at common-lisp.net
Wed Jun 29 13:29:51 UTC 2011


Author: lgiessmann
Date: Wed Jun 29 06:29:49 2011
New Revision: 530

Log:
gdl-frontend: Widgets: added a callback hierarchy

Added:
   branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/environment/ICommitCallback.java
   branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/environment/IDeleteCallback.java
   branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/environment/ILoadCallback.java
Modified:
   branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlPanel.java
   branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/environment/GdlError.java
   branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/environment/IGdlErrorHandler.java

Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlPanel.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlPanel.java	Wed Jun 29 05:59:20 2011	(r529)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlPanel.java	Wed Jun 29 06:29:49 2011	(r530)
@@ -3,10 +3,13 @@
 import java.util.ArrayList;
 import us.isidor.gdl.anaToMia.TopicMaps.TmEngineModel.TmEngine;
 import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMap;
+import us.isidor.gdl.anaToMia.Widgets.environment.GdlError;
+import us.isidor.gdl.anaToMia.Widgets.environment.ICommitCallback;
+import us.isidor.gdl.anaToMia.Widgets.environment.IDeleteCallback;
 import us.isidor.gdl.anaToMia.Widgets.environment.IGdlErrorHandler;
 import us.isidor.gdl.anaToMia.Widgets.environment.IGdlEventHandler;
+import us.isidor.gdl.anaToMia.Widgets.environment.ILoadCallback;
 import us.isidor.gdl.anaToMia.Widgets.views.GdlDefaultTopicView;
-
 import com.google.gwt.user.client.ui.AbsolutePanel;
 import com.google.gwt.user.client.ui.Composite;
 
@@ -40,7 +43,15 @@
 	// the actual view with the corresponding content
 	GdlDefaultTopicView view = null;
 	
+	// callback instance for getting/loading the GDL schema
+	private ILoadCallback loadCallback = null;
+	// callback instance for committing the frontend data to the server
+	private ICommitCallback commitCallback = null;
+	// callback instance for deleting the frontend data on the server
+	private IDeleteCallback deleteCallback = null;
+
 	
+	// some constructors
 	private GdlPanel() {
 		initWidget(mainPanel);
 	}
@@ -56,6 +67,15 @@
 	}
 	
 	
+	// TODO: 5x constructor
+	
+	// TODO: getter + setter Tmengine
+	
+	// TODO: getter + setter Event/Error Containers
+	
+	// TODO: getter + setter Callbacks
+	
+	
 	public GdlPanel(String instanceIdentifier, int width, int height){
 		this(instanceIdentifier);
 		this.setPixelSize(width, height);
@@ -90,6 +110,7 @@
 	}
 	
 	
+	// some methods for adding handler instances
 	public void addOnLoadHandler(IGdlEventHandler handler){
 		if(!onLoadContainer.contains(handler)){
 			onLoadContainer.add(handler);
@@ -150,11 +171,13 @@
 	}
 	
 	
+	// getter for the Topic Maps engine instance
 	public TmEngine getTmengine(){
 		return this.tmEngine;
 	}
 	
 	
+	
 	public void setTmEngine(TmEngine tmEngine) {
 		if(tmEngine != null){
 			this.tmEngine = tmEngine;
@@ -162,58 +185,94 @@
 	}
 	
 	
+	// some setters for callback instances
+	
+	
+	// some getters for callback instances
+	
+	
 	public void doLoad(){
 		try{
 			// TODO: Implement
+			
+			// TODO: execute onLoadContainer items
 		}catch(Exception e){
-			// TODO: executes all onError handlers
+			for (IGdlErrorHandler handler : onErrorContainer) {
+				handler.onError(GdlError.LoadError, e);
+			}
 		}
 	}
 	
 	
+	
+	
 	public void doCommit(){
 		try{
 			// TODO: Implement
+			
+			// TODO: execute onCommitContainer items
 		}catch(Exception e){
-			// TODO: executes all onError handlers
+			for (IGdlErrorHandler handler : onErrorContainer) {
+				handler.onError(GdlError.CommitError, e);
+			}
 		}
 	}
 	
 	
+	
+	
 	public void doValidate() {
 		try{
 			// TODO: Implement
+			
+			// TODO: execute onValidateContainer items
 		}catch(Exception e){
-			// TODO: executes all onError handlers
+			for (IGdlErrorHandler handler : onErrorContainer) {
+				handler.onError(GdlError.ValidateError, e);
+			}
 		}
 	}
 	
 	
+	
+	
 	public void doDelete() {
 		try{
 			// TODO: Implement
+			
+			// TODO: execute onDeleteContainer items
 		}catch(Exception e){
-			// TODO: executes all onError handlers
+			for (IGdlErrorHandler handler : onErrorContainer) {
+				handler.onError(GdlError.DeleteError, e);
+			}
 		}
 	}
 	
 	
+	
+	
 	public TopicMap generateTopicMap() {
 		try{
 			// TODO: Implement
 			return  null;
 		}catch(Exception e){
-			// TODO: executes all onError handlers
+			for (IGdlErrorHandler handler : onErrorContainer) {
+				handler.onError(GdlError.TopicMapsGenerationError, e);
+			}
 			return null;
 		}
 	}
 	
 	
+	
+	
 	public void createView(){
 		try{
 			// TODO: Implement
 		}catch(Exception e){
-			// TODO: executes all onError handlers
+			for (IGdlErrorHandler handler : onErrorContainer) {
+				handler.onError(GdlError.ViewCreationError, e);
+			}
 		}
 	}
 }

Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/environment/GdlError.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/environment/GdlError.java	Wed Jun 29 05:59:20 2011	(r529)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/environment/GdlError.java	Wed Jun 29 06:29:49 2011	(r530)
@@ -1,5 +1,11 @@
 package us.isidor.gdl.anaToMia.Widgets.environment;
 
 public enum GdlError {
-
+	LoadError,
+	CommitError,
+	ValidateError,
+	DeleteError,
+	TopicMapsGenerationError,
+	ViewCreationError
+	// TODO: ...
 }

Added: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/environment/ICommitCallback.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/ICommitCallback.java	Wed Jun 29 06:29:49 2011	(r530)
@@ -0,0 +1,5 @@
+package us.isidor.gdl.anaToMia.Widgets.environment;
+
+public interface ICommitCallback {
+	// TODO: implement
+}

Added: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/environment/IDeleteCallback.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/IDeleteCallback.java	Wed Jun 29 06:29:49 2011	(r530)
@@ -0,0 +1,5 @@
+package us.isidor.gdl.anaToMia.Widgets.environment;
+
+public interface IDeleteCallback {
+	// TODO: implement
+}

Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/environment/IGdlErrorHandler.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/environment/IGdlErrorHandler.java	Wed Jun 29 05:59:20 2011	(r529)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/environment/IGdlErrorHandler.java	Wed Jun 29 06:29:49 2011	(r530)
@@ -2,5 +2,5 @@
 
 
 public interface IGdlErrorHandler {
-	public void onError(GdlError errorType, Object errorInformation);
+	public void onError(GdlError errorType, Exception errorInformation);
 }

Added: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/environment/ILoadCallback.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/ILoadCallback.java	Wed Jun 29 06:29:49 2011	(r530)
@@ -0,0 +1,5 @@
+package us.isidor.gdl.anaToMia.Widgets.environment;
+
+public interface ILoadCallback {
+	// TODO: implement
+}




More information about the Isidorus-cvs mailing list