Author: lgiessmann Date: Sat Jul 16 01:01:39 2011 New Revision: 633
Log: gdl-frontend: Widgets: chnged the inner class Reference
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/GdlTitle.java branches/gdl-frontend/src/anaToMia/GDL_Widgets/war/gdl_widgets/test.gdl.jtm
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 Jul 15 09:59:54 2011 (r632) +++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlReference.java Sat Jul 16 01:01:39 2011 (r633) @@ -10,8 +10,25 @@ 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; @@ -39,7 +56,8 @@ public GdlReference(Topic tmRepresentative) throws InvalidGdlSchemaException, ExecutionException{ super(tmRepresentative); // TODO: create a Reference element for each TM-elem - this.createReference().setText("Reference"); + this.createReference().setText("Reference"); // TODO: remove + } @@ -185,6 +203,85 @@ } + /* + protected class Reference extends Composite implements HasFocusHandlers, HasBlurHandlers, HasMouseDownHandlers, HasMouseUpHandlers, HasMouseOutHandlers, HasMouseOverHandlers { + Hyperlink link = new Hyperlink(); + + + public Reference(){ + initWidget(link); + } + + + public Reference(String text){ + this(); + this.link.setText(text); + } + + + public Reference(String text, String href){ + this(text); + this.link.setTargetHistoryToken(href); + } + + + public String getText(){ + return this.link.getText(); + } + + + public void setText(String text){ + this.link.setText(text); + } + + + public String getHref(){ + return this.link.getTargetHistoryToken(); + } + + + public void setHref(String text){ + this.link.setTargetHistoryToken(text); + } + + + @Override + public HandlerRegistration addBlurHandler(BlurHandler handler) { + return this.addDomHandler(handler, BlurEvent.getType()); + } + + + @Override + public HandlerRegistration addFocusHandler(FocusHandler handler) { + return this.addDomHandler(handler, FocusEvent.getType()); + } + + + @Override + public HandlerRegistration addMouseOverHandler(MouseOverHandler handler) { + return this.addDomHandler(handler, MouseOverEvent.getType()); + } + + + @Override + public HandlerRegistration addMouseOutHandler(MouseOutHandler handler) { + return this.addDomHandler(handler, MouseOutEvent.getType()); + } + + + @Override + public HandlerRegistration addMouseUpHandler(MouseUpHandler handler) { + return this.addDomHandler(handler, MouseUpEvent.getType()); + } + + + @Override + public HandlerRegistration addMouseDownHandler(MouseDownHandler handler) { + return this.addDomHandler(handler, MouseDownEvent.getType()); + } + } + */ + // this class wraps a Label that is used as protected class Reference extends Label implements HasFocusHandlers, HasBlurHandlers { @@ -192,9 +289,11 @@ super(); } - public Reference(String text){ + + public Reference(String text) { super(text); } +
@Override public HandlerRegistration addBlurHandler(BlurHandler handler) {
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 Jul 15 09:59:54 2011 (r632) +++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlTitle.java Sat Jul 16 01:01:39 2011 (r633) @@ -20,7 +20,6 @@ import us.isidor.gdl.anaToMia.Widgets.value.PositiveNumUnitValue; import us.isidor.gdl.anaToMia.Widgets.value.TextAlignValue; import us.isidor.gdl.anaToMia.Widgets.value.TextDecorationValue; - import com.google.gwt.dom.client.Style.FontStyle; import com.google.gwt.event.dom.client.BlurEvent; import com.google.gwt.event.dom.client.BlurHandler;
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/war/gdl_widgets/test.gdl.jtm ============================================================================== --- branches/gdl-frontend/src/anaToMia/GDL_Widgets/war/gdl_widgets/test.gdl.jtm Fri Jul 15 09:59:54 2011 (r632) +++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/war/gdl_widgets/test.gdl.jtm Sat Jul 16 01:01:39 2011 (r633) @@ -39,6 +39,7 @@ {"subject_identifiers":["[gdl:background-color]"], "instance_of":["si:[tmcl:occurrence-type]"]}, {"subject_identifiers":["[gdl:width]"], "instance_of":["si:[tmcl:occurrence-type]"]}, {"subject_identifiers":["[gdl:height]"], "instance_of":["si:[tmcl:occurrence-type]"]}, + {"subject_identifiers":["[gdl:font-weight]"], "instance_of":["si:[tmcl:occurrence-type]"]}, {"subject_identifiers":["[doc:default-creator-topic-view-1]"], "instance_of":["si:[gdl:Default-Creator-Topic-View]"], "names":[{"value": "Def. Creator View 1", "type":"si:[gdl:view-name]"}], "occurrences":[{"type":"si:[gdl:id]", "value":"default_creator_topic_view_1_id", "datatype":"[xsd:ID]"}, {"type":"si:[gdl:background-color]", "value":"#ccc"}, {"type":"si:[gdl:width]", "value":"500px"}, {"type":"si:[gdl:height]", "value":"600px"}]}, {"subject_identifiers":["[gdl:View]"]}, {"subject_identifiers":["[gdl:Text]"]}, @@ -50,8 +51,8 @@ {"subject_identifiers":["[doc:list-item-2]"], "instance_of":["si:[gdl:Text]"], "occurrences":[{"type":"si:[gdl:id]", "value":"list_item_2_id", "datatype":"[xsd:ID]"}, {"type":"si:[gdl:padding]", "value":"5px"}, {"type":"si:[gdl:margin-top]", "value":"5px"}]}, {"subject_identifiers":["[gdl:List-Box]"]}, {"subject_identifiers":["[doc:text-1]"], "instance_of":["si:[gdl:Text]"], "occurrences":[{"type":"si:[gdl:id]", "value":"text_1_id", "datatype":"[xsd:ID]"}, {"type":"si:[gdl:readonly]", "value":"false", "datatype":"[xsd:boolean]"}]}, - {"subject_identifiers":["[doc:title-1]"], "instance_of":["si:[gdl:Title]"], "occurrences":[{"type":"si:[gdl:id]", "value":"title_1_id", "datatype":"[xsd:ID]"}, {"type":"si:[gdl:text-decoration]", "value":"underline"}, {"type":"si:[gdl:background-color]", "value":"#ccc"}]}, - {"subject_identifiers":["[doc:reference-1]"], "instance_of":["si:[gdl:Reference]"], "occurrences":[{"type":"si:[gdl:id]", "value":"reference_1_id", "datatype":"[xsd:ID]"}, {"type":"si:[gdl:margin-left]", "value":"200px"}, {"type":"si:[gdl:background-color]", "value":"#ccc"}]}, + {"subject_identifiers":["[doc:title-1]"], "instance_of":["si:[gdl:Title]"], "occurrences":[{"type":"si:[gdl:id]", "value":"title_1_id", "datatype":"[xsd:ID]"}, {"type":"si:[gdl:text-decoration]", "value":"underline"}, {"type":"si:[gdl:background-color]", "value":"#ccc"}, {"type":"si:[gdl:font-weight]", "value":"bold"}]}, + {"subject_identifiers":["[doc:reference-1]"], "instance_of":["si:[gdl:Reference]"], "occurrences":[{"type":"si:[gdl:id]", "value":"reference_1_id", "datatype":"[xsd:ID]"}, {"type":"si:[gdl:margin-left]", "value":"200px"}, {"type":"si:[gdl:background-color]", "value":"yellow"}]}, {"subject_identifiers":["[doc:list-box-1]"], "instance_of":["si:[gdl:List-Box]"], "occurrences":[{"type":"si:[gdl:id]", "value":"list_box_1_id", "datatype":"[xsd:ID]"}]}, {"subject_identifiers":["[gdl:Value]"], "instance_of":["si:[tmcl:topic-type]"]}, {"subject_identifiers":["[doc:pos-of-title-1]"], "instance_of":["si:[gdl:Position]"]},