isidorus-cvs
Threads by month
- ----- 2025 -----
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- 1037 discussions

[isidorus-cvs] r579 - in branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets: base container values
by lgiessmann@common-lisp.net 08 Jul '11
by lgiessmann@common-lisp.net 08 Jul '11
08 Jul '11
Author: lgiessmann
Date: Fri Jul 8 00:01:50 2011
New Revision: 579
Log:
gdl-frontend: Widgets: implemented GdlList
Added:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/values/ListStylePositionValue.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/values/ListStyleTypeValue.java
Modified:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlPsis.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/container/GdlList.java
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlPsis.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlPsis.java Thu Jul 7 09:29:24 2011 (r578)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlPsis.java Fri Jul 8 00:01:50 2011 (r579)
@@ -129,7 +129,7 @@
public final static String gdlFloat = gdl + "float";
public final static String gdlBackgroundColor = gdl + "background-color";
public final static String gdlOrdered = gdl + "ordered";
- public final static String gdlListstyleType = gdl + "list-style-type";
+ public final static String gdlListStyleType = gdl + "list-style-type";
public final static String gdlListStylePosition = gdl + "list-style-position";
public final static String gdlPositionStyle = gdl + "position-style";
public final static String gdlNthValue = gdl + "nth-value";
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 Thu Jul 7 09:29:24 2011 (r578)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java Fri Jul 8 00:01:50 2011 (r579)
@@ -914,7 +914,7 @@
return null;
} else {
return new NumUnitValue(paddingOcc.getValue());
- }
+ }
}
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 Thu Jul 7 09:29:24 2011 (r578)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/container/GdlList.java Fri Jul 8 00:01:50 2011 (r579)
@@ -1,49 +1,289 @@
package us.isidor.gdl.anaToMia.Widgets.container;
+import java.util.ArrayList;
import com.google.gwt.dom.client.Element;
import com.google.gwt.user.client.DOM;
-
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.SimplePanel;
+import com.google.gwt.user.client.ui.Widget;
+import com.google.gwt.dom.client.Node;
+import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Occurrence;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
+import us.isidor.gdl.anaToMia.Widgets.base.GdlPsis;
import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject;
-import us.isidor.gdl.anaToMia.Widgets.base.IGdlContainer;
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
+import us.isidor.gdl.anaToMia.Widgets.environment.Pair;
+import us.isidor.gdl.anaToMia.Widgets.values.ListStylePositionValue;
+import us.isidor.gdl.anaToMia.Widgets.values.ListStyleTypeValue;
-public class GdlList extends GdlVisibleObject implements IGdlContainer{
- protected Element listElement = null;
+public class GdlList extends GdlVisibleObject{
+
// some constructors
- protected GdlList(){
+ protected GdlList() throws InvalidGdlSchemaException{
super();
+ this.initList(this.getOrdered());
}
public GdlList(Topic tmRepresentative) throws InvalidGdlSchemaException, ExecutionException{
super(tmRepresentative);
+ this.initList(this.getOrdered());
}
- public void initList(boolean ordered){
- Element elem = DOM.createElement(ordered ? "ol" : "ul");
- super.addToContainerPanel(elem);
+ // sets the list Element to either ol or ul depending on the gdl:ordered property
+ public void initList(boolean ordered) throws InvalidGdlSchemaException {
+ // this object is able to own only one sub-element
+ super.subElements.add(new ListWidget(this.getOrdered()));
}
- public void createListItem(){
-
+ // returns the property of a gdl:ordered occurrence, otherwise the default value if no occurrence is set
+ public boolean getOrdered() throws InvalidGdlSchemaException{
+ Occurrence orderedOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlOrdered);
+
+ if(orderedOcc != null){
+ String boolStr = orderedOcc.getValue().toUpperCase();
+ if(boolStr.equals("TRUE")){
+ return true;
+ } else if(boolStr.equals("FALSE")) {
+ return false;
+ } else {
+ throw new InvalidGdlSchemaException("The occurrence " + GdlPsis.OccurrenceType.gdlOrdered + " must be set to one of \"true\" or \"false\", but is \"" + orderedOcc.getValue() + "\"");
+ }
+ } else {
+ return false;
+ }
}
- public boolean getOrdered(){
- // TODO: implement
- return false;
+ // returns a ListStyleTypeValeu instance that describes this instance's list style type property
+ public ListStyleTypeValue getListStyleType() throws InvalidGdlSchemaException {
+ Occurrence typeOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlListStyleType);
+
+ if(typeOcc != null){
+ try{
+ return ListStyleTypeValue.fromString(typeOcc.getValue());
+ }catch(IllegalArgumentException e){
+ String values = "deciaml, decimal-leading-zero, lower-greek, lower-roman, armenian, georgian, upper-roman, " +
+ "lower-alpha, upper-alpha, lower-latin, upper-latin, disc, circle, square or none";
+ throw new InvalidGdlSchemaException("The occurrence " + GdlPsis.OccurrenceType.gdlListStyleType + " must be set to one of " + values + " , but is \"" + typeOcc.getValue() + "\"");
+ }
+ } else if(this.getOrdered()){
+ return ListStyleTypeValue.DECIMAL;
+ } else {
+ return ListStyleTypeValue.CIRCLE;
+ }
}
+
+ // returns a ListStylePositionValue instance that describes this instance's list style position property
+ public ListStylePositionValue getListStylePosition() throws InvalidGdlSchemaException {
+ Occurrence positionOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlListStylePosition);
+ if(positionOcc != null){
+ try{
+ return ListStylePositionValue.valueOf(positionOcc.getValue().toUpperCase());
+ }catch(IllegalArgumentException e){
+ throw new InvalidGdlSchemaException("The occurrence " + GdlPsis.OccurrenceType.gdlListStylePosition + " must be set to one of inside or outside, but is \"" + positionOcc.getValue() + "\"");
+ }
+ } else{
+ return ListStylePositionValue.OUTSIDE;
+ }
+
+ }
+
+
+ // sets the css property ordered
+ @Deprecated
+ public void setOrdered(Widget widget, boolean value) throws InvalidGdlSchemaException, ExecutionException {
+ // do nothing this property has to be set in the initList mehtod
+ }
+
+
+ // sets the css property list-style-type
+ public void setListStyleType(Widget widget, ListStyleTypeValue value) throws InvalidGdlSchemaException, ExecutionException {
+ this.setCssProperty(widget, null, "list-style-type", value.getCssValue());
+ }
+
+
+ // sets the css property list-style-position
+ public void setListStylePositionValue(Widget widget, ListStylePositionValue value) throws InvalidGdlSchemaException, ExecutionException {
+ this.setCssProperty(widget, null, "list-style-position", value.getCssValue());
+ }
+
+
+ // calls the super applies the GdlStyle for every TextArea item of this instance
+ @Override
+ protected void setGdlStyle() throws InvalidGdlSchemaException, ExecutionException{
+ if(this.subElements != null){
+ for (Widget item : this.subElements) {
+ this.setGdlStyle(item);
+ }
+ }
+ }
+
+
+ // sets the css properties, by calling the super class's method and the local
+ // method, which sets some specific properties for the GdlList instance
@Override
- public void append(GdlVisibleObject ancestor, GdlVisibleObject descendant)
- throws InvalidGdlSchemaException {
- // TODO Auto-generated method stub
+ public void setGdlStyle(Widget widget) throws InvalidGdlSchemaException, ExecutionException {
+ super.setGdlStyle(widget);
+
+ this.setListStylePositionValue(widget, this.getListStylePosition());
+ this.setListStyleType(widget, this.getListStyleType());
+ }
+
+
+ // inserts the passed item on the given index
+ public void append(GdlVisibleObject item, int position){
+ if(this.subElements != null && this.subElements.size() != 0){
+ ((ListWidget)this.subElements.get(0)).insertWidget(item, position);
+ }
+ }
+
+
+ // Wraps a ul an ol element as a widget based on a SimplePanel
+ protected class ListWidget extends Composite {
+ private SimplePanel basePanel = new SimplePanel();
+ private Element listElement = null;
+ // note: index is not the actual index of the item in the array list,
+ // it is the user's passed index when inserting this element
+ private ArrayList<Pair<ListItem, Integer>> itemsAndIndexes = new ArrayList<Pair<ListItem, Integer>>();
+
+ public ListWidget(){
+ this.listElement = DOM.createElement("ul");
+ this.basePanel.getElement().insertFirst(this.listElement);
+ }
+
+ public ListWidget(boolean ordered){
+ if(ordered) this.listElement = DOM.createElement("ol");
+ else this.listElement = DOM.createElement("ul");
+ this.basePanel.getElement().insertFirst(this.listElement);
+ }
+
+
+ // inserts the passed list item as the last child to this list element
+ public void appendListItem(ListItem item){
+ if(item == null) return;
+ item.appendToList(this.listElement);
+ }
+
+
+ // inserts the passed instance item to this list directly after the intance previous
+ public void appendListItem(ListItem item, ListItem previous){
+ if(item == null) return;
+ item.appendToList(this.listElement, previous);
+ }
+
+
+ // inserts the passed widget directly before the first item that
+ // has a greater position index
+ public void insertWidget(Widget widget, int position){
+ ListItem previosItem = this.getItemBeforeIndex(position);
+ ListItem item = new ListItem(this.listElement);
+ item.appendContentToListItem(widget.getElement());
+ this.appendListItem(item, previosItem);
+ }
+
+
+ // returns the first item that has a smaller position index
+ public ListItem getItemBeforeIndex(int idx){
+ Pair<ListItem, Integer> result = null;
+ for (Pair<ListItem, Integer> item : this.itemsAndIndexes) {
+ if(item.getSecond() < idx && (result == null || result.getSecond() < item.getSecond()))result = item;
+ }
+
+ if(result != null) result.getFirst();
+ return null;
+ }
+
+
+ // returns all ListItems
+ public ArrayList<ListItem> getItems(){
+ ArrayList<ListItem> items = new ArrayList<GdlList.ListItem>();
+ for (Pair<ListItem, Integer> pair : this.itemsAndIndexes) {
+ items.add(pair.getFirst());
+ }
+ return items;
+ }
+
+
+ // returns the position index of the item, that was psecified when
+ // inserting the passed ListItem
+ public int indexOfItem(ListItem item){
+ for (Pair<ListItem, Integer> pair : this.itemsAndIndexes) {
+ if(pair.getFirst().equals(item)) return pair.getSecond();
+ }
+
+ return -1;
+ }
+ }
+
+
+ // this class wrapps a list item, i.e. a div element within a li element
+ protected class ListItem{
+ private Element liElement = null;
+ private Element divElement = null;
+
+ public ListItem(){
+ this.liElement = DOM.createElement("li");
+ this.divElement = DOM.createElement("div");
+ this.liElement.insertFirst(this.divElement);
+ }
+
+ public ListItem(Element parentList){
+ this();
+ this.appendToList(parentList);
+ }
+
+ // inserts the this instance into the passed list element,
+ // if this instance is not bound yet
+ public void appendToList(Element parentList){
+ if(parentList != null && this.liElement.getParentNode() == null){
+ Node lastChild = parentList.getLastChild();
+ if(lastChild != null){
+ parentList.insertAfter(this.liElement, lastChild);
+ } else {
+ parentList.insertFirst(this.liElement);
+ }
+ }
+ }
+
+
+ // inserts the this instance into the passed list element
+ // after the passed ListItem, if this instance is not bound yet
+ public void appendToList(Element parentList, ListItem previous){
+ if(parentList == null) return;
+
+ if(previous == null){
+ this.appendToList(parentList);
+ }else{
+ parentList.insertAfter(this.liElement, previous.liElement);
+ }
+ }
+
+
+ // removes this instance from the set list
+ public void removeFromList(){
+ this.liElement.removeFromParent();
+ }
+
+ // appends the content element to the inner div item
+ public void appendContentToListItem(Element content){
+ if(content != null){
+ Node lastChild = this.divElement.getLastChild();
+ if(lastChild != null){
+ this.divElement.insertAfter(content, lastChild);
+ } else {
+ this.divElement.insertFirst(content);
+ }
+ }
+ }
+
+
}
}
Added: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/values/ListStylePositionValue.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/values/ListStylePositionValue.java Fri Jul 8 00:01:50 2011 (r579)
@@ -0,0 +1,13 @@
+package us.isidor.gdl.anaToMia.Widgets.values;
+
+public enum ListStylePositionValue implements CssValue {
+ INSIDE,
+ OUTSIDE;
+
+
+ @Override
+ public String getCssValue() {
+ return this.toString().toLowerCase();
+ }
+
+}
Added: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/values/ListStyleTypeValue.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/values/ListStyleTypeValue.java Fri Jul 8 00:01:50 2011 (r579)
@@ -0,0 +1,47 @@
+package us.isidor.gdl.anaToMia.Widgets.values;
+
+public enum ListStyleTypeValue implements CssValue{
+ DECIMAL,
+ DECIMAL_LEADING_ZERO,
+ LOWER_GREEK,
+ LOWER_ROMAN,
+ ARMENIAN,
+ GEORGIAN,
+ UPPER_ROMAN,
+ LOWER_ALPHA,
+ UPPER_ALPHA,
+ LOWER_LATIN,
+ UPPER_LATIN,
+ DISC,
+ CIRCLE,
+ SQUARE,
+ NONE;
+
+ @Override
+ public String getCssValue() {
+ return this.toString().toLowerCase().replace("_", "-");
+ }
+
+
+ public static ListStyleTypeValue fromString(String str) throws IllegalArgumentException{
+ if(null == str) return null;
+
+ String upperStr = str.toUpperCase();
+ if(upperStr.equals("DECIMAL")) return DECIMAL;
+ else if(upperStr.equals("DECIMAL-LEADING-ZERO")) return DECIMAL_LEADING_ZERO;
+ else if(upperStr.equals("LOWER-GREEK")) return LOWER_GREEK;
+ else if(upperStr.equals("LOWER-ROMAN")) return LOWER_ROMAN;
+ else if(upperStr.equals("ARMENIAN")) return ARMENIAN;
+ else if(upperStr.equals("GEORGIAN")) return GEORGIAN;
+ else if(upperStr.equals("UPPER-ROMAN")) return UPPER_ROMAN;
+ else if(upperStr.equals("LOWER-ALPHA")) return LOWER_ALPHA;
+ else if(upperStr.equals("UPPER-ALPHA")) return UPPER_ALPHA;
+ else if(upperStr.equals("LOWER-LATIN")) return LOWER_LATIN;
+ else if(upperStr.equals("UPPER-LATIN")) return UPPER_LATIN;
+ else if(upperStr.equals("DISC")) return DISC;
+ else if(upperStr.equals("CIRCLE")) return CIRCLE;
+ else if(upperStr.equals("SQUARE")) return SQUARE;
+ else if(upperStr.equals("NONE")) return NONE;
+ else throw new IllegalArgumentException("the value " + str + "is not a FontWeightValue value");
+ }
+}
1
0

[isidorus-cvs] r578 - in branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets: . base container
by lgiessmann@common-lisp.net 07 Jul '11
by lgiessmann@common-lisp.net 07 Jul '11
07 Jul '11
Author: lgiessmann
Date: Thu Jul 7 09:29:24 2011
New Revision: 578
Log:
gdl-frontend: Widgets: started to implement GdlList
Added:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/container/
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/container/GdlList.java
Modified:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/GDL_Widgets.gwt.xml
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/GDL_Widgets.gwt.xml
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/GDL_Widgets.gwt.xml Thu Jul 7 08:49:40 2011 (r577)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/GDL_Widgets.gwt.xml Thu Jul 7 09:29:24 2011 (r578)
@@ -22,6 +22,7 @@
<source path="base"/>
<source path="views"/>
<source path="text"/>
+ <source path="container"/>
<source path="environment"/>
<source path="values"/>
<source path="isidorus"/>
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 Thu Jul 7 08:49:40 2011 (r577)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java Thu Jul 7 09:29:24 2011 (r578)
@@ -21,6 +21,7 @@
import us.isidor.gdl.anaToMia.Widgets.values.CursorValue;
import us.isidor.gdl.anaToMia.Widgets.values.NumUnitValue;
import com.google.gwt.core.client.JsArray;
+import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.Style.Display;
import com.google.gwt.dom.client.Style.Float;
import com.google.gwt.dom.client.Style.VerticalAlign;
@@ -54,6 +55,7 @@
import com.google.gwt.user.client.ui.Panel;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;
+import com.google.gwt.dom.client.Node;
public abstract class GdlVisibleObject extends Composite implements GdlDescriptor, HasClickHandlers, HasMouseOutHandlers, HasMouseOverHandlers, HasFocusHandlers, HasMouseDownHandlers, HasMouseUpHandlers, HasBlurHandlers{
@@ -100,6 +102,20 @@
this.containerPanel.add(widget);
}
+
+ // this method should be invoked if a new sub-element is added to this instance
+ protected void addToContainerPanel(Element elem){
+ if(this.containerPanel == null){
+ this.containerPanel = new VerticalPanel();
+ this.mainPanel.add(this.containerPanel);
+ }
+
+ Element panel = this.containerPanel.getElement();
+ Node lastItem = panel.getLastChild();
+ if(lastItem == null) panel.insertFirst(lastItem);
+ else panel.insertAfter(elem, lastItem);
+ }
+
// a helper method that returns all occurrences of the type bound to the passed PSI
protected JsArray<Occurrence> getOccurrences(String occurrenceType){
Added: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/container/GdlList.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/container/GdlList.java Thu Jul 7 09:29:24 2011 (r578)
@@ -0,0 +1,49 @@
+package us.isidor.gdl.anaToMia.Widgets.container;
+
+import com.google.gwt.dom.client.Element;
+import com.google.gwt.user.client.DOM;
+
+import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
+import us.isidor.gdl.anaToMia.Widgets.base.GdlVisibleObject;
+import us.isidor.gdl.anaToMia.Widgets.base.IGdlContainer;
+import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
+import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
+
+public class GdlList extends GdlVisibleObject implements IGdlContainer{
+ protected Element listElement = null;
+
+ // some constructors
+ protected GdlList(){
+ super();
+ }
+
+
+ public GdlList(Topic tmRepresentative) throws InvalidGdlSchemaException, ExecutionException{
+ super(tmRepresentative);
+ }
+
+
+ public void initList(boolean ordered){
+ Element elem = DOM.createElement(ordered ? "ol" : "ul");
+ super.addToContainerPanel(elem);
+ }
+
+
+ public void createListItem(){
+
+ }
+
+
+ public boolean getOrdered(){
+ // TODO: implement
+ return false;
+ }
+
+
+ @Override
+ public void append(GdlVisibleObject ancestor, GdlVisibleObject descendant)
+ throws InvalidGdlSchemaException {
+ // TODO Auto-generated method stub
+
+ }
+}
1
0

[isidorus-cvs] r577 - in branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets: base text
by lgiessmann@common-lisp.net 07 Jul '11
by lgiessmann@common-lisp.net 07 Jul '11
07 Jul '11
Author: lgiessmann
Date: Thu Jul 7 08:49:40 2011
New Revision: 577
Log:
gdl-frontend: Widgets: implemented GdlListBox (GDL:one-per-group is currently not implemented)
Added:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlListBox.java
Modified:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlTextObject.java
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java Thu Jul 7 07:44:51 2011 (r576)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java Thu Jul 7 08:49:40 2011 (r577)
@@ -4,6 +4,7 @@
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Occurrence;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
import us.isidor.gdl.anaToMia.Widgets.isidorus.LoadSchemaCallback;
+import us.isidor.gdl.anaToMia.Widgets.text.GdlListBox;
import us.isidor.gdl.anaToMia.Widgets.text.GdlText;
import us.isidor.gdl.anaToMia.Widgets.values.CursorValue;
import com.google.gwt.core.client.EntryPoint;
@@ -114,7 +115,7 @@
fsHover.addTheme(gdlHover);
- GdlText tmp = new GdlText(tmpRepresentative){};
+ GdlListBox tmp = new GdlListBox(tmpRepresentative){};
this.mainPanel.add(tmp);
}catch(Exception e){
e.printStackTrace();
Added: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlListBox.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/text/GdlListBox.java Thu Jul 7 08:49:40 2011 (r577)
@@ -0,0 +1,198 @@
+package us.isidor.gdl.anaToMia.Widgets.text;
+
+import java.util.ArrayList;
+
+import com.google.gwt.event.shared.EventHandler;
+import com.google.gwt.i18n.client.HasDirection.Direction;
+import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.ui.ListBox;
+import com.google.gwt.user.client.ui.Widget;
+
+import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Occurrence;
+import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
+import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMapsTypes;
+import us.isidor.gdl.anaToMia.Widgets.base.GdlPsis;
+import us.isidor.gdl.anaToMia.Widgets.base.IGdlHasValue;
+import us.isidor.gdl.anaToMia.Widgets.environment.ActiveStyleHandler;
+import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
+import us.isidor.gdl.anaToMia.Widgets.environment.FocusStyleHandler;
+import us.isidor.gdl.anaToMia.Widgets.environment.HoverStyleHandler;
+import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
+import us.isidor.gdl.anaToMia.Widgets.environment.Pair;
+
+public class GdlListBox extends GdlTextObject implements IGdlHasValue{
+ // some constructors
+ protected GdlListBox() throws InvalidGdlSchemaException, ExecutionException {
+ super();
+ }
+
+
+ public GdlListBox(Topic tmRepresentative) throws InvalidGdlSchemaException, ExecutionException{
+ super(tmRepresentative);
+ // TODO: create a ListBox element for each TM-elem
+ ListBox lb = this.createNewListBox(); // TODO: remove only for debugging
+ lb.addItem("value-1", Direction.LTR);
+ lb.addItem("value-2", Direction.LTR);
+ lb.addItem("value-3", Direction.LTR);
+ lb.addItem("value-4", Direction.LTR);
+ lb.addItem("value-5", Direction.LTR);
+ lb.addItem("value-6", Direction.LTR);
+ lb.addItem("value-1", Direction.LTR);
+ lb.addItem("value-2", Direction.LTR);
+ lb.addItem("value-3", Direction.LTR);
+ lb.addItem("value-4", Direction.LTR);
+ lb.addItem("value-5", Direction.LTR);
+ lb.addItem("value-6", Direction.LTR);
+ lb = this.createNewListBox(); // TODO: remove only for debugging
+ lb.addItem("value-1", Direction.LTR);
+ lb.addItem("value-2", Direction.LTR);
+ lb.addItem("value-3", Direction.LTR);
+ }
+
+
+ // creates a new ListBox item, adds it to the subElements array,
+ // and applies the styles on it
+ protected ListBox createNewListBox() throws InvalidGdlSchemaException, ExecutionException {
+ ListBox elem = new ListBox(this.getMultiple());
+ DOM.setElementAttribute(elem.getElement(), "id", this.getId() + "__GDL_" + this.subElements.size());
+ this.setGdlStyle(elem);
+ ActiveStyleHandler asHandler = new ActiveStyleHandler(this);
+ FocusStyleHandler fsHandler = new FocusStyleHandler(this);
+ HoverStyleHandler hsHandler = new HoverStyleHandler(this);
+ elem.addMouseDownHandler(asHandler);
+ elem.addMouseUpHandler(asHandler);
+ elem.addMouseOverHandler(hsHandler);
+ elem.addMouseOutHandler(hsHandler);
+ elem.addFocusHandler(fsHandler);
+ elem.addBlurHandler(fsHandler);
+ this.subElements.add(elem);
+ super.addToContainerPanel(elem);
+ return elem;
+ }
+
+
+ // removes the passed element and all its handlers from the outer element
+ protected void removeListbox(ListBox elem) throws InvalidGdlSchemaException, ExecutionException{
+ for (Pair<Widget, ArrayList<EventHandler>> item : this.eventHandlers) {
+ if(item.getFirst().equals(elem)){
+ this.eventHandlers.remove(item);
+ break;
+ }
+ }
+ this.subElements.remove(elem);
+ elem.removeFromParent();
+ }
+
+
+ // returns the gdl:multiple property - if no value is set the default value is returned
+ public boolean getMultiple() throws InvalidGdlSchemaException {
+ Occurrence multipleOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlMultiple);
+
+ if(multipleOcc != null){
+ String boolStr = multipleOcc.getValue().toUpperCase();
+ if(boolStr.equals("TRUE")){
+ return true;
+ } else if(boolStr.equals("FALSE")) {
+ return false;
+ } else {
+ throw new InvalidGdlSchemaException("The occurrence " + GdlPsis.OccurrenceType.gdlMargin + " must be set to one of \"true\" or \"false\", but is \"" + multipleOcc.getValue() + "\"");
+ }
+ } else {
+ return false;
+ }
+ }
+
+
+ // returns the gdl:one-per-group property - if no value is set the default value is returned
+ public boolean getOnePerGroup() throws InvalidGdlSchemaException {
+ Occurrence onePerGroupOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlOnePerGroup);
+
+ if(onePerGroupOcc != null){
+ String boolStr = onePerGroupOcc.getValue().toUpperCase();
+ if(boolStr.equals("TRUE")){
+ return true;
+ } else if(boolStr.equals("FALSE")) {
+ return false;
+ } else {
+ throw new InvalidGdlSchemaException("The occurrence " + GdlPsis.OccurrenceType.gdlOnePerGroup + " must be set to one of \"true\" or \"false\", but is \"" + onePerGroupOcc.getValue() + "\"");
+ }
+ } else {
+ return false;
+ }
+ }
+
+
+ // returns an int instance of a gdl:size occurrence.
+ // If no gdl:size occurrence is set, the default value is returned
+ public int getSize() throws InvalidGdlSchemaException {
+ Occurrence rowsOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlSize);
+
+ if(rowsOcc != null){
+ try{
+ int value = Integer.valueOf(rowsOcc.getValue());
+ if(value < 0) throw new InvalidGdlSchemaException("The occurrence " + GdlPsis.OccurrenceType.gdlSize + " must be set to a positive integer, but is \"" + rowsOcc.getValue() + "\"");
+ else return value;
+ }catch(NumberFormatException e){
+ throw new InvalidGdlSchemaException("The occurrence " + GdlPsis.OccurrenceType.gdlSize + " must be set to a positive integer, but is \"" + rowsOcc.getValue() + "\"");
+ }
+ } else {
+ return 1;
+ }
+ }
+
+
+ // sets the size property of this element by using the GWT DOM class
+ public void setSize(Widget widget, int value){
+ ((ListBox)widget).setVisibleItemCount(value);
+ }
+
+
+ // this method has not effect, it is defined only for consistency reasons
+ @Deprecated
+ public void setMultiple(Widget widget, boolean value){
+ // Do nothing the gdl:multiple property is set in the createListBox method
+ // directly when calling the ListBox constructor
+ }
+
+
+ public void setOnePerGroup(Widget widget, boolean value){
+ // TODO: implement => http://code.google.com/p/gwt-traction/source/browse/src/com/tractionsoftwar…
+ }
+
+
+ // sets the css properties, by calling the super class's method and the local
+ // method, which sets some specific properties for the GdlText instance
+ @Override
+ public void setGdlStyle(Widget widget) throws InvalidGdlSchemaException, ExecutionException {
+ super.setGdlStyle(widget);
+
+ this.setSize(widget, this.getSize());
+ this.setOnePerGroup(widget, this.getOnePerGroup());
+ }
+
+
+ // returns an ArrayList of string that contains all selected values
+ @Override
+ public ArrayList<String> getStringValue() {
+ ArrayList<String> results = new ArrayList<String>();
+ for (Widget elem : super.subElements) {
+ ListBox lb = ((ListBox)elem);
+ if(lb.getSelectedIndex() != -1) results.add(lb.getValue(lb.getSelectedIndex()));
+ }
+ return results;
+ }
+
+
+ @Override
+ public ArrayList<Pair<TopicMapsTypes, Object>> getTmValue() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+
+ @Override
+ public boolean validate() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+}
\ No newline at end of file
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java Thu Jul 7 07:44:51 2011 (r576)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java Thu Jul 7 08:49:40 2011 (r577)
@@ -52,12 +52,12 @@
}
- // creates a new TextArea item, adds it to the textElements array,
+ // creates a new TextArea item, adds it to the subElements array,
// and applies the styles on it
protected TextArea createNewTextArea() throws InvalidGdlSchemaException, ExecutionException {
TextArea elem = new TextArea();
DOM.setElementAttribute(elem.getElement(), "id", this.getId() + "__GDL_" + this.subElements.size());
- this.setGdlStyle((Widget)elem);
+ this.setGdlStyle(elem);
ActiveStyleHandler asHandler = new ActiveStyleHandler(this);
FocusStyleHandler fsHandler = new FocusStyleHandler(this);
HoverStyleHandler hsHandler = new HoverStyleHandler(this);
@@ -448,7 +448,7 @@
}
- // returns a boolean instance of a gdl:rows occurrence.
+ // returns an int instance of a gdl:rows occurrence.
// If no gdl:rows occurrence is set, the default value is returned
public int getRows() throws InvalidGdlSchemaException {
Occurrence rowsOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlRows);
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlTextObject.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlTextObject.java Thu Jul 7 07:44:51 2011 (r576)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlTextObject.java Thu Jul 7 08:49:40 2011 (r577)
@@ -1,10 +1,7 @@
package us.isidor.gdl.anaToMia.Widgets.text;
-
import com.google.gwt.dom.client.Style.FontStyle;
-import com.google.gwt.user.client.ui.TextArea;
import com.google.gwt.user.client.ui.Widget;
-
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Occurrence;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
import us.isidor.gdl.anaToMia.Widgets.base.GdlPsis;
@@ -283,66 +280,66 @@
// sets the direction style property of this element by using the GWT DOM class
public void setDirection(Widget widget, DirectionValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "direction", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "direction", value.getCssValue());
}
// sets the text-align style property of this element by using the GWT DOM class
public void setTextAlign(Widget widget, TextAlignValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "textAlign", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "textAlign", value.getCssValue());
}
// sets the line-height style property of this element by using the GWT DOM class
public void setLineHeight(Widget widget, NormalNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "lineHeight", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "lineHeight", value.getCssValue());
}
// sets the text-decoration style property of this element by using the GWT DOM class
public void setTextDecoration(Widget widget, TextDecorationValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "textDecoration", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "textDecoration", value.getCssValue());
}
// sets the color style property of this element by using the GWT DOM class
public void setColor(Widget widget, ColorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "color", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "color", value.getCssValue());
}
// sets the font-family style property of this element by using the GWT DOM class
public void setFontFamily(Widget widget, String value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "fontFamily", value);
+ if(value != null) this.setCssProperty(widget, styleClass, "fontFamily", value);
}
// sets the font-style style property of this element by using the GWT DOM class
public void setFontStyle(Widget widget, FontStyle value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "fontStyle", value.getCssName());
+ if(value != null) this.setCssProperty(widget, styleClass, "fontStyle", value.getCssName());
}
// sets the font-size style property of this element by using the GWT DOM class
public void setFontSize(Widget widget, PositiveNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "fontSize", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "fontSize", value.getCssValue());
}
// sets the font-weight style property of this element by using the GWT DOM class
public void setFontWeight(Widget widget, FontWeightValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "fontWeight", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "fontWeight", value.getCssValue());
}
// sets the letter-spacing style property of this element by using the GWT DOM class
public void setLetterSpacing(Widget widget, NormalNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "letterSpacing", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "letterSpacing", value.getCssValue());
}
// sets the word-spacing style property of this element by using the GWT DOM class
public void setWordSpacing(Widget widget, NormalNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "wordSpacing", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "wordSpacing", value.getCssValue());
}
1
0

[isidorus-cvs] r576 - in branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets: base text
by lgiessmann@common-lisp.net 07 Jul '11
by lgiessmann@common-lisp.net 07 Jul '11
07 Jul '11
Author: lgiessmann
Date: Thu Jul 7 07:44:51 2011
New Revision: 576
Log:
gdl-frontend: Widgets: fixed a bug in the style-handlers, which are responsible for setting width, min-width, max-width, height, min-height and max-height for resizeable textarea elements
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/text/GdlText.java
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 Thu Jul 7 06:50:26 2011 (r575)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java Thu Jul 7 07:44:51 2011 (r576)
@@ -26,6 +26,7 @@
import com.google.gwt.dom.client.Style.VerticalAlign;
import com.google.gwt.event.dom.client.BlurEvent;
import com.google.gwt.event.dom.client.BlurHandler;
+import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.FocusEvent;
import com.google.gwt.event.dom.client.FocusHandler;
@@ -51,7 +52,6 @@
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Panel;
-import com.google.gwt.user.client.ui.TextArea;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;
@@ -1194,202 +1194,199 @@
// sets the border-color style property of this element by using the GWT DOM class
public void setBorderColor(Widget widget, ColorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderColor", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "borderColor", value.getCssValue());
}
// sets the border-top-color style property of this element by using the GWT DOM class
public void setBorderTopColor(Widget widget, ColorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderTopColor", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "borderTopColor", value.getCssValue());
}
// sets the border-right-color style property of this element by using the GWT DOM class
public void setBorderRightColor(Widget widget, ColorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderRightColor", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "borderRightColor", value.getCssValue());
}
// sets the border-bottom-color style property of this element by using the GWT DOM class
public void setBorderBottomColor(Widget widget, ColorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderBottomColor", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "borderBottomColor", value.getCssValue());
}
// sets the border-left-color style property of this element by using the GWT DOM class
public void setBorderLeftColor(Widget widget, ColorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderLeftColor", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "borderLeftColor", value.getCssValue());
}
// sets the border-style style property of this element by using the GWT DOM class
public void setBorderStyle(Widget widget, BorderStyleValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderStyle", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "borderStyle", value.getCssValue());
}
// sets the border-top-style style property of this element by using the GWT DOM class
public void setBorderTopStyle(Widget widget, BorderStyleValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderTopStyle", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "borderTopStyle", value.getCssValue());
}
// sets the border-right-style style property of this element by using the GWT DOM class
public void setBorderRightStyle(Widget widget, BorderStyleValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderRightStyle", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "borderRightStyle", value.getCssValue());
}
// sets the border-bottom-style style property of this element by using the GWT DOM class
public void setBorderBottomStyle(Widget widget, BorderStyleValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderBottomStyle", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "borderBottomStyle", value.getCssValue());
}
// sets the border-left-style style property of this element by using the GWT DOM class
public void setBorderLeftStyle(Widget widget, BorderStyleValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderLeftStyle", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "borderLeftStyle", value.getCssValue());
}
// sets the border-width style property of this element by using the GWT DOM class
public void setBorderWidth(Widget widget, AbsoluteNumValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderWidth", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "borderWidth", value.getCssValue());
}
// sets the border-width style property of this element by using the GWT DOM class
public void setBorderTopWidth(Widget widget, AbsoluteNumValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderTopWidth", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "borderTopWidth", value.getCssValue());
}
// sets the border-width style property of this element by using the GWT DOM class@Override
public void setBorderRightWidth(Widget widget, AbsoluteNumValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderRightWidth", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "borderRightWidth", value.getCssValue());
}
// sets the border-width style property of this element by using the GWT DOM class
public void setBorderBottomWidth(Widget widget, AbsoluteNumValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderBottomWidth", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "borderBottomWidth", value.getCssValue());
}
// sets the border-width style property of this element by using the GWT DOM class
public void setBorderLeftWidth(Widget widget, AbsoluteNumValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderLeftWidth", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "borderLeftWidth", value.getCssValue());
}
// sets the border-radius style property of this element by using the GWT DOM class
public void setBorderRadius(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderRadius", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "borderRadius", value.getCssValue());
}
// sets the border-top-right-radius style property of this element by using the GWT DOM class
public void setBorderTopRightRadius(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderTopRightRadius", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "borderTopRightRadius", value.getCssValue());
}
// sets the border-bottom-right-radius style property of this element by using the GWT DOM class
public void setBorderBottomRightRadius(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderBottomRightRadius", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "borderBottomRightRadius", value.getCssValue());
}
// sets the border-bottom-left-radius style property of this element by using the GWT DOM class
public void setBorderBottomLeftRadius(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderBottomLeftRadius", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "borderBottomLeftRadius", value.getCssValue());
}
// sets the border-top-left-radius style property of this element by using the GWT DOM class
public void setBorderTopLeftRadius(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderTopLeftRadius", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "borderTopLeftRadius", value.getCssValue());
}
// sets the padding style property of this element by using the GWT DOM class
public void setPadding(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "padding", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "padding", value.getCssValue());
}
// sets the padding-top style property of this element by using the GWT DOM class
public void setPaddingTop(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "paddingTop", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "paddingTop", value.getCssValue());
}
// sets the padding-right style property of this element by using the GWT DOM class
public void setPaddingRight(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "paddingRight", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "paddingRight", value.getCssValue());
}
// sets the padding-bottom style property of this element by using the GWT DOM class
public void setPaddingBottom(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "paddingBottom", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "paddingBottom", value.getCssValue());
}
// sets the padding-left style property of this element by using the GWT DOM class
public void setPaddingLeft(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "paddingLeft", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "paddingLeft", value.getCssValue());
}
-
-
-
// sets the width style property of this element by using the GWT DOM class
public void setWidth(Widget widget, AutoNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "width", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "width", value.getCssValue());
}
// sets the min-width style property of this element by using the GWT DOM class
public void setMinWidth(Widget widget, AutoNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "minWidth", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "minWidth", value.getCssValue());
}
// sets the max-width style property of this element by using the GWT DOM class
public void setMaxWidth(Widget widget, AutoNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "maxWidth", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "maxWidth", value.getCssValue());
}
// sets the height style property of this element by using the GWT DOM class
public void setHeight(Widget widget, AutoNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "height", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "height", value.getCssValue());
}
// sets the min-height style property of this element by using the GWT DOM class
public void setMinHeight(Widget widget, AutoNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "minHeight", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "minHeight", value.getCssValue());
}
// sets the max-height style property of this element by using the GWT DOM class
public void setMaxHeight(Widget widget, AutoNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "maxHeight", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "maxHeight", value.getCssValue());
}
// sets the cursor style property of this element by using the GWT DOM class
public void setCursor(Widget widget, CursorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "cursor", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "cursor", value.getCssValue());
}
// sets the background-color style property of this element by using the GWT DOM class
public void setBackgroundColor(Widget widget, ColorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "backgroundColor", value.getCssValue());
+ if(value != null) this.setCssProperty(widget, styleClass, "backgroundColor", value.getCssValue());
}
@@ -1499,7 +1496,7 @@
public MultipleHandlerRegistration addClickHandler(ClickHandler handler) {
MultipleHandlerRegistration regs = new MultipleHandlerRegistration();
for (Widget item : this.subElements) {
- regs.addHandlerRegistration(((TextArea)item).addClickHandler(handler));
+ regs.addHandlerRegistration(item.addHandler(handler, ClickEvent.getType()));
}
return regs;
}
@@ -1510,7 +1507,7 @@
public MultipleHandlerRegistration addMouseOutHandler(MouseOutHandler handler){
MultipleHandlerRegistration regs = new MultipleHandlerRegistration();
for (Widget item : this.subElements) {
- regs.addHandlerRegistration(((TextArea)item).addMouseOutHandler(handler));
+ regs.addHandlerRegistration(item.addHandler(handler, MouseOutEvent.getType()));
}
return regs;
}
@@ -1521,7 +1518,7 @@
public MultipleHandlerRegistration addMouseOverHandler(MouseOverHandler handler){
MultipleHandlerRegistration regs = new MultipleHandlerRegistration();
for (Widget item : this.subElements) {
- regs.addHandlerRegistration(((TextArea)item).addMouseOverHandler(handler));
+ regs.addHandlerRegistration(item.addHandler(handler, MouseOverEvent.getType()));
}
return regs;
}
@@ -1532,7 +1529,7 @@
public MultipleHandlerRegistration addFocusHandler(FocusHandler handler){
MultipleHandlerRegistration regs = new MultipleHandlerRegistration();
for (Widget item : this.subElements) {
- regs.addHandlerRegistration(((TextArea)item).addFocusHandler(handler));
+ regs.addHandlerRegistration(item.addHandler(handler, FocusEvent.getType()));
}
return regs;
}
@@ -1543,7 +1540,7 @@
public MultipleHandlerRegistration addMouseDownHandler(MouseDownHandler handler){
MultipleHandlerRegistration regs = new MultipleHandlerRegistration();
for (Widget item : this.subElements) {
- regs.addHandlerRegistration(((TextArea)item).addMouseDownHandler(handler));
+ regs.addHandlerRegistration(item.addHandler(handler, MouseDownEvent.getType()));
}
return regs;
}
@@ -1554,7 +1551,7 @@
public MultipleHandlerRegistration addMouseUpHandler(MouseUpHandler handler){
MultipleHandlerRegistration regs = new MultipleHandlerRegistration();
for (Widget item : this.subElements) {
- regs.addHandlerRegistration(((TextArea)item).addMouseUpHandler(handler));
+ regs.addHandlerRegistration(item.addHandler(handler, MouseUpEvent.getType()));
}
return regs;
}
@@ -1566,14 +1563,14 @@
public MultipleHandlerRegistration addBlurHandler(BlurHandler handler){
MultipleHandlerRegistration regs = new MultipleHandlerRegistration();
for (Widget item : this.subElements) {
- regs.addHandlerRegistration(((TextArea)item).addBlurHandler(handler));
+ regs.addHandlerRegistration(item.addHandler(handler, BlurEvent.getType()));
}
return regs;
}
// adds the passed handler to the list eventHandlers
- private void addEventHandler(Widget elem, EventHandler handler){
+ protected void addEventHandler(Widget elem, EventHandler handler){
if(handler == null || elem == null) return;
for (Pair<Widget, ArrayList<EventHandler>> item : this.eventHandlers) {
@@ -1591,7 +1588,7 @@
// remove the passed handler of the list eventHandlers
- private void removeEventHandler(Widget elem, EventHandler handler){
+ protected void removeEventHandler(Widget elem, EventHandler handler){
for (Pair<Widget, ArrayList<EventHandler>> item : this.eventHandlers) {
if(item.getFirst().equals(elem)){
item.getSecond().remove(handler);
@@ -1601,7 +1598,7 @@
// returns the last handler bound to the passed element.
- private EventHandler getLastHandler(Widget elem){
+ protected EventHandler getLastHandler(Widget elem){
for (Pair<Widget, ArrayList<EventHandler>> item : this.eventHandlers) {
if(item.getFirst().equals(elem)){
int idx = item.getSecond().size() - 1;
@@ -1616,7 +1613,7 @@
// applies the styles bound to hover and the passed element
- private void onHoverStart(Widget widget){
+ protected void onHoverStart(Widget widget){
for (Pair<String, String> elem : this.hoverCssNamesAndStyles) {
DOM.setStyleAttribute(widget.getElement(), elem.getFirst(), elem.getSecond());
}
@@ -1624,7 +1621,7 @@
// applies the styles bound to acitve and the passed element
- private void onActiveStart(Widget widget){
+ protected void onActiveStart(Widget widget){
for (Pair<String, String> elem : this.activeCssNamesAndStyles) {
DOM.setStyleAttribute(widget.getElement(), elem.getFirst(), elem.getSecond());
}
@@ -1632,7 +1629,7 @@
// applies the styles bound to focus and the passed element
- private void onFocusStart(Widget widget){
+ protected void onFocusStart(Widget widget){
for (Pair<String, String> elem : this.focusCssNamesAndStyles) {
DOM.setStyleAttribute(widget.getElement(), elem.getFirst(), elem.getSecond());
}
@@ -1652,7 +1649,7 @@
// shall be called when the focus event was fired
public void onHoverEnd(MouseOutEvent event, HoverStyleHandler handler) {
try{
- TextArea source = (TextArea)event.getSource();
+ Widget source = (Widget)event.getSource();
this.removeEventHandler(source, handler);
EventHandler lastHandler = this.getLastHandler(source);
if(lastHandler == null){
@@ -1696,7 +1693,7 @@
}
- // shall be called to apply the styles of the sctive class
+ // shall be called to apply the styles of the active class
public void onActiveStart(MouseDownEvent event, ActiveStyleHandler handler) {
Widget source = (Widget)event.getSource();
this.addEventHandler(source, handler);
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java Thu Jul 7 06:50:26 2011 (r575)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java Thu Jul 7 07:44:51 2011 (r576)
@@ -1,11 +1,16 @@
package us.isidor.gdl.anaToMia.Widgets.text;
import java.util.ArrayList;
+
+import com.google.gwt.event.dom.client.BlurEvent;
import com.google.gwt.event.dom.client.KeyPressEvent;
import com.google.gwt.event.dom.client.KeyPressHandler;
+import com.google.gwt.event.dom.client.MouseOutEvent;
+import com.google.gwt.event.dom.client.MouseUpEvent;
import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.TextArea;
import com.google.gwt.user.client.ui.Widget;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Occurrence;
@@ -633,5 +638,193 @@
}
- // TODO: override setWidth when invoking by any StyleHandler => if resize is true => don't set the size to its origin, but to its last value
+ // like setGdlStyle, except the width, minwidth, maxWidth, height, minHeight and maxHeight properties
+ // are not set. This method should only be invoked of the onFocusEnd, onActiveEnd and onHoverEnd
+ // to avoid the resizing of resizeable textarea elements
+ private void setCleanGdlStyle(TextArea source) throws InvalidGdlSchemaException, ExecutionException{
+ ResizeValue resize = this.getResize();
+
+ // GdlVisibleObject
+ this.setContentOrientation(source, this.getContentOrientation());
+
+ this.setVerticalAlign(source, this.getVerticalAlign(null), null);
+
+ this.setMargin(source, this.getMargin(null), null);
+ this.setMarginTop(source, this.getMarginTop(null), null);
+ this.setMarginRight(source, this.getMarginRight(null), null);
+ this.setMarginBottom(source, this.getMarginBottom(null), null);
+ this.setMarginLeft(source, this.getMarginLeft(null), null);
+
+ this.setBorderColor(source, this.getBorderColor(null), null);
+ this.setBorderTopColor(source, this.getBorderTopColor(null), null);
+ this.setBorderRightColor(source, this.getBorderRightColor(null), null);
+ this.setBorderBottomColor(source, this.getBorderBottomColor(null), null);
+ this.setBorderLeftColor(source, this.getBorderLeftColor(null), null);
+
+ this.setBorderStyle(source, this.getBorderStyle(null), null);
+ this.setBorderTopStyle(source, this.getBorderTopStyle(null), null);
+ this.setBorderRightStyle(source, this.getBorderRightStyle(null), null);
+ this.setBorderBottomStyle(source, this.getBorderBottomStyle(null), null);
+ this.setBorderLeftStyle(source, this.getBorderLeftStyle(null), null);
+
+ this.setBorderWidth(source, this.getBorderWidth(null), null);
+ this.setBorderTopWidth(source, this.getBorderTopWidth(null), null);
+ this.setBorderRightWidth(source, this.getBorderRightWidth(null), null);
+ this.setBorderBottomWidth(source, this.getBorderBottomWidth(null), null);
+ this.setBorderLeftWidth(source, this.getBorderLeftWidth(null), null);
+
+ this.setBorderRadius(source, this.getBorderRadius(null), null);
+ this.setBorderTopRightRadius(source, this.getBorderTopRightRadius(null), null);
+ this.setBorderBottomRightRadius(source, this.getBorderBottomRightRadius(null), null);
+ this.setBorderBottomLeftRadius(source, this.getBorderBottomLeftRadius(null), null);
+ this.setBorderTopLeftRadius(source, this.getBorderTopLeftRadius(null), null);
+
+ this.setCursor(source, this.getCursor(null), null);
+
+ this.setBackgroundColor(source, this.getBackgroundColor(null), null);
+
+ if(resize == ResizeValue.NONE || resize == ResizeValue.VERTICAL){
+ this.setWidth(source, this.getWidth(null), null);
+ this.setMaxWidth(source, this.getMaxWidth(null), null);
+ this.setMinWidth(source, this.getMinWidth(null), null);
+ }
+
+ if(resize == ResizeValue.NONE || resize == ResizeValue.HORIZONTAL){
+ this.setHeight(source, this.getHeight(null), null);
+ this.setMaxHeight(source, this.getMaxHeight(null), null);
+ this.setMinHeight(source, this.getMinHeight(null), null);
+ }
+
+ // GdlTextObject
+ this.setColor(source, this.getColor(null), null);
+
+ this.setDirection(source, this.getDirection(null), null);
+ this.setTextAlign(source, this.getTextAlign(null), null);
+ this.setLineHeight(source, this.getLineHeight(null), null);
+ this.setTextDecoration(source, this.getTextDecoration(null), null);
+ this.setFontFamily(source, this.getFontFamily(null), null);
+ this.setFontStyle(source, this.getFontStyle(null), null);
+ this.setFontSize(source, this.getFontSize(null), null);
+ this.setFontWeight(source, this.getFontWeight(null), null);
+ this.setLetterSpacing(source, this.getLetterSpacing(null), null);
+ this.setWordSpacing(source, this.getWordSpacing(null), null);
+ }
+
+
+ // shall be called to apply the styles of the focus class
+ public void onActiveEnd(MouseUpEvent event, ActiveStyleHandler handler) {
+ try{
+ TextArea source = (TextArea)event.getSource();
+ this.removeEventHandler(source, handler);
+ EventHandler lastHandler = this.getLastHandler(source);
+ if(lastHandler == null){
+ this.setCleanGdlStyle(source);
+ }else {
+ if(lastHandler.getClass().equals(HoverStyleHandler.class)) this.onHoverStart(source);
+ else this.onFocusStart(source);
+ }
+ }catch(Exception e){
+ Window.alert("could not apply the default CSS style >> " + e.getClass() + " >> " + e.getMessage());
+ }
+ }
+
+
+ // shall be called when the focus event was fired
+ public void onHoverEnd(MouseOutEvent event, HoverStyleHandler handler) {
+ try{
+ TextArea source = (TextArea)event.getSource();
+ this.removeEventHandler(source, handler);
+ EventHandler lastHandler = this.getLastHandler(source);
+ if(lastHandler == null){
+ this.setCleanGdlStyle(source);
+ }else {
+ if(lastHandler.getClass().equals(ActiveStyleHandler.class)) this.onActiveStart(source);
+ else this.onFocusStart(source);
+ }
+ }catch(Exception e){
+ Window.alert("could not apply the default CSS style >> " + e.getClass() + " >> " + e.getMessage());
+ e.printStackTrace();
+ }
+ }
+
+
+ // shall be called when the blur event was fired
+ public void onFocusEnd(BlurEvent event, FocusStyleHandler handler) {
+ try{
+ TextArea source = (TextArea)event.getSource();
+ this.removeEventHandler(source, handler);
+ EventHandler lastHandler = this.getLastHandler(source);
+ if(lastHandler == null){
+ this.setCleanGdlStyle(source);
+ }else {
+ if(lastHandler.getClass().equals(ActiveStyleHandler.class)) this.onActiveStart(source);
+ else this.onHoverStart(source);
+ }
+ }catch(Exception e){
+ Window.alert("could not apply the default CSS style >> " + e.getClass() + " >> " + e.getMessage());
+ }
+ }
+
+
+ // width, minWidth, maxWidth, height, minHeight, maxHeight properties are ignore for styleClasses of resizable elements
+ @Override
+ protected void setCssProperty(Widget elem, String styleClass, String cssProperty, String cssValue)throws InvalidGdlSchemaException, ExecutionException{
+ if(styleClass != null){
+ ResizeValue resize = this.getResize();
+ if(resize == ResizeValue.NONE){
+ super.setCssProperty(elem, styleClass, cssProperty, cssValue);
+ }else if(resize == ResizeValue.HORIZONTAL){
+ if(cssProperty.equals("width") || cssProperty.equals("minWidth") || cssProperty.equals("maxWidth")) {
+ // do nothing this properties are ignored for resizable textareas
+ } else {
+ super.setCssProperty(elem, styleClass, cssProperty, cssValue);
+ }
+ }else if(resize == ResizeValue.VERTICAL) {
+ if(cssProperty.equals("height") || cssProperty.equals("minHeight") || cssProperty.equals("maxHeight")) {
+ // do nothing this properties are ignored for resizable textareas
+ } else {
+ super.setCssProperty(elem, styleClass, cssProperty, cssValue);
+ }
+ }else {
+ if(cssProperty.equals("height") || cssProperty.equals("minHeight") || cssProperty.equals("maxHeight") || cssProperty.equals("width") || cssProperty.equals("minWidth") || cssProperty.equals("maxWidth")) {
+ // do nothing this properties are ignored for resizable textareas
+ } else {
+ super.setCssProperty(elem, styleClass, cssProperty, cssValue);
+ }
+ }
+ }else {
+ super.setCssProperty(elem, styleClass, cssProperty, cssValue);
+ }
+ }
+
+
+ // width, minWidth, maxWidth, height, minHeight, maxHeight properties are ignore for styleClasses of resizable elements
+ protected void setCssProperty(String styleClass, String cssProperty, String cssValue)throws InvalidGdlSchemaException, ExecutionException{
+ if(styleClass != null){
+ ResizeValue resize = this.getResize();
+ if(resize == ResizeValue.NONE){
+ super.setCssProperty(styleClass, cssProperty, cssValue);
+ }else if(resize == ResizeValue.HORIZONTAL){
+ if(cssProperty.equals("width") || cssProperty.equals("minWidth") || cssProperty.equals("maxWidth")) {
+ // do nothing this properties are ignored for resizable textareas
+ } else {
+ super.setCssProperty(styleClass, cssProperty, cssValue);
+ }
+ }else if(resize == ResizeValue.VERTICAL) {
+ if(cssProperty.equals("height") || cssProperty.equals("minHeight") || cssProperty.equals("maxHeight")) {
+ // do nothing this properties are ignored for resizable textareas
+ } else {
+ super.setCssProperty(styleClass, cssProperty, cssValue);
+ }
+ }else {
+ if(cssProperty.equals("height") || cssProperty.equals("minHeight") || cssProperty.equals("maxHeight") || cssProperty.equals("width") || cssProperty.equals("minWidth") || cssProperty.equals("maxWidth")) {
+ // do nothing this properties are ignored for resizable textareas
+ } else {
+ super.setCssProperty(styleClass, cssProperty, cssValue);
+ }
+ }
+ }else {
+ super.setCssProperty(styleClass, cssProperty, cssValue);
+ }
+ }
}
1
0

[isidorus-cvs] r575 - in branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets: base text
by lgiessmann@common-lisp.net 07 Jul '11
by lgiessmann@common-lisp.net 07 Jul '11
07 Jul '11
Author: lgiessmann
Date: Thu Jul 7 06:50:26 2011
New Revision: 575
Log:
gdl-frontend: Widgets: foxed a bug in the style-handlers, which are responsible for setting the css properties of active, hover and focus
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/text/GdlText.java
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 Thu Jul 7 05:58:31 2011 (r574)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java Thu Jul 7 06:50:26 2011 (r575)
@@ -65,7 +65,7 @@
protected ArrayList<Pair<String, String>> focusCssNamesAndStyles = new ArrayList<Pair<String,String>>();
protected ArrayList<Pair<String, String>> hoverCssNamesAndStyles = new ArrayList<Pair<String,String>>();
protected ArrayList<Widget> subElements = new ArrayList<Widget>();
- protected ArrayList<Pair<TextArea, ArrayList<EventHandler>>> eventHandlers = new ArrayList<Pair<TextArea, ArrayList<EventHandler>>>();
+ protected ArrayList<Pair<Widget, ArrayList<EventHandler>>> eventHandlers = new ArrayList<Pair<Widget, ArrayList<EventHandler>>>();
// some constructors
@@ -1573,39 +1573,36 @@
// adds the passed handler to the list eventHandlers
- private void addEventHandler(TextArea elem, EventHandler handler){
+ private void addEventHandler(Widget elem, EventHandler handler){
if(handler == null || elem == null) return;
- for (Pair<TextArea, ArrayList<EventHandler>> item : this.eventHandlers) {
+ for (Pair<Widget, ArrayList<EventHandler>> item : this.eventHandlers) {
if(item.getFirst().equals(elem)){
- item.getSecond().add(handler);
- return;
+ if(!item.getSecond().contains(handler)){
+ item.getSecond().add(handler);
+ return;
+ }
}
}
ArrayList<EventHandler> newHandlerList = new ArrayList<EventHandler>();
newHandlerList.add(handler);
- this.eventHandlers.add(new Pair<TextArea, ArrayList<EventHandler>>(elem, newHandlerList));
+ this.eventHandlers.add(new Pair<Widget, ArrayList<EventHandler>>(elem, newHandlerList));
}
// remove the passed handler of the list eventHandlers
- private void removeEventHandler(TextArea elem, EventHandler handler){
- for (Pair<TextArea, ArrayList<EventHandler>> item : this.eventHandlers) {
+ private void removeEventHandler(Widget elem, EventHandler handler){
+ for (Pair<Widget, ArrayList<EventHandler>> item : this.eventHandlers) {
if(item.getFirst().equals(elem)){
- for (EventHandler handlerItem : item.getSecond()) {
- if(handlerItem.equals(handler)){
- item.getSecond().remove(handlerItem);
- return;
- }
- }
+ item.getSecond().remove(handler);
}
}
}
// returns the last handler bound to the passed element.
- private EventHandler getLastHandler(TextArea elem){
- for (Pair<TextArea, ArrayList<EventHandler>> item : this.eventHandlers) {
+ private EventHandler getLastHandler(Widget elem){
+ for (Pair<Widget, ArrayList<EventHandler>> item : this.eventHandlers) {
if(item.getFirst().equals(elem)){
int idx = item.getSecond().size() - 1;
if(idx >= 0){
@@ -1617,6 +1614,7 @@
return null;
}
+
// applies the styles bound to hover and the passed element
private void onHoverStart(Widget widget){
for (Pair<String, String> elem : this.hoverCssNamesAndStyles) {
@@ -1643,7 +1641,7 @@
// some handler for applying the css style bound to the pseudo classes hover, active and focus
public void onHoverStart(MouseOverEvent event, HoverStyleHandler handler) {
- TextArea source = (TextArea)event.getSource();
+ Widget source = (Widget)event.getSource();
this.addEventHandler(source, handler);
for (Pair<String, String> elem : this.hoverCssNamesAndStyles) {
DOM.setStyleAttribute(source.getElement(), elem.getFirst(), elem.getSecond());
@@ -1672,7 +1670,7 @@
// shall be called to apply the styles of the focus class
public void onFocusStart(FocusEvent event, FocusStyleHandler handler) {
- TextArea source = (TextArea)event.getSource();
+ Widget source = (Widget)event.getSource();
this.addEventHandler(source, handler);
for (Pair<String, String> elem : this.focusCssNamesAndStyles) {
DOM.setStyleAttribute(source.getElement(), elem.getFirst(), elem.getSecond());
@@ -1683,7 +1681,7 @@
// shall be called when the blur event was fired
public void onFocusEnd(BlurEvent event, FocusStyleHandler handler) {
try{
- TextArea source = (TextArea)event.getSource();
+ Widget source = (Widget)event.getSource();
this.removeEventHandler(source, handler);
EventHandler lastHandler = this.getLastHandler(source);
if(lastHandler == null){
@@ -1700,7 +1698,7 @@
// shall be called to apply the styles of the sctive class
public void onActiveStart(MouseDownEvent event, ActiveStyleHandler handler) {
- TextArea source = (TextArea)event.getSource();
+ Widget source = (Widget)event.getSource();
this.addEventHandler(source, handler);
for (Pair<String, String> elem : this.activeCssNamesAndStyles) {
DOM.setStyleAttribute(source.getElement(), elem.getFirst(), elem.getSecond());
@@ -1711,7 +1709,7 @@
// shall be called to apply the styles of the focus class
public void onActiveEnd(MouseUpEvent event, ActiveStyleHandler handler) {
try{
- TextArea source = (TextArea)event.getSource();
+ Widget source = (Widget)event.getSource();
this.removeEventHandler(source, handler);
EventHandler lastHandler = this.getLastHandler(source);
if(lastHandler == null){
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java Thu Jul 7 05:58:31 2011 (r574)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java Thu Jul 7 06:50:26 2011 (r575)
@@ -70,7 +70,7 @@
// removes the passed element and all its handlers from the outer element
protected void removeTextArea(TextArea elem) throws InvalidGdlSchemaException, ExecutionException{
- for (Pair<TextArea, ArrayList<EventHandler>> item : this.eventHandlers) {
+ for (Pair<Widget, ArrayList<EventHandler>> item : this.eventHandlers) {
if(item.getFirst().equals(elem)){
this.eventHandlers.remove(item);
break;
1
0

[isidorus-cvs] r574 - in branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets: base text
by lgiessmann@common-lisp.net 07 Jul '11
by lgiessmann@common-lisp.net 07 Jul '11
07 Jul '11
Author: lgiessmann
Date: Thu Jul 7 05:58:31 2011
New Revision: 574
Log:
gdl-frontend: Widgets: implemented the behavior for gdl:ContentOrientation
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/TestClass.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java
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 Thu Jul 7 00:58:04 2011 (r573)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java Thu Jul 7 05:58:31 2011 (r574)
@@ -49,12 +49,16 @@
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.AbsolutePanel;
import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.HorizontalPanel;
+import com.google.gwt.user.client.ui.Panel;
import com.google.gwt.user.client.ui.TextArea;
+import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;
public abstract class GdlVisibleObject extends Composite implements GdlDescriptor, HasClickHandlers, HasMouseOutHandlers, HasMouseOverHandlers, HasFocusHandlers, HasMouseDownHandlers, HasMouseUpHandlers, HasBlurHandlers{
protected AbsolutePanel mainPanel = new AbsolutePanel();
+ protected Panel containerPanel = null;
protected Topic tmRepresentative = null;
protected TopicMap tm = null;
protected ArrayList<Pair<String, String>> activeCssNamesAndStyles = new ArrayList<Pair<String,String>>();
@@ -85,6 +89,17 @@
return this.tmRepresentative;
}
+
+ // this method should be invoked if a new sub-element is added to this instance
+ protected void addToContainerPanel(Widget widget){
+ if(this.containerPanel == null){
+ this.containerPanel = new VerticalPanel();
+ this.mainPanel.add(this.containerPanel);
+ }
+
+ this.containerPanel.add(widget);
+ }
+
// a helper method that returns all occurrences of the type bound to the passed PSI
protected JsArray<Occurrence> getOccurrences(String occurrenceType){
@@ -1123,10 +1138,10 @@
// sets the float style property of all sub elements by using the GWT DOM class
public void setContentOrientation(Widget widget, ContentOrientationValue value) throws InvalidGdlSchemaException, ExecutionException {
- // TODO: use a VerticalPanel or HorizontalPanel instead of setting the display property
- String valueStr = "inline";
- if(value != null && value == ContentOrientationValue.VERTICAL) valueStr = "block";
- this.setCssProperty(widget, null, "display", valueStr);
+ if(value == ContentOrientationValue.HORIZONTAL && this.containerPanel == null) this.containerPanel = new HorizontalPanel();
+ else if(this.containerPanel == null) this.containerPanel = new VerticalPanel();
+
+ this.mainPanel.add(this.containerPanel);
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java Thu Jul 7 00:58:04 2011 (r573)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java Thu Jul 7 05:58:31 2011 (r574)
@@ -5,7 +5,6 @@
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Topic;
import us.isidor.gdl.anaToMia.Widgets.isidorus.LoadSchemaCallback;
import us.isidor.gdl.anaToMia.Widgets.text.GdlText;
-import us.isidor.gdl.anaToMia.Widgets.text.GdlTextObject;
import us.isidor.gdl.anaToMia.Widgets.values.CursorValue;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.event.dom.client.ClickEvent;
@@ -104,7 +103,7 @@
tmpRepresentative.createOccurrence(gdlFontSize, "15pt", null);
tmpRepresentative.createOccurrence(gdlTextDecoration, "underline", null);
tmpRepresentative.createOccurrence(gdlDisplay, "inline", null);
- tmpRepresentative.createOccurrence(gdlContentOrientation, "horizontal", null);
+ tmpRepresentative.createOccurrence(gdlContentOrientation, "vertical", null);
Occurrence bgcHover = tmpRepresentative.createOccurrence(gdlBackgroundColor, "green", null);
bgcHover.addTheme(gdlHover);
Occurrence bgcActive = tmpRepresentative.createOccurrence(gdlBackgroundColor, "purple", null);
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java Thu Jul 7 00:58:04 2011 (r573)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java Thu Jul 7 05:58:31 2011 (r574)
@@ -63,7 +63,7 @@
elem.addFocusHandler(fsHandler);
elem.addBlurHandler(fsHandler);
this.subElements.add(elem);
- super.mainPanel.add(elem);
+ super.addToContainerPanel(elem);
return elem;
}
1
0

[isidorus-cvs] r573 - in branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets: base text values views
by lgiessmann@common-lisp.net 07 Jul '11
by lgiessmann@common-lisp.net 07 Jul '11
07 Jul '11
Author: lgiessmann
Date: Thu Jul 7 00:58:04 2011
New Revision: 573
Log:
gdl-frontend: Widgets: simplified te behavior of the superclass GdlVisibleObject
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/TestClass.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlTextObject.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/values/ContentOrientationValue.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlCreatorAssociationView.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlDefaultCreatorTopicView.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlEditorAssociationView.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialCreatorTopicView.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialEditorTopicView.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlView.java
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 Wed Jul 6 13:36:01 2011 (r572)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java Thu Jul 7 00:58:04 2011 (r573)
@@ -23,12 +23,10 @@
import com.google.gwt.core.client.JsArray;
import com.google.gwt.dom.client.Style.Display;
import com.google.gwt.dom.client.Style.Float;
-import com.google.gwt.dom.client.Style.Overflow;
import com.google.gwt.dom.client.Style.VerticalAlign;
import com.google.gwt.event.dom.client.BlurEvent;
import com.google.gwt.event.dom.client.BlurHandler;
import com.google.gwt.event.dom.client.ClickHandler;
-import com.google.gwt.event.dom.client.DomEvent;
import com.google.gwt.event.dom.client.FocusEvent;
import com.google.gwt.event.dom.client.FocusHandler;
import com.google.gwt.event.dom.client.HasBlurHandlers;
@@ -46,9 +44,12 @@
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.EventHandler;
import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.AbsolutePanel;
import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.TextArea;
import com.google.gwt.user.client.ui.Widget;
@@ -59,6 +60,8 @@
protected ArrayList<Pair<String, String>> activeCssNamesAndStyles = new ArrayList<Pair<String,String>>();
protected ArrayList<Pair<String, String>> focusCssNamesAndStyles = new ArrayList<Pair<String,String>>();
protected ArrayList<Pair<String, String>> hoverCssNamesAndStyles = new ArrayList<Pair<String,String>>();
+ protected ArrayList<Widget> subElements = new ArrayList<Widget>();
+ protected ArrayList<Pair<TextArea, ArrayList<EventHandler>>> eventHandlers = new ArrayList<Pair<TextArea, ArrayList<EventHandler>>>();
// some constructors
@@ -155,7 +158,7 @@
// If no gdl:display occurrence is set, the default value is returned
public Display getDisplay() throws InvalidGdlSchemaException {
Occurrence displayOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlDisplay);
-
+
if(displayOcc != null){
String value = displayOcc.getValue().toLowerCase();
if(value.equals("none")){
@@ -238,7 +241,7 @@
throw new InvalidGdlSchemaException("The occurrence " + GdlPsis.OccurrenceType.gdlContentOrientation + " must be set to one of \"horizontal\" or \"vertical\", but is \"" + orientationOcc.getValue() + "\"");
}
} else {
- return ContentOrientationValue.Vertical;
+ return ContentOrientationValue.VERTICAL;
}
}
@@ -1119,8 +1122,13 @@
// sets the float style property of all sub elements by using the GWT DOM class
- public abstract void setContentOrientation(Widget widget, ContentOrientationValue value) throws InvalidGdlSchemaException, ExecutionException;
-
+ public void setContentOrientation(Widget widget, ContentOrientationValue value) throws InvalidGdlSchemaException, ExecutionException {
+ // TODO: use a VerticalPanel or HorizontalPanel instead of setting the display property
+ String valueStr = "inline";
+ if(value != null && value == ContentOrientationValue.VERTICAL) valueStr = "block";
+ this.setCssProperty(widget, null, "display", valueStr);
+ }
+
// sets the clear style property of this element by using the GWT DOM class
public void setClear(ClearValue value){
@@ -1131,160 +1139,244 @@
// sets the vertical-align style property of this element and all it's sub-elements by using the GWT DOM class
- public abstract void setVerticalAlign(Widget widget, VerticalAlign value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
-
+ public void setVerticalAlign(Widget widget, VerticalAlign value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null){
+ this.setCssProperty( widget, styleClass, "verticalAlign", value.getCssName());
+ this.setCssProperty(styleClass, "verticalAlign", value.getCssName());
+ }
+ }
+
// sets the margin style property of this element by using the GWT DOM class
- public abstract void setMargin(Widget widget, NumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
+ public void setMargin(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty(widget, styleClass, "margin", value.getCssValue());
+ }
// sets the margin-top style property of this element by using the GWT DOM class
- public abstract void setMarginTop(Widget widget, NumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
+ public void setMarginTop(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty(widget, styleClass, "marginTop", value.getCssValue());
+ }
// sets the margin-right style property of this element by using the GWT DOM class
- public abstract void setMarginRight(Widget widget, NumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
+ public void setMarginRight(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty(widget, styleClass, "marginRight", value.getCssValue());
+ }
// sets the margin-bottom style property of this element by using the GWT DOM class
- public abstract void setMarginBottom(Widget widget, NumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
+ public void setMarginBottom(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty(widget, styleClass, "marginBottom", value.getCssValue());
+ }
// sets the margin-left style property of this element by using the GWT DOM class
- public abstract void setMarginLeft(Widget widget, NumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
-
-
+ public void setMarginLeft(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty(widget, styleClass, "marginLeft", value.getCssValue());
+ }
+
+
// sets the border-color style property of this element by using the GWT DOM class
- public abstract void setBorderColor(Widget widget, ColorValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
+ public void setBorderColor(Widget widget, ColorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderColor", value.getCssValue());
+ }
// sets the border-top-color style property of this element by using the GWT DOM class
- public abstract void setBorderTopColor(Widget widget, ColorValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
+ public void setBorderTopColor(Widget widget, ColorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderTopColor", value.getCssValue());
+ }
// sets the border-right-color style property of this element by using the GWT DOM class
- public abstract void setBorderRightColor(Widget widget, ColorValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
+ public void setBorderRightColor(Widget widget, ColorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderRightColor", value.getCssValue());
+ }
// sets the border-bottom-color style property of this element by using the GWT DOM class
- public abstract void setBorderBottomColor(Widget widget, ColorValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
+ public void setBorderBottomColor(Widget widget, ColorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderBottomColor", value.getCssValue());
+ }
// sets the border-left-color style property of this element by using the GWT DOM class
- public abstract void setBorderLeftColor(Widget widget, ColorValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
-
-
+ public void setBorderLeftColor(Widget widget, ColorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderLeftColor", value.getCssValue());
+ }
+
+
// sets the border-style style property of this element by using the GWT DOM class
- public abstract void setBorderStyle(Widget widget, BorderStyleValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
+ public void setBorderStyle(Widget widget, BorderStyleValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderStyle", value.getCssValue());
+ }
// sets the border-top-style style property of this element by using the GWT DOM class
- public abstract void setBorderTopStyle(Widget widget, BorderStyleValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
+ public void setBorderTopStyle(Widget widget, BorderStyleValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderTopStyle", value.getCssValue());
+ }
// sets the border-right-style style property of this element by using the GWT DOM class
- public abstract void setBorderRightStyle(Widget widget, BorderStyleValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
+ public void setBorderRightStyle(Widget widget, BorderStyleValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderRightStyle", value.getCssValue());
+ }
// sets the border-bottom-style style property of this element by using the GWT DOM class
- public abstract void setBorderBottomStyle(Widget widget, BorderStyleValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
+ public void setBorderBottomStyle(Widget widget, BorderStyleValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderBottomStyle", value.getCssValue());
+ }
// sets the border-left-style style property of this element by using the GWT DOM class
- public abstract void setBorderLeftStyle(Widget widget, BorderStyleValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
-
+ public void setBorderLeftStyle(Widget widget, BorderStyleValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderLeftStyle", value.getCssValue());
+ }
+
// sets the border-width style property of this element by using the GWT DOM class
- public abstract void setBorderWidth(Widget widget, AbsoluteNumValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
-
+ public void setBorderWidth(Widget widget, AbsoluteNumValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderWidth", value.getCssValue());
+ }
- // sets the border-width style property of this element by using the GWT DOM class
- public abstract void setBorderTopWidth(Widget widget, AbsoluteNumValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
-
// sets the border-width style property of this element by using the GWT DOM class
- public abstract void setBorderRightWidth(Widget widget, AbsoluteNumValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
-
+ public void setBorderTopWidth(Widget widget, AbsoluteNumValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderTopWidth", value.getCssValue());
+ }
- // sets the border-width style property of this element by using the GWT DOM class
- public abstract void setBorderBottomWidth(Widget widget, AbsoluteNumValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
+ // sets the border-width style property of this element by using the GWT DOM class@Override
+ public void setBorderRightWidth(Widget widget, AbsoluteNumValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderRightWidth", value.getCssValue());
+ }
// sets the border-width style property of this element by using the GWT DOM class
- public abstract void setBorderLeftWidth(Widget widget, AbsoluteNumValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
+ public void setBorderBottomWidth(Widget widget, AbsoluteNumValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderBottomWidth", value.getCssValue());
+ }
+ // sets the border-width style property of this element by using the GWT DOM class
+ public void setBorderLeftWidth(Widget widget, AbsoluteNumValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderLeftWidth", value.getCssValue());
+ }
+
+
// sets the border-radius style property of this element by using the GWT DOM class
- public abstract void setBorderRadius(Widget widget, NumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
+ public void setBorderRadius(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderRadius", value.getCssValue());
+ }
// sets the border-top-right-radius style property of this element by using the GWT DOM class
- public abstract void setBorderTopRightRadius(Widget widget, NumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
+ public void setBorderTopRightRadius(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderTopRightRadius", value.getCssValue());
+ }
// sets the border-bottom-right-radius style property of this element by using the GWT DOM class
- public abstract void setBorderBottomRightRadius(Widget widget, NumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
+ public void setBorderBottomRightRadius(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderBottomRightRadius", value.getCssValue());
+ }
// sets the border-bottom-left-radius style property of this element by using the GWT DOM class
- public abstract void setBorderBottomLeftRadius(Widget widget, NumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
+ public void setBorderBottomLeftRadius(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderBottomLeftRadius", value.getCssValue());
+ }
// sets the border-top-left-radius style property of this element by using the GWT DOM class
- public abstract void setBorderTopLeftRadius(Widget widget, NumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
-
-
+ public void setBorderTopLeftRadius(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderTopLeftRadius", value.getCssValue());
+ }
+
+
+
// sets the padding style property of this element by using the GWT DOM class
- public abstract void setPadding(Widget widget, NumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
+ public void setPadding(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "padding", value.getCssValue());
+ }
// sets the padding-top style property of this element by using the GWT DOM class
- public abstract void setPaddingTop(Widget widget, NumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
+ public void setPaddingTop(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "paddingTop", value.getCssValue());
+ }
// sets the padding-right style property of this element by using the GWT DOM class
- public abstract void setPaddingRight(Widget widget, NumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
+ public void setPaddingRight(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "paddingRight", value.getCssValue());
+ }
// sets the padding-bottom style property of this element by using the GWT DOM class
- public abstract void setPaddingBottom(Widget widget, NumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
+ public void setPaddingBottom(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "paddingBottom", value.getCssValue());
+ }
// sets the padding-left style property of this element by using the GWT DOM class
- public abstract void setPaddingLeft(Widget widget, NumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
-
+ public void setPaddingLeft(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "paddingLeft", value.getCssValue());
+ }
+
+
+
+
// sets the width style property of this element by using the GWT DOM class
- public abstract void setWidth(Widget widget, AutoNumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
+ public void setWidth(Widget widget, AutoNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "width", value.getCssValue());
+ }
// sets the min-width style property of this element by using the GWT DOM class
- public abstract void setMinWidth(Widget widget, AutoNumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
+ public void setMinWidth(Widget widget, AutoNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "minWidth", value.getCssValue());
+ }
// sets the max-width style property of this element by using the GWT DOM class
- public abstract void setMaxWidth(Widget widget, AutoNumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
+ public void setMaxWidth(Widget widget, AutoNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "maxWidth", value.getCssValue());
+ }
// sets the height style property of this element by using the GWT DOM class
- public abstract void setHeight(Widget widget, AutoNumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
+ public void setHeight(Widget widget, AutoNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "height", value.getCssValue());
+ }
// sets the min-height style property of this element by using the GWT DOM class
- public abstract void setMinHeight(Widget widget, AutoNumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
+ public void setMinHeight(Widget widget, AutoNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "minHeight", value.getCssValue());
+ }
// sets the max-height style property of this element by using the GWT DOM class
- public abstract void setMaxHeight(Widget widget, AutoNumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
-
-
+ public void setMaxHeight(Widget widget, AutoNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "maxHeight", value.getCssValue());
+ }
+
+
// sets the cursor style property of this element by using the GWT DOM class
- public abstract void setCursor(Widget widget, CursorValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
+ public void setCursor(Widget widget, CursorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "cursor", value.getCssValue());
+ }
// sets the background-color style property of this element by using the GWT DOM class
- public abstract void setBackgroundColor(Widget widget, ColorValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
-
+ public void setBackgroundColor(Widget widget, ColorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "backgroundColor", value.getCssValue());
+ }
+
// sets the passed css style porperty to the passed css value.
// If a styleClass is given, the style is applied to either active, hover or focus
@@ -1304,7 +1396,79 @@
throw new InvalidGdlSchemaException("GDL defines only the style classes " + values + ", but found " + styleClass);
}
}
+
+
+ // sets a given css property and css value of this element's sub element
+ protected void setCssProperty(Widget elem, String styleClass, String cssProperty, String cssValue)throws InvalidGdlSchemaException, ExecutionException{
+ if(cssValue == null || cssProperty == null) return;
+ if(styleClass == null){
+ DOM.setStyleAttribute(elem.getElement(), cssProperty, cssValue);
+ } else if(styleClass.equals(GdlPsis.Scope.gdlActive)){
+ this.activeCssNamesAndStyles.add(new Pair<String, String>(cssProperty, cssValue));
+ } else if(styleClass.equals(GdlPsis.Scope.gdlFocus)){
+ this.focusCssNamesAndStyles.add(new Pair<String, String>(cssProperty, cssValue));
+ } else if (styleClass.equals(GdlPsis.Scope.gdlHover)){
+ this.hoverCssNamesAndStyles.add(new Pair<String, String>(cssProperty, cssValue));
+ } else {
+ String values = GdlPsis.Scope.gdlActive + ", " + GdlPsis.Scope.gdlFocus + ", " + GdlPsis.Scope.gdlHover;
+ throw new InvalidGdlSchemaException("GDL defines only the style classes " + values + ", but found " + styleClass);
+ }
+ }
+
+
+ // sets all GDL styles that are defined by the topic map representative to tha passed widget
+ public void setGdlStyle(Widget widget) throws InvalidGdlSchemaException, ExecutionException {
+ this.setContentOrientation(widget, this.getContentOrientation());
+
+ String[] styleClasses = new String[]{null, GdlPsis.Scope.gdlActive, GdlPsis.Scope.gdlFocus, GdlPsis.Scope.gdlHover};
+ for (String styleClass : styleClasses) {
+ this.setVerticalAlign(widget, this.getVerticalAlign(styleClass), styleClass);
+
+ this.setMargin(widget, this.getMargin(styleClass), styleClass);
+ this.setMarginTop(widget, this.getMarginTop(styleClass), styleClass);
+ this.setMarginRight(widget, this.getMarginRight(styleClass), styleClass);
+ this.setMarginBottom(widget, this.getMarginBottom(styleClass), styleClass);
+ this.setMarginLeft(widget, this.getMarginLeft(styleClass), styleClass);
+
+ this.setBorderColor(widget, this.getBorderColor(styleClass), styleClass);
+ this.setBorderTopColor(widget, this.getBorderTopColor(styleClass), styleClass);
+ this.setBorderRightColor(widget, this.getBorderRightColor(styleClass), styleClass);
+ this.setBorderBottomColor(widget, this.getBorderBottomColor(styleClass), styleClass);
+ this.setBorderLeftColor(widget, this.getBorderLeftColor(styleClass), styleClass);
+
+ this.setBorderStyle(widget, this.getBorderStyle(styleClass), styleClass);
+ this.setBorderTopStyle(widget, this.getBorderTopStyle(styleClass), styleClass);
+ this.setBorderRightStyle(widget, this.getBorderRightStyle(styleClass), styleClass);
+ this.setBorderBottomStyle(widget, this.getBorderBottomStyle(styleClass), styleClass);
+ this.setBorderLeftStyle(widget, this.getBorderLeftStyle(styleClass), styleClass);
+
+ this.setBorderWidth(widget, this.getBorderWidth(styleClass), styleClass);
+ this.setBorderTopWidth(widget, this.getBorderTopWidth(styleClass), styleClass);
+ this.setBorderRightWidth(widget, this.getBorderRightWidth(styleClass), styleClass);
+ this.setBorderBottomWidth(widget, this.getBorderBottomWidth(styleClass), styleClass);
+ this.setBorderLeftWidth(widget, this.getBorderLeftWidth(styleClass), styleClass);
+
+ this.setBorderRadius(widget, this.getBorderRadius(styleClass), styleClass);
+ this.setBorderTopRightRadius(widget, this.getBorderTopRightRadius(styleClass), styleClass);
+ this.setBorderBottomRightRadius(widget, this.getBorderBottomRightRadius(styleClass), styleClass);
+ this.setBorderBottomLeftRadius(widget, this.getBorderBottomLeftRadius(styleClass), styleClass);
+ this.setBorderTopLeftRadius(widget, this.getBorderTopLeftRadius(styleClass), styleClass);
+
+ this.setCursor(widget, this.getCursor(styleClass), styleClass);
+
+ this.setWidth(widget, this.getWidth(styleClass), styleClass);
+ this.setMaxWidth(widget, this.getMaxWidth(styleClass), styleClass);
+ this.setMinWidth(widget, this.getMinWidth(styleClass), styleClass);
+
+ this.setHeight(widget, this.getHeight(styleClass), styleClass);
+ this.setMaxHeight(widget, this.getMaxHeight(styleClass), styleClass);
+ this.setMinHeight(widget, this.getMinHeight(styleClass), styleClass);
+
+ this.setBackgroundColor(widget, this.getBackgroundColor(styleClass), styleClass);
+ }
+ }
+
// sets all GDL styles that are defined by the topic map representative
protected void setGdlStyle() throws InvalidGdlSchemaException, ExecutionException {
@@ -1317,59 +1481,232 @@
// registers a click handler to all sub-elements of this element
@Override
- public abstract MultipleHandlerRegistration addClickHandler(ClickHandler handler);
+ public MultipleHandlerRegistration addClickHandler(ClickHandler handler) {
+ MultipleHandlerRegistration regs = new MultipleHandlerRegistration();
+ for (Widget item : this.subElements) {
+ regs.addHandlerRegistration(((TextArea)item).addClickHandler(handler));
+ }
+ return regs;
+ }
// registers a mouse-out handler to all sub-elements of this element
@Override
- public abstract MultipleHandlerRegistration addMouseOutHandler(MouseOutHandler handler);
+ public MultipleHandlerRegistration addMouseOutHandler(MouseOutHandler handler){
+ MultipleHandlerRegistration regs = new MultipleHandlerRegistration();
+ for (Widget item : this.subElements) {
+ regs.addHandlerRegistration(((TextArea)item).addMouseOutHandler(handler));
+ }
+ return regs;
+ }
// registers a mouse-over handler to all sub-elements of this element
@Override
- public abstract MultipleHandlerRegistration addMouseOverHandler(MouseOverHandler handler);
+ public MultipleHandlerRegistration addMouseOverHandler(MouseOverHandler handler){
+ MultipleHandlerRegistration regs = new MultipleHandlerRegistration();
+ for (Widget item : this.subElements) {
+ regs.addHandlerRegistration(((TextArea)item).addMouseOverHandler(handler));
+ }
+ return regs;
+ }
// registers a focus handler to all sub-elements of this element
@Override
- public abstract MultipleHandlerRegistration addFocusHandler(FocusHandler handler);
+ public MultipleHandlerRegistration addFocusHandler(FocusHandler handler){
+ MultipleHandlerRegistration regs = new MultipleHandlerRegistration();
+ for (Widget item : this.subElements) {
+ regs.addHandlerRegistration(((TextArea)item).addFocusHandler(handler));
+ }
+ return regs;
+ }
// registers a mouse-down handler to all sub-elements of this element
@Override
- public abstract MultipleHandlerRegistration addMouseDownHandler(MouseDownHandler handler);
+ public MultipleHandlerRegistration addMouseDownHandler(MouseDownHandler handler){
+ MultipleHandlerRegistration regs = new MultipleHandlerRegistration();
+ for (Widget item : this.subElements) {
+ regs.addHandlerRegistration(((TextArea)item).addMouseDownHandler(handler));
+ }
+ return regs;
+ }
// registers a mouse-up handler to all sub-elements of this element
@Override
- public abstract MultipleHandlerRegistration addMouseUpHandler(MouseUpHandler handler);
+ public MultipleHandlerRegistration addMouseUpHandler(MouseUpHandler handler){
+ MultipleHandlerRegistration regs = new MultipleHandlerRegistration();
+ for (Widget item : this.subElements) {
+ regs.addHandlerRegistration(((TextArea)item).addMouseUpHandler(handler));
+ }
+ return regs;
+ }
+
// registers a blur handler to all sub-elements of this element
@Override
- public abstract MultipleHandlerRegistration addBlurHandler(BlurHandler handler);
+ public MultipleHandlerRegistration addBlurHandler(BlurHandler handler){
+ MultipleHandlerRegistration regs = new MultipleHandlerRegistration();
+ for (Widget item : this.subElements) {
+ regs.addHandlerRegistration(((TextArea)item).addBlurHandler(handler));
+ }
+ return regs;
+ }
- // shall be called, if a sub-element of this element is hovered
- public abstract void onHoverStart(@SuppressWarnings("rawtypes") DomEvent event, HoverStyleHandler handler);
+ // adds the passed handler to the list eventHandlers
+ private void addEventHandler(TextArea elem, EventHandler handler){
+ if(handler == null || elem == null) return;
+
+ for (Pair<TextArea, ArrayList<EventHandler>> item : this.eventHandlers) {
+ if(item.getFirst().equals(elem)){
+ item.getSecond().add(handler);
+ return;
+ }
+ }
+ ArrayList<EventHandler> newHandlerList = new ArrayList<EventHandler>();
+ newHandlerList.add(handler);
+ this.eventHandlers.add(new Pair<TextArea, ArrayList<EventHandler>>(elem, newHandlerList));
+ }
- // shall be called, if a sub-element of this element is hovered
- public abstract void onHoverEnd(@SuppressWarnings("rawtypes") DomEvent event, HoverStyleHandler handler);
+ // remove the passed handler of the list eventHandlers
+ private void removeEventHandler(TextArea elem, EventHandler handler){
+ for (Pair<TextArea, ArrayList<EventHandler>> item : this.eventHandlers) {
+ if(item.getFirst().equals(elem)){
+ for (EventHandler handlerItem : item.getSecond()) {
+ if(handlerItem.equals(handler)){
+ item.getSecond().remove(handlerItem);
+ return;
+ }
+ }
+ }
+ }
+ }
+
+
+ // returns the last handler bound to the passed element.
+ private EventHandler getLastHandler(TextArea elem){
+ for (Pair<TextArea, ArrayList<EventHandler>> item : this.eventHandlers) {
+ if(item.getFirst().equals(elem)){
+ int idx = item.getSecond().size() - 1;
+ if(idx >= 0){
+ return item.getSecond().get(idx);
+ }
+ }
+ }
+
+ return null;
+ }
+ // applies the styles bound to hover and the passed element
+ private void onHoverStart(Widget widget){
+ for (Pair<String, String> elem : this.hoverCssNamesAndStyles) {
+ DOM.setStyleAttribute(widget.getElement(), elem.getFirst(), elem.getSecond());
+ }
+ }
- // shall be called, if a sub-element of this element is focused
- public abstract void onFocusStart(@SuppressWarnings("rawtypes") DomEvent event, FocusStyleHandler handler);
+ // applies the styles bound to acitve and the passed element
+ private void onActiveStart(Widget widget){
+ for (Pair<String, String> elem : this.activeCssNamesAndStyles) {
+ DOM.setStyleAttribute(widget.getElement(), elem.getFirst(), elem.getSecond());
+ }
+ }
- // shall be called, if a sub-element of this element is focused
- public abstract void onFocusEnd(@SuppressWarnings("rawtypes") DomEvent event, FocusStyleHandler handler);
+ // applies the styles bound to focus and the passed element
+ private void onFocusStart(Widget widget){
+ for (Pair<String, String> elem : this.focusCssNamesAndStyles) {
+ DOM.setStyleAttribute(widget.getElement(), elem.getFirst(), elem.getSecond());
+ }
+ }
- // shall be called, if a sub-element of this element is focused
- public abstract void onActiveStart(@SuppressWarnings("rawtypes") DomEvent event, ActiveStyleHandler handler);
+ // some handler for applying the css style bound to the pseudo classes hover, active and focus
+ public void onHoverStart(MouseOverEvent event, HoverStyleHandler handler) {
+ TextArea source = (TextArea)event.getSource();
+ this.addEventHandler(source, handler);
+ for (Pair<String, String> elem : this.hoverCssNamesAndStyles) {
+ DOM.setStyleAttribute(source.getElement(), elem.getFirst(), elem.getSecond());
+ }
+ }
+
- // shall be called, if a sub-element of this element is focused
- public abstract void onActiveEnd(@SuppressWarnings("rawtypes") DomEvent event, ActiveStyleHandler handler);
+ // shall be called when the focus event was fired
+ public void onHoverEnd(MouseOutEvent event, HoverStyleHandler handler) {
+ try{
+ TextArea source = (TextArea)event.getSource();
+ this.removeEventHandler(source, handler);
+ EventHandler lastHandler = this.getLastHandler(source);
+ if(lastHandler == null){
+ this.setGdlStyle(source);
+ }else {
+ if(lastHandler.getClass().equals(ActiveStyleHandler.class)) this.onActiveStart(source);
+ else this.onFocusStart(source);
+ }
+ }catch(Exception e){
+ Window.alert("could not apply the default CSS style >> " + e.getClass() + " >> " + e.getMessage());
+ e.printStackTrace();
+ }
+ }
+
+
+ // shall be called to apply the styles of the focus class
+ public void onFocusStart(FocusEvent event, FocusStyleHandler handler) {
+ TextArea source = (TextArea)event.getSource();
+ this.addEventHandler(source, handler);
+ for (Pair<String, String> elem : this.focusCssNamesAndStyles) {
+ DOM.setStyleAttribute(source.getElement(), elem.getFirst(), elem.getSecond());
+ }
+ }
+
+
+ // shall be called when the blur event was fired
+ public void onFocusEnd(BlurEvent event, FocusStyleHandler handler) {
+ try{
+ TextArea source = (TextArea)event.getSource();
+ this.removeEventHandler(source, handler);
+ EventHandler lastHandler = this.getLastHandler(source);
+ if(lastHandler == null){
+ this.setGdlStyle(source);
+ }else {
+ if(lastHandler.getClass().equals(ActiveStyleHandler.class)) this.onActiveStart(source);
+ else this.onHoverStart(source);
+ }
+ }catch(Exception e){
+ Window.alert("could not apply the default CSS style >> " + e.getClass() + " >> " + e.getMessage());
+ }
+ }
+
+
+ // shall be called to apply the styles of the sctive class
+ public void onActiveStart(MouseDownEvent event, ActiveStyleHandler handler) {
+ TextArea source = (TextArea)event.getSource();
+ this.addEventHandler(source, handler);
+ for (Pair<String, String> elem : this.activeCssNamesAndStyles) {
+ DOM.setStyleAttribute(source.getElement(), elem.getFirst(), elem.getSecond());
+ }
+ }
+
+
+ // shall be called to apply the styles of the focus class
+ public void onActiveEnd(MouseUpEvent event, ActiveStyleHandler handler) {
+ try{
+ TextArea source = (TextArea)event.getSource();
+ this.removeEventHandler(source, handler);
+ EventHandler lastHandler = this.getLastHandler(source);
+ if(lastHandler == null){
+ this.setGdlStyle(source);
+ }else {
+ if(lastHandler.getClass().equals(HoverStyleHandler.class)) this.onHoverStart(source);
+ else this.onFocusStart(source);
+ }
+ }catch(Exception e){
+ Window.alert("could not apply the default CSS style >> " + e.getClass() + " >> " + e.getMessage());
+ }
+ }
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java Wed Jul 6 13:36:01 2011 (r572)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java Thu Jul 7 00:58:04 2011 (r573)
@@ -80,6 +80,8 @@
Topic gdlReadonly = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.OccurrenceType.gdlReadonly));
Topic gdlResize = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.OccurrenceType.gdlResize));
Topic gdlTextDecoration = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.OccurrenceType.gdlTextDecoration));
+ Topic gdlDisplay = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.OccurrenceType.gdlDisplay));
+ Topic gdlContentOrientation = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.OccurrenceType.gdlContentOrientation));
tmpRepresentative.createOccurrence(gdlId, "ID_1", null);
tmpRepresentative.createOccurrence(gdlBackgroundColor, "red", null);
@@ -101,6 +103,8 @@
tmpRepresentative.createOccurrence(gdlResize, "both", null);
tmpRepresentative.createOccurrence(gdlFontSize, "15pt", null);
tmpRepresentative.createOccurrence(gdlTextDecoration, "underline", null);
+ tmpRepresentative.createOccurrence(gdlDisplay, "inline", null);
+ tmpRepresentative.createOccurrence(gdlContentOrientation, "horizontal", null);
Occurrence bgcHover = tmpRepresentative.createOccurrence(gdlBackgroundColor, "green", null);
bgcHover.addTheme(gdlHover);
Occurrence bgcActive = tmpRepresentative.createOccurrence(gdlBackgroundColor, "purple", null);
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java Wed Jul 6 13:36:01 2011 (r572)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java Thu Jul 7 00:58:04 2011 (r573)
@@ -1,22 +1,11 @@
package us.isidor.gdl.anaToMia.Widgets.text;
import java.util.ArrayList;
-import com.google.gwt.dom.client.Style.FontStyle;
-import com.google.gwt.dom.client.Style.VerticalAlign;
-import com.google.gwt.event.dom.client.BlurHandler;
-import com.google.gwt.event.dom.client.ClickHandler;
-import com.google.gwt.event.dom.client.DomEvent;
-import com.google.gwt.event.dom.client.FocusHandler;
import com.google.gwt.event.dom.client.KeyPressEvent;
import com.google.gwt.event.dom.client.KeyPressHandler;
-import com.google.gwt.event.dom.client.MouseDownHandler;
-import com.google.gwt.event.dom.client.MouseOutHandler;
-import com.google.gwt.event.dom.client.MouseOverHandler;
-import com.google.gwt.event.dom.client.MouseUpHandler;
import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.user.client.DOM;
-import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.TextArea;
import com.google.gwt.user.client.ui.Widget;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Occurrence;
@@ -29,31 +18,19 @@
import us.isidor.gdl.anaToMia.Widgets.environment.FocusStyleHandler;
import us.isidor.gdl.anaToMia.Widgets.environment.HoverStyleHandler;
import us.isidor.gdl.anaToMia.Widgets.environment.InvalidGdlSchemaException;
-import us.isidor.gdl.anaToMia.Widgets.environment.MultipleHandlerRegistration;
import us.isidor.gdl.anaToMia.Widgets.environment.Pair;
import us.isidor.gdl.anaToMia.Widgets.values.AbsoluteNumValue;
-import us.isidor.gdl.anaToMia.Widgets.values.AutoNumUnitValue;
import us.isidor.gdl.anaToMia.Widgets.values.BorderStyleValue;
import us.isidor.gdl.anaToMia.Widgets.values.ColorValue;
-import us.isidor.gdl.anaToMia.Widgets.values.ContentOrientationValue;
-import us.isidor.gdl.anaToMia.Widgets.values.CursorValue;
-import us.isidor.gdl.anaToMia.Widgets.values.DirectionValue;
-import us.isidor.gdl.anaToMia.Widgets.values.FontWeightValue;
-import us.isidor.gdl.anaToMia.Widgets.values.NormalNumUnitValue;
import us.isidor.gdl.anaToMia.Widgets.values.NumUnitValue;
-import us.isidor.gdl.anaToMia.Widgets.values.PositiveNumUnitValue;
import us.isidor.gdl.anaToMia.Widgets.values.ResizeValue;
-import us.isidor.gdl.anaToMia.Widgets.values.TextAlignValue;
-import us.isidor.gdl.anaToMia.Widgets.values.TextDecorationValue;
import us.isidor.gdl.anaToMia.Widgets.values.TextTypeValue;
public class GdlText extends GdlTextObject implements IGdlHasValue{
- protected ArrayList<TextArea> textElements = new ArrayList<TextArea>();
protected ArrayList<PasswordKeyPressHandler> passwordKeyPressHandler = null;
protected ArrayList<HandlerRegistration> passwordKeyPressRegistrations = null;
- protected ArrayList<Pair<TextArea, ArrayList<EventHandler>>> eventHandlers = new ArrayList<Pair<TextArea, ArrayList<EventHandler>>>();
// some constructors
@@ -66,6 +43,7 @@
super(tmRepresentative);
// TODO: create a text element for each TM-elem
this.createNewTextArea(); // TODO: remove only for debugging
+ this.createNewTextArea(); // TODO: remove only for debugging
}
@@ -73,7 +51,7 @@
// and applies the styles on it
protected TextArea createNewTextArea() throws InvalidGdlSchemaException, ExecutionException {
TextArea elem = new TextArea();
- DOM.setElementAttribute(elem.getElement(), "id", this.getId() + "__GDL_" + this.textElements.size());
+ DOM.setElementAttribute(elem.getElement(), "id", this.getId() + "__GDL_" + this.subElements.size());
this.setGdlStyle((Widget)elem);
ActiveStyleHandler asHandler = new ActiveStyleHandler(this);
FocusStyleHandler fsHandler = new FocusStyleHandler(this);
@@ -84,7 +62,7 @@
elem.addMouseOutHandler(hsHandler);
elem.addFocusHandler(fsHandler);
elem.addBlurHandler(fsHandler);
- this.textElements.add(elem);
+ this.subElements.add(elem);
super.mainPanel.add(elem);
return elem;
}
@@ -98,7 +76,7 @@
break;
}
}
- this.textElements.remove(elem);
+ this.subElements.remove(elem);
elem.removeFromParent();
}
@@ -520,25 +498,6 @@
}
- // sets a given css property and css value of this element's text area element
- private void setCssProperty(TextArea elem, String styleClass, String cssProperty, String cssValue)throws InvalidGdlSchemaException, ExecutionException{
- if(cssValue == null || cssProperty == null) return;
-
- if(styleClass == null){
- DOM.setStyleAttribute(elem.getElement(), cssProperty, cssValue);
- } else if(styleClass.equals(GdlPsis.Scope.gdlActive)){
- super.activeCssNamesAndStyles.add(new Pair<String, String>(cssProperty, cssValue));
- } else if(styleClass.equals(GdlPsis.Scope.gdlFocus)){
- super.focusCssNamesAndStyles.add(new Pair<String, String>(cssProperty, cssValue));
- } else if (styleClass.equals(GdlPsis.Scope.gdlHover)){
- super.hoverCssNamesAndStyles.add(new Pair<String, String>(cssProperty, cssValue));
- } else {
- String values = GdlPsis.Scope.gdlActive + ", " + GdlPsis.Scope.gdlFocus + ", " + GdlPsis.Scope.gdlHover;
- throw new InvalidGdlSchemaException("GDL defines only the style classes " + values + ", but found " + styleClass);
- }
- }
-
-
// sets the resize style property.
// If gdl:readonly is set to true, this property is set to none, i.e. the passed value is ignored.
// IF gdl:readonly is set to false, this property is set to the passed argument.
@@ -565,9 +524,9 @@
this.passwordKeyPressHandler = new ArrayList<PasswordKeyPressHandler>();
this.passwordKeyPressRegistrations = new ArrayList<HandlerRegistration>();
- for (TextArea item : this.textElements) {
+ for (Widget item : this.subElements) {
PasswordKeyPressHandler handler = new PasswordKeyPressHandler();
- this.passwordKeyPressRegistrations.add(item.addKeyPressHandler(handler));
+ this.passwordKeyPressRegistrations.add(((TextArea)item).addKeyPressHandler(handler));
}
}
}else {
@@ -600,481 +559,25 @@
// cols is only treated if width is not set
if(widthOcc == null) DOM.setElementAttribute(widget.getElement(), "cols", String.valueOf(value));
}
-
-
- @Override
- public void setDirection(Widget widget, DirectionValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "direction", value.getCssValue());
- }
-
-
- @Override
- public void setTextAlign(Widget widget, TextAlignValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "textAlign", value.getCssValue());
- }
-
-
- @Override
- public void setLineHeight(Widget widget, NormalNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "lineHeight", value.getCssValue());
- }
-
-
- @Override
- public void setTextDecoration(Widget widget, TextDecorationValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "textDecoration", value.getCssValue());
- }
-
-
- @Override
- public void setColor(Widget widget, ColorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "color", value.getCssValue());
- }
-
-
- @Override
- public void setFontFamily(Widget widget, String value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "fontFamily", value);
- }
-
-
- @Override
- public void setFontStyle(Widget widget, FontStyle value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "fontStyle", value.getCssName());
- }
-
-
- @Override
- public void setFontSize(Widget widget, PositiveNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "fontSize", value.getCssValue());
- }
-
-
- @Override
- public void setFontWeight(Widget widget, FontWeightValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "fontWeight", value.getCssValue());
- }
-
-
- @Override
- public void setLetterSpacing(Widget widget, NormalNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "letterSpacing", value.getCssValue());
- }
-
-
- @Override
- public void setWordSpacing(Widget widget, NormalNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "wordSpacing", value.getCssValue());
- }
-
-
- @Override
- public void setContentOrientation(Widget widget, ContentOrientationValue value) throws InvalidGdlSchemaException, ExecutionException {
- String valueStr = "inline";
- if(value != null && value == ContentOrientationValue.Vertical) valueStr = "block";
- this.setCssProperty((TextArea)widget, null, "display", valueStr);
- }
-
-
- @Override
- public void setMargin(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "margin", value.getCssValue());
- }
-
-
- @Override
- public void setMarginTop(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "marginTop", value.getCssValue());
- }
-
-
- @Override
- public void setMarginRight(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "marginRight", value.getCssValue());
- }
-
-
- @Override
- public void setMarginBottom(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "marginBottom", value.getCssValue());
- }
-
-
- @Override
- public void setMarginLeft(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "marginLeft", value.getCssValue());
- }
-
-
- @Override
- public void setBorderColor(Widget widget, ColorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderColor", value.getCssValue());
- }
-
-
- @Override
- public void setBorderTopColor(Widget widget, ColorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderTopColor", value.getCssValue());
- }
-
-
- @Override
- public void setBorderRightColor(Widget widget, ColorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderRightColor", value.getCssValue());
- }
-
-
- @Override
- public void setBorderBottomColor(Widget widget, ColorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderBottomColor", value.getCssValue());
- }
-
-
- @Override
- public void setBorderLeftColor(Widget widget, ColorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderLeftColor", value.getCssValue());
- }
-
-
- @Override
- public void setBorderStyle(Widget widget, BorderStyleValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderStyle", value.getCssValue());
- }
-
-
- @Override
- public void setBorderTopStyle(Widget widget, BorderStyleValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderTopStyle", value.getCssValue());
- }
-
-
- @Override
- public void setBorderRightStyle(Widget widget, BorderStyleValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderRightStyle", value.getCssValue());
- }
-
-
- @Override
- public void setBorderBottomStyle(Widget widget, BorderStyleValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderBottomStyle", value.getCssValue());
- }
-
-
- @Override
- public void setBorderLeftStyle(Widget widget, BorderStyleValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderLeftStyle", value.getCssValue());
- }
-
-
- @Override
- public void setBorderWidth(Widget widget, AbsoluteNumValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderWidth", value.getCssValue());
- }
-
-
- @Override
- public void setBorderTopWidth(Widget widget, AbsoluteNumValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderTopWidth", value.getCssValue());
- }
-
-
- @Override
- public void setBorderRightWidth(Widget widget, AbsoluteNumValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderRightWidth", value.getCssValue());
- }
-
-
- @Override
- public void setBorderBottomWidth(Widget widget, AbsoluteNumValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderBottomWidth", value.getCssValue());
- }
-
-
- @Override
- public void setBorderLeftWidth(Widget widget, AbsoluteNumValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderLeftWidth", value.getCssValue());
- }
-
-
- @Override
- public void setBorderRadius(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderRadius", value.getCssValue());
- }
-
-
- @Override
- public void setBorderTopRightRadius(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderTopRightRadius", value.getCssValue());
- }
-
-
- @Override
- public void setBorderBottomRightRadius(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderBottomRightRadius", value.getCssValue());
- }
-
-
- @Override
- public void setBorderBottomLeftRadius(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderBottomLeftRadius", value.getCssValue());
- }
-
-
- @Override
- public void setBorderTopLeftRadius(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "borderTopLeftRadius", value.getCssValue());
- }
-
-
- @Override
- public void setPadding(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "padding", value.getCssValue());
- }
-
-
- @Override
- public void setPaddingTop(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "paddingTop", value.getCssValue());
- }
-
-
- @Override
- public void setPaddingRight(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "paddingRight", value.getCssValue());
- }
-
-
- @Override
- public void setPaddingBottom(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "paddingBottom", value.getCssValue());
- }
-
-
- @Override
- public void setPaddingLeft(Widget widget, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "paddingLeft", value.getCssValue());
- }
-
-
- @Override
- public void setWidth(Widget widget, AutoNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "width", value.getCssValue());
- }
-
-
- @Override
- public void setMinWidth(Widget widget, AutoNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "minWidth", value.getCssValue());
- }
-
-
- @Override
- public void setMaxWidth(Widget widget, AutoNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "maxWidth", value.getCssValue());
- }
-
-
- @Override
- public void setHeight(Widget widget, AutoNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "height", value.getCssValue());
- }
-
-
- @Override
- public void setMinHeight(Widget widget, AutoNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "minHeight", value.getCssValue());
- }
-
-
- @Override
- public void setMaxHeight(Widget widget, AutoNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "maxHeight", value.getCssValue());
- }
-
-
- @Override
- public void setCursor(Widget widget, CursorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "cursor", value.getCssValue());
- }
-
-
- @Override
- public void setBackgroundColor(Widget widget, ColorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "backgroundColor", value.getCssValue());
- }
- public void setVerticalAlign(Widget widget, VerticalAlign value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- if(value != null){
- this.setCssProperty((TextArea) widget, styleClass, "verticalAlign", value.getCssName());
- super.setCssProperty(styleClass, "verticalAlign", value.getCssName());
- }
- }
-
-
- public void setGdlStyle(Widget widget) throws InvalidGdlSchemaException, ExecutionException {
- this.setContentOrientation(widget, this.getContentOrientation());
-
- String[] styleClasses = new String[]{null, GdlPsis.Scope.gdlActive, GdlPsis.Scope.gdlFocus, GdlPsis.Scope.gdlHover};
- for (String styleClass : styleClasses) {
- this.setReadonly(widget, this.getReadonly());
- this.setResize(widget, this.getResize());
- this.setTextType(this.getTextType());
- this.setRows(widget, this.getRows());
- this.setCols(widget, this.getCols());
-
- this.setVerticalAlign(widget, this.getVerticalAlign(styleClass), styleClass);
-
- this.setMargin(widget, this.getMargin(styleClass), styleClass);
- this.setMarginTop(widget, this.getMarginTop(styleClass), styleClass);
- this.setMarginRight(widget, this.getMarginRight(styleClass), styleClass);
- this.setMarginBottom(widget, this.getMarginBottom(styleClass), styleClass);
- this.setMarginLeft(widget, this.getMarginLeft(styleClass), styleClass);
-
- this.setBorderColor(widget, this.getBorderColor(styleClass), styleClass);
- this.setBorderTopColor(widget, this.getBorderTopColor(styleClass), styleClass);
- this.setBorderRightColor(widget, this.getBorderRightColor(styleClass), styleClass);
- this.setBorderBottomColor(widget, this.getBorderBottomColor(styleClass), styleClass);
- this.setBorderLeftColor(widget, this.getBorderLeftColor(styleClass), styleClass);
-
- this.setBorderStyle(widget, this.getBorderStyle(styleClass), styleClass);
- this.setBorderTopStyle(widget, this.getBorderTopStyle(styleClass), styleClass);
- this.setBorderRightStyle(widget, this.getBorderRightStyle(styleClass), styleClass);
- this.setBorderBottomStyle(widget, this.getBorderBottomStyle(styleClass), styleClass);
- this.setBorderLeftStyle(widget, this.getBorderLeftStyle(styleClass), styleClass);
-
- this.setBorderWidth(widget, this.getBorderWidth(styleClass), styleClass);
- this.setBorderTopWidth(widget, this.getBorderTopWidth(styleClass), styleClass);
- this.setBorderRightWidth(widget, this.getBorderRightWidth(styleClass), styleClass);
- this.setBorderBottomWidth(widget, this.getBorderBottomWidth(styleClass), styleClass);
- this.setBorderLeftWidth(widget, this.getBorderLeftWidth(styleClass), styleClass);
-
- this.setBorderRadius(widget, this.getBorderRadius(styleClass), styleClass);
- this.setBorderTopRightRadius(widget, this.getBorderTopRightRadius(styleClass), styleClass);
- this.setBorderBottomRightRadius(widget, this.getBorderBottomRightRadius(styleClass), styleClass);
- this.setBorderBottomLeftRadius(widget, this.getBorderBottomLeftRadius(styleClass), styleClass);
- this.setBorderTopLeftRadius(widget, this.getBorderTopLeftRadius(styleClass), styleClass);
-
- this.setCursor(widget, this.getCursor(styleClass), styleClass);
-
- this.setWidth(widget, this.getWidth(styleClass), styleClass);
- this.setMaxWidth(widget, this.getMaxWidth(styleClass), styleClass);
- this.setMinWidth(widget, this.getMinWidth(styleClass), styleClass);
-
- this.setHeight(widget, this.getHeight(styleClass), styleClass);
- this.setMaxHeight(widget, this.getMaxHeight(styleClass), styleClass);
- this.setMinHeight(widget, this.getMinHeight(styleClass), styleClass);
-
- this.setBackgroundColor(widget, this.getBackgroundColor(styleClass), styleClass);
- this.setColor(widget, this.getColor(styleClass), styleClass);
-
- this.setDirection(widget, this.getDirection(styleClass), styleClass);
- this.setTextAlign(widget, this.getTextAlign(styleClass), styleClass);
- this.setLineHeight(widget, this.getLineHeight(styleClass), styleClass);
- this.setTextDecoration(widget, this.getTextDecoration(styleClass), styleClass);
- this.setFontFamily(widget, this.getFontFamily(styleClass), styleClass);
- this.setFontStyle(widget, this.getFontStyle(styleClass), styleClass);
- this.setFontSize(widget, this.getFontSize(styleClass), styleClass);
- this.setFontWeight(widget, this.getFontWeight(styleClass), styleClass);
- this.setLetterSpacing(widget, this.getLetterSpacing(styleClass), styleClass);
- this.setWordSpacing(widget, this.getWordSpacing(styleClass), styleClass);
- }
- }
-
- // calls the super applies the GdlStyle for eaver TextAre item of this instance
+ // calls the super applies the GdlStyle for every TextArea item of this instance
@Override
protected void setGdlStyle() throws InvalidGdlSchemaException, ExecutionException{
- if(this.textElements != null){
- for (TextArea item : this.textElements) {
- this.setGdlStyle((Widget)item);
+ if(this.subElements != null){
+ for (Widget item : this.subElements) {
+ this.setGdlStyle(item);
}
}
}
- // registers a passed mouse down handler to each text element of this item
- @Override
- public MultipleHandlerRegistration addMouseDownHandler(MouseDownHandler handler){
- MultipleHandlerRegistration regs = new MultipleHandlerRegistration();
- for (TextArea item : this.textElements) {
- regs.addHandlerRegistration(item.addMouseDownHandler(handler));
- }
- return regs;
- }
-
-
- // registers a passed mouse up handler to each text element of this item
- @Override
- public MultipleHandlerRegistration addMouseUpHandler(MouseUpHandler handler){
- MultipleHandlerRegistration regs = new MultipleHandlerRegistration();
- for (TextArea item : this.textElements) {
- regs.addHandlerRegistration(item.addMouseUpHandler(handler));
- }
- return regs;
- }
-
-
- // registers a passed focus handler to each text element of this item
- @Override
- public MultipleHandlerRegistration addFocusHandler(FocusHandler handler){
- MultipleHandlerRegistration regs = new MultipleHandlerRegistration();
- for (TextArea item : this.textElements) {
- regs.addHandlerRegistration(item.addFocusHandler(handler));
- }
- return regs;
- }
-
-
- // registers a passed blur handler to each text element of this item
- @Override
- public MultipleHandlerRegistration addBlurHandler(BlurHandler handler){
- MultipleHandlerRegistration regs = new MultipleHandlerRegistration();
- for (TextArea item : this.textElements) {
- regs.addHandlerRegistration(item.addBlurHandler(handler));
- }
- return regs;
- }
-
-
- // registers a passed mouse out handler to each text element of this item
- @Override
- public MultipleHandlerRegistration addMouseOutHandler(MouseOutHandler handler){
- MultipleHandlerRegistration regs = new MultipleHandlerRegistration();
- for (TextArea item : this.textElements) {
- regs.addHandlerRegistration(item.addMouseOutHandler(handler));
- }
- return regs;
- }
-
-
- // registers a passed mouse over handler to each text element of this item
- @Override
- public MultipleHandlerRegistration addMouseOverHandler(MouseOverHandler handler){
- MultipleHandlerRegistration regs = new MultipleHandlerRegistration();
- for (TextArea item : this.textElements) {
- regs.addHandlerRegistration(item.addMouseOverHandler(handler));
- }
- return regs;
- }
-
-
- // registers a passed click handler to each text element of this item
- @Override
- public MultipleHandlerRegistration addClickHandler(ClickHandler handler) {
- MultipleHandlerRegistration regs = new MultipleHandlerRegistration();
- for (TextArea item : this.textElements) {
- regs.addHandlerRegistration(item.addClickHandler(handler));
- }
- return regs;
- }
-
-
// returns the results of all text area elements
@Override
public ArrayList<String> getStringValue() {
ArrayList<String> results = new ArrayList<String>();
- for (TextArea item : this.textElements) {
- results.add(item.getValue());
+ for (Widget item : this.subElements) {
+ results.add(((TextArea)item).getValue());
}
return results;
}
@@ -1092,162 +595,21 @@
// TODO: implement
return false;
}
-
-
- // adds the passed handler to the list eventHandlers
- private void addEventHandler(TextArea elem, EventHandler handler){
- if(handler == null || elem == null) return;
-
- for (Pair<TextArea, ArrayList<EventHandler>> item : this.eventHandlers) {
- if(item.getFirst().equals(elem)){
- item.getSecond().add(handler);
- return;
- }
- }
- ArrayList<EventHandler> newHandlerList = new ArrayList<EventHandler>();
- newHandlerList.add(handler);
- this.eventHandlers.add(new Pair<TextArea, ArrayList<EventHandler>>(elem, newHandlerList));
- }
-
-
- // remove the passed handler of the list eventHandlers
- private void removeEventHandler(TextArea elem, EventHandler handler){
- for (Pair<TextArea, ArrayList<EventHandler>> item : this.eventHandlers) {
- if(item.getFirst().equals(elem)){
- for (EventHandler handlerItem : item.getSecond()) {
- if(handlerItem.equals(handler)){
- item.getSecond().remove(handlerItem);
- return;
- }
- }
- }
- }
- }
-
-
- // returns the last handler bound to the passed element.
- private EventHandler getLastHandler(TextArea elem){
- for (Pair<TextArea, ArrayList<EventHandler>> item : this.eventHandlers) {
- if(item.getFirst().equals(elem)){
- int idx = item.getSecond().size() - 1;
- if(idx >= 0){
- return item.getSecond().get(idx);
- }
- }
- }
-
- return null;
- }
-
-
- // applies the styles bound to hover and the passed element
- private void onHoverStart(Widget widget){
- for (Pair<String, String> elem : this.hoverCssNamesAndStyles) {
- DOM.setStyleAttribute(widget.getElement(), elem.getFirst(), elem.getSecond());
- }
- }
- // applies the styles bound to acitve and the passed element
- private void onActiveStart(Widget widget){
- for (Pair<String, String> elem : this.activeCssNamesAndStyles) {
- DOM.setStyleAttribute(widget.getElement(), elem.getFirst(), elem.getSecond());
- }
- }
-
-
- // applies the styles bound to focus and the passed element
- private void onFocusStart(Widget widget){
- for (Pair<String, String> elem : this.focusCssNamesAndStyles) {
- DOM.setStyleAttribute(widget.getElement(), elem.getFirst(), elem.getSecond());
- }
- }
-
-
- // some handler for applying the css style bound to the pseudo classes hover, active and focus
- @Override
- public void onHoverStart(@SuppressWarnings("rawtypes") DomEvent event, HoverStyleHandler handler) {
- TextArea source = (TextArea)event.getSource();
- this.addEventHandler(source, handler);
- for (Pair<String, String> elem : this.hoverCssNamesAndStyles) {
- DOM.setStyleAttribute(source.getElement(), elem.getFirst(), elem.getSecond());
- }
- }
-
-
- @Override
- public void onHoverEnd(@SuppressWarnings("rawtypes") DomEvent event, HoverStyleHandler handler) {
- try{
- TextArea source = (TextArea)event.getSource();
- this.removeEventHandler(source, handler);
- EventHandler lastHandler = this.getLastHandler(source);
- if(lastHandler == null){
- this.setGdlStyle(source);
- }else {
- if(lastHandler.getClass().equals(ActiveStyleHandler.class)) this.onActiveStart(source);
- else this.onFocusStart(source);
- }
- }catch(Exception e){
- Window.alert("could not apply the default CSS style >> " + e.getClass() + " >> " + e.getMessage());
- e.printStackTrace();
- }
- }
-
-
- @Override
- public void onFocusStart(@SuppressWarnings("rawtypes") DomEvent event, FocusStyleHandler handler) {
- TextArea source = (TextArea)event.getSource();
- this.addEventHandler(source, handler);
- for (Pair<String, String> elem : this.focusCssNamesAndStyles) {
- DOM.setStyleAttribute(source.getElement(), elem.getFirst(), elem.getSecond());
- }
- }
-
-
+ // sets the css properties, by calling the super class's method and the local
+ // method, which sets some specific properties for the GdlText instance
@Override
- public void onFocusEnd(@SuppressWarnings("rawtypes") DomEvent event, FocusStyleHandler handler) {
- try{
- TextArea source = (TextArea)event.getSource();
- this.removeEventHandler(source, handler);
- EventHandler lastHandler = this.getLastHandler(source);
- if(lastHandler == null){
- this.setGdlStyle(source);
- }else {
- if(lastHandler.getClass().equals(ActiveStyleHandler.class)) this.onActiveStart(source);
- else this.onHoverStart(source);
- }
- }catch(Exception e){
- Window.alert("could not apply the default CSS style >> " + e.getClass() + " >> " + e.getMessage());
- }
- }
-
+ public void setGdlStyle(Widget widget) throws InvalidGdlSchemaException, ExecutionException {
+ super.setGdlStyle(widget);
- @Override
- public void onActiveStart(@SuppressWarnings("rawtypes") DomEvent event, ActiveStyleHandler handler) {
- TextArea source = (TextArea)event.getSource();
- this.addEventHandler(source, handler);
- for (Pair<String, String> elem : this.activeCssNamesAndStyles) {
- DOM.setStyleAttribute(source.getElement(), elem.getFirst(), elem.getSecond());
- }
+ this.setReadonly(widget, this.getReadonly());
+ this.setResize(widget, this.getResize());
+ this.setTextType(this.getTextType());
+ this.setRows(widget, this.getRows());
+ this.setCols(widget, this.getCols());
}
-
- @Override
- public void onActiveEnd(@SuppressWarnings("rawtypes") DomEvent event, ActiveStyleHandler handler) {
- try{
- TextArea source = (TextArea)event.getSource();
- this.removeEventHandler(source, handler);
- EventHandler lastHandler = this.getLastHandler(source);
- if(lastHandler == null){
- this.setGdlStyle(source);
- }else {
- if(lastHandler.getClass().equals(HoverStyleHandler.class)) this.onHoverStart(source);
- else this.onFocusStart(source);
- }
- }catch(Exception e){
- Window.alert("could not apply the default CSS style >> " + e.getClass() + " >> " + e.getMessage());
- }
- }
// this class catches all keypress events and transforms the visible
@@ -1264,9 +626,12 @@
realValue += (char)event.getCharCode() + "";
}
-
+
public String getValue(){
return this.realValue;
}
}
+
+
+ // TODO: override setWidth when invoking by any StyleHandler => if resize is true => don't set the size to its origin, but to its last value
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlTextObject.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlTextObject.java Wed Jul 6 13:36:01 2011 (r572)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlTextObject.java Thu Jul 7 00:58:04 2011 (r573)
@@ -2,6 +2,7 @@
import com.google.gwt.dom.client.Style.FontStyle;
+import com.google.gwt.user.client.ui.TextArea;
import com.google.gwt.user.client.ui.Widget;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Occurrence;
@@ -281,45 +282,86 @@
// sets the direction style property of this element by using the GWT DOM class
- public abstract void setDirection(Widget widget, DirectionValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException;
+ public void setDirection(Widget widget, DirectionValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "direction", value.getCssValue());
+ }
// sets the text-align style property of this element by using the GWT DOM class
- public abstract void setTextAlign(Widget widget, TextAlignValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException;
+ public void setTextAlign(Widget widget, TextAlignValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "textAlign", value.getCssValue());
+ }
// sets the line-height style property of this element by using the GWT DOM class
- public abstract void setLineHeight(Widget widget, NormalNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException;
+ public void setLineHeight(Widget widget, NormalNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "lineHeight", value.getCssValue());
+ }
// sets the text-decoration style property of this element by using the GWT DOM class
- public abstract void setTextDecoration(Widget widget, TextDecorationValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException;
+ public void setTextDecoration(Widget widget, TextDecorationValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "textDecoration", value.getCssValue());
+ }
// sets the color style property of this element by using the GWT DOM class
- public abstract void setColor(Widget widget, ColorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException;
+ public void setColor(Widget widget, ColorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "color", value.getCssValue());
+ }
// sets the font-family style property of this element by using the GWT DOM class
- public abstract void setFontFamily(Widget widget, String value, String styleClass) throws InvalidGdlSchemaException, ExecutionException;
+ public void setFontFamily(Widget widget, String value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "fontFamily", value);
+ }
// sets the font-style style property of this element by using the GWT DOM class
- public abstract void setFontStyle(Widget widget, FontStyle value, String styleClass) throws InvalidGdlSchemaException, ExecutionException;
+ public void setFontStyle(Widget widget, FontStyle value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "fontStyle", value.getCssName());
+ }
// sets the font-size style property of this element by using the GWT DOM class
- public abstract void setFontSize(Widget widget, PositiveNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException;
+ public void setFontSize(Widget widget, PositiveNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "fontSize", value.getCssValue());
+ }
// sets the font-weight style property of this element by using the GWT DOM class
- public abstract void setFontWeight(Widget widget, FontWeightValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException;
+ public void setFontWeight(Widget widget, FontWeightValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "fontWeight", value.getCssValue());
+ }
// sets the letter-spacing style property of this element by using the GWT DOM class
- public abstract void setLetterSpacing(Widget widget, NormalNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException;
-
+ public void setLetterSpacing(Widget widget, NormalNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "letterSpacing", value.getCssValue());
+ }
// sets the word-spacing style property of this element by using the GWT DOM class
- public abstract void setWordSpacing(Widget widget, NormalNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException;
+ public void setWordSpacing(Widget widget, NormalNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty((TextArea)widget, styleClass, "wordSpacing", value.getCssValue());
+ }
+
+
+ public void setGdlStyle(Widget widget) throws InvalidGdlSchemaException, ExecutionException {
+ super.setGdlStyle(widget);
+ String[] styleClasses = new String[]{null, GdlPsis.Scope.gdlActive, GdlPsis.Scope.gdlFocus, GdlPsis.Scope.gdlHover};
+ for (String styleClass : styleClasses) {
+ this.setColor(widget, this.getColor(styleClass), styleClass);
+
+ this.setDirection(widget, this.getDirection(styleClass), styleClass);
+ this.setTextAlign(widget, this.getTextAlign(styleClass), styleClass);
+ this.setLineHeight(widget, this.getLineHeight(styleClass), styleClass);
+ this.setTextDecoration(widget, this.getTextDecoration(styleClass), styleClass);
+ this.setFontFamily(widget, this.getFontFamily(styleClass), styleClass);
+ this.setFontStyle(widget, this.getFontStyle(styleClass), styleClass);
+ this.setFontSize(widget, this.getFontSize(styleClass), styleClass);
+ this.setFontWeight(widget, this.getFontWeight(styleClass), styleClass);
+ this.setLetterSpacing(widget, this.getLetterSpacing(styleClass), styleClass);
+ this.setWordSpacing(widget, this.getWordSpacing(styleClass), styleClass);
+ }
+ }
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/values/ContentOrientationValue.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/values/ContentOrientationValue.java Wed Jul 6 13:36:01 2011 (r572)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/values/ContentOrientationValue.java Thu Jul 7 00:58:04 2011 (r573)
@@ -1,8 +1,8 @@
package us.isidor.gdl.anaToMia.Widgets.values;
public enum ContentOrientationValue implements CssValue{
- Horizontal,
- Vertical;
+ HORIZONTAL,
+ VERTICAL;
@Override
public String getCssValue() {
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlCreatorAssociationView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlCreatorAssociationView.java Wed Jul 6 13:36:01 2011 (r572)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlCreatorAssociationView.java Thu Jul 7 00:58:04 2011 (r573)
@@ -384,40 +384,38 @@
}
-
-
@Override
- public void onHoverStart(DomEvent event, HoverStyleHandler handler) {
+ public void onHoverStart(MouseOverEvent event, HoverStyleHandler handler) {
// TODO Auto-generated method stub
}
@Override
- public void onHoverEnd(DomEvent event, HoverStyleHandler handler) {
+ public void onHoverEnd(MouseOutEvent event, HoverStyleHandler handler) {
// TODO Auto-generated method stub
}
@Override
- public void onFocusStart(DomEvent event, FocusStyleHandler handler) {
+ public void onFocusStart(FocusEvent event, FocusStyleHandler handler) {
// TODO Auto-generated method stub
}
@Override
- public void onFocusEnd(DomEvent event, FocusStyleHandler handler) {
+ public void onFocusEnd(BlurEvent event, FocusStyleHandler handler) {
// TODO Auto-generated method stub
}
@Override
- public void onActiveStart(DomEvent event, ActiveStyleHandler handler) {
+ public void onActiveStart(MouseDownEvent event, ActiveStyleHandler handler) {
// TODO Auto-generated method stub
}
@Override
- public void onActiveEnd(DomEvent event, ActiveStyleHandler handler) {
+ public void onActiveEnd(MouseUpEvent event, ActiveStyleHandler handler) {
// TODO Auto-generated method stub
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlDefaultCreatorTopicView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlDefaultCreatorTopicView.java Wed Jul 6 13:36:01 2011 (r572)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlDefaultCreatorTopicView.java Thu Jul 7 00:58:04 2011 (r573)
@@ -419,49 +419,46 @@
// TODO Auto-generated method stub
}
-
-
+
@Override
- public void onHoverStart(DomEvent event, HoverStyleHandler handler) {
+ public void onHoverStart(MouseOverEvent event, HoverStyleHandler handler) {
// TODO Auto-generated method stub
}
@Override
- public void onHoverEnd(DomEvent event, HoverStyleHandler handler) {
+ public void onHoverEnd(MouseOutEvent event, HoverStyleHandler handler) {
// TODO Auto-generated method stub
}
@Override
- public void onFocusStart(DomEvent event, FocusStyleHandler handler) {
+ public void onFocusStart(FocusEvent event, FocusStyleHandler handler) {
// TODO Auto-generated method stub
}
@Override
- public void onFocusEnd(DomEvent event, FocusStyleHandler handler) {
+ public void onFocusEnd(BlurEvent event, FocusStyleHandler handler) {
// TODO Auto-generated method stub
}
@Override
- public void onActiveStart(DomEvent event, ActiveStyleHandler handler) {
+ public void onActiveStart(MouseDownEvent event, ActiveStyleHandler handler) {
// TODO Auto-generated method stub
}
@Override
- public void onActiveEnd(DomEvent event, ActiveStyleHandler handler) {
+ public void onActiveEnd(MouseUpEvent event, ActiveStyleHandler handler) {
// TODO Auto-generated method stub
}
-
-
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlEditorAssociationView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlEditorAssociationView.java Wed Jul 6 13:36:01 2011 (r572)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlEditorAssociationView.java Thu Jul 7 00:58:04 2011 (r573)
@@ -421,48 +421,49 @@
// TODO Auto-generated method stub
}
-
-
+
@Override
- public void onHoverStart(DomEvent event, HoverStyleHandler handler) {
+ public void onHoverStart(MouseOverEvent event, HoverStyleHandler handler) {
// TODO Auto-generated method stub
}
@Override
- public void onHoverEnd(DomEvent event, HoverStyleHandler handler) {
+ public void onHoverEnd(MouseOutEvent event, HoverStyleHandler handler) {
// TODO Auto-generated method stub
}
@Override
- public void onFocusStart(DomEvent event, FocusStyleHandler handler) {
+ public void onFocusStart(FocusEvent event, FocusStyleHandler handler) {
// TODO Auto-generated method stub
}
@Override
- public void onFocusEnd(DomEvent event, FocusStyleHandler handler) {
+ public void onFocusEnd(BlurEvent event, FocusStyleHandler handler) {
// TODO Auto-generated method stub
}
@Override
- public void onActiveStart(DomEvent event, ActiveStyleHandler handler) {
+ public void onActiveStart(MouseDownEvent event, ActiveStyleHandler handler) {
// TODO Auto-generated method stub
}
@Override
- public void onActiveEnd(DomEvent event, ActiveStyleHandler handler) {
+ public void onActiveEnd(MouseUpEvent event, ActiveStyleHandler handler) {
// TODO Auto-generated method stub
}
+
+
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialCreatorTopicView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialCreatorTopicView.java Wed Jul 6 13:36:01 2011 (r572)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialCreatorTopicView.java Thu Jul 7 00:58:04 2011 (r573)
@@ -422,47 +422,47 @@
// TODO Auto-generated method stub
}
-
-
+
+
@Override
- public void onHoverStart(DomEvent event, HoverStyleHandler handler) {
+ public void onHoverStart(MouseOverEvent event, HoverStyleHandler handler) {
// TODO Auto-generated method stub
}
@Override
- public void onHoverEnd(DomEvent event, HoverStyleHandler handler) {
+ public void onHoverEnd(MouseOutEvent event, HoverStyleHandler handler) {
// TODO Auto-generated method stub
}
@Override
- public void onFocusStart(DomEvent event, FocusStyleHandler handler) {
+ public void onFocusStart(FocusEvent event, FocusStyleHandler handler) {
// TODO Auto-generated method stub
}
@Override
- public void onFocusEnd(DomEvent event, FocusStyleHandler handler) {
+ public void onFocusEnd(BlurEvent event, FocusStyleHandler handler) {
// TODO Auto-generated method stub
}
@Override
- public void onActiveStart(DomEvent event, ActiveStyleHandler handler) {
+ public void onActiveStart(MouseDownEvent event, ActiveStyleHandler handler) {
// TODO Auto-generated method stub
}
@Override
- public void onActiveEnd(DomEvent event, ActiveStyleHandler handler) {
+ public void onActiveEnd(MouseUpEvent event, ActiveStyleHandler handler) {
// TODO Auto-generated method stub
}
-
+
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialEditorTopicView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialEditorTopicView.java Wed Jul 6 13:36:01 2011 (r572)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialEditorTopicView.java Thu Jul 7 00:58:04 2011 (r573)
@@ -424,49 +424,47 @@
// TODO Auto-generated method stub
}
-
@Override
- public void onHoverStart(DomEvent event, HoverStyleHandler handler) {
+ public void onHoverStart(MouseOverEvent event, HoverStyleHandler handler) {
// TODO Auto-generated method stub
}
@Override
- public void onHoverEnd(DomEvent event, HoverStyleHandler handler) {
+ public void onHoverEnd(MouseOutEvent event, HoverStyleHandler handler) {
// TODO Auto-generated method stub
}
@Override
- public void onFocusStart(DomEvent event, FocusStyleHandler handler) {
+ public void onFocusStart(FocusEvent event, FocusStyleHandler handler) {
// TODO Auto-generated method stub
}
@Override
- public void onFocusEnd(DomEvent event, FocusStyleHandler handler) {
+ public void onFocusEnd(BlurEvent event, FocusStyleHandler handler) {
// TODO Auto-generated method stub
}
@Override
- public void onActiveStart(DomEvent event, ActiveStyleHandler handler) {
+ public void onActiveStart(MouseDownEvent event, ActiveStyleHandler handler) {
// TODO Auto-generated method stub
}
@Override
- public void onActiveEnd(DomEvent event, ActiveStyleHandler handler) {
+ public void onActiveEnd(MouseUpEvent event, ActiveStyleHandler handler) {
// TODO Auto-generated method stub
}
-
-
+
}
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlView.java Wed Jul 6 13:36:01 2011 (r572)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlView.java Thu Jul 7 00:58:04 2011 (r573)
@@ -80,60 +80,6 @@
}
- // registers a click handler to all sub-elements of this element
- @Override
- public MultipleHandlerRegistration addClickHandler(ClickHandler handler){
- // TODO: implement
- return null;
- }
-
-
- // registers a mouse-out handler to all sub-elements of this element
- @Override
- public MultipleHandlerRegistration addMouseOutHandler(MouseOutHandler handler){
- // TODO: implement
- return null;
- }
-
-
- // registers a mouse-over handler to all sub-elements of this element
- @Override
- public MultipleHandlerRegistration addMouseOverHandler(MouseOverHandler handler){
- // TODO: implement
- return null;
- }
-
-
- // registers a focus handler to all sub-elements of this element
- @Override
- public MultipleHandlerRegistration addFocusHandler(FocusHandler handler){
- // TODO: implement
- return null;
- }
-
-
- // registers a mouse-down handler to all sub-elements of this element
- @Override
- public MultipleHandlerRegistration addMouseDownHandler(MouseDownHandler handler){
- // TODO: implement
- return null;
- }
-
-
- // registers a mouse-up handler to all sub-elements of this element
- @Override
- public MultipleHandlerRegistration addMouseUpHandler(MouseUpHandler handler){
- // TODO: implement
- return null;
- }
-
-
- // registers a blur handler to all sub-elements of this element
- @Override
- public MultipleHandlerRegistration addBlurHandler(BlurHandler handler){
- // TODO: implement
- return null;
- }
1
0

[isidorus-cvs] r572 - in branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets: base text views
by lgiessmann@common-lisp.net 06 Jul '11
by lgiessmann@common-lisp.net 06 Jul '11
06 Jul '11
Author: lgiessmann
Date: Wed Jul 6 13:36:01 2011
New Revision: 572
Log:
gdl-frontend: Widgets: remove gdl:overlow from teh spec and impl
Modified:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlPsis.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/base/TestClass.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlCreatorAssociationView.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlDefaultCreatorTopicView.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlEditorAssociationView.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialCreatorTopicView.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialEditorTopicView.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlView.java
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlPsis.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlPsis.java Wed Jul 6 12:33:40 2011 (r571)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlPsis.java Wed Jul 6 13:36:01 2011 (r572)
@@ -128,7 +128,6 @@
public final static String gdlClear = gdl + "clear";
public final static String gdlFloat = gdl + "float";
public final static String gdlBackgroundColor = gdl + "background-color";
- public final static String gdlOverflow = gdl + "overflow";
public final static String gdlOrdered = gdl + "ordered";
public final static String gdlListstyleType = gdl + "list-style-type";
public final static String gdlListStylePosition = gdl + "list-style-position";
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 Wed Jul 6 12:33:40 2011 (r571)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java Wed Jul 6 13:36:01 2011 (r572)
@@ -1085,37 +1085,6 @@
}
}
-
- // returns an Overflow instance that represents the overflow property of this element.
- // If a styleClass is set, only the corresponding value of the scoped occurrence is returned
- // null, null otherwise. If the styleClass is null and no occurrence was found, the default value for this
- // property is returned.
- public Overflow getOverflow(String styleClass) throws InvalidGdlSchemaException {
- Occurrence overflowOcc = null;
- if(styleClass != null){
- overflowOcc = getNoneOrOneScopedOccurrence(GdlPsis.OccurrenceType.gdlOverflow, styleClass);
- } else {
- overflowOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlOverflow);
- }
-
- if(overflowOcc == null && styleClass != null){
- return null;
- } else if(overflowOcc == null) {
- return Overflow.SCROLL;
- } else {
- String value = overflowOcc.getValue().toUpperCase();
- if(value.equals("VISIBLE")){
- return Overflow.VISIBLE;
- }else if(value.equals("HIDDEN")){
- return Overflow.HIDDEN;
- }else if(value.equals("SCROLL")){
- return Overflow.SCROLL;
- }else {
- throw new InvalidGdlSchemaException("overflow must be set to one of visible, hidden or scroll, but is " + overflowOcc.getValue());
- }
- }
- }
-
// sets the id property of this element by using the GWT DOM class
public void setId(String id){
@@ -1316,16 +1285,7 @@
// sets the background-color style property of this element by using the GWT DOM class
public abstract void setBackgroundColor(Widget widget, ColorValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
-
- // sets the width, height and overflow property of this element depending on the amount
- // of sub-elements
- protected abstract void adjustSize();
-
- // sets the overflow style property of this element by using the GWT DOM class
- public abstract void setOverflow(Widget widget, Overflow value, String styleClass)throws InvalidGdlSchemaException, ExecutionException;
-
-
// sets the passed css style porperty to the passed css value.
// If a styleClass is given, the style is applied to either active, hover or focus
protected void setCssProperty(String styleClass, String cssProperty, String cssValue)throws InvalidGdlSchemaException, ExecutionException{
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java Wed Jul 6 12:33:40 2011 (r571)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java Wed Jul 6 13:36:01 2011 (r572)
@@ -79,18 +79,14 @@
Topic gdlFocus = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.Scope.gdlFocus));
Topic gdlReadonly = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.OccurrenceType.gdlReadonly));
Topic gdlResize = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.OccurrenceType.gdlResize));
- Topic gdlOverflow = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.OccurrenceType.gdlOverflow));
Topic gdlTextDecoration = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.OccurrenceType.gdlTextDecoration));
tmpRepresentative.createOccurrence(gdlId, "ID_1", null);
- /*
tmpRepresentative.createOccurrence(gdlBackgroundColor, "red", null);
- */
tmpRepresentative.createOccurrence(gdlWidth, "300px", null);
tmpRepresentative.createOccurrence(gdlHeight, "300px", null);
tmpRepresentative.createOccurrence(gdlBorderRadius, "30px", null);
tmpRepresentative.createOccurrence(gdlBorderBottomRightRadius, "2%", null);
- /*
tmpRepresentative.createOccurrence(gdlPadding, "5px", null);
tmpRepresentative.createOccurrence(gdlPaddingLeft, "5%", null);
tmpRepresentative.createOccurrence(gdlCursor, CursorValue.HELP.getCssValue(), null);
@@ -103,7 +99,6 @@
tmpRepresentative.createOccurrence(gdlBorderWidth, "5px", null);
tmpRepresentative.createOccurrence(gdlReadonly, "false", null);
tmpRepresentative.createOccurrence(gdlResize, "both", null);
- tmpRepresentative.createOccurrence(gdlOverflow, "hidden", null);
tmpRepresentative.createOccurrence(gdlFontSize, "15pt", null);
tmpRepresentative.createOccurrence(gdlTextDecoration, "underline", null);
Occurrence bgcHover = tmpRepresentative.createOccurrence(gdlBackgroundColor, "green", null);
@@ -114,7 +109,6 @@
bgcFocus.addTheme(gdlFocus);
Occurrence fsHover = tmpRepresentative.createOccurrence(gdlFontSize, "25pt", null);
fsHover.addTheme(gdlHover);
- */
GdlText tmp = new GdlText(tmpRepresentative){};
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java Wed Jul 6 12:33:40 2011 (r571)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java Wed Jul 6 13:36:01 2011 (r572)
@@ -2,7 +2,6 @@
import java.util.ArrayList;
import com.google.gwt.dom.client.Style.FontStyle;
-import com.google.gwt.dom.client.Style.Overflow;
import com.google.gwt.dom.client.Style.VerticalAlign;
import com.google.gwt.event.dom.client.BlurHandler;
import com.google.gwt.event.dom.client.ClickHandler;
@@ -87,13 +86,12 @@
elem.addBlurHandler(fsHandler);
this.textElements.add(elem);
super.mainPanel.add(elem);
- this.adjustSize();
return elem;
}
// removes the passed element and all its handlers from the outer element
- protected void removeTextArea(TextArea elem){
+ protected void removeTextArea(TextArea elem) throws InvalidGdlSchemaException, ExecutionException{
for (Pair<TextArea, ArrayList<EventHandler>> item : this.eventHandlers) {
if(item.getFirst().equals(elem)){
this.eventHandlers.remove(item);
@@ -102,7 +100,6 @@
}
this.textElements.remove(elem);
elem.removeFromParent();
- this.adjustSize();
}
@@ -551,8 +548,6 @@
} else{
DOM.setStyleAttribute(widget.getElement(), "resize", value.getCssValue());
}
-
- // TODO: if resize == true => set width/height of the outer/container element after the resize operation
}
@@ -594,9 +589,6 @@
// rows is only treated if height is not set
if(heightOcc == null) ((TextArea)widget).setVisibleLines(value);
-
- // set the outer element (the panel to the correct size if it is not set
- //TODO: super.setHeight(new AutoNumUnitValue(this.textElement.getOffsetHeight() + "px"), null);
}
@@ -607,9 +599,6 @@
// cols is only treated if width is not set
if(widthOcc == null) DOM.setElementAttribute(widget.getElement(), "cols", String.valueOf(value));
-
- // set the outer element (the panel to the correct size if it is not set
- //TODO: super.setWidth(new AutoNumUnitValue(this.textElement.getOffsetWidth() + "px"), null);
}
@@ -921,11 +910,6 @@
super.setCssProperty(styleClass, "verticalAlign", value.getCssName());
}
}
-
-
- public void setOverflow(Widget widget, Overflow value, String styleClass)throws InvalidGdlSchemaException, ExecutionException {
- if(value != null) this.setCssProperty((TextArea)widget, styleClass, "overflow", value.getCssName());
- }
public void setGdlStyle(Widget widget) throws InvalidGdlSchemaException, ExecutionException {
@@ -938,9 +922,7 @@
this.setTextType(this.getTextType());
this.setRows(widget, this.getRows());
this.setCols(widget, this.getCols());
-
- this.setOverflow(widget, this.getOverflow(styleClass), styleClass);
-
+
this.setVerticalAlign(widget, this.getVerticalAlign(styleClass), styleClass);
this.setMargin(widget, this.getMargin(styleClass), styleClass);
@@ -1008,32 +990,8 @@
this.setGdlStyle((Widget)item);
}
}
-
- this.adjustSize();
- }
-
-
- // resets the size of this element depending on the amount of inner sub-elements
- @Override
- protected void adjustSize(){
-
-
-
- // if width is not set => auto
- // if width is set => offset width of the biggest sub-elements || width of sub-elements
- // if min-width is not set => auto
- // if min-width is set => offset width of the biggest sub-elements || min-width of sub-elements
- // if max-width is not set => auto
- // if max-width is set => offset width of the biggest sub-elements || max-width of sub-elements
-
-
-
-
-
- // TODO: set overflow of the element
}
-
// registers a passed mouse down handler to each text element of this item
@Override
public MultipleHandlerRegistration addMouseDownHandler(MouseDownHandler handler){
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlCreatorAssociationView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlCreatorAssociationView.java Wed Jul 6 12:33:40 2011 (r571)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlCreatorAssociationView.java Wed Jul 6 13:36:01 2011 (r572)
@@ -385,10 +385,6 @@
}
- @Override
- protected void adjustSize() {
- // ignore this method, since all instances of gdl:View have a static size
- }
@Override
public void onHoverStart(DomEvent event, HoverStyleHandler handler) {
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlDefaultCreatorTopicView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlDefaultCreatorTopicView.java Wed Jul 6 12:33:40 2011 (r571)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlDefaultCreatorTopicView.java Wed Jul 6 13:36:01 2011 (r572)
@@ -421,11 +421,6 @@
}
- @Override
- protected void adjustSize() {
- // ignore this method, since all instances of gdl:View have a static size
- }
-
@Override
public void onHoverStart(DomEvent event, HoverStyleHandler handler) {
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlEditorAssociationView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlEditorAssociationView.java Wed Jul 6 12:33:40 2011 (r571)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlEditorAssociationView.java Wed Jul 6 13:36:01 2011 (r572)
@@ -423,11 +423,6 @@
}
- @Override
- protected void adjustSize() {
- // ignore this method, since all instances of gdl:View have a static size
- }
-
@Override
public void onHoverStart(DomEvent event, HoverStyleHandler handler) {
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialCreatorTopicView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialCreatorTopicView.java Wed Jul 6 12:33:40 2011 (r571)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialCreatorTopicView.java Wed Jul 6 13:36:01 2011 (r572)
@@ -425,12 +425,6 @@
@Override
- protected void adjustSize() {
- // ignore this method, since all instances of gdl:View have a static size
- }
-
-
- @Override
public void onHoverStart(DomEvent event, HoverStyleHandler handler) {
// TODO Auto-generated method stub
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialEditorTopicView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialEditorTopicView.java Wed Jul 6 12:33:40 2011 (r571)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlSpecialEditorTopicView.java Wed Jul 6 13:36:01 2011 (r572)
@@ -425,11 +425,6 @@
}
-
- @Override
- protected void adjustSize() {
- // ignore this method, since all instances of gdl:View have a static size
- }
@Override
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlView.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlView.java Wed Jul 6 12:33:40 2011 (r571)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/views/GdlView.java Wed Jul 6 13:36:01 2011 (r572)
@@ -74,11 +74,6 @@
}
- @Override
- public void setOverflow(Widget widget, Overflow value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
- // TODO: implement
- }
-
public void setContentOrientation(Widget widget, ContentOrientationValue value){
// do nothing - since all content elements are positioned vie the GDL positioning concept
1
0

[isidorus-cvs] r571 - in branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets: base text
by lgiessmann@common-lisp.net 06 Jul '11
by lgiessmann@common-lisp.net 06 Jul '11
06 Jul '11
Author: lgiessmann
Date: Wed Jul 6 12:33:40 2011
New Revision: 571
Log:
gdl-frontend: Widgets: fixed a bug when applying the readonly property
Modified:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java Wed Jul 6 11:55:37 2011 (r570)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java Wed Jul 6 12:33:40 2011 (r571)
@@ -82,13 +82,15 @@
Topic gdlOverflow = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.OccurrenceType.gdlOverflow));
Topic gdlTextDecoration = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.OccurrenceType.gdlTextDecoration));
-
- tmpRepresentative.createOccurrence(gdlBackgroundColor, "red", null);
tmpRepresentative.createOccurrence(gdlId, "ID_1", null);
+ /*
+ tmpRepresentative.createOccurrence(gdlBackgroundColor, "red", null);
+ */
tmpRepresentative.createOccurrence(gdlWidth, "300px", null);
tmpRepresentative.createOccurrence(gdlHeight, "300px", null);
tmpRepresentative.createOccurrence(gdlBorderRadius, "30px", null);
tmpRepresentative.createOccurrence(gdlBorderBottomRightRadius, "2%", null);
+ /*
tmpRepresentative.createOccurrence(gdlPadding, "5px", null);
tmpRepresentative.createOccurrence(gdlPaddingLeft, "5%", null);
tmpRepresentative.createOccurrence(gdlCursor, CursorValue.HELP.getCssValue(), null);
@@ -112,7 +114,7 @@
bgcFocus.addTheme(gdlFocus);
Occurrence fsHover = tmpRepresentative.createOccurrence(gdlFontSize, "25pt", null);
fsHover.addTheme(gdlHover);
-
+ */
GdlText tmp = new GdlText(tmpRepresentative){};
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java Wed Jul 6 11:55:37 2011 (r570)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java Wed Jul 6 12:33:40 2011 (r571)
@@ -545,11 +545,11 @@
// sets the resize style property.
// If gdl:readonly is set to true, this property is set to none, i.e. the passed value is ignored.
// IF gdl:readonly is set to false, this property is set to the passed argument.
- public void setResize(ResizeValue value) throws InvalidGdlSchemaException, ExecutionException{
+ public void setResize(Widget widget, ResizeValue value) throws InvalidGdlSchemaException, ExecutionException{
if(value == null || getReadonly() == true){
- for (TextArea elem : this.textElements) this.setCssProperty(elem, null, "resize", "none");
+ DOM.setStyleAttribute(widget.getElement(), "resize", "none");
} else{
- for (TextArea elem : this.textElements) this.setCssProperty(elem, null, "resize", value.getCssValue());
+ DOM.setStyleAttribute(widget.getElement(), "resize", value.getCssValue());
}
// TODO: if resize == true => set width/height of the outer/container element after the resize operation
@@ -557,8 +557,8 @@
// sets the readonly property of this element's text are element
- public void setReadonly(boolean value){
- for (TextArea item : this.textElements) item.setReadOnly(value);
+ public void setReadonly(Widget widget, boolean value){
+ ((TextArea)widget).setReadOnly(value);
}
@@ -588,12 +588,12 @@
// sets the rows property if gdl:width is not set
- public void setRows(int value) throws InvalidGdlSchemaException, ExecutionException {
+ public void setRows(Widget widget, int value) throws InvalidGdlSchemaException, ExecutionException {
if(value < 0) throw new InvalidGdlSchemaException("The occurrence " + GdlPsis.OccurrenceType.gdlRows + " must be set to a positive integer, but is \"" + value + "\"");
Occurrence heightOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlHeight);
// rows is only treated if height is not set
- if(heightOcc == null) this.setRows(value);
+ if(heightOcc == null) ((TextArea)widget).setVisibleLines(value);
// set the outer element (the panel to the correct size if it is not set
//TODO: super.setHeight(new AutoNumUnitValue(this.textElement.getOffsetHeight() + "px"), null);
@@ -601,12 +601,12 @@
// sets the cols property if gdl:height is not set
- public void setCols(int value) throws InvalidGdlSchemaException, ExecutionException {
+ public void setCols(Widget widget, int value) throws InvalidGdlSchemaException, ExecutionException {
if(value < 0) throw new InvalidGdlSchemaException("The occurrence " + GdlPsis.OccurrenceType.gdlRows + " must be set to a positive integer, but is \"" + value + "\"");
Occurrence widthOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlWidth);
// cols is only treated if width is not set
- if(widthOcc == null) this.setCols(value);
+ if(widthOcc == null) DOM.setElementAttribute(widget.getElement(), "cols", String.valueOf(value));
// set the outer element (the panel to the correct size if it is not set
//TODO: super.setWidth(new AutoNumUnitValue(this.textElement.getOffsetWidth() + "px"), null);
@@ -929,15 +929,16 @@
public void setGdlStyle(Widget widget) throws InvalidGdlSchemaException, ExecutionException {
- this.setReadonly(this.getReadonly());
- this.setResize(this.getResize());
- this.setTextType(this.getTextType());
- this.setRows(this.getRows());
- this.setCols(this.getCols());
this.setContentOrientation(widget, this.getContentOrientation());
String[] styleClasses = new String[]{null, GdlPsis.Scope.gdlActive, GdlPsis.Scope.gdlFocus, GdlPsis.Scope.gdlHover};
for (String styleClass : styleClasses) {
+ this.setReadonly(widget, this.getReadonly());
+ this.setResize(widget, this.getResize());
+ this.setTextType(this.getTextType());
+ this.setRows(widget, this.getRows());
+ this.setCols(widget, this.getCols());
+
this.setOverflow(widget, this.getOverflow(styleClass), styleClass);
this.setVerticalAlign(widget, this.getVerticalAlign(styleClass), styleClass);
@@ -1015,7 +1016,21 @@
// resets the size of this element depending on the amount of inner sub-elements
@Override
protected void adjustSize(){
- // TODO: implement => width, height, overflow of the mainpanel
+
+
+
+ // if width is not set => auto
+ // if width is set => offset width of the biggest sub-elements || width of sub-elements
+ // if min-width is not set => auto
+ // if min-width is set => offset width of the biggest sub-elements || min-width of sub-elements
+ // if max-width is not set => auto
+ // if max-width is set => offset width of the biggest sub-elements || max-width of sub-elements
+
+
+
+
+
+ // TODO: set overflow of the element
}
1
0

[isidorus-cvs] r570 - in branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets: environment text
by lgiessmann@common-lisp.net 06 Jul '11
by lgiessmann@common-lisp.net 06 Jul '11
06 Jul '11
Author: lgiessmann
Date: Wed Jul 6 11:55:37 2011
New Revision: 570
Log:
gdl-frontend: Widgets: fixed a bug when applying the styles for CSS active, hover and focus
Modified:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/environment/FocusStyleHandler.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/environment/FocusStyleHandler.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/environment/FocusStyleHandler.java Wed Jul 6 11:09:04 2011 (r569)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/environment/FocusStyleHandler.java Wed Jul 6 11:55:37 2011 (r570)
@@ -5,7 +5,7 @@
import com.google.gwt.event.dom.client.BlurHandler;
import com.google.gwt.event.dom.client.FocusEvent;
import com.google.gwt.event.dom.client.FocusHandler;
-import com.google.gwt.user.client.ui.Widget;
+
public class FocusStyleHandler implements FocusHandler, BlurHandler{
GdlVisibleObject widget = null;
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java Wed Jul 6 11:09:04 2011 (r569)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java Wed Jul 6 11:55:37 2011 (r570)
@@ -4,21 +4,15 @@
import com.google.gwt.dom.client.Style.FontStyle;
import com.google.gwt.dom.client.Style.Overflow;
import com.google.gwt.dom.client.Style.VerticalAlign;
-import com.google.gwt.event.dom.client.BlurEvent;
import com.google.gwt.event.dom.client.BlurHandler;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.DomEvent;
-import com.google.gwt.event.dom.client.FocusEvent;
import com.google.gwt.event.dom.client.FocusHandler;
import com.google.gwt.event.dom.client.KeyPressEvent;
import com.google.gwt.event.dom.client.KeyPressHandler;
-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.EventHandler;
import com.google.gwt.event.shared.HandlerRegistration;
@@ -72,7 +66,7 @@
public GdlText(Topic tmRepresentative) throws InvalidGdlSchemaException, ExecutionException{
super(tmRepresentative);
// TODO: create a text element for each TM-elem
- this.createNewTextArea();
+ this.createNewTextArea(); // TODO: remove only for debugging
}
@@ -1109,7 +1103,6 @@
for (TextArea item : this.textElements) {
results.add(item.getValue());
}
-
return results;
}
@@ -1174,6 +1167,30 @@
}
+ // applies the styles bound to hover and the passed element
+ private void onHoverStart(Widget widget){
+ for (Pair<String, String> elem : this.hoverCssNamesAndStyles) {
+ DOM.setStyleAttribute(widget.getElement(), elem.getFirst(), elem.getSecond());
+ }
+ }
+
+
+ // applies the styles bound to acitve and the passed element
+ private void onActiveStart(Widget widget){
+ for (Pair<String, String> elem : this.activeCssNamesAndStyles) {
+ DOM.setStyleAttribute(widget.getElement(), elem.getFirst(), elem.getSecond());
+ }
+ }
+
+
+ // applies the styles bound to focus and the passed element
+ private void onFocusStart(Widget widget){
+ for (Pair<String, String> elem : this.focusCssNamesAndStyles) {
+ DOM.setStyleAttribute(widget.getElement(), elem.getFirst(), elem.getSecond());
+ }
+ }
+
+
// some handler for applying the css style bound to the pseudo classes hover, active and focus
@Override
public void onHoverStart(@SuppressWarnings("rawtypes") DomEvent event, HoverStyleHandler handler) {
@@ -1194,8 +1211,8 @@
if(lastHandler == null){
this.setGdlStyle(source);
}else {
- if(lastHandler.getClass().equals(ActiveStyleHandler.class)) this.onActiveStart(event, null);
- else this.onFocusStart(null, null);
+ if(lastHandler.getClass().equals(ActiveStyleHandler.class)) this.onActiveStart(source);
+ else this.onFocusStart(source);
}
}catch(Exception e){
Window.alert("could not apply the default CSS style >> " + e.getClass() + " >> " + e.getMessage());
@@ -1223,8 +1240,8 @@
if(lastHandler == null){
this.setGdlStyle(source);
}else {
- if(lastHandler.getClass().equals(ActiveStyleHandler.class)) this.onActiveStart(event, null);
- else this.onHoverStart(null, null);
+ if(lastHandler.getClass().equals(ActiveStyleHandler.class)) this.onActiveStart(source);
+ else this.onHoverStart(source);
}
}catch(Exception e){
Window.alert("could not apply the default CSS style >> " + e.getClass() + " >> " + e.getMessage());
@@ -1251,8 +1268,8 @@
if(lastHandler == null){
this.setGdlStyle(source);
}else {
- if(lastHandler.getClass().equals(HoverStyleHandler.class)) this.onHoverStart(event, null);
- else this.onFocusStart(null, null);
+ if(lastHandler.getClass().equals(HoverStyleHandler.class)) this.onHoverStart(source);
+ else this.onFocusStart(source);
}
}catch(Exception e){
Window.alert("could not apply the default CSS style >> " + e.getClass() + " >> " + e.getMessage());
1
0