[isidorus-cvs] r560 - in branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets: base environment text values
lgiessmann at common-lisp.net
lgiessmann at common-lisp.net
Tue Jul 5 16:41:32 UTC 2011
Author: lgiessmann
Date: Tue Jul 5 09:41:31 2011
New Revision: 560
Log:
gdl-frontend: Widgets: added diverse methods to GdlText
Added:
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/environment/MultipleHandlerRegistration.java
branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/values/ResizeValue.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/IGdlHasValue.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
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 Mon Jul 4 23:59:48 2011 (r559)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/GdlVisibleObject.java Tue Jul 5 09:41:31 2011 (r560)
@@ -1087,7 +1087,7 @@
}else if(value.equals("SCROLL")){
return Overflow.SCROLL;
}else {
- throw new InvalidGdlSchemaException("cursor must be set to one of visible, hidden or scroll, but is " + overflowOcc.getValue());
+ throw new InvalidGdlSchemaException("overflow must be set to one of visible, hidden or scroll, but is " + overflowOcc.getValue());
}
}
}
@@ -1516,6 +1516,9 @@
private ArrayList<Pair<String, String>> cssNameAndValues = new ArrayList<Pair<String,String>>();
private ArrayList<Pair<String, String>> cssPreviousNameAndValues = new ArrayList<Pair<String,String>>();
+
+ public CssStyleHandler() {}
+
// adds a CSS name value pair
public void addCssStyle(Pair<String, String> cssNameAndValue) {
@@ -1550,7 +1553,11 @@
// this class is used to set the style of focused elements
protected class FocusStyleHandler extends CssStyleHandler implements FocusHandler, BlurHandler{
-
+ public FocusStyleHandler() {
+ super();
+ }
+
+
@Override
public void onFocus(FocusEvent event) {
super.setStyles();
@@ -1566,12 +1573,17 @@
// this class is used to set the style of hovered elements
protected class HoverStyleHandler extends CssStyleHandler implements MouseOverHandler, MouseOutHandler {
-
+ public HoverStyleHandler() {
+ super();
+ }
+
+
@Override
public void onMouseOut(MouseOutEvent event) {
super.unsetStyles();
}
+
@Override
public void onMouseOver(MouseOverEvent event) {
super.setStyles();
@@ -1581,6 +1593,9 @@
// this class is used to set the style of active elements
protected class ActiveStyleHandler extends CssStyleHandler implements MouseDownHandler, MouseUpHandler {
+ public ActiveStyleHandler() {
+ super();
+ }
@Override
@@ -1588,6 +1603,7 @@
super.unsetStyles();
}
+
@Override
public void onMouseDown(MouseDownEvent event) {
super.setStyles();
Modified: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/IGdlHasValue.java
==============================================================================
--- branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/IGdlHasValue.java Mon Jul 4 23:59:48 2011 (r559)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/IGdlHasValue.java Tue Jul 5 09:41:31 2011 (r560)
@@ -1,11 +1,14 @@
package us.isidor.gdl.anaToMia.Widgets.base;
+import java.util.ArrayList;
+
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Construct;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.TopicMapsTypes;
+import us.isidor.gdl.anaToMia.Widgets.environment.Pair;
public interface IGdlHasValue {
- public String getStringValue();
- public Construct getTmValue();
- public TopicMapsTypes getTmType(); // null if it is a String value
+ public ArrayList<String> getStringValue();
+ public ArrayList<Pair<TopicMapsTypes, Object>> getTmValue(); // TopicMapsTypes is null if the acual value is a string
+ public boolean validate();
}
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 Mon Jul 4 23:59:48 2011 (r559)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/base/TestClass.java Tue Jul 5 09:41:31 2011 (r560)
@@ -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.GdlText;
import us.isidor.gdl.anaToMia.Widgets.text.GdlTextObject;
import us.isidor.gdl.anaToMia.Widgets.values.CursorValue;
import com.google.gwt.core.client.EntryPoint;
@@ -76,6 +77,9 @@
Topic gdlHover = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.Scope.gdlHover));
Topic gdlActive = gdlPanel.getSchemaTm().createTopicBySubjectIdentifier(gdlPanel.getSchemaTm().createLocator(GdlPsis.Scope.gdlActive));
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));
tmpRepresentative.createOccurrence(gdlBackgroundColor, "red", null);
@@ -94,19 +98,22 @@
tmpRepresentative.createOccurrence(gdlBorderBottomColor, "rgb(100%, 100%, 0%)", null);
tmpRepresentative.createOccurrence(gdlBorderStyle, "dashed", null);
tmpRepresentative.createOccurrence(gdlBorderWidth, "5px", null);
- Occurrence bgcHover = tmpRepresentative.createOccurrence(gdlBackgroundColor, "green", null);
- bgcHover.addTheme(gdlHover);
- Occurrence bgcActive = tmpRepresentative.createOccurrence(gdlBackgroundColor, "purple", null);
- bgcActive.addTheme(gdlActive);
- Occurrence bgcFocus = tmpRepresentative.createOccurrence(gdlBackgroundColor, "silver", null);
- bgcFocus.addTheme(gdlFocus);
+ tmpRepresentative.createOccurrence(gdlReadonly, "false", null);
+ tmpRepresentative.createOccurrence(gdlResize, "both", null);
+ tmpRepresentative.createOccurrence(gdlOverflow, "hidden", null);
tmpRepresentative.createOccurrence(gdlFontSize, "15pt", null);
- Occurrence fsHover = tmpRepresentative.createOccurrence(gdlFontSize, "25pt", null);
- fsHover.addTheme(gdlHover);
+ //Occurrence bgcHover = tmpRepresentative.createOccurrence(gdlBackgroundColor, "green", null);
+ //bgcHover.addTheme(gdlHover);
+ //Occurrence bgcActive = tmpRepresentative.createOccurrence(gdlBackgroundColor, "purple", null);
+ //bgcActive.addTheme(gdlActive);
+ //Occurrence bgcFocus = tmpRepresentative.createOccurrence(gdlBackgroundColor, "silver", null);
+ //bgcFocus.addTheme(gdlFocus);
+ //Occurrence fsHover = tmpRepresentative.createOccurrence(gdlFontSize, "25pt", null);
+ //fsHover.addTheme(gdlHover);
- GdlTextObject tmp = new GdlTextObject(tmpRepresentative){};
+ GdlText tmp = new GdlText(tmpRepresentative){};
this.mainPanel.add(tmp);
}catch(Exception e){
e.printStackTrace();
Added: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/environment/MultipleHandlerRegistration.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/environment/MultipleHandlerRegistration.java Tue Jul 5 09:41:31 2011 (r560)
@@ -0,0 +1,23 @@
+package us.isidor.gdl.anaToMia.Widgets.environment;
+
+import java.util.ArrayList;
+
+import com.google.gwt.event.shared.HandlerRegistration;
+
+public class MultipleHandlerRegistration implements HandlerRegistration {
+ private ArrayList<HandlerRegistration> registrations = new ArrayList<HandlerRegistration>();
+
+
+ @Override
+ public void removeHandler() {
+ for (HandlerRegistration reg : this.registrations) {
+ reg.removeHandler();
+ }
+ }
+
+
+ public void addHandlerRegistration(HandlerRegistration registration){
+ this.registrations.add(registration);
+ }
+
+}
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 Mon Jul 4 23:59:48 2011 (r559)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlText.java Tue Jul 5 09:41:31 2011 (r560)
@@ -1,31 +1,118 @@
package us.isidor.gdl.anaToMia.Widgets.text;
-import com.google.gwt.dom.client.Style.Display;
+import java.util.ArrayList;
+import com.google.gwt.dom.client.Style.FontStyle;
+import com.google.gwt.event.dom.client.BlurHandler;
+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.HandlerRegistration;
+import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.Window;
+import com.google.gwt.user.client.ui.TextArea;
import us.isidor.gdl.anaToMia.TopicMaps.TopicMapsModel.Construct;
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.GdlVisibleObject;
import us.isidor.gdl.anaToMia.Widgets.base.IGdlHasValue;
import us.isidor.gdl.anaToMia.Widgets.environment.ExecutionException;
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.AutoNumValue;
+import us.isidor.gdl.anaToMia.Widgets.values.BorderStyleValue;
+import us.isidor.gdl.anaToMia.Widgets.values.ColorValue;
+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{
+
+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, ActiveStyleHandler>> activeStyleHandler = new ArrayList<Pair<TextArea,ActiveStyleHandler>>();
+ protected ArrayList<Pair<TextArea, FocusStyleHandler>> focusStyleHandler = new ArrayList<Pair<TextArea,FocusStyleHandler>>();
+ protected ArrayList<Pair<TextArea, HoverStyleHandler>> hoverStyleHandler = new ArrayList<Pair<TextArea,HoverStyleHandler>>();
+
+
+ // TODO: check ActiveHandler, FocusHandler and HoverHandler for bugs ==> click event!
+
// some constructors
- protected GdlText(){
+ protected GdlText() throws InvalidGdlSchemaException, ExecutionException {
super();
}
public GdlText(Topic tmRepresentative) throws InvalidGdlSchemaException, ExecutionException{
- super(tmRepresentative);
+ this();
+ this.tmRepresentative = tmRepresentative;
+ this.tm = this.tmRepresentative.getTopicMap();
+ super.setId(this.getId());
+ // TODO: create a text element for each TM-elem
+ this.createNewTextArea();
}
+ // creates a new TextArea item, adds it to the textElements array,
+ // and applies the styles on it
+ protected TextArea createNewTextArea() throws InvalidGdlSchemaException, ExecutionException {
+ TextArea elem = new TextArea();
+ this.textElements.add(elem);
+ DOM.setElementAttribute(elem.getElement(), "id", this.getId() + "__GDL_" + this.textElements.size());
+ super.mainPanel.add(elem);
+ this.setContentGdlStyle(elem);
+
+ // TODO: reset the text area size on each text element
+ return elem;
+ }
+
+
+ // removes the passed element and all its handlers from the outer element
+ protected void removeTextArea(TextArea elem){
+ for (Pair<TextArea, ActiveStyleHandler> item : this.activeStyleHandler) {
+ if(item.getFirst().equals(elem)){
+ this.activeStyleHandler.remove(item);
+ break;
+ }
+ }
+ for (Pair<TextArea, FocusStyleHandler> item : this.focusStyleHandler) {
+ if(item.getFirst().equals(elem)){
+ this.focusStyleHandler.remove(item);
+ break;
+ }
+ }
+ for (Pair<TextArea, HoverStyleHandler> item : this.hoverStyleHandler) {
+ if(item.getFirst().equals(elem)){
+ this.hoverStyleHandler.remove(item);
+ break;
+ }
+ }
+
+ this.textElements.remove(elem);
+ elem.removeFromParent();
+
+ // TODO: reset the text area size on each text element
+ }
+
// returns a TextType instance of a gdl:text-type occurrence.
// If no gdl:text-type occurrence is set, the default value is returned
@@ -46,7 +133,7 @@
// returns a boolean instance of a gdl:readonly occurrence.
// If no gdl:readonly occurrence is set, the default value is returned
- public boolean getReadnonly() throws InvalidGdlSchemaException {
+ public boolean getReadonly() throws InvalidGdlSchemaException {
Occurrence readOnlyOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlReadonly);
if(readOnlyOcc != null){
@@ -64,7 +151,6 @@
}
-
// returns a boolean instance of a gdl:rows occurrence.
// If no gdl:rows occurrence is set, the default value is returned
public int getRows() throws InvalidGdlSchemaException {
@@ -105,56 +191,768 @@
// returns a boolean instance of a gdl:resize occurrence.
// If no gdl:resize occurrence is set, the default value is returned
- public boolean getResize() throws InvalidGdlSchemaException {
+ public ResizeValue getResize() throws InvalidGdlSchemaException {
Occurrence resizeOcc = getNoneOrOneUnscopedOccurrence(GdlPsis.OccurrenceType.gdlResize);
if(resizeOcc != null){
- String boolStr = resizeOcc.getValue().toUpperCase();
- if(boolStr.equals("TRUE")){
- return true;
- } else if(boolStr.equals("FALSE")) {
- return false;
- } else {
- throw new InvalidGdlSchemaException("The occurrence " + GdlPsis.OccurrenceType.gdlResize + " must be set to one of \"true\" or \"false\", but is \"" + resizeOcc.getValue() + "\"");
+ try{
+ return ResizeValue.valueOf(resizeOcc.getValue().toUpperCase());
+ }catch(IllegalArgumentException e){
+ throw new InvalidGdlSchemaException("The occurrence " + GdlPsis.OccurrenceType.gdlResize + " must be set to one of \"both\", \"vertical\", \"horizontal\" or \"none\", but is \"" + resizeOcc.getValue() + "\"");
}
} else {
- return false;
+ return ResizeValue.NONE;
+ }
+ }
+
+
+ // 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)){
+ for (Pair<TextArea, ActiveStyleHandler> item : this.activeStyleHandler) {
+ if(item.getFirst().equals(elem)){
+ item.getSecond().addCssStyle(new Pair<String, String>(cssProperty, cssValue));
+ break;
+ }
+ }
+ } else if(styleClass.equals(GdlPsis.Scope.gdlFocus)){
+ for (Pair<TextArea, FocusStyleHandler> item : this.focusStyleHandler) {
+ if(item.getFirst().equals(elem)){
+ item.getSecond().addCssStyle(new Pair<String, String>(cssProperty, cssValue));
+ break;
+ }
+ }
+ } else if (styleClass.equals(GdlPsis.Scope.gdlHover)){
+ for (Pair<TextArea, HoverStyleHandler> item : this.hoverStyleHandler) {
+ if(item.getFirst().equals(elem)){
+ item.getSecond().addCssStyle(new Pair<String, String>(cssProperty, cssValue));
+ break;
+ }
+ }
+ } 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.
+ public void setResize(ResizeValue value) throws InvalidGdlSchemaException, ExecutionException{
+ if(getReadonly() == true){
+ for (TextArea elem : this.textElements) this.setCssProperty(elem, null, "resize", "none");
+ } else {
+ for (TextArea elem : this.textElements) this.setCssProperty(elem, null, "resize", value.getCssValue());
+ }
+
+ // TODO: if resize == true => set width/height of the outer/container element after the resize operation
+ }
+
+
+ // sets the readonly property of this element's text are element
+ public void setReadonly(boolean value){
+ for (TextArea item : this.textElements) item.setReadOnly(value);
+ }
+
+
+ // sets and registers or unsets and deregisters a PasswordKeyPressHandler
+ // on this element's text area item.
+ public void setTextType(TextTypeValue value){
+ if(value == TextTypeValue.Password){
+ if(this.passwordKeyPressHandler == null) {
+ this.passwordKeyPressHandler = new ArrayList<PasswordKeyPressHandler>();
+ this.passwordKeyPressRegistrations = new ArrayList<HandlerRegistration>();
+
+ for (TextArea item : this.textElements) {
+ PasswordKeyPressHandler handler = new PasswordKeyPressHandler();
+ this.passwordKeyPressRegistrations.add(item.addKeyPressHandler(handler));
+ }
+ }
+ }else {
+ if(this.passwordKeyPressRegistrations != null){
+ for (HandlerRegistration reg : this.passwordKeyPressRegistrations) {
+ reg.removeHandler();
+ }
+ this.passwordKeyPressHandler = null;
+ this.passwordKeyPressRegistrations = null;
+ }
}
}
+ public void setWidth(TextArea elem, AutoNumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(elem, styleClass, "width", value.getCssValue());
+ }
+
+
+ @Override
+ public void setWidth(AutoNumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ // TODO: implement
+
+ }
+
+
+ public void setHeight(TextArea elem, AutoNumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ // TODO: implement
+ }
+
+
+ // sets the rows property if gdl:width is not set
+ public void setRows(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);
+
+ // 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);
+ }
+
+
+ // sets the cols property if gdl:height is not set
+ public void setCols(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);
+
+ // 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);
+ }
+
+
+ // sets the background-color style property of this element's text items by using the GWT DOM class
+ @Override
+ public void setBackgroundColor(ColorValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(styleClass, "backgroundColor", value.getCssValue());
+ }
+
+
+ // sets the cursor style property of this element's text items by using the GWT DOM class
+ @Override
+ public void setCursor(CursorValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(styleClass, "cursor", value.getCssValue());
+ }
+
+
+ // sets the border-color property of this element's text items by using the GWT DOM class
+ @Override
+ public void setBorderColor(ColorValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(styleClass, "boderColor", value.getCssValue());
+ }
+
+
+ // sets the border-top-color property of this element's text items by using the GWT DOM class
+ @Override
+ public void setBorderTopColor(ColorValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(styleClass, "boderTopColor", value.getCssValue());
+ }
+
+
+ // sets the border-right-color property of this element's text items by using the GWT DOM class
+ @Override
+ public void setBorderRightColor(ColorValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(styleClass, "boderRightColor", value.getCssValue());
+ }
+
+
+ // sets the border-bottom-color property of this element's text items by using the GWT DOM class
+ @Override
+ public void setBorderBottomColor(ColorValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(styleClass, "boderBottomColor", value.getCssValue());
+ }
+
+
+ // sets the border-left-color property of this element's text items by using the GWT DOM class
+ @Override
+ public void setBorderLeftColor(ColorValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(styleClass, "boderLeftColor", value.getCssValue());
+ }
+
+
+ // sets the border-style property of this element's text items by using the GWT DOM class
+ @Override
+ public void setBorderStyle(BorderStyleValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(styleClass, "boderStyle", value.getCssValue());
+ }
+
+
+ // sets the border-top-style property of this element's text items by using the GWT DOM class
+ @Override
+ public void setBorderTopStyle(BorderStyleValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(styleClass, "boderTopStyle", value.getCssValue());
+ }
+
+
+ // sets the border-right-style property of this element's text items by using the GWT DOM class
+ @Override
+ public void setBorderRightStyle(BorderStyleValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(styleClass, "boderRightStyle", value.getCssValue());
+ }
+
+
+ // sets the border-bottom-style property of this element's text items by using the GWT DOM class
+ @Override
+ public void setBorderBottomStyle(BorderStyleValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(styleClass, "boderBottomStyle", value.getCssValue());
+ }
+
+
+ // sets the border-left-style property of this element's text items by using the GWT DOM class
+ @Override
+ public void setBorderLeftStyle(BorderStyleValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(styleClass, "boderLeftStyle", value.getCssValue());
+ }
+
+
+ // sets the border-width property of this element's text items by using the GWT DOM class
+ @Override
+ public void setBorderWidth(AbsoluteNumValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(styleClass, "boderWidth", value.getCssValue());
+ }
+
+
+ // sets the border-top-width property of this element's text items by using the GWT DOM class
+ @Override
+ public void setBorderTopWidth(AbsoluteNumValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(styleClass, "boderTopWidth", value.getCssValue());
+ }
+
+
+ // sets the border-right-width property of this element's text items by using the GWT DOM class
+ @Override
+ public void setBorderRightWidth(AbsoluteNumValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(styleClass, "boderRightWidth", value.getCssValue());
+ }
+
+
+ // sets the border-bottom-width property of this element's text items by using the GWT DOM class
+ @Override
+ public void setBorderBottomWidth(AbsoluteNumValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(styleClass, "boderBottomWidth", value.getCssValue());
+ }
+
+
+ // sets the border-left-width property of this element's text items by using the GWT DOM class
+ @Override
+ public void setBorderLeftWidth(AbsoluteNumValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(styleClass, "boderLeftWidth", value.getCssValue());
+ }
+
+
+ // sets the border-radius property of this element's text items by using the GWT DOM class
+ @Override
+ public void setBorderRadius(NumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(styleClass, "boderRadius", value.getCssValue());
+ }
+
+
+ // sets the border-top-right-radius property of this element's text items by using the GWT DOM class
+ @Override
+ public void setBorderTopRightRadius(NumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(styleClass, "boderTopRightRadius", value.getCssValue());
+ }
+
+
+ // sets the border-bottom-right-radius property of this element's text items by using the GWT DOM class
+ @Override
+ public void setBorderBottomRightRadius(NumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(styleClass, "boderBottomRightRadius", value.getCssValue());
+ }
+
+
+ // sets the border-bottom-left-radius property of this element's text items by using the GWT DOM class
+ @Override
+ public void setBorderBottomLeftRadius(NumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(styleClass, "boderBottomLeftRadius", value.getCssValue());
+ }
+
+
+ // sets the border-top-left-radius property of this element's text items by using the GWT DOM class
+ @Override
+ public void setBorderTopLeftRadius(NumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(styleClass, "boderTopLeftRadius", value.getCssValue());
+ }
+
+
+ // sets the margin property of this element's text items by using the GWT DOM class
+ public void setMargin(TextArea elem, NumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(elem, styleClass, "margin", value.getCssValue());
+ }
+
+
+ // sets the margin-top-color property of this element's text items by using the GWT DOM class
+ public void setMarginTop(TextArea elem, NumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(elem, styleClass, "marginTop", value.getCssValue());
+ }
+
+
+ // sets the margin-right-color property of this element's text items by using the GWT DOM class
+ public void setMarginRight(TextArea elem, NumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(elem, styleClass, "marginRight", value.getCssValue());
+ }
+
+
+ // sets the margin-bottom-color property of this element's text items by using the GWT DOM class
+ public void setMarginBottom(TextArea elem, NumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(elem, styleClass, "marginBottom", value.getCssValue());
+ }
+
+
+ // sets the margin-left-color property of this element's text items by using the GWT DOM class
+ public void setMarginLeft(TextArea elem, NumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(elem, styleClass, "marginLeft", value.getCssValue());
+ }
+
+
+ // sets the padding property of this element's text items by using the GWT DOM class
+ public void setPadding(TextArea elem, NumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(elem, styleClass, "padding", value.getCssValue());
+ }
+
+
+ // sets the padding-top property of this element's text items by using the GWT DOM class
+ public void setPaddingTop(TextArea elem, NumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(elem, styleClass, "paddingTop", value.getCssValue());
+ }
+
+
+ // sets the padding-right property of this element's text items by using the GWT DOM class
+ public void setPaddingRight(TextArea elem, NumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(elem, styleClass, "paddingRight", value.getCssValue());
+ }
+
+
+ // sets the padding-bottom property of this element's text items by using the GWT DOM class
+ public void setPaddingBottom(TextArea elem, NumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(elem, styleClass, "paddingBottom", value.getCssValue());
+ }
+
+
+ // sets the padding-left property of this element's text items by using the GWT DOM class
+ public void setPaddingLeft(TextArea elem, NumUnitValue value, String styleClass)throws InvalidGdlSchemaException, ExecutionException{
+ if(value != null) this.setCssProperty(elem, styleClass, "paddingLeft", value.getCssValue());
+ }
+
+
+ // sets the background-color property of this element's text items by using the GWT DOM class
+ public void setBackgroundColor(TextArea elem, ColorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty(elem, styleClass, "backgroundColor", value.getCssValue());
+ }
+
+
+ // sets the cursor property of this element's text items by using the GWT DOM class
+ public void setCursor(TextArea elem, CursorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty(elem, styleClass, "cursor", value.getCssValue());
+ }
+
+
+ // sets the color property of this element's text items by using the GWT DOM class
+ public void setColor(TextArea elem, ColorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty(elem, styleClass, "color", value.getCssValue());
+ }
+
+
+ // sets the border-color property of this element's text items by using the GWT DOM class
+ public void setBorderColor(TextArea elem, ColorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty(elem, styleClass, "borderColor", value.getCssValue());
+ }
+
+
+ // sets the border-top-color property of this element's text items by using the GWT DOM class
+ public void setBorderTopColor(TextArea elem, ColorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty(elem, styleClass, "borderTopColor", value.getCssValue());
+ }
+
+
+ // sets the border-right-color property of this element's text items by using the GWT DOM class
+ public void setBorderRightColor(TextArea elem, ColorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty(elem, styleClass, "borderRightColor", value.getCssValue());
+ }
+
+
+ // sets the border-bottom-color property of this element's text items by using the GWT DOM class
+ public void setBorderBottomColor(TextArea elem, ColorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty(elem, styleClass, "borderBottomColor", value.getCssValue());
+ }
+
+
+ // sets the border-left-color property of this element's text items by using the GWT DOM class
+ public void setBorderLeftColor(TextArea elem, ColorValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty(elem, styleClass, "borderLeftColor", value.getCssValue());
+ }
+
+
+ // sets the border-style property of this element's text items by using the GWT DOM class
+ public void setBorderStyle(TextArea elem, BorderStyleValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty(elem, styleClass, "borderStyle", value.getCssValue());
+ }
+
+
+ // sets the border-top-style property of this element's text items by using the GWT DOM class
+ public void setBorderTopStyle(TextArea elem, BorderStyleValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty(elem, styleClass, "borderTopStyle", value.getCssValue());
+ }
+
+
+ // sets the border-right-style property of this element's text items by using the GWT DOM class
+ public void setBorderRightStyle(TextArea elem, BorderStyleValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty(elem, styleClass, "borderRightStyle", value.getCssValue());
+ }
+
+
+ // sets the border-bottom-style property of this element's text items by using the GWT DOM class
+ public void setBorderBottomStyle(TextArea elem, BorderStyleValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty(elem, styleClass, "borderBottomStyle", value.getCssValue());
+ }
+
+
+ // sets the border-left-style property of this element's text items by using the GWT DOM class
+ public void setBorderLeftStyle(TextArea elem, BorderStyleValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty(elem, styleClass, "borderLeftStyle", value.getCssValue());
+ }
+
+
+ // sets the border-width property of this element's text items by using the GWT DOM class
+ public void setBorderWidth(TextArea elem, AbsoluteNumValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty(elem, styleClass, "borderWidth", value.getCssValue());
+ }
+
+
+ // sets the border-top-width property of this element's text items by using the GWT DOM class
+ public void setBorderTopWidth(TextArea elem, AbsoluteNumValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty(elem, styleClass, "borderTopWidth", value.getCssValue());
+ }
+
+
+ // sets the border-right-width property of this element's text items by using the GWT DOM class
+ public void setBorderRightWidth(TextArea elem, AbsoluteNumValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty(elem, styleClass, "borderRightWidth", value.getCssValue());
+ }
+
+
+ // sets the border-bottom-width property of this element's text items by using the GWT DOM class
+ public void setBorderBottomWidth(TextArea elem, AbsoluteNumValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty(elem, styleClass, "borderBottomWidth", value.getCssValue());
+ }
+
+
+ // sets the border-left-width property of this element's text items by using the GWT DOM class
+ public void setBorderLeftWidth(TextArea elem, AbsoluteNumValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty(elem, styleClass, "borderLeftWidth", value.getCssValue());
+ }
+
+
+ // sets the border-radius property of this element's text items by using the GWT DOM class
+ public void setBorderRadius(TextArea elem, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty(elem, styleClass, "borderRadius", value.getCssValue());
+ }
+
+
+ // sets the border-top-right-radius property of this element's text items by using the GWT DOM class
+ public void setBorderTopRightRadius(TextArea elem, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty(elem, styleClass, "borderTopRightRadius", value.getCssValue());
+ }
+
+
+ // sets the border-bottom-right-radius property of this element's text items by using the GWT DOM class
+ public void setBorderBottomRightRadius(TextArea elem, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty(elem, styleClass, "borderBottomRightRadius", value.getCssValue());
+ }
+
+
+ // sets the border-bottom-left-radius property of this element's text items by using the GWT DOM class
+ public void setBorderBottomLeftRadius(TextArea elem, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty(elem, styleClass, "borderBottomLeftRadius", value.getCssValue());
+ }
+
+
+ // sets the border-top-left-radius property of this element's text items by using the GWT DOM class
+ public void setBorderTopLeftRadius(TextArea elem, NumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty(elem, styleClass, "borderTopLeftRadius", value.getCssValue());
+ }
+
+
+ // sets the direction property of this element's text items by using the GWT DOM class
+ public void setDirection(TextArea elem, DirectionValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty(elem, styleClass, "direction", value.getCssValue());
+ }
+
+
+ // sets the text-align property of this element's text items by using the GWT DOM class
+ public void setTextAlign(TextArea elem, TextAlignValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty(elem, styleClass, "textAlign", value.getCssValue());
+ }
+
+
+ // sets the line-height property of this element's text items by using the GWT DOM class
+ public void setLineHeight(TextArea elem, NormalNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty(elem, styleClass, "lineHeight", value.getCssValue());
+ }
+
+
+ // sets the text-decoration property of this element's text items by using the GWT DOM class
+ public void setTextDecoration(TextArea elem, TextDecorationValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty(elem, styleClass, "textDecoration", value.getCssValue());
+ }
+
+
+ // sets the font-family property of this element's text items by using the GWT DOM class
+ public void setFontFamily(TextArea elem, String value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty(elem, styleClass, "fontFamily", value);
+ }
+
+
+ // sets the font-style property of this element's text items by using the GWT DOM class
+ public void setFontStyle(TextArea elem, FontStyle value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty(elem, styleClass, "fontStyle", value.getCssName());
+ }
+
+
+ // sets the font-size property of this element's text items by using the GWT DOM class
+ public void setFontSize(TextArea elem, PositiveNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty(elem, styleClass, "fontSize", value.getCssValue());
+ }
+
+
+ // sets the font-weight property of this element's text items by using the GWT DOM class
+ public void setFontWeight(TextArea elem, FontWeightValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty(elem, styleClass, "fontWeight", value.getCssValue());
+ }
+
+
+ // sets the letter-spacing property of this element's text items by using the GWT DOM class
+ public void setLetterSpacing(TextArea elem, NormalNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty(elem, styleClass, "letterSpacing", value.getCssValue());
+ }
+
+
+ // sets the word-spacing property of this element's text items by using the GWT DOM class
+ public void setWordSpacing(TextArea elem, NormalNumUnitValue value, String styleClass) throws InvalidGdlSchemaException, ExecutionException {
+ if(value != null) this.setCssProperty(elem, styleClass, "wordSpacing", value.getCssValue());
+ }
+
+
+ // sets the GDL style of the passed content element, i.e. the TextArea element
+ protected void setContentGdlStyle(TextArea elem) throws InvalidGdlSchemaException, ExecutionException{
+ // create all handlers for elem
+ ActiveStyleHandler asHandler = new ActiveStyleHandler();
+ this.activeStyleHandler.add(new Pair<TextArea, GdlVisibleObject.ActiveStyleHandler>(elem, asHandler));
+ FocusStyleHandler fsHandler = new FocusStyleHandler();
+ this.focusStyleHandler.add(new Pair<TextArea, GdlVisibleObject.FocusStyleHandler>(elem, fsHandler));
+ HoverStyleHandler hsHandler = new HoverStyleHandler();
+ this.hoverStyleHandler.add(new Pair<TextArea, GdlVisibleObject.HoverStyleHandler>(elem, hsHandler));
+
+
+ // all attributes for the actual text element
+ this.setReadonly(this.getReadonly());
+ this.setResize(this.getResize());
+ this.setTextType(this.getTextType());
+ this.setRows(this.getRows());
+ this.setCols(this.getCols());
+
+ String[] styleClasses = new String[]{null, GdlPsis.Scope.gdlActive, GdlPsis.Scope.gdlFocus, GdlPsis.Scope.gdlHover};
+ for (String styleClass : styleClasses) {
+ // visible object styles
+ this.setBackgroundColor(elem, this.getBackgroundColor(styleClass), styleClass);
+ this.setCursor(elem, this.getCursor(styleClass), styleClass);
+ this.setColor(elem, this.getColor(styleClass), styleClass);
+ this.setBorderColor(elem, this.getBorderColor(styleClass), styleClass);
+ this.setBorderTopColor(elem, this.getBorderTopColor(styleClass), styleClass);
+ this.setBorderRightColor(elem, this.getBorderRightColor(styleClass), styleClass);
+ this.setBorderBottomColor(elem, this.getBorderBottomColor(styleClass), styleClass);
+ this.setBorderLeftColor(elem, this.getBorderLeftColor(styleClass), styleClass);
+ this.setBorderStyle(elem, this.getBorderStyle(styleClass), styleClass);
+ this.setBorderTopStyle(elem, this.getBorderTopStyle(styleClass), styleClass);
+ this.setBorderRightStyle(elem, this.getBorderRightStyle(styleClass), styleClass);
+ this.setBorderBottomStyle(elem, this.getBorderBottomStyle(styleClass), styleClass);
+ this.setBorderLeftStyle(elem, this.getBorderLeftStyle(styleClass), styleClass);
+ this.setBorderWidth(elem, this.getBorderWidth(styleClass), styleClass);
+ this.setBorderTopWidth(elem, this.getBorderTopWidth(styleClass), styleClass);
+ this.setBorderRightWidth(elem, this.getBorderRightWidth(styleClass), styleClass);
+ this.setBorderBottomWidth(elem, this.getBorderBottomWidth(styleClass), styleClass);
+ this.setBorderLeftWidth(elem, this.getBorderLeftWidth(styleClass), styleClass);
+ this.setBorderRadius(elem, this.getBorderRadius(styleClass), styleClass);
+ this.setBorderTopRightRadius(elem, this.getBorderTopRightRadius(styleClass), styleClass);
+ this.setBorderBottomRightRadius(elem, this.getBorderBottomRightRadius(styleClass), styleClass);
+ this.setBorderBottomLeftRadius(elem, this.getBorderBottomLeftRadius(styleClass), styleClass);
+ this.setBorderTopLeftRadius(elem, this.getBorderTopLeftRadius(styleClass), styleClass);
+ this.setMargin(elem, this.getMargin(styleClass), styleClass);
+ this.setMarginTop(elem, this.getMarginTop(styleClass), styleClass);
+ this.setMarginRight(elem, this.getMarginRight(styleClass), styleClass);
+ this.setMarginBottom(elem, this.getMarginBottom(styleClass), styleClass);
+ this.setMarginLeft(elem, this.getMarginLeft(styleClass), styleClass);
+ this.setPadding(elem, this.getPadding(styleClass), styleClass);
+ this.setPaddingTop(elem, this.getPaddingTop(styleClass), styleClass);
+ this.setPaddingRight(elem, this.getPaddingRight(styleClass), styleClass);
+ this.setPaddingBottom(elem, this.getPaddingBottom(styleClass), styleClass);
+ this.setPaddingLeft(elem, this.getPaddingLeft(styleClass), styleClass);
+ this.setWidth(elem, this.getWidth(styleClass), styleClass);
+ this.setHeight(elem, this.getHeight(styleClass), styleClass);
+
+ // text object styles
+ this.setDirection(elem, this.getDirection(styleClass), styleClass);
+ this.setTextAlign(elem, this.getTextAlign(styleClass), styleClass);
+ this.setLineHeight(elem, this.getLineHeight(styleClass), styleClass);
+ this.setTextDecoration(elem, this.getTextDecoration(styleClass), styleClass);
+ this.setFontFamily(elem, this.getFontFamily(styleClass), styleClass);
+ this.setFontStyle(elem, this.getFontStyle(styleClass), styleClass);
+ this.setFontSize(elem, this.getFontSize(styleClass), styleClass);
+ this.setFontWeight(elem, this.getFontWeight(styleClass), styleClass);
+ this.setLetterSpacing(elem, this.getLetterSpacing(styleClass), styleClass);
+ this.setWordSpacing(elem, this.getWordSpacing(styleClass), styleClass);
+ }
+
+ // register the corresponding handlers for each text element
+ elem.addMouseDownHandler(asHandler);
+ elem.addMouseUpHandler(asHandler);
+ elem.addFocusHandler(fsHandler);
+ elem.addBlurHandler(fsHandler);
+ elem.addMouseOutHandler(hsHandler);
+ elem.addMouseOverHandler(hsHandler);
+ }
+
+
// calls the super class's setGdlStyle and additionally calls local statements
// to fulfill the style settings
@Override
protected void setGdlStyle() throws InvalidGdlSchemaException, ExecutionException{
- super.setGdlStyle();
-
- // TODO: implement
- // text-type
- // readonly
- // rows
- // calls
- // resize
-
+ // the outer/container element
+ super.setDisplay(super.getDisplay());
+ super.setZindex(super.getZindex());
+ super.setFloat(super.getFloat());
+ super.setClear(super.getClear());
+
+ String[] styleClasses = new String[]{null, GdlPsis.Scope.gdlActive, GdlPsis.Scope.gdlFocus, GdlPsis.Scope.gdlHover};
+ for (String styleClass : styleClasses) {
+ super.setVerticalAlign(super.getVerticalAlign(styleClass), styleClass);
+ super.setOverflow(super.getOverflow(styleClass), styleClass);
+ super.setWidth(super.getWidth(styleClass), styleClass);
+ super.setMinWidth(super.getMinWidth(styleClass), styleClass);
+ super.setMaxWidth(super.getMaxWidth(styleClass), styleClass);
+ super.setHeight(super.getHeight(styleClass), styleClass);
+ super.setMinHeight(super.getMinHeight(styleClass), styleClass);
+ super.setMaxHeight(super.getMaxHeight(styleClass), styleClass);
+ }
+ }
+
+
+ // 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 String getStringValue() {
- // TODO Auto-generated method stub
- return null;
+ 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 Construct getTmValue() {
- // TODO Auto-generated method stub
- return null;
+ 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;
+ }
+
+
+ // 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());
+ }
+
+ return results;
}
+
@Override
- public TopicMapsTypes getTmType() {
+ public ArrayList<Pair<TopicMapsTypes, Object>> getTmValue() {
// TODO Auto-generated method stub
return null;
}
-
+
+
+ @Override
+ public boolean validate(){
+ // TODO: implement
+ return false;
+ }
+
+
+ // this class catches all keypress events and transforms the visible
+ // characters to *, whereas the actual characters are collected and requestable
+ // via the function getValue.
+ protected class PasswordKeyPressHandler implements KeyPressHandler {
+ String realValue = "";
+
+ @Override
+ public void onKeyPress(KeyPressEvent event) {
+ TextArea elem = (TextArea) event.getSource();
+ elem.cancelKey();
+ elem.setText(elem.getText() + "*");
+ realValue += (char)event.getCharCode() + "";
+ }
+
+
+ public String getValue(){
+ return this.realValue;
+ }
+ }
}
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 Mon Jul 4 23:59:48 2011 (r559)
+++ branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/text/GdlTextObject.java Tue Jul 5 09:41:31 2011 (r560)
@@ -354,7 +354,7 @@
for (String styleClass : styleClasses) {
this.setDirection(this.getDirection(styleClass), styleClass);
this.setTextAlign(this.getTextAlign(styleClass), styleClass);
- this.setTextAlign(this.getTextAlign(styleClass), styleClass);
+ this.setLineHeight(this.getLineHeight(styleClass), styleClass);
this.setTextDecoration(this.getTextDecoration(styleClass), styleClass);
this.setColor(this.getColor(styleClass), styleClass);
this.setFontFamily(this.getFontFamily(styleClass), styleClass);
Added: branches/gdl-frontend/src/anaToMia/GDL_Widgets/src/us/isidor/gdl/anaToMia/Widgets/values/ResizeValue.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/ResizeValue.java Tue Jul 5 09:41:31 2011 (r560)
@@ -0,0 +1,15 @@
+package us.isidor.gdl.anaToMia.Widgets.values;
+
+public enum ResizeValue implements CssValue {
+ BOTH,
+ VERTICAL,
+ HORIZONTAL,
+ NONE;
+
+
+ @Override
+ public String getCssValue() {
+ return this.toString().toLowerCase();
+ }
+
+}
More information about the Isidorus-cvs
mailing list