Author: lgiessmann
Date: Fri Sep 2 02:00:04 2011
New Revision: 818
Log:
gdl-frontend: Widgets: changed the base-structure for validating user data
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/GdlSpace.java
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/button/GdlActionButton.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/button/GdlCommitButton.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/button/GdlDeleteButton.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/container/GdlList.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/container/GdlUnit.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlInfo.java
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/GdlTitle.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlAssociationView.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlTopicView.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlView.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 Fri Sep 2 00:58:42 2011 (r817)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlPanel.java Fri Sep 2 02:00:04 2011 (r818)
@@ -266,7 +266,7 @@
// data by using the view's getContent method.
public ArrayList<Pair<Construct, TopicMapsTypes>> getContent() throws Exception {
try{
- return this.view.getContent(null);
+ return this.view.getContent(null, false);
}catch(Exception e){
for (IOnErrorCallback handler : localOnErrorContainer) {
handler.onError(GdlErrorTypes.TopicMapsGenerationError, e);
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlSpace.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlSpace.java Fri Sep 2 00:58:42 2011 (r817)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlSpace.java Fri Sep 2 02:00:04 2011 (r818)
@@ -38,11 +38,4 @@
public void fixValue(){
// has no effect on this element
}
-
-
- @Override
- public void validate() throws ExecutionException {
- // this element has no editable content and is always valid
- return;
- }
}
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 Sep 2 00:58:42 2011 (r817)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java Fri Sep 2 02:00:04 2011 (r818)
@@ -18,6 +18,7 @@
import us.isidor.gdl.anaToMia.Widgets.environment.FocusStyleHandler;
import us.isidor.gdl.anaToMia.Widgets.environment.GdlInstantiator;
import us.isidor.gdl.anaToMia.Widgets.environment.HoverStyleHandler;
+import us.isidor.gdl.anaToMia.Widgets.environment.InvalidContentException;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
import us.isidor.gdl.anaToMia.Widgets.environment.MultipleHandlerRegistration;
import us.isidor.gdl.anaToMia.Widgets.environment.Pair;
@@ -2213,7 +2214,7 @@
// returns the actual data that is hold by this instance
- public ArrayList<Pair<Construct, TopicMapsTypes>> getContent(Construct carrier) throws InvalidGdlSchemaException, ExecutionException {
+ public ArrayList<Pair<Construct, TopicMapsTypes>> getContent(Construct carrier, boolean onlyValidate) throws InvalidGdlSchemaException, ExecutionException, InvalidContentException {
ArrayList<Pair<Construct, TopicMapsTypes>> result = new ArrayList<Pair<Construct,TopicMapsTypes>>();
if(this.getRootConstraint() == null) return result;
Construct localCarrier = carrier;
@@ -2297,10 +2298,4 @@
return result;
}
-
-
- // validates the entered user data, if it is invalid a ExecutionException is thrown
- public void validate() throws ExecutionException{
- // TODO: implement
- }
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/button/GdlActionButton.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/button/GdlActionButton.java Fri Sep 2 00:58:42 2011 (r817)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/button/GdlActionButton.java Fri Sep 2 02:00:04 2011 (r818)
@@ -270,11 +270,4 @@
public void fixValue(){
// has no effect on this element
}
-
-
- @Override
- public void validate() throws ExecutionException {
- // this element has no editable content and is always valid
- return;
- }
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/button/GdlCommitButton.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/button/GdlCommitButton.java Fri Sep 2 00:58:42 2011 (r817)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/button/GdlCommitButton.java Fri Sep 2 02:00:04 2011 (r818)
@@ -42,7 +42,7 @@
TmEngine tmEngine = this.owner.getRoot().getTmEngine();
ICommitCallback callback = this.owner.getRoot().getCommitCallback();
- callback.commitTmConstruct(this.owner.getGdlParent().getContent(null), tmEngine, this.owner.getId());
+ callback.commitTmConstruct(this.owner.getGdlParent().getContent(null, false), tmEngine, this.owner.getId());
}catch(Exception e){
e.printStackTrace();
Window.alert("caught: " + e.getMessage());
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/button/GdlDeleteButton.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/button/GdlDeleteButton.java Fri Sep 2 00:58:42 2011 (r817)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/button/GdlDeleteButton.java Fri Sep 2 02:00:04 2011 (r818)
@@ -38,7 +38,7 @@
public void onClick(ClickEvent event) {
try{
IDeleteCallback callback = this.owner.getRoot().getDeleteCallback();
- callback.deleteTmConstruct(this.owner.getGdlParent().getContent(null), this.owner.getId());
+ callback.deleteTmConstruct(this.owner.getGdlParent().getContent(null, false), this.owner.getId());
}catch(Exception e){
e.printStackTrace();
Window.alert("caught: " + e.getMessage());
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/container/GdlList.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/container/GdlList.java Fri Sep 2 00:58:42 2011 (r817)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/container/GdlList.java Fri Sep 2 02:00:04 2011 (r818)
@@ -275,21 +275,8 @@
contents.add(content);
}
}
-
-
- public void validate() throws ExecutionException {
- for (GdlVisibleObject content : this.contents) content.validate();
- }
}
-
- @Override
- public void validate() throws ExecutionException {
- for (Widget ctrl : this.subElements) {
- ((ListWidget)((ButtonableObject)ctrl).getMainObject()).validate();
- }
- }
-
@Override
public GdlVisibleObject append(Topic ancestor, Topic current) throws InvalidGdlSchemaException, ExecutionException {
@@ -429,13 +416,6 @@
}
- public void validate() throws ExecutionException {
- for (Pair<ListItem, Integer> item: this.itemsAndIndexes) {
- item.getFirst().validate();
- }
- }
-
-
public void setId(String id){
DOM.setElementAttribute(this.basePanel.getElement(), "id", id);
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/container/GdlUnit.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/container/GdlUnit.java Fri Sep 2 00:58:42 2011 (r817)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/container/GdlUnit.java Fri Sep 2 02:00:04 2011 (r818)
@@ -244,14 +244,6 @@
}
- @Override
- public void validate() throws ExecutionException {
- for (Widget ctrl : this.subElements) {
- ((UnitWidget)((ButtonableObject)ctrl).getMainObject()).validate();
- }
- }
-
-
protected class UnitWidget extends Composite implements HasFocusHandlers, HasBlurHandlers, HasMouseOutHandlers, HasMouseOverHandlers, HasMouseDownHandlers, HasMouseUpHandlers{
private CaptionPanel basePanel = new CaptionPanel();
private AbsolutePanel containerPanel = new AbsolutePanel();
@@ -378,14 +370,5 @@
e.printStackTrace();
}
}
-
-
- public void validate() throws ExecutionException{
- for (Widget ctrl : this.subElements) {
- if(ctrl instanceof GdlVisibleObject){
- ((GdlVisibleObject)ctrl).validate();
- }
- }
- }
}
}
\ No newline at end of file
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlInfo.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlInfo.java Fri Sep 2 00:58:42 2011 (r817)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlInfo.java Fri Sep 2 02:00:04 2011 (r818)
@@ -108,11 +108,4 @@
public ArrayList<String> getSelectedValues(){
return new ArrayList<String>();
}
-
-
- @Override
- public void validate() throws ExecutionException {
- // this element has no editable content and is always valid
- return;
- }
}
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 Sep 2 00:58:42 2011 (r817)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlReference.java Fri Sep 2 02:00:04 2011 (r818)
@@ -58,13 +58,6 @@
}
- @Override
- public void validate() throws ExecutionException {
- // this element has no editable content and is always valid
- return;
- }
-
-
private ReferenceWidget createReference() throws InvalidGdlSchemaException, ExecutionException {
ReferenceWidget reference = new ReferenceWidget();
DOM.setElementAttribute(reference.getElement(), "id", this.getId() + "__GDL_" + this.subElements.size());
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlTitle.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlTitle.java Fri Sep 2 00:58:42 2011 (r817)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlTitle.java Fri Sep 2 02:00:04 2011 (r818)
@@ -449,13 +449,6 @@
}
- @Override
- public void validate() throws ExecutionException {
- // this element has no editable content and is always valid
- return;
- }
-
-
// this class represents the acutal content of this widget, i.e.
// it wraps a h1, h2, h3 or h4 element
protected class TitleWidget extends Composite implements HasMouseDownHandlers, HasMouseUpHandlers, HasMouseOverHandlers, HasMouseOutHandlers, HasBlurHandlers, HasFocusHandlers{
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlAssociationView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlAssociationView.java Fri Sep 2 00:58:42 2011 (r817)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlAssociationView.java Fri Sep 2 02:00:04 2011 (r818)
@@ -16,6 +16,7 @@
import us.isidor.gdl.anaToMia.Widgets.base.PSIs;
import us.isidor.gdl.anaToMia.Widgets.base.TmHelper;
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
+import us.isidor.gdl.anaToMia.Widgets.environment.InvalidContentException;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
import us.isidor.gdl.anaToMia.Widgets.environment.Pair;
import us.isidor.gdl.anaToMia.Widgets.value.ContentOrientationValue;
@@ -184,13 +185,13 @@
@Override
- public ArrayList<Pair<Construct, TopicMapsTypes>> getContent(Construct carrier) throws InvalidGdlSchemaException, ExecutionException {
+ public ArrayList<Pair<Construct, TopicMapsTypes>> getContent(Construct carrier, boolean onlyValidate) throws InvalidGdlSchemaException, ExecutionException, InvalidContentException{
ArrayList<Pair<Construct, TopicMapsTypes>> result = new ArrayList<Pair<Construct,TopicMapsTypes>>();
for (Widget ctrl : this.subElements) {
if(ctrl instanceof ButtonableObject){
if(((ButtonableObject)ctrl).getMainObject() instanceof AssociationItem){
- for (Pair<Construct, TopicMapsTypes> pair : ((AssociationItem)((ButtonableObject)ctrl).getMainObject()).getContent(null)) {
+ for (Pair<Construct, TopicMapsTypes> pair : ((AssociationItem)((ButtonableObject)ctrl).getMainObject()).getContent(null, onlyValidate)) {
result.add(pair);
}
}
@@ -223,13 +224,6 @@
return result;
}
-
-
- @Override
- public void validate() throws ExecutionException {
- for (Widget ctrl : this.subElements)
- if(ctrl instanceof AssociationItem) ((AssociationItem)ctrl).validate();
- }
// This class represents a single association that is displayed.
@@ -270,14 +264,14 @@
@Override
- public ArrayList<Pair<Construct, TopicMapsTypes>> getContent(Construct carrier) throws InvalidGdlSchemaException, ExecutionException {
+ public ArrayList<Pair<Construct, TopicMapsTypes>> getContent(Construct carrier, boolean onlyValidate) throws InvalidGdlSchemaException, ExecutionException, InvalidContentException {
ArrayList<Pair<Construct, TopicMapsTypes>> result = new ArrayList<Pair<Construct,TopicMapsTypes>>();
Association localCarrier = this.getRepresentedAssociation();
for (Widget ctrl : this.subElements) {
if(ctrl instanceof GdlVisibleObject){
- ((GdlVisibleObject)ctrl).getContent(localCarrier);
+ ((GdlVisibleObject)ctrl).getContent(localCarrier, onlyValidate);
}
}
result.add(new Pair<Construct, TopicMapsTypes>(localCarrier, TopicMapsTypes.Association));
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlTopicView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlTopicView.java Fri Sep 2 00:58:42 2011 (r817)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlTopicView.java Fri Sep 2 02:00:04 2011 (r818)
@@ -18,6 +18,7 @@
import us.isidor.gdl.anaToMia.Widgets.base.TmHelper;
import us.isidor.gdl.anaToMia.Widgets.base.Utils;
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
+import us.isidor.gdl.anaToMia.Widgets.environment.InvalidContentException;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
import us.isidor.gdl.anaToMia.Widgets.environment.Pair;
import us.isidor.gdl.anaToMia.Widgets.value.ContentOrientationValue;
@@ -139,7 +140,7 @@
@Override
- public ArrayList<Pair<Construct, TopicMapsTypes>> getContent(Construct carrier) throws InvalidGdlSchemaException, ExecutionException {
+ public ArrayList<Pair<Construct, TopicMapsTypes>> getContent(Construct carrier, boolean onlyValidate) throws InvalidGdlSchemaException, ExecutionException, InvalidContentException {
ArrayList<Pair<Construct, TopicMapsTypes>> result = new ArrayList<Pair<Construct,TopicMapsTypes>>();
Topic localCarrier = (Topic)this.receivedData;
@@ -151,7 +152,7 @@
if(i == result.size()) result.add(new Pair<Construct, TopicMapsTypes>(localCarrier, TopicMapsTypes.Topic));
if(ctrl instanceof GdlVisibleObject){
- for (Pair<Construct, TopicMapsTypes> pair : ((GdlVisibleObject)ctrl).getContent(localCarrier)) {
+ for (Pair<Construct, TopicMapsTypes> pair : ((GdlVisibleObject)ctrl).getContent(localCarrier, onlyValidate)) {
if((this.receivedData != null || (ctrl instanceof GdlView)) && !this.indirectlyContained(pair, result))result.add(pair);
}
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlView.java Fri Sep 2 00:58:42 2011 (r817)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/view/GdlView.java Fri Sep 2 02:00:04 2011 (r818)
@@ -125,14 +125,4 @@
return this.hiddenValues;
}
}
-
-
- @Override
- public void validate() throws ExecutionException {
- for (Widget ctrl : this.subElements) {
- if(ctrl instanceof GdlVisibleObject){
- ((GdlVisibleObject)ctrl).validate();
- }
- }
- }
}
\ No newline at end of file