diff options
author | John Ahlroos <john@vaadin.com> | 2012-09-03 11:41:06 +0300 |
---|---|---|
committer | John Ahlroos <john@vaadin.com> | 2012-09-03 11:41:06 +0300 |
commit | 971b0684482dd3b7eb4efac09b9c24e1ea2b305d (patch) | |
tree | 6d6a4be640837500cfaa2f805a8602a9f4803871 /shared | |
parent | 340cd7899812b444941584d383d930fe8155159b (diff) | |
parent | f85c152a48686a8a0dca38ca12b4f3509cac056f (diff) | |
download | vaadin-framework-971b0684482dd3b7eb4efac09b9c24e1ea2b305d.tar.gz vaadin-framework-971b0684482dd3b7eb4efac09b9c24e1ea2b305d.zip |
Merge branch 'master' into layoutgraph
Conflicts:
shared/src/com/vaadin/shared/ComponentState.java
Diffstat (limited to 'shared')
25 files changed, 168 insertions, 1251 deletions
diff --git a/shared/src/com/vaadin/shared/AbstractFieldState.java b/shared/src/com/vaadin/shared/AbstractFieldState.java index 02cbd16a6f..37f8599bbf 100644 --- a/shared/src/com/vaadin/shared/AbstractFieldState.java +++ b/shared/src/com/vaadin/shared/AbstractFieldState.java @@ -24,128 +24,9 @@ import com.vaadin.shared.ui.TabIndexState; * @since 7.0.0 * */ -public class AbstractFieldState extends ComponentState implements TabIndexState { - private boolean propertyReadOnly = false; - private boolean hideErrors = false; - private boolean required = false; - private boolean modified = false; - - /** - * The tab order number of this field. - */ - private int tabIndex = 0; - - /** - * Checks if the property data source for the Field is in read only mode. - * This affects the read only state of the field itself. - * - * @return true if there is a property data source and it is set to read - * only, false otherwise - */ - public boolean isPropertyReadOnly() { - return propertyReadOnly; - } - - /** - * Sets the read only state of the property data source. - * - * @param propertyReadOnly - * true if the property data source if read only, false otherwise - */ - public void setPropertyReadOnly(boolean propertyReadOnly) { - this.propertyReadOnly = propertyReadOnly; - } - - /** - * Returns true if the component will hide any errors even if the error - * message is set. - * - * @return true if error messages are disabled - */ - public boolean isHideErrors() { - return hideErrors; - } - - /** - * Sets whether the component should hide any errors even if the error - * message is set. - * - * This is used e.g. on forms to hide error messages for invalid fields - * before the first user actions. - * - * @param hideErrors - * true if error messages should be hidden - */ - public void setHideErrors(boolean hideErrors) { - this.hideErrors = hideErrors; - } - - /** - * Is the field required. Required fields must filled by the user. - * - * See {@link com.vaadin.ui.AbstractField#isRequired()} for more - * information. - * - * @return <code>true</code> if the field is required, otherwise - * <code>false</code>. - */ - public boolean isRequired() { - return required; - } - - /** - * Sets the field required. Required fields must filled by the user. - * - * See {@link com.vaadin.ui.AbstractField#setRequired(boolean)} for more - * information. - * - * @param required - * Is the field required. - */ - public void setRequired(boolean required) { - this.required = required; - } - - /** - * Has the contents of the field been modified, i.e. has the value been - * updated after it was read from the data source. - * - * @return true if the field has been modified, false otherwise - */ - public boolean isModified() { - return modified; - } - - /** - * Setter for the modified flag, toggled when the contents of the field is - * modified by the user. - * - * @param modified - * the new modified state - * - */ - public void setModified(boolean modified) { - this.modified = modified; - } - - /* - * (non-Javadoc) - * - * @see com.vaadin.client.ComponentState#getTabIndex() - */ - @Override - public int getTabIndex() { - return tabIndex; - } - - /* - * (non-Javadoc) - * - * @see com.vaadin.client.ui.TabIndexState#setTabIndex(int) - */ - @Override - public void setTabIndex(int tabIndex) { - this.tabIndex = tabIndex; - } - +public class AbstractFieldState extends TabIndexState { + public boolean propertyReadOnly = false; + public boolean hideErrors = false; + public boolean required = false; + public boolean modified = false; } diff --git a/shared/src/com/vaadin/shared/ComponentState.java b/shared/src/com/vaadin/shared/ComponentState.java index 06330a8604..86ae042f79 100644 --- a/shared/src/com/vaadin/shared/ComponentState.java +++ b/shared/src/com/vaadin/shared/ComponentState.java @@ -1,4 +1,4 @@ -/* +/* * Copyright 2011 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not @@ -16,7 +16,6 @@ package com.vaadin.shared; -import java.util.HashSet; import java.util.List; import java.util.Set; @@ -30,374 +29,25 @@ import com.vaadin.shared.communication.SharedState; * @since 7.0 */ public class ComponentState extends SharedState { - private String height = ""; - private String width = ""; - private boolean readOnly = false; - private boolean immediate = false; - private String description = ""; + public String height = ""; + public String width = ""; + public boolean readOnly = false; + public boolean immediate = false; + public String description = ""; // Note: for the caption, there is a difference between null and an empty // string! - private String caption = null; - private boolean visible = true; - private List<String> styles = null; - private String id = null; + public String caption = null; + public boolean visible = true; + public List<String> styles = null; + public String id = null; /** * A set of event identifiers with registered listeners. */ - private Set<String> registeredEventListeners = null; + public Set<String> registeredEventListeners = null; // HTML formatted error message for the component // TODO this could be an object with more information, but currently the UI // only uses the message - private String errorMessage = null; - - /** - * 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 true if the component height is relative to the parent, i.e. - * percentage, false if it is fixed/auto. - * - * @return true if component height is relative (percentage) - */ - public boolean isRelativeHeight() { - return getHeight().endsWith("%"); - } - - /** - * 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()); - } - - /** - * Returns true if the component width is relative to the parent, i.e. - * percentage, false if it is fixed/auto. - * - * @return true if component width is relative (percentage) - */ - public boolean isRelativeWidth() { - return getWidth().endsWith("%"); - } - - /** - * Returns true if the component is in read-only mode. - * - * @see com.vaadin.ui.Component#isReadOnly() - * - * @return true if the component is in read-only mode - */ - public boolean isReadOnly() { - return readOnly; - } - - /** - * Sets or resets the read-only mode for a component. - * - * @see com.vaadin.ui.Component#setReadOnly() - * - * @param readOnly - * new mode for the component - */ - public void setReadOnly(boolean readOnly) { - this.readOnly = readOnly; - } - - /** - * Returns true if the component is in immediate mode. - * - * @see com.vaadin.server.VariableOwner#isImmediate() - * - * @return true if the component is in immediate mode - */ - public boolean isImmediate() { - return immediate; - } - - /** - * Sets or resets the immediate mode for a component. - * - * @see com.vaadin.server.VariableOwner#setImmediate() - * - * @param immediate - * new mode for the component - */ - public void setImmediate(boolean immediate) { - this.immediate = immediate; - } - - /** - * Returns true if the component has user-defined styles. - * - * @return true if the component has user-defined styles - */ - public boolean hasStyles() { - return styles != null && !styles.isEmpty(); - } - - /** - * Gets the description of the component (typically shown as tooltip). - * - * @see com.vaadin.ui.AbstractComponent#getDescription() - * - * @return component description (not null, can be empty string) - */ - public String getDescription() { - return description; - } - - /** - * Sets the description of the component (typically shown as tooltip). - * - * @see com.vaadin.ui.AbstractComponent#setDescription(String) - * - * @param description - * new component description (can be null) - */ - public void setDescription(String description) { - this.description = description; - } - - /** - * Returns true if the component has a description. - * - * @return true if the component has a description - */ - public boolean hasDescription() { - return getDescription() != null && !"".equals(getDescription()); - } - - /** - * Gets the caption of the component (typically shown by the containing - * layout). - * - * @see com.vaadin.ui.Component#getCaption() - * - * @return component caption - can be null (no caption) or empty string - * (reserve space for an empty caption) - */ - public String getCaption() { - return caption; - } - - /** - * Sets the caption of the component (typically shown by the containing - * layout). - * - * @see com.vaadin.ui.Component#setCaption(String) - * - * @param caption - * new component caption - can be null (no caption) or empty - * string (reserve space for an empty caption) - */ - public void setCaption(String caption) { - this.caption = caption; - } - - /** - * Returns the visibility state of the component. Note that this state is - * related to the component only, not its parent. This might differ from - * what {@link com.vaadin.ui.Component#isVisible()} returns as this takes - * the hierarchy into account. - * - * @return The visibility state. - */ - public boolean isVisible() { - return visible; - } - - /** - * Sets the visibility state of the component. - * - * @param visible - * The new visibility state. - */ - public void setVisible(boolean visible) { - this.visible = visible; - } - - /** - * Gets the style names for the component. - * - * @return A List of style names or null if no styles have been set. - */ - public List<String> getStyles() { - return styles; - } - - /** - * Sets the style names for the component. - * - * @param styles - * A list containing style names - */ - public void setStyles(List<String> styles) { - this.styles = styles; - } - - /** - * Gets the id for the component. The id is added as DOM id for the - * component. - * - * @return The id for the component or null if not set - */ - public String getId() { - return id; - } - - /** - * Sets the id for the component. The id is added as DOM id for the - * component. - * - * @param id - * The new id for the component or null for no id - * - */ - public void setId(String id) { - this.id = id; - } - - /** - * Gets the identifiers for the event listeners that have been registered - * for the component (using an event id) - * - * @return A set of event identifiers or null if no identifiers have been - * registered - */ - public Set<String> getRegisteredEventListeners() { - return registeredEventListeners; - } - - /** - * Sets the identifiers for the event listeners that have been registered - * for the component (using an event id) - * - * @param registeredEventListeners - * The new set of identifiers or null if no identifiers have been - * registered - */ - public void setRegisteredEventListeners(Set<String> registeredEventListeners) { - this.registeredEventListeners = registeredEventListeners; - } - - /** - * Adds an event listener id. - * - * @param eventListenerId - * The event identifier to add - */ - public void addRegisteredEventListener(String eventListenerId) { - if (registeredEventListeners == null) { - registeredEventListeners = new HashSet<String>(); - } - registeredEventListeners.add(eventListenerId); - - } - - /** - * Removes an event listener id. - * - * @param eventListenerId - * The event identifier to remove - */ - public void removeRegisteredEventListener(String eventIdentifier) { - if (registeredEventListeners == null) { - return; - } - registeredEventListeners.remove(eventIdentifier); - if (registeredEventListeners.size() == 0) { - registeredEventListeners = null; - } - } - - /** - * Returns the current error message for the component. - * - * @return HTML formatted error message to show for the component or null if - * none - */ - public String getErrorMessage() { - return errorMessage; - } - - /** - * Sets the current error message for the component. - * - * TODO this could use an object with more details about the error - * - * @param errorMessage - * HTML formatted error message to show for the component or null - * for none - */ - public void setErrorMessage(String errorMessage) { - this.errorMessage = errorMessage; - } - + public String errorMessage = null; } + diff --git a/shared/src/com/vaadin/shared/JavaScriptExtensionState.java b/shared/src/com/vaadin/shared/JavaScriptExtensionState.java index 3e97294f7d..fb864c6ee1 100644 --- a/shared/src/com/vaadin/shared/JavaScriptExtensionState.java +++ b/shared/src/com/vaadin/shared/JavaScriptExtensionState.java @@ -1,4 +1,4 @@ -/* +/* * Copyright 2011 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not diff --git a/shared/src/com/vaadin/shared/communication/SharedState.java b/shared/src/com/vaadin/shared/communication/SharedState.java index 09147ac97d..4473eba7a0 100644 --- a/shared/src/com/vaadin/shared/communication/SharedState.java +++ b/shared/src/com/vaadin/shared/communication/SharedState.java @@ -59,29 +59,5 @@ public class SharedState implements Serializable { */ public Map<String, URLReference> resources = new HashMap<String, URLReference>(); - private boolean enabled = true; - - /** - * Returns true if the component is enabled. - * - * @see com.vaadin.ui.Component#isEnabled() - * - * @return true if the component is enabled - */ - public boolean isEnabled() { - return enabled; - } - - /** - * Enables or disables the component. - * - * @see com.vaadin.ui.Component#setEnabled(boolean) - * - * @param enabled - * new mode for the component - */ - public void setEnabled(boolean enabled) { - this.enabled = enabled; - } - + public boolean enabled = true; } diff --git a/shared/src/com/vaadin/shared/extension/javascriptmanager/JavaScriptManagerState.java b/shared/src/com/vaadin/shared/extension/javascriptmanager/JavaScriptManagerState.java index 7d1938d735..71af5e9598 100644 --- a/shared/src/com/vaadin/shared/extension/javascriptmanager/JavaScriptManagerState.java +++ b/shared/src/com/vaadin/shared/extension/javascriptmanager/JavaScriptManagerState.java @@ -1,4 +1,4 @@ -/* +/* * Copyright 2011 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not @@ -22,13 +22,5 @@ import java.util.Set; import com.vaadin.shared.communication.SharedState; public class JavaScriptManagerState extends SharedState { - private Set<String> names = new HashSet<String>(); - - public Set<String> getNames() { - return names; - } - - public void setNames(Set<String> names) { - this.names = names; - } + public Set<String> names = new HashSet<String>(); } diff --git a/shared/src/com/vaadin/shared/ui/AbstractEmbeddedState.java b/shared/src/com/vaadin/shared/ui/AbstractEmbeddedState.java index 6422b643ad..608152cc54 100644 --- a/shared/src/com/vaadin/shared/ui/AbstractEmbeddedState.java +++ b/shared/src/com/vaadin/shared/ui/AbstractEmbeddedState.java @@ -6,14 +6,5 @@ public class AbstractEmbeddedState extends ComponentState { public static final String SOURCE_RESOURCE = "source"; - private String alternateText; - - public String getAlternateText() { - return alternateText; - } - - public void setAlternateText(String alternateText) { - this.alternateText = alternateText; - } - + public String alternateText; } diff --git a/shared/src/com/vaadin/shared/ui/AbstractMediaState.java b/shared/src/com/vaadin/shared/ui/AbstractMediaState.java index 80d41dd797..76d4e1b000 100644 --- a/shared/src/com/vaadin/shared/ui/AbstractMediaState.java +++ b/shared/src/com/vaadin/shared/ui/AbstractMediaState.java @@ -19,80 +19,20 @@ import java.util.ArrayList; import java.util.List; import com.vaadin.shared.ComponentState; -import com.vaadin.shared.annotations.DelegateToWidget; import com.vaadin.shared.communication.URLReference; public class AbstractMediaState extends ComponentState { - private boolean showControls; + public boolean showControls; - private String altText; + public String altText; - private boolean htmlContentAllowed; + public boolean htmlContentAllowed; - private boolean autoplay; + public boolean autoplay; - private boolean muted; + public boolean muted; - private List<URLReference> sources = new ArrayList<URLReference>(); - private List<String> sourceTypes = new ArrayList<String>(); - - public boolean isShowControls() { - return showControls; - } - - @DelegateToWidget("setControls") - public void setShowControls(boolean showControls) { - this.showControls = showControls; - } - - public String getAltText() { - return altText; - } - - public void setAltText(String altText) { - this.altText = altText; - } - - public boolean isHtmlContentAllowed() { - return htmlContentAllowed; - } - - public void setHtmlContentAllowed(boolean htmlContentAllowed) { - this.htmlContentAllowed = htmlContentAllowed; - } - - public boolean isAutoplay() { - return autoplay; - } - - @DelegateToWidget - public void setAutoplay(boolean autoplay) { - this.autoplay = autoplay; - } - - public boolean isMuted() { - return muted; - } - - @DelegateToWidget - public void setMuted(boolean muted) { - this.muted = muted; - } - - public List<URLReference> getSources() { - return sources; - } - - public void setSources(List<URLReference> sources) { - this.sources = sources; - } - - public List<String> getSourceTypes() { - return sourceTypes; - } - - public void setSourceTypes(List<String> sourceTypes) { - this.sourceTypes = sourceTypes; - } + public List<URLReference> sources = new ArrayList<URLReference>(); + public List<String> sourceTypes = new ArrayList<String>(); } diff --git a/shared/src/com/vaadin/shared/ui/ComponentStateUtil.java b/shared/src/com/vaadin/shared/ui/ComponentStateUtil.java new file mode 100644 index 0000000000..dd2611f04b --- /dev/null +++ b/shared/src/com/vaadin/shared/ui/ComponentStateUtil.java @@ -0,0 +1,60 @@ +package com.vaadin.shared.ui; + +import java.util.HashSet; + +import com.vaadin.shared.ComponentState; + +public final class ComponentStateUtil { + + private ComponentStateUtil() { + // Util class is not instantiable + } + + public static final boolean isUndefinedWidth(ComponentState state) { + return state.width == null || "".equals(state.width); + } + + public static final boolean isUndefinedHeight(ComponentState state) { + return state.height == null || "".equals(state.height); + } + + public static final boolean hasDescription(ComponentState state) { + return state.description != null && !"".equals(state.description); + } + + public static final boolean hasStyles(ComponentState state) { + return state.styles != null && !state.styles.isEmpty(); + } + + /** + * Removes an event listener id. + * + * @param eventListenerId + * The event identifier to remove + */ + public static final void removeRegisteredEventListener( + ComponentState state, + String eventIdentifier) { + if (state.registeredEventListeners == null) { + return; + } + state.registeredEventListeners.remove(eventIdentifier); + if (state.registeredEventListeners.size() == 0) { + state.registeredEventListeners = null; + } + } + + /** + * Adds an event listener id. + * + * @param eventListenerId + * The event identifier to add + */ + public static final void addRegisteredEventListener(ComponentState state, + String eventListenerId) { + if (state.registeredEventListeners == null) { + state.registeredEventListeners = new HashSet<String>(); + } + state.registeredEventListeners.add(eventListenerId); + } +} diff --git a/shared/src/com/vaadin/shared/ui/TabIndexState.java b/shared/src/com/vaadin/shared/ui/TabIndexState.java index 5f17b9b016..a9cb56e5ed 100644 --- a/shared/src/com/vaadin/shared/ui/TabIndexState.java +++ b/shared/src/com/vaadin/shared/ui/TabIndexState.java @@ -15,6 +15,8 @@ */ package com.vaadin.shared.ui; +import com.vaadin.shared.ComponentState; + /** * Interface implemented by state classes that support tab indexes. * @@ -22,19 +24,11 @@ package com.vaadin.shared.ui; * @since 7.0.0 * */ -public interface TabIndexState { - /** - * Gets the <i>tabulator index</i> of the field. - * - * @return the tab index for the Field - */ - public int getTabIndex(); +public class TabIndexState extends ComponentState { /** - * Sets the <i>tabulator index</i> of the field. - * - * @param tabIndex - * the tab index to set + * The <i>tabulator index</i> of the field. */ - public void setTabIndex(int tabIndex); + public int tabIndex = 0; + } diff --git a/shared/src/com/vaadin/shared/ui/absolutelayout/AbsoluteLayoutState.java b/shared/src/com/vaadin/shared/ui/absolutelayout/AbsoluteLayoutState.java index a0e0f4d3c7..283e827e6e 100644 --- a/shared/src/com/vaadin/shared/ui/absolutelayout/AbsoluteLayoutState.java +++ b/shared/src/com/vaadin/shared/ui/absolutelayout/AbsoluteLayoutState.java @@ -1,4 +1,4 @@ -/* +/* * Copyright 2011 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not @@ -18,24 +18,9 @@ package com.vaadin.shared.ui.absolutelayout; import java.util.HashMap; import java.util.Map; -import com.vaadin.shared.Connector; import com.vaadin.shared.ui.AbstractLayoutState; public class AbsoluteLayoutState extends AbstractLayoutState { // Maps each component to a position - private Map<String, String> connectorToCssPosition = new HashMap<String, String>(); - - public String getConnectorPosition(Connector connector) { - return connectorToCssPosition.get(connector.getConnectorId()); - } - - public Map<String, String> getConnectorToCssPosition() { - return connectorToCssPosition; - } - - public void setConnectorToCssPosition( - Map<String, String> componentToCssPosition) { - connectorToCssPosition = componentToCssPosition; - } - + public Map<String, String> connectorToCssPosition = new HashMap<String, String>(); }
\ No newline at end of file diff --git a/shared/src/com/vaadin/shared/ui/button/ButtonState.java b/shared/src/com/vaadin/shared/ui/button/ButtonState.java index 2383b038bd..c144a8124f 100644 --- a/shared/src/com/vaadin/shared/ui/button/ButtonState.java +++ b/shared/src/com/vaadin/shared/ui/button/ButtonState.java @@ -27,108 +27,11 @@ import com.vaadin.shared.ui.TabIndexState; * * @since 7.0 */ -public class ButtonState extends ComponentState implements TabIndexState { - private boolean disableOnClick = false; - private int clickShortcutKeyCode = 0; - /** - * The tab order number of this field. - */ - private int tabIndex = 0; +public class ButtonState extends TabIndexState { + public boolean disableOnClick = false; + public int clickShortcutKeyCode = 0; /** * If caption should be rendered in HTML */ - private boolean htmlContentAllowed = false; - - /** - * Checks whether the button should be disabled on the client side on next - * click. - * - * @return true if the button should be disabled on click - */ - public boolean isDisableOnClick() { - return disableOnClick; - } - - /** - * Sets whether the button should be disabled on the client side on next - * click. - * - * @param disableOnClick - * true if the button should be disabled on click - */ - public void setDisableOnClick(boolean disableOnClick) { - this.disableOnClick = disableOnClick; - } - - /** - * Returns the key code for activating the button via a keyboard shortcut. - * - * See {@link com.vaadin.ui.Button#setClickShortcut(int, int...)} for more - * information. - * - * @return key code or 0 for none - */ - public int getClickShortcutKeyCode() { - return clickShortcutKeyCode; - } - - /** - * Sets the key code for activating the button via a keyboard shortcut. - * - * See {@link com.vaadin.ui.Button#setClickShortcut(int, int...)} for more - * information. - * - * @param clickShortcutKeyCode - * key code or 0 for none - */ - public void setClickShortcutKeyCode(int clickShortcutKeyCode) { - this.clickShortcutKeyCode = clickShortcutKeyCode; - } - - /** - * Set whether the caption text is rendered as HTML or not. You might need - * to retheme button to allow higher content than the original text style. - * - * If set to true, the captions are passed to the browser as html and the - * developer is responsible for ensuring no harmful html is used. If set to - * false, the content is passed to the browser as plain text. - * - * @param htmlContentAllowed - * <code>true</code> if caption is rendered as HTML, - * <code>false</code> otherwise - */ - public void setHtmlContentAllowed(boolean htmlContentAllowed) { - this.htmlContentAllowed = htmlContentAllowed; - } - - /** - * Return HTML rendering setting. - * - * @return <code>true</code> if the caption text is to be rendered as HTML, - * <code>false</code> otherwise - */ - public boolean isHtmlContentAllowed() { - return htmlContentAllowed; - } - - /* - * (non-Javadoc) - * - * @see com.vaadin.client.ui.TabIndexState#getTabIndex() - */ - @Override - public int getTabIndex() { - return tabIndex; - } - - /* - * (non-Javadoc) - * - * @see com.vaadin.client.ui.TabIndexState#setTabIndex(int) - */ - @Override - public void setTabIndex(int tabIndex) { - this.tabIndex = tabIndex; - } - + public boolean htmlContentAllowed = false; } diff --git a/shared/src/com/vaadin/shared/ui/checkbox/CheckBoxState.java b/shared/src/com/vaadin/shared/ui/checkbox/CheckBoxState.java index 1f48b8fe9e..b89270bee2 100644 --- a/shared/src/com/vaadin/shared/ui/checkbox/CheckBoxState.java +++ b/shared/src/com/vaadin/shared/ui/checkbox/CheckBoxState.java @@ -1,4 +1,4 @@ -/* +/* * Copyright 2011 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not @@ -18,14 +18,6 @@ package com.vaadin.shared.ui.checkbox; import com.vaadin.shared.AbstractFieldState; public class CheckBoxState extends AbstractFieldState { - private boolean checked = false; - - public boolean isChecked() { - return checked; - } - - public void setChecked(boolean checked) { - this.checked = checked; - } + public boolean checked = false; }
\ No newline at end of file diff --git a/shared/src/com/vaadin/shared/ui/csslayout/CssLayoutState.java b/shared/src/com/vaadin/shared/ui/csslayout/CssLayoutState.java index fc230a8e2f..2fbc42ca0f 100644 --- a/shared/src/com/vaadin/shared/ui/csslayout/CssLayoutState.java +++ b/shared/src/com/vaadin/shared/ui/csslayout/CssLayoutState.java @@ -1,4 +1,4 @@ -/* +/* * Copyright 2011 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not @@ -22,14 +22,5 @@ import com.vaadin.shared.Connector; import com.vaadin.shared.ui.AbstractLayoutState; public class CssLayoutState extends AbstractLayoutState { - private Map<Connector, String> childCss = new HashMap<Connector, String>(); - - public Map<Connector, String> getChildCss() { - return childCss; - } - - public void setChildCss(Map<Connector, String> childCss) { - this.childCss = childCss; - } - + public Map<Connector, String> childCss = new HashMap<Connector, String>(); }
\ No newline at end of file diff --git a/shared/src/com/vaadin/shared/ui/customlayout/CustomLayoutState.java b/shared/src/com/vaadin/shared/ui/customlayout/CustomLayoutState.java index 0c1aa24161..e77ea5c068 100644 --- a/shared/src/com/vaadin/shared/ui/customlayout/CustomLayoutState.java +++ b/shared/src/com/vaadin/shared/ui/customlayout/CustomLayoutState.java @@ -1,4 +1,4 @@ -/* +/* * Copyright 2011 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not @@ -22,32 +22,7 @@ import com.vaadin.shared.Connector; import com.vaadin.shared.ui.AbstractLayoutState; public class CustomLayoutState extends AbstractLayoutState { - Map<Connector, String> childLocations = new HashMap<Connector, String>(); - private String templateContents; - private String templateName; - - public String getTemplateContents() { - return templateContents; - } - - public void setTemplateContents(String templateContents) { - this.templateContents = templateContents; - } - - public String getTemplateName() { - return templateName; - } - - public void setTemplateName(String templateName) { - this.templateName = templateName; - } - - public Map<Connector, String> getChildLocations() { - return childLocations; - } - - public void setChildLocations(Map<Connector, String> childLocations) { - this.childLocations = childLocations; - } - + public Map<Connector, String> childLocations = new HashMap<Connector, String>(); + public String templateContents; + public String templateName; }
\ No newline at end of file diff --git a/shared/src/com/vaadin/shared/ui/flash/FlashState.java b/shared/src/com/vaadin/shared/ui/flash/FlashState.java index 2d33d1a711..50f0d63733 100644 --- a/shared/src/com/vaadin/shared/ui/flash/FlashState.java +++ b/shared/src/com/vaadin/shared/ui/flash/FlashState.java @@ -6,63 +6,15 @@ import com.vaadin.shared.ui.AbstractEmbeddedState; public class FlashState extends AbstractEmbeddedState { - protected String classId; + public String classId; - protected String codebase; + public String codebase; - protected String codetype; + public String codetype; - protected String archive; + public String archive; - protected String standby; + public String standby; - protected Map<String, String> embedParams; - - public String getClassId() { - return classId; - } - - public void setClassId(String classId) { - this.classId = classId; - } - - public String getCodebase() { - return codebase; - } - - public void setCodebase(String codeBase) { - codebase = codebase; - } - - public String getCodetype() { - return codetype; - } - - public void setCodetype(String codetype) { - this.codetype = codetype; - } - - public String getArchive() { - return archive; - } - - public void setArchive(String archive) { - this.archive = archive; - } - - public String getStandby() { - return standby; - } - - public void setStandby(String standby) { - this.standby = standby; - } - - public Map<String, String> getEmbedParams() { - return embedParams; - } - - public void setEmbedParams(Map<String, String> embedParams) { - this.embedParams = embedParams; - } + public Map<String, String> embedParams; } diff --git a/shared/src/com/vaadin/shared/ui/form/FormState.java b/shared/src/com/vaadin/shared/ui/form/FormState.java index 7e8b36707a..f0e79ad38f 100644 --- a/shared/src/com/vaadin/shared/ui/form/FormState.java +++ b/shared/src/com/vaadin/shared/ui/form/FormState.java @@ -1,4 +1,4 @@ -/* +/* * Copyright 2011 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not @@ -19,23 +19,6 @@ import com.vaadin.shared.AbstractFieldState; import com.vaadin.shared.Connector; public class FormState extends AbstractFieldState { - private Connector layout; - private Connector footer; - - public Connector getLayout() { - return layout; - } - - public void setLayout(Connector layout) { - this.layout = layout; - } - - public Connector getFooter() { - return footer; - } - - public void setFooter(Connector footer) { - this.footer = footer; - } - + public Connector layout; + public Connector footer; }
\ No newline at end of file diff --git a/shared/src/com/vaadin/shared/ui/gridlayout/GridLayoutState.java b/shared/src/com/vaadin/shared/ui/gridlayout/GridLayoutState.java index 381a6a7f85..ae54dc3765 100644 --- a/shared/src/com/vaadin/shared/ui/gridlayout/GridLayoutState.java +++ b/shared/src/com/vaadin/shared/ui/gridlayout/GridLayoutState.java @@ -1,4 +1,4 @@ -/* +/* * Copyright 2011 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not @@ -18,41 +18,8 @@ package com.vaadin.shared.ui.gridlayout; import com.vaadin.shared.ui.AbstractLayoutState; public class GridLayoutState extends AbstractLayoutState { - private boolean spacing = false; - private int rows = 0; - private int columns = 0; - private int marginsBitmask = 0; - - public boolean isSpacing() { - return spacing; - } - - public void setSpacing(boolean spacing) { - this.spacing = spacing; - } - - public int getMarginsBitmask() { - return marginsBitmask; - } - - public void setMarginsBitmask(int marginsBitmask) { - this.marginsBitmask = marginsBitmask; - } - - public int getRows() { - return rows; - } - - public void setRows(int rows) { - this.rows = rows; - } - - public int getColumns() { - return columns; - } - - public void setColumns(int cols) { - columns = cols; - } - + public boolean spacing = false; + public int rows = 0; + public int columns = 0; + public int marginsBitmask = 0; }
\ No newline at end of file diff --git a/shared/src/com/vaadin/shared/ui/orderedlayout/AbstractOrderedLayoutState.java b/shared/src/com/vaadin/shared/ui/orderedlayout/AbstractOrderedLayoutState.java index 35456ab9ac..27ab6ac8e0 100644 --- a/shared/src/com/vaadin/shared/ui/orderedlayout/AbstractOrderedLayoutState.java +++ b/shared/src/com/vaadin/shared/ui/orderedlayout/AbstractOrderedLayoutState.java @@ -1,4 +1,4 @@ -/* +/* * Copyright 2011 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not @@ -23,56 +23,16 @@ import com.vaadin.shared.ui.AbstractLayoutState; import com.vaadin.shared.ui.AlignmentInfo; public class AbstractOrderedLayoutState extends AbstractLayoutState { - private boolean spacing = false; + public boolean spacing = false; - private HashMap<Connector, ChildComponentData> childData = new HashMap<Connector, ChildComponentData>(); + public HashMap<Connector, ChildComponentData> childData = new HashMap<Connector, ChildComponentData>(); - private int marginsBitmask = 0; + public int marginsBitmask = 0; public static class ChildComponentData implements Serializable { - private int alignmentBitmask = AlignmentInfo.TOP_LEFT.getBitMask(); - private float expandRatio = 0.0f; - public int getAlignmentBitmask() { - return alignmentBitmask; - } + public int alignmentBitmask = AlignmentInfo.TOP_LEFT.getBitMask(); - public void setAlignmentBitmask(int alignmentBitmask) { - this.alignmentBitmask = alignmentBitmask; - } - - public float getExpandRatio() { - return expandRatio; - } - - public void setExpandRatio(float expandRatio) { - this.expandRatio = expandRatio; - } - - } - - public HashMap<Connector, ChildComponentData> getChildData() { - return childData; - } - - public void setChildData(HashMap<Connector, ChildComponentData> childData) { - this.childData = childData; - } - - public boolean isSpacing() { - return spacing; - } - - public void setSpacing(boolean spacing) { - this.spacing = spacing; - } - - public int getMarginsBitmask() { - return marginsBitmask; - } - - public void setMarginsBitmask(int marginsBitmask) { - this.marginsBitmask = marginsBitmask; + public float expandRatio = 0.0f; } - }
\ No newline at end of file diff --git a/shared/src/com/vaadin/shared/ui/panel/PanelState.java b/shared/src/com/vaadin/shared/ui/panel/PanelState.java index d432de97ad..878b921d55 100644 --- a/shared/src/com/vaadin/shared/ui/panel/PanelState.java +++ b/shared/src/com/vaadin/shared/ui/panel/PanelState.java @@ -1,4 +1,4 @@ -/* +/* * Copyright 2011 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not @@ -18,31 +18,6 @@ package com.vaadin.shared.ui.panel; import com.vaadin.shared.ComponentState; public class PanelState extends ComponentState { - private int tabIndex; - private int scrollLeft, scrollTop; - - public int getTabIndex() { - return tabIndex; - } - - public void setTabIndex(int tabIndex) { - this.tabIndex = tabIndex; - } - - public int getScrollLeft() { - return scrollLeft; - } - - public void setScrollLeft(int scrollLeft) { - this.scrollLeft = scrollLeft; - } - - public int getScrollTop() { - return scrollTop; - } - - public void setScrollTop(int scrollTop) { - this.scrollTop = scrollTop; - } - + public int tabIndex; + public int scrollLeft, scrollTop; }
\ No newline at end of file diff --git a/shared/src/com/vaadin/shared/ui/slider/SliderState.java b/shared/src/com/vaadin/shared/ui/slider/SliderState.java index 98168b80af..7236672b31 100644 --- a/shared/src/com/vaadin/shared/ui/slider/SliderState.java +++ b/shared/src/com/vaadin/shared/ui/slider/SliderState.java @@ -4,57 +4,17 @@ import com.vaadin.shared.AbstractFieldState; public class SliderState extends AbstractFieldState { - protected double value; + public double value; - protected double maxValue; - protected double minValue; + public double maxValue; + public double minValue; /** * The number of fractional digits that are considered significant. Must be * non-negative. */ - protected int resolution; + public int resolution; - protected SliderOrientation orientation; - - public double getValue() { - return value; - } - - public void setValue(double value) { - this.value = value; - } - - public double getMaxValue() { - return maxValue; - } - - public void setMaxValue(double maxValue) { - this.maxValue = maxValue; - } - - public double getMinValue() { - return minValue; - } - - public void setMinValue(double minValue) { - this.minValue = minValue; - } - - public int getResolution() { - return resolution; - } - - public void setResolution(int resolution) { - this.resolution = resolution; - } - - public SliderOrientation getOrientation() { - return orientation; - } - - public void setOrientation(SliderOrientation orientation) { - this.orientation = orientation; - } + public SliderOrientation orientation; } diff --git a/shared/src/com/vaadin/shared/ui/splitpanel/AbstractSplitPanelState.java b/shared/src/com/vaadin/shared/ui/splitpanel/AbstractSplitPanelState.java index 71f789b70d..41c51f998a 100644 --- a/shared/src/com/vaadin/shared/ui/splitpanel/AbstractSplitPanelState.java +++ b/shared/src/com/vaadin/shared/ui/splitpanel/AbstractSplitPanelState.java @@ -1,4 +1,4 @@ -/* +/* * Copyright 2011 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not @@ -23,117 +23,22 @@ import com.vaadin.shared.annotations.DelegateToWidget; public class AbstractSplitPanelState extends ComponentState { - private Connector firstChild = null; - private Connector secondChild = null; - private SplitterState splitterState = new SplitterState(); - - public boolean hasFirstChild() { - return firstChild != null; - } - - public boolean hasSecondChild() { - return secondChild != null; - } - - public Connector getFirstChild() { - return firstChild; - } - - public void setFirstChild(Connector firstChild) { - this.firstChild = firstChild; - } - - public Connector getSecondChild() { - return secondChild; - } - - public void setSecondChild(Connector secondChild) { - this.secondChild = secondChild; - } - - public SplitterState getSplitterState() { - return splitterState; - } - - public void setSplitterState(SplitterState splitterState) { - this.splitterState = splitterState; - } + public Connector firstChild = null; + public Connector secondChild = null; + public SplitterState splitterState = new SplitterState(); public static class SplitterState implements Serializable { - private float position; - private String positionUnit; - private float minPosition; - private String minPositionUnit; - private float maxPosition; - private String maxPositionUnit; - private boolean positionReversed = false; - private boolean locked = false; - - public float getPosition() { - return position; - } - - public void setPosition(float position) { - this.position = position; - } - - public String getPositionUnit() { - return positionUnit; - } - - public void setPositionUnit(String positionUnit) { - this.positionUnit = positionUnit; - } - - public float getMinPosition() { - return minPosition; - } - - public void setMinPosition(float minPosition) { - this.minPosition = minPosition; - } - - public String getMinPositionUnit() { - return minPositionUnit; - } - - public void setMinPositionUnit(String minPositionUnit) { - this.minPositionUnit = minPositionUnit; - } - - public float getMaxPosition() { - return maxPosition; - } - - public void setMaxPosition(float maxPosition) { - this.maxPosition = maxPosition; - } - - public String getMaxPositionUnit() { - return maxPositionUnit; - } - - public void setMaxPositionUnit(String maxPositionUnit) { - this.maxPositionUnit = maxPositionUnit; - } - - public boolean isPositionReversed() { - return positionReversed; - } - + public float position; + public String positionUnit; + public float minPosition; + public String minPositionUnit; + public float maxPosition; + public String maxPositionUnit; + @DelegateToWidget - public void setPositionReversed(boolean positionReversed) { - this.positionReversed = positionReversed; - } - - public boolean isLocked() { - return locked; - } + public boolean positionReversed = false; @DelegateToWidget - public void setLocked(boolean locked) { - this.locked = locked; - } - + public boolean locked = false; } }
\ No newline at end of file diff --git a/shared/src/com/vaadin/shared/ui/textarea/TextAreaState.java b/shared/src/com/vaadin/shared/ui/textarea/TextAreaState.java index 50dc1393a3..a562c607b0 100644 --- a/shared/src/com/vaadin/shared/ui/textarea/TextAreaState.java +++ b/shared/src/com/vaadin/shared/ui/textarea/TextAreaState.java @@ -23,29 +23,13 @@ public class TextAreaState extends AbstractTextFieldState { /** * Number of visible rows in the text area. The default is 5. */ - private int rows = 5; + @DelegateToWidget + public int rows = 5; /** * Tells if word-wrapping should be used in the text area. */ - private boolean wordwrap = true; - - public int getRows() { - return rows; - } - - @DelegateToWidget - public void setRows(int rows) { - this.rows = rows; - } - - public boolean isWordwrap() { - return wordwrap; - } - @DelegateToWidget - public void setWordwrap(boolean wordwrap) { - this.wordwrap = wordwrap; - } + public boolean wordwrap = true; } diff --git a/shared/src/com/vaadin/shared/ui/textfield/AbstractTextFieldState.java b/shared/src/com/vaadin/shared/ui/textfield/AbstractTextFieldState.java index cd3562606d..39265c516f 100644 --- a/shared/src/com/vaadin/shared/ui/textfield/AbstractTextFieldState.java +++ b/shared/src/com/vaadin/shared/ui/textfield/AbstractTextFieldState.java @@ -21,53 +21,20 @@ public class AbstractTextFieldState extends AbstractFieldState { /** * Maximum character count in text field. */ - private int maxLength = -1; + public int maxLength = -1; /** * Number of visible columns in the TextField. */ - private int columns = 0; + public int columns = 0; /** * The prompt to display in an empty field. Null when disabled. */ - private String inputPrompt = null; + public String inputPrompt = null; /** * The text in the field */ - private String text = null; - - public int getMaxLength() { - return maxLength; - } - - public void setMaxLength(int maxLength) { - this.maxLength = maxLength; - } - - public int getColumns() { - return columns; - } - - public void setColumns(int columns) { - this.columns = columns; - } - - public String getInputPrompt() { - return inputPrompt; - } - - public void setInputPrompt(String inputPrompt) { - this.inputPrompt = inputPrompt; - } - - public String getText() { - return text; - } - - public void setText(String text) { - this.text = text; - } - + public String text = null; } diff --git a/shared/src/com/vaadin/shared/ui/ui/UIState.java b/shared/src/com/vaadin/shared/ui/ui/UIState.java index 01426bd8f3..6bbfeb18e1 100644 --- a/shared/src/com/vaadin/shared/ui/ui/UIState.java +++ b/shared/src/com/vaadin/shared/ui/ui/UIState.java @@ -1,4 +1,4 @@ -/* +/* * Copyright 2011 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not @@ -19,14 +19,5 @@ import com.vaadin.shared.ComponentState; import com.vaadin.shared.Connector; public class UIState extends ComponentState { - private Connector content; - - public Connector getContent() { - return content; - } - - public void setContent(Connector content) { - this.content = content; - } - + public Connector content; }
\ No newline at end of file diff --git a/shared/src/com/vaadin/shared/ui/window/WindowState.java b/shared/src/com/vaadin/shared/ui/window/WindowState.java index 526c5dacb0..c86b6cb187 100644 --- a/shared/src/com/vaadin/shared/ui/window/WindowState.java +++ b/shared/src/com/vaadin/shared/ui/window/WindowState.java @@ -1,4 +1,4 @@ -/* +/* * Copyright 2011 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not @@ -18,68 +18,11 @@ package com.vaadin.shared.ui.window; import com.vaadin.shared.ui.panel.PanelState; public class WindowState extends PanelState { - private boolean modal = false; - private boolean resizable = true; - private boolean resizeLazy = false; - private boolean draggable = true; - private boolean centered = false;; - private int positionX = -1; - private int positionY = -1; - - public boolean isModal() { - return modal; - } - - public void setModal(boolean modal) { - this.modal = modal; - } - - public boolean isResizable() { - return resizable; - } - - public void setResizable(boolean resizable) { - this.resizable = resizable; - } - - public boolean isResizeLazy() { - return resizeLazy; - } - - public void setResizeLazy(boolean resizeLazy) { - this.resizeLazy = resizeLazy; - } - - public boolean isDraggable() { - return draggable; - } - - public void setDraggable(boolean draggable) { - this.draggable = draggable; - } - - public boolean isCentered() { - return centered; - } - - public void setCentered(boolean centered) { - this.centered = centered; - } - - public int getPositionX() { - return positionX; - } - - public void setPositionX(int positionX) { - this.positionX = positionX; - } - - public int getPositionY() { - return positionY; - } - - public void setPositionY(int positionY) { - this.positionY = positionY; - } - + public boolean modal = false; + public boolean resizable = true; + public boolean resizeLazy = false; + public boolean draggable = true; + public boolean centered = false;; + public int positionX = -1; + public int positionY = -1; }
\ No newline at end of file |