use of com.servoy.j2db.persistence.CSSPosition in project servoy-client by Servoy.
the class JSCSSPosition method setLeft.
@JSSetter
public void setLeft(String left) {
CSSPosition position = component.getBaseComponent(true).getCssPosition();
if (position != null) {
position.left = left;
component.getBaseComponent(true).setCssPosition(position);
}
}
use of com.servoy.j2db.persistence.CSSPosition in project servoy-client by Servoy.
the class JSCSSPosition method l.
/**
* Set left css position (in pixels or percent).
*
* @param left left position in pixels or percentage
*
* @sample
* comp.cssPosition.l("10").t("10").w("20%").h("30px")
*
* @return css position
*/
@Override
@JSFunction
public ICSSPosition l(String left) {
CSSPosition position = component.getBaseComponent(true).getCssPosition();
if (position != null) {
position.left = left;
component.getBaseComponent(true).setCssPosition(position);
}
return this;
}
use of com.servoy.j2db.persistence.CSSPosition in project servoy-client by Servoy.
the class JSCSSPosition method r.
/**
* Set right css position (in pixels or percent).
*
* @param right right position in pixels or percentage
*
* @sample
* comp.cssPosition.r("10").b("10").w("20%").h("30px")
*
* @return css position
*/
@Override
@JSFunction
public ICSSPosition r(String right) {
CSSPosition position = component.getBaseComponent(true).getCssPosition();
if (position != null) {
position.right = right;
component.getBaseComponent(true).setCssPosition(position);
}
return this;
}
use of com.servoy.j2db.persistence.CSSPosition in project servoy-client by Servoy.
the class JSCSSPosition method w.
/**
* Set width css position (in pixels or percent).
*
* @param width width position in pixels or percentage
*
* @sample
* comp.cssPosition.l("10").t("10").w("20%").h("30px")
*
* @return css position
*/
@Override
@JSFunction
public ICSSPosition w(String width) {
CSSPosition position = component.getBaseComponent(true).getCssPosition();
if (position != null) {
position.width = width;
component.getBaseComponent(true).setCssPosition(position);
}
return this;
}
use of com.servoy.j2db.persistence.CSSPosition in project servoy-client by Servoy.
the class CSSPositionPropertyType method toDesignValue.
/*
* (non-Javadoc)
*
* @see com.servoy.j2db.persistence.IDesignValueConverter#toDesignValue(java.lang.Object, org.sablo.specification.PropertyDescription)
*/
@Override
public Object toDesignValue(Object javaValue, PropertyDescription pd) {
if (javaValue instanceof CSSPosition) {
CSSPosition cssPosition = (CSSPosition) javaValue;
JSONObject json = new JSONObject();
json.put("top", cssPosition.top);
json.put("left", cssPosition.left);
json.put("bottom", cssPosition.bottom);
json.put("right", cssPosition.right);
json.put("width", cssPosition.width);
json.put("height", cssPosition.height);
return json;
}
return javaValue;
}
Aggregations