use of com.servoy.j2db.persistence.CSSPosition in project servoy-client by Servoy.
the class JSCSSPosition method t.
/**
* Set top css position (in pixels or percent).
*
* @param top top position in pixels or percentage
*
* @sample
* comp.cssPosition.l("10").t("10").w("20%").h("30px")
*
* @return css position
*/
@Override
@JSFunction
public ICSSPosition t(String top) {
CSSPosition position = component.getBaseComponent(true).getCssPosition();
if (position != null) {
position.top = top;
component.getBaseComponent(true).setCssPosition(position);
}
return this;
}
use of com.servoy.j2db.persistence.CSSPosition in project servoy-client by Servoy.
the class PersistHelper method createCSSPosition.
public static CSSPosition createCSSPosition(String s) {
if (s == null)
return null;
String top = "-1";
String left = "-1";
String bottom = "-1";
String right = "-1";
String width = "-1";
String height = "-1";
try {
// $NON-NLS-1$
StringTokenizer tk = new StringTokenizer(s, ",");
if (tk.hasMoreTokens())
top = tk.nextToken();
if (tk.hasMoreTokens())
right = tk.nextToken();
if (tk.hasMoreTokens())
bottom = tk.nextToken();
if (tk.hasMoreTokens())
left = tk.nextToken();
if (tk.hasMoreTokens())
width = tk.nextToken();
if (tk.hasMoreTokens())
height = tk.nextToken();
} catch (Exception ex) {
Debug.error(ex);
return null;
}
return new CSSPosition(top, right, bottom, left, width, height);
}
use of com.servoy.j2db.persistence.CSSPosition in project servoy-client by Servoy.
the class JSCSSPosition method b.
/**
* Set bottom css position (in pixels or percent).
*
* @param bottom bottom position in pixels or percentage
*
* @sample
* comp.cssPosition.r("10").b("10").w("20%").h("30px")
*
* @return css position
*/
@Override
@JSFunction
public ICSSPosition b(String bottom) {
CSSPosition position = component.getBaseComponent(true).getCssPosition();
if (position != null) {
position.bottom = bottom;
component.getBaseComponent(true).setCssPosition(position);
}
return this;
}
use of com.servoy.j2db.persistence.CSSPosition in project servoy-client by Servoy.
the class JSCSSPosition method setBottom.
@JSSetter
public void setBottom(String bottom) {
CSSPosition position = component.getBaseComponent(true).getCssPosition();
if (position != null) {
position.bottom = bottom;
component.getBaseComponent(true).setCssPosition(position);
}
}
use of com.servoy.j2db.persistence.CSSPosition in project servoy-client by Servoy.
the class JSCSSPosition method h.
/**
* Set height css position (in pixels or percent).
*
* @param height height position in pixels or percentage
*
* @sample
* comp.cssPosition.l("10").t("10").w("20%").h("30px")
*
* @return css position
*/
@Override
@JSFunction
public ICSSPosition h(String height) {
CSSPosition position = component.getBaseComponent(true).getCssPosition();
if (position != null) {
position.height = height;
component.getBaseComponent(true).setCssPosition(position);
}
return this;
}
Aggregations