123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- /*
- @VaadinApache2LicenseForJavaFiles@
- */
-
- package com.vaadin.terminal.gwt.client;
-
- import com.vaadin.terminal.gwt.client.communication.SharedState;
-
- /**
- * Default shared state implementation for UI components.
- *
- * State classes of concrete components should extend this class.
- *
- * @since 7.0
- */
- public class ComponentState extends SharedState {
- private String height = "";
- private String width = "";
-
- /**
- * Returns the component height as set by the server.
- *
- * Can be relative (containing the percent sign) or absolute, or empty
- * string for undefined height.
- *
- * @return component height as defined by the server, not null
- */
- public String getHeight() {
- if (height == null) {
- return "";
- }
- return height;
- }
-
- /**
- * Sets the height of the component in the server format.
- *
- * Can be relative (containing the percent sign) or absolute, or null or
- * empty string for undefined height.
- *
- * @param height
- * component height
- */
- public void setHeight(String height) {
- this.height = height;
- }
-
- /**
- * Returns true if the component height is undefined, false if defined
- * (absolute or relative).
- *
- * @return true if component height is undefined
- */
- public boolean isUndefinedHeight() {
- return "".equals(getHeight());
- }
-
- /**
- * Returns the component width as set by the server.
- *
- * Can be relative (containing the percent sign) or absolute, or empty
- * string for undefined height.
- *
- * @return component width as defined by the server, not null
- */
- public String getWidth() {
- if (width == null) {
- return "";
- }
- return width;
- }
-
- /**
- * Sets the width of the component in the server format.
- *
- * Can be relative (containing the percent sign) or absolute, or null or
- * empty string for undefined width.
- *
- * @param width
- * component width
- */
- public void setWidth(String width) {
- this.width = width;
- }
-
- /**
- * Returns true if the component width is undefined, false if defined
- * (absolute or relative).
- *
- * @return true if component width is undefined
- */
- public boolean isUndefinedWidth() {
- return "".equals(getWidth());
- }
-
- // TODO more fields to move here: style, readonly, immediate, disabled,
- // caption and description
-
- }
|