Author: lgiessmann Date: Mon Nov 28 07:07:19 2011 New Revision: 1038
Log: gdl-frontend: Widgets: updated the test-gdl-schema for a test for GdlRadioButton
Modified: trunk/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/button/GdlCheckBox.java trunk/src/anaToMia/GDL_Widgets/war/gdl_widgets/Service_GDL_Schema.jtm
Modified: trunk/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/button/GdlCheckBox.java ============================================================================== --- trunk/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/button/GdlCheckBox.java Mon Nov 28 07:02:47 2011 (r1037) +++ trunk/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/button/GdlCheckBox.java Mon Nov 28 07:07:19 2011 (r1038) @@ -1,7 +1,6 @@ package us.isidor.gdl.anaToMia.Widgets.button;
import java.util.ArrayList; - import com.google.gwt.user.client.ui.CheckBox; import com.google.gwt.user.client.ui.Widget; import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Construct; @@ -20,10 +19,10 @@ public GdlCheckBox(Topic tmRepresentative, Construct receivedData, GdlVisibleObject gdlParent) throws InvalidGdlSchemaException, ExecutionException{ super(tmRepresentative, receivedData, gdlParent); - // TODO: create a check box for each tm construct - this.createCheckBox().setText("Check Box 1"); - this.createCheckBox().setText("Check Box 2"); - this.createCheckBox().setText("Check Box 3"); + + if(receivedData != null && this.getConstraint() != null) this.setReceivedData(); + else this.setDefaultValue(); + this.setNthButtons(); } @@ -40,14 +39,23 @@
@Override public void addSubItem(String value) throws InvalidGdlSchemaException, ExecutionException { - // TODO: implement + CheckBox cb = this.createCheckBox(); + cb.setText(value); + cb.setValue(true); } @Override public ArrayList<String> getSelectedValues(){ - // TODO: implement - return new ArrayList<String>(); + ArrayList<String> result = new ArrayList<String>(); + + for (Widget elem : this.subElements) { + ButtonableObject bo = (ButtonableObject)elem; + Widget wdgt = bo.getMainObject(); + if((wdgt instanceof CheckBox) && ((CheckBox)wdgt).getValue()) result.add(((CheckBox)wdgt).getText()); + } + + return result; }
Modified: trunk/src/anaToMia/GDL_Widgets/war/gdl_widgets/Service_GDL_Schema.jtm ============================================================================== --- trunk/src/anaToMia/GDL_Widgets/war/gdl_widgets/Service_GDL_Schema.jtm Mon Nov 28 07:02:47 2011 (r1037) +++ trunk/src/anaToMia/GDL_Widgets/war/gdl_widgets/Service_GDL_Schema.jtm Mon Nov 28 07:07:19 2011 (r1038) @@ -231,9 +231,9 @@ {"subject_identifiers":["[gdlsrv:service-variant-name-iis-text-value-group]"], "instance_of":["si:[gdlt:Value-Group]"]}, {"subject_identifiers":["[model:service-variant-name-ii-constraint]"], "instance_of":["si:[gdlt:Variant-Name-Identifiers]"]},
- {"subject_identifiers":["[gdlsrv:service-variant-name-reifier-text]"], "instance_of":["si:[gdlt:Radio-Button]"], "occurrences":[{"type":"si:[gdl:id]", "value":"service_variant_name_reifier_text_id"}]}, - {"subject_identifiers":["[gdlsrv:service-variant-name-reifier-text-position]"], "instance_of":["si:[gdlt:Position]"], "occurrences":[{"type":"si:[gdl:position-style]", "value":"absolute"}, {"type":"si:[gdl:top]", "value":"490px"}, {"type":"si:[gdl:left]", "value":"10px"}]}, - {"subject_identifiers":["[gdlsrv:service-variant-name-reifier-text-value-group]"], "instance_of":["si:[gdlt:Value-Group]"]}, + {"subject_identifiers":["[gdlsrv:service-variant-name-reifier-radio-button]"], "instance_of":["si:[gdlt:Radio-Button]"], "occurrences":[{"type":"si:[gdl:id]", "value":"service_variant_name_reifier_text_id"}]}, + {"subject_identifiers":["[gdlsrv:service-variant-name-reifier-radio-button-position]"], "instance_of":["si:[gdlt:Position]"], "occurrences":[{"type":"si:[gdl:position-style]", "value":"absolute"}, {"type":"si:[gdl:top]", "value":"490px"}, {"type":"si:[gdl:left]", "value":"10px"}]}, + {"subject_identifiers":["[gdlsrv:service-variant-name-reifier-radio-button-value-group]"], "instance_of":["si:[gdlt:Value-Group]"]}, {"subject_identifiers":["[model:service-variant-name-reifier-constraint]"], "instance_of":["si:[gdlt:Variant-Name-Reifier]"]},
{"subject_identifiers":["[gdlsrv:service-editor-commit-button]"], "instance_of":["si:[gdlt:Commit-Button]"], "occurrences":[{"type":"si:[gdl:id]", "value":"service_creator_commit_button_id"}, {"type":"si:[gdl:height]", "value":"30px"}, {"type":"si:[gdl:width]", "value":"80px"}, {"type":"si:[gdl:font-size]", "value":"12px"}]}, @@ -433,16 +433,16 @@ {"type":"si:[gdl:tm-binding]", "roles":[{"type":"si:[gdl:value-group]", "player":"si:[gdlsrv:service-variant-name-iis-text-value-group]"},{"type":"si:[gdl:tm-construct]", "player":"si:[model:service-variant-name-ii-constraint]"}]}, {"type":"si:[gdl:tm-binding]", "roles":[{"type":"si:[gdl:descriptor]", "player":"si:[model:service-variant-name-ii-constraint]"},{"type":"si:[gdl:tm-construct]", "player":"si:[model:service-variant-name-constraint]"}]},
- {"type":"si:[gdl:contains]", "roles":[{"type":"si:[gdl:container]", "player":"si:[gdlsrv:service-default-editor-topic-view]"},{"type":"si:[gdl:containee]", "player":"si:[gdlsrv:service-variant-name-reifier-text]"}]}, - {"type":"si:[gdl:position]", "roles":[{"type":"si:[gdl:descriptor]", "player":"si:[gdlsrv:service-variant-name-reifier-text-position]"},{"type":"si:[gdl:ancestor]", "player":"si:[gdlsrv:service-variant-name-iis-text]"},{"type":"si:[gdl:descendant]", "player":"si:[gdlsrv:service-variant-name-reifier-text]"}]}, - {"type":"si:[gdl:view-binding]", "roles":[{"type":"si:[gdl:value-group]", "player":"si:[gdlsrv:service-variant-name-reifier-text-value-group]"},{"type":"si:[gdl:descriptor]", "player":"si:[gdlsrv:service-variant-name-reifier-text]"}]}, - {"type":"si:[gdl:tm-binding]", "roles":[{"type":"si:[gdl:value-group]", "player":"si:[gdlsrv:service-variant-name-reifier-text-value-group]"},{"type":"si:[gdl:tm-construct]", "player":"si:[model:service-variant-name-reifier-constraint]"}]}, + {"type":"si:[gdl:contains]", "roles":[{"type":"si:[gdl:container]", "player":"si:[gdlsrv:service-default-editor-topic-view]"},{"type":"si:[gdl:containee]", "player":"si:[gdlsrv:service-variant-name-reifier-radio-button]"}]}, + {"type":"si:[gdl:position]", "roles":[{"type":"si:[gdl:descriptor]", "player":"si:[gdlsrv:service-variant-name-reifier-radio-button-position]"},{"type":"si:[gdl:ancestor]", "player":"si:[gdlsrv:service-variant-name-iis-text]"},{"type":"si:[gdl:descendant]", "player":"si:[gdlsrv:service-variant-name-reifier-radio-button]"}]}, + {"type":"si:[gdl:view-binding]", "roles":[{"type":"si:[gdl:value-group]", "player":"si:[gdlsrv:service-variant-name-reifier-radio-button-value-group]"},{"type":"si:[gdl:descriptor]", "player":"si:[gdlsrv:service-variant-name-reifier-radio-button]"}]}, + {"type":"si:[gdl:tm-binding]", "roles":[{"type":"si:[gdl:value-group]", "player":"si:[gdlsrv:service-variant-name-reifier-radio-button-value-group]"},{"type":"si:[gdl:tm-construct]", "player":"si:[model:service-variant-name-reifier-constraint]"}]}, {"type":"si:[gdl:tm-binding]", "roles":[{"type":"si:[gdl:descriptor]", "player":"si:[model:service-variant-name-reifier-constraint]"},{"type":"si:[gdl:tm-construct]", "player":"si:[model:service-variant-name-constraint]"}]}, {"type":"si:[tmcl:allowed-reifier]", "roles":[{"type":"si:[tmcl:allows]", "player":"si:[model:service-variant-name-reifier-constraint]"},{"type":"si:[tmcl:allowed]", "player":"si:[types:Reifier-Type]"}]},
{"type":"si:[gdl:contains]", "roles":[{"type":"si:[gdl:container]", "player":"si:[gdlsrv:service-default-editor-topic-view]"},{"type":"si:[gdl:containee]", "player":"si:[gdlsrv:service-editor-commit-button]"}]}, - {"type":"si:[gdl:position]", "roles":[{"type":"si:[gdl:descriptor]", "player":"si:[gdlsrv:service-editor-commit-button-position]"},{"type":"si:[gdl:ancestor]", "player":"si:[gdlsrv:service-variant-name-reifier-text]"},{"type":"si:[gdl:descendant]", "player":"si:[gdlsrv:service-editor-commit-button]"}]} + {"type":"si:[gdl:position]", "roles":[{"type":"si:[gdl:descriptor]", "player":"si:[gdlsrv:service-editor-commit-button-position]"},{"type":"si:[gdl:ancestor]", "player":"si:[gdlsrv:service-variant-name-reifier-radio-button]"},{"type":"si:[gdl:descendant]", "player":"si:[gdlsrv:service-editor-commit-button]"}]}