[isidorus-cvs] r949 - in branches/gdl-frontend/src/anaToMia/GDL_Widgets: src/us/isidor/gdl/anaToMia/Widgets/isidorus war

lgiessmann at common-lisp.net lgiessmann at common-lisp.net
Wed Sep 21 10:08:03 UTC 2011


Author: lgiessmann
Date: Wed Sep 21 03:08:03 2011
New Revision: 949

Log:
gdl-frontend: Widgets: fixed some bugs in the GdlWebPage class

Modified:
   branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/isidorus/DeleteCallback.java
   branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/isidorus/GdlWebPage.java
   branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/isidorus/HashObjectPsiContainer.java
   branches/gdl-frontend/src/anaToMia/GDL_Widgets/war/GDL_Widgets.css

Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/isidorus/DeleteCallback.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/isidorus/DeleteCallback.java	Wed Sep 21 02:37:02 2011	(r948)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/isidorus/DeleteCallback.java	Wed Sep 21 03:08:03 2011	(r949)
@@ -35,7 +35,7 @@
 										   		  "?topics model:environment env:";
 	private final String TM_SPARQL_QUERY_PART_2 = ".\n}";
 	private GdlWebPage gdlWebPage = null;
-	private HashObjectPsiContainer hashObjectPsiContainer = new HashObjectPsiContainer(null);
+	private HashObjectPsiContainer hashObjectPsiContainer = new HashObjectPsiContainer();
 	
 	
 	@SuppressWarnings("unused")
@@ -123,12 +123,6 @@
 				Window.alert("could not request existing instances of " + IsidorusConstants.HASH_OBJECT_PSI + ", because(" + response.getStatusCode() + "): " + response.getStatusText());
 			}
 			DeleteCallback.this.gdlWebPage.removeLoadScreenPanel();
-			
-			
-			
-			// TODO: check the user's input
-			// TODO: delete all hash-objects
-			// TODO: delete the environment
 		}
 		
 

Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/isidorus/GdlWebPage.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/isidorus/GdlWebPage.java	Wed Sep 21 02:37:02 2011	(r948)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/isidorus/GdlWebPage.java	Wed Sep 21 03:08:03 2011	(r949)
@@ -78,7 +78,8 @@
 	
 	public void resetPage() {
 		this.removeLoadScreenPanel();
-		if(gdlPanel != null) this.gdlPanel.removeFromParent();
+		if(this.hashObjectPsicontainer != null) this.hashObjectPsicontainer.removeFromParent();
+		if(this.gdlPanel != null) this.gdlPanel.removeFromParent();
 		if(this.psiContainer != null) this.psiContainer.removeFromParent();
 		if(this.createNewButton != null) this.createNewButton.removeFromParent();
 		
@@ -101,6 +102,7 @@
 	
 	public void setGdlPanel(GdlPanel gdlPanel){
 		if(this.gdlPanel != null) this.gdlPanel.removeFromParent();
+		if(this.hashObjectPsicontainer != null) this.hashObjectPsicontainer.removeFromParent();
 		this.gdlPanel = gdlPanel;
 		if(this.gdlPanel != null) this.contentPanel.add(this.gdlPanel);
 	}

Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/isidorus/HashObjectPsiContainer.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/isidorus/HashObjectPsiContainer.java	Wed Sep 21 02:37:02 2011	(r948)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/isidorus/HashObjectPsiContainer.java	Wed Sep 21 03:08:03 2011	(r949)
@@ -3,7 +3,10 @@
 
 
 import java.util.ArrayList;
+
+import com.google.gwt.event.dom.client.ClickEvent;
 import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.user.client.Window;
 import com.google.gwt.user.client.ui.Button;
 import com.google.gwt.user.client.ui.CheckBox;
 import com.google.gwt.user.client.ui.Composite;
@@ -15,19 +18,14 @@
 public class HashObjectPsiContainer extends Composite {
 	private ArrayList<CheckBox> psiCheckBoxes = new ArrayList<CheckBox>();
 	private VerticalPanel containerPanel = new VerticalPanel();
-	private Button commitButton = new Button("delete");
+	private Button commitButton = new Button("delete the Environment topic and all its Hash-Object topics");
+	private final String ERROR_STYLE_CLASS = "bad_input";
 	
 	
-	private HashObjectPsiContainer(){
+	public HashObjectPsiContainer(){
 		this.initWidget(this.containerPanel);
 		this.containerPanel.add(this.commitButton);
-	}
-	
-	
-	public HashObjectPsiContainer(ClickHandler buttonClikcHandler){
-		this();
-		
-		if(buttonClikcHandler != null) this.commitButton.addClickHandler(buttonClikcHandler);
+		this.commitButton.addClickHandler(new HashObjectPsiContainerClickHandler());
 	}
 	
 	
@@ -50,4 +48,28 @@
 		if(widgetIdx == this.containerPanel.getWidgetCount()) this.containerPanel.add(cbx);
 		this.containerPanel.insert(this.commitButton, this.containerPanel.getWidgetCount());
 	}
+	
+	
+	private class HashObjectPsiContainerClickHandler implements ClickHandler {
+		public HashObjectPsiContainerClickHandler(){}
+		
+		
+		@Override
+		public void onClick(ClickEvent event) {
+			boolean allValuesChecked = true;
+			for (CheckBox cbx : HashObjectPsiContainer.this.psiCheckBoxes) {
+				if(!cbx.getValue()){
+					cbx.addStyleName(HashObjectPsiContainer.this.ERROR_STYLE_CLASS);
+					allValuesChecked = false;
+				}
+			}
+			
+			if(!allValuesChecked){
+				Window.alert("to delete the an environment topic, please select explicit all associated hash-object topics to be deleted!");
+			} else {
+				// TODO: delete all hash-objects
+				// TODO: delete the environment
+			}
+		}
+	}
 }

Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/war/GDL_Widgets.css
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/war/GDL_Widgets.css	Wed Sep 21 02:37:02 2011	(r948)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/war/GDL_Widgets.css	Wed Sep 21 03:08:03 2011	(r949)
@@ -70,4 +70,9 @@
 
 .create_new_button {
   margin-bottom: 2em;
+}
+
+
+.bad_input {
+  color: red;	
 }
\ No newline at end of file




More information about the Isidorus-cvs mailing list