diff options
author | John Ahlroos <john@vaadin.com> | 2012-08-31 12:27:45 +0300 |
---|---|---|
committer | John Ahlroos <john@vaadin.com> | 2012-08-31 12:27:45 +0300 |
commit | dac974af9bc73491d8818581821a2c99458f71a2 (patch) | |
tree | 235145653519a5f09a929a996485e9b0fdad3115 /server/src/com/vaadin/ui | |
parent | 7b25b3886ea95bc6495506fbe9472e45fcbde684 (diff) | |
download | vaadin-framework-dac974af9bc73491d8818581821a2c99458f71a2.tar.gz vaadin-framework-dac974af9bc73491d8818581821a2c99458f71a2.zip |
Removed getters/setters from states and made instance variabled public
Diffstat (limited to 'server/src/com/vaadin/ui')
20 files changed, 245 insertions, 214 deletions
diff --git a/server/src/com/vaadin/ui/AbsoluteLayout.java b/server/src/com/vaadin/ui/AbsoluteLayout.java index 794de49671..e3eecaac12 100644 --- a/server/src/com/vaadin/ui/AbsoluteLayout.java +++ b/server/src/com/vaadin/ui/AbsoluteLayout.java @@ -182,7 +182,7 @@ public class AbsoluteLayout extends AbstractLayout implements connectorToPosition.put(c.getConnectorId(), getPosition(c) .getCSSString()); } - getState().setConnectorToCssPosition(connectorToPosition); + getState().connectorToCssPosition = connectorToPosition; } @@ -639,6 +639,7 @@ public class AbsoluteLayout extends AbstractLayout implements * @deprecated Since 7.0, replaced by * {@link #addLayoutClickListener(LayoutClickListener)} **/ + @Override @Deprecated public void addListener(LayoutClickListener listener) { addLayoutClickListener(listener); @@ -654,6 +655,7 @@ public class AbsoluteLayout extends AbstractLayout implements * @deprecated Since 7.0, replaced by * {@link #removeLayoutClickListener(LayoutClickListener)} **/ + @Override @Deprecated public void removeListener(LayoutClickListener listener) { removeLayoutClickListener(listener); diff --git a/server/src/com/vaadin/ui/AbstractComponent.java b/server/src/com/vaadin/ui/AbstractComponent.java index 045173036e..e367d39b07 100644 --- a/server/src/com/vaadin/ui/AbstractComponent.java +++ b/server/src/com/vaadin/ui/AbstractComponent.java @@ -1,4 +1,4 @@ -/* +/* * Copyright 2011 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not @@ -40,6 +40,7 @@ import com.vaadin.server.Resource; import com.vaadin.server.Terminal; import com.vaadin.shared.ComponentConstants; import com.vaadin.shared.ComponentState; +import com.vaadin.shared.ui.ComponentStateUtil; import com.vaadin.tools.ReflectTools; /** @@ -118,7 +119,7 @@ public abstract class AbstractComponent extends AbstractClientConnector */ @Override public void setId(String id) { - getState().setId(id); + getState().id = id; } /* @@ -128,7 +129,7 @@ public abstract class AbstractComponent extends AbstractClientConnector */ @Override public String getId() { - return getState().getId(); + return getState().id; } /** @@ -154,8 +155,8 @@ public abstract class AbstractComponent extends AbstractClientConnector @Override public String getStyleName() { String s = ""; - if (getState().getStyles() != null) { - for (final Iterator<String> it = getState().getStyles().iterator(); it + if (getState().styles != null) { + for (final Iterator<String> it = getState().styles.iterator(); it .hasNext();) { s += it.next(); if (it.hasNext()) { @@ -173,13 +174,13 @@ public abstract class AbstractComponent extends AbstractClientConnector @Override public void setStyleName(String style) { if (style == null || "".equals(style)) { - getState().setStyles(null); + getState().styles = null; return; } - if (getState().getStyles() == null) { - getState().setStyles(new ArrayList<String>()); + if (getState().styles == null) { + getState().styles = new ArrayList<String>(); } - List<String> styles = getState().getStyles(); + List<String> styles = getState().styles; styles.clear(); String[] styleParts = style.split(" +"); for (String part : styleParts) { @@ -202,10 +203,10 @@ public abstract class AbstractComponent extends AbstractClientConnector return; } - if (getState().getStyles() == null) { - getState().setStyles(new ArrayList<String>()); + if (getState().styles == null) { + getState().styles = new ArrayList<String>(); } - List<String> styles = getState().getStyles(); + List<String> styles = getState().styles; if (!styles.contains(style)) { styles.add(style); } @@ -213,11 +214,11 @@ public abstract class AbstractComponent extends AbstractClientConnector @Override public void removeStyleName(String style) { - if (getState().getStyles() != null) { + if (getState().styles != null) { String[] styleParts = style.split(" +"); for (String part : styleParts) { if (part.length() > 0) { - getState().getStyles().remove(part); + getState().styles.remove(part); } } } @@ -229,7 +230,7 @@ public abstract class AbstractComponent extends AbstractClientConnector */ @Override public String getCaption() { - return getState().getCaption(); + return getState().caption; } /** @@ -242,7 +243,7 @@ public abstract class AbstractComponent extends AbstractClientConnector */ @Override public void setCaption(String caption) { - getState().setCaption(caption); + getState().caption = caption; } /* @@ -319,7 +320,7 @@ public abstract class AbstractComponent extends AbstractClientConnector */ @Override public boolean isEnabled() { - return getState().isEnabled(); + return getState().enabled; } /* @@ -329,7 +330,7 @@ public abstract class AbstractComponent extends AbstractClientConnector */ @Override public void setEnabled(boolean enabled) { - getState().setEnabled(enabled); + getState().enabled = enabled; } /* @@ -358,7 +359,7 @@ public abstract class AbstractComponent extends AbstractClientConnector * interface. */ public boolean isImmediate() { - return getState().isImmediate(); + return getState().immediate; } /** @@ -371,7 +372,7 @@ public abstract class AbstractComponent extends AbstractClientConnector * @see Component#isImmediate() */ public void setImmediate(boolean immediate) { - getState().setImmediate(immediate); + getState().immediate = immediate; } /* @@ -381,7 +382,7 @@ public abstract class AbstractComponent extends AbstractClientConnector */ @Override public boolean isVisible() { - return getState().isVisible(); + return getState().visible; } /* @@ -391,11 +392,11 @@ public abstract class AbstractComponent extends AbstractClientConnector */ @Override public void setVisible(boolean visible) { - if (getState().isVisible() == visible) { + if (getState().visible == visible) { return; } - getState().setVisible(visible); + getState().visible = visible; if (getParent() != null) { // Must always repaint the parent (at least the hierarchy) when // visibility of a child component changes. @@ -461,7 +462,7 @@ public abstract class AbstractComponent extends AbstractClientConnector * @return component's description <code>String</code> */ public String getDescription() { - return getState().getDescription(); + return getState().description; } /** @@ -477,7 +478,7 @@ public abstract class AbstractComponent extends AbstractClientConnector * the new description string for the component. */ public void setDescription(String description) { - getState().setDescription(description); + getState().description = description; } /* @@ -570,7 +571,7 @@ public abstract class AbstractComponent extends AbstractClientConnector */ @Override public boolean isReadOnly() { - return getState().isReadOnly(); + return getState().readOnly; } /* @@ -579,7 +580,7 @@ public abstract class AbstractComponent extends AbstractClientConnector */ @Override public void setReadOnly(boolean readOnly) { - getState().setReadOnly(readOnly); + getState().readOnly = readOnly; } /* @@ -700,24 +701,24 @@ public abstract class AbstractComponent extends AbstractClientConnector if (getHeight() >= 0 && (getHeightUnits() != Unit.PERCENTAGE || ComponentSizeValidator .parentCanDefineHeight(this))) { - getState().setHeight("" + getCSSHeight()); + getState().height = "" + getCSSHeight(); } else { - getState().setHeight(""); + getState().height = ""; } if (getWidth() >= 0 && (getWidthUnits() != Unit.PERCENTAGE || ComponentSizeValidator .parentCanDefineWidth(this))) { - getState().setWidth("" + getCSSWidth()); + getState().width = "" + getCSSWidth(); } else { - getState().setWidth(""); + getState().width = ""; } ErrorMessage error = getErrorMessage(); if (null != error) { - getState().setErrorMessage(error.getFormattedHtmlMessage()); + getState().errorMessage = error.getFormattedHtmlMessage(); } else { - getState().setErrorMessage(null); + getState().errorMessage = null; } } @@ -766,7 +767,8 @@ public abstract class AbstractComponent extends AbstractClientConnector eventRouter.addListener(eventType, target, method); if (needRepaint) { - getState().addRegisteredEventListener(eventIdentifier); + ComponentStateUtil.addRegisteredEventListener(getState(), + eventIdentifier); } } @@ -814,7 +816,8 @@ public abstract class AbstractComponent extends AbstractClientConnector if (eventRouter != null) { eventRouter.removeListener(eventType, target); if (!eventRouter.hasListeners(eventType)) { - getState().removeRegisteredEventListener(eventIdentifier); + ComponentStateUtil.removeRegisteredEventListener(getState(), + eventIdentifier); } } } diff --git a/server/src/com/vaadin/ui/AbstractComponentContainer.java b/server/src/com/vaadin/ui/AbstractComponentContainer.java index cf3bf1d2b9..31529ca0d6 100644 --- a/server/src/com/vaadin/ui/AbstractComponentContainer.java +++ b/server/src/com/vaadin/ui/AbstractComponentContainer.java @@ -1,4 +1,4 @@ -/* +/* * Copyright 2011 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not @@ -115,6 +115,7 @@ public abstract class AbstractComponentContainer extends AbstractComponent * @deprecated Since 7.0, replaced by * {@link #addComponentAttachListener(com.vaadin.ui.ComponentContainer.ComponentAttachListener)} **/ + @Override @Deprecated public void addListener(ComponentAttachListener listener) { addComponentAttachListener(listener); @@ -131,6 +132,7 @@ public abstract class AbstractComponentContainer extends AbstractComponent * @deprecated Since 7.0, replaced by * {@link #addComponentDetachListener(com.vaadin.ui.ComponentContainer.ComponentDetachListener)} **/ + @Override @Deprecated public void addListener(ComponentDetachListener listener) { addComponentDetachListener(listener); @@ -147,6 +149,7 @@ public abstract class AbstractComponentContainer extends AbstractComponent * @deprecated Since 7.0, replaced by * {@link #removeComponentAttachListener(com.vaadin.ui.ComponentContainer.ComponentAttachListener)} **/ + @Override @Deprecated public void removeListener(ComponentAttachListener listener) { removeComponentAttachListener(listener); @@ -163,6 +166,7 @@ public abstract class AbstractComponentContainer extends AbstractComponent * @deprecated Since 7.0, replaced by * {@link #removeComponentDetachListener(com.vaadin.ui.ComponentContainer.ComponentDetachListener)} **/ + @Override @Deprecated public void removeListener(ComponentDetachListener listener) { removeComponentDetachListener(listener); @@ -240,7 +244,7 @@ public abstract class AbstractComponentContainer extends AbstractComponent @Override public void setVisible(boolean visible) { - if (getState().isVisible() == visible) { + if (getState().visible == visible) { return; } diff --git a/server/src/com/vaadin/ui/AbstractEmbedded.java b/server/src/com/vaadin/ui/AbstractEmbedded.java index d94f62120f..5c72141ef9 100644 --- a/server/src/com/vaadin/ui/AbstractEmbedded.java +++ b/server/src/com/vaadin/ui/AbstractEmbedded.java @@ -52,10 +52,10 @@ public abstract class AbstractEmbedded extends AbstractComponent { * content. */ public void setAlternateText(String altText) { - if (altText != getState().getAlternateText() - || (altText != null && !altText.equals(getState() - .getAlternateText()))) { - getState().setAlternateText(altText); + if (altText != getState().alternateText + || (altText != null && !altText + .equals(getState().alternateText))) { + getState().alternateText = altText; requestRepaint(); } } @@ -67,7 +67,7 @@ public abstract class AbstractEmbedded extends AbstractComponent { * @returns Alternate text */ public String getAlternateText() { - return getState().getAlternateText(); + return getState().alternateText; } } diff --git a/server/src/com/vaadin/ui/AbstractField.java b/server/src/com/vaadin/ui/AbstractField.java index b1d45ae590..548cb06c8f 100644 --- a/server/src/com/vaadin/ui/AbstractField.java +++ b/server/src/com/vaadin/ui/AbstractField.java @@ -1,4 +1,4 @@ -/* +/* * Copyright 2011 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not @@ -355,11 +355,11 @@ public abstract class AbstractField<T> extends AbstractComponent implements */ @Override public boolean isModified() { - return getState().isModified(); + return getState().modified; } private void setModified(boolean modified) { - getState().setModified(modified); + getState().modified = modified; } /** @@ -632,8 +632,8 @@ public abstract class AbstractField<T> extends AbstractComponent implements // Sets the new data source dataSource = newDataSource; - getState().setPropertyReadOnly( - dataSource == null ? false : dataSource.isReadOnly()); + getState().propertyReadOnly = dataSource == null ? false : dataSource + .isReadOnly(); // Check if the current converter is compatible. if (newDataSource != null @@ -1056,6 +1056,7 @@ public abstract class AbstractField<T> extends AbstractComponent implements * @deprecated Since 7.0, replaced by * {@link #addValueChangeListener(com.vaadin.data.Property.ValueChangeListener)} **/ + @Override @Deprecated public void addListener(Property.ValueChangeListener listener) { addValueChangeListener(listener); @@ -1076,6 +1077,7 @@ public abstract class AbstractField<T> extends AbstractComponent implements * @deprecated Since 7.0, replaced by * {@link #removeValueChangeListener(com.vaadin.data.Property.ValueChangeListener)} **/ + @Override @Deprecated public void removeListener(Property.ValueChangeListener listener) { removeValueChangeListener(listener); @@ -1117,7 +1119,7 @@ public abstract class AbstractField<T> extends AbstractComponent implements */ @Override public void readOnlyStatusChange(Property.ReadOnlyStatusChangeEvent event) { - getState().setPropertyReadOnly(event.getProperty().isReadOnly()); + getState().propertyReadOnly = event.getProperty().isReadOnly(); } /** @@ -1167,6 +1169,7 @@ public abstract class AbstractField<T> extends AbstractComponent implements * @deprecated Since 7.0, replaced by * {@link #addReadOnlyStatusChangeListener(com.vaadin.data.Property.ReadOnlyStatusChangeListener)} **/ + @Override @Deprecated public void addListener(Property.ReadOnlyStatusChangeListener listener) { addReadOnlyStatusChangeListener(listener); @@ -1188,6 +1191,7 @@ public abstract class AbstractField<T> extends AbstractComponent implements * @deprecated Since 7.0, replaced by * {@link #removeReadOnlyStatusChangeListener(com.vaadin.data.Property.ReadOnlyStatusChangeListener)} **/ + @Override @Deprecated public void removeListener(Property.ReadOnlyStatusChangeListener listener) { removeReadOnlyStatusChangeListener(listener); @@ -1258,7 +1262,7 @@ public abstract class AbstractField<T> extends AbstractComponent implements */ @Override public int getTabIndex() { - return getState().getTabIndex(); + return getState().tabIndex; } /* @@ -1268,7 +1272,7 @@ public abstract class AbstractField<T> extends AbstractComponent implements */ @Override public void setTabIndex(int tabIndex) { - getState().setTabIndex(tabIndex); + getState().tabIndex = tabIndex; } /** @@ -1350,7 +1354,7 @@ public abstract class AbstractField<T> extends AbstractComponent implements */ @Override public boolean isRequired() { - return getState().isRequired(); + return getState().required; } /** @@ -1370,7 +1374,7 @@ public abstract class AbstractField<T> extends AbstractComponent implements */ @Override public void setRequired(boolean required) { - getState().setRequired(required); + getState().required = required; } /** @@ -1569,7 +1573,7 @@ public abstract class AbstractField<T> extends AbstractComponent implements super.beforeClientResponse(initial); // Hide the error indicator if needed - getState().setHideErrors(shouldHideErrors()); + getState().hideErrors = shouldHideErrors(); } /** diff --git a/server/src/com/vaadin/ui/AbstractOrderedLayout.java b/server/src/com/vaadin/ui/AbstractOrderedLayout.java index 184f7c40f4..4e27dbb158 100644 --- a/server/src/com/vaadin/ui/AbstractOrderedLayout.java +++ b/server/src/com/vaadin/ui/AbstractOrderedLayout.java @@ -143,11 +143,11 @@ public abstract class AbstractOrderedLayout extends AbstractLayout implements } private void componentRemoved(Component c) { - getState().getChildData().remove(c); + getState().childData.remove(c); } private void componentAdded(Component c) { - getState().getChildData().put(c, new ChildComponentData()); + getState().childData.put(c, new ChildComponentData()); } /** @@ -232,11 +232,11 @@ public abstract class AbstractOrderedLayout extends AbstractLayout implements @Override public void setComponentAlignment(Component childComponent, Alignment alignment) { - ChildComponentData childData = getState().getChildData().get( + ChildComponentData childData = getState().childData.get( childComponent); if (childData != null) { // Alignments are bit masks - childData.setAlignmentBitmask(alignment.getBitMask()); + childData.alignmentBitmask = alignment.getBitMask(); } else { throw new IllegalArgumentException( "Component must be added to layout before using setComponentAlignment()"); @@ -252,14 +252,14 @@ public abstract class AbstractOrderedLayout extends AbstractLayout implements */ @Override public Alignment getComponentAlignment(Component childComponent) { - ChildComponentData childData = getState().getChildData().get( + ChildComponentData childData = getState().childData.get( childComponent); if (childData == null) { throw new IllegalArgumentException( "The given component is not a child of this layout"); } - return new Alignment(childData.getAlignmentBitmask()); + return new Alignment(childData.alignmentBitmask); } /* @@ -269,7 +269,7 @@ public abstract class AbstractOrderedLayout extends AbstractLayout implements */ @Override public void setSpacing(boolean spacing) { - getState().setSpacing(spacing); + getState().spacing = spacing; } /* @@ -279,7 +279,7 @@ public abstract class AbstractOrderedLayout extends AbstractLayout implements */ @Override public boolean isSpacing() { - return getState().isSpacing(); + return getState().spacing; } /** @@ -312,13 +312,13 @@ public abstract class AbstractOrderedLayout extends AbstractLayout implements * @param ratio */ public void setExpandRatio(Component component, float ratio) { - ChildComponentData childData = getState().getChildData().get(component); + ChildComponentData childData = getState().childData.get(component); if (childData == null) { throw new IllegalArgumentException( "The given component is not a child of this layout"); } - childData.setExpandRatio(ratio); + childData.expandRatio = ratio; } /** @@ -329,13 +329,13 @@ public abstract class AbstractOrderedLayout extends AbstractLayout implements * @return expand ratio of given component, 0.0f by default. */ public float getExpandRatio(Component component) { - ChildComponentData childData = getState().getChildData().get(component); + ChildComponentData childData = getState().childData.get(component); if (childData == null) { throw new IllegalArgumentException( "The given component is not a child of this layout"); } - return childData.getExpandRatio(); + return childData.expandRatio; } @Override @@ -349,6 +349,7 @@ public abstract class AbstractOrderedLayout extends AbstractLayout implements * @deprecated Since 7.0, replaced by * {@link #addLayoutClickListener(LayoutClickListener)} **/ + @Override @Deprecated public void addListener(LayoutClickListener listener) { addLayoutClickListener(listener); @@ -364,6 +365,7 @@ public abstract class AbstractOrderedLayout extends AbstractLayout implements * @deprecated Since 7.0, replaced by * {@link #removeLayoutClickListener(LayoutClickListener)} **/ + @Override @Deprecated public void removeListener(LayoutClickListener listener) { removeLayoutClickListener(listener); @@ -405,7 +407,7 @@ public abstract class AbstractOrderedLayout extends AbstractLayout implements */ @Override public MarginInfo getMargin() { - return new MarginInfo(getState().getMarginsBitmask()); + return new MarginInfo(getState().marginsBitmask); } /* @@ -415,6 +417,6 @@ public abstract class AbstractOrderedLayout extends AbstractLayout implements */ @Override public void setMargin(MarginInfo marginInfo) { - getState().setMarginsBitmask(marginInfo.getBitMask()); + getState().marginsBitmask = marginInfo.getBitMask(); } } diff --git a/server/src/com/vaadin/ui/AbstractSplitPanel.java b/server/src/com/vaadin/ui/AbstractSplitPanel.java index f1452caacf..c5df57b36f 100644 --- a/server/src/com/vaadin/ui/AbstractSplitPanel.java +++ b/server/src/com/vaadin/ui/AbstractSplitPanel.java @@ -56,7 +56,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { @Override public void setSplitterPosition(float position) { - getSplitterState().setPosition(position); + getSplitterState().position = position; } }; @@ -150,7 +150,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { // detach old removeComponent(getFirstComponent()); } - getState().setFirstChild(c); + getState().firstChild = c; if (c != null) { super.addComponent(c); } @@ -173,7 +173,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { // detach old removeComponent(getSecondComponent()); } - getState().setSecondChild(c); + getState().secondChild = c; if (c != null) { super.addComponent(c); } @@ -186,7 +186,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { * @return the first component of this split panel */ public Component getFirstComponent() { - return (Component) getState().getFirstChild(); + return (Component) getState().firstChild; } /** @@ -196,7 +196,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { * @return the second component of this split panel */ public Component getSecondComponent() { - return (Component) getState().getSecondChild(); + return (Component) getState().secondChild; } /** @@ -210,9 +210,9 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { public void removeComponent(Component c) { super.removeComponent(c); if (c == getFirstComponent()) { - getState().setFirstChild(null); + getState().firstChild = null; } else if (c == getSecondComponent()) { - getState().setSecondChild(null); + getState().secondChild = null; } markAsDirty(); } @@ -322,9 +322,9 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { pos = Math.round(pos); } SplitterState splitterState = getSplitterState(); - splitterState.setPosition(pos); - splitterState.setPositionUnit(unit.getSymbol()); - splitterState.setPositionReversed(reverse); + splitterState.position = pos; + splitterState.positionUnit = unit.getSymbol(); + splitterState.positionReversed = reverse; posUnit = unit; } @@ -335,7 +335,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { * @return position of the splitter */ public float getSplitPosition() { - return getSplitterState().getPosition(); + return getSplitterState().position; } /** @@ -358,7 +358,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { * Allowed units are UNITS_PERCENTAGE and UNITS_PIXELS */ public void setMinSplitPosition(int pos, Unit unit) { - setSplitPositionLimits(pos, unit, getSplitterState().getMaxPosition(), + setSplitPositionLimits(pos, unit, getSplitterState().maxPosition, posMaxUnit); } @@ -369,7 +369,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { * @return the minimum position of the splitter */ public float getMinSplitPosition() { - return getSplitterState().getMinPosition(); + return getSplitterState().minPosition; } /** @@ -392,7 +392,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { * Allowed units are UNITS_PERCENTAGE and UNITS_PIXELS */ public void setMaxSplitPosition(float pos, Unit unit) { - setSplitPositionLimits(getSplitterState().getMinPosition(), posMinUnit, + setSplitPositionLimits(getSplitterState().minPosition, posMinUnit, pos, unit); } @@ -403,7 +403,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { * @return the maximum position of the splitter */ public float getMaxSplitPosition() { - return getSplitterState().getMaxPosition(); + return getSplitterState().maxPosition; } /** @@ -440,12 +440,12 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { SplitterState state = getSplitterState(); - state.setMinPosition(minPos); - state.setMinPositionUnit(minPosUnit.getSymbol()); + state.minPosition = minPos; + state.minPositionUnit = minPosUnit.getSymbol(); posMinUnit = minPosUnit; - state.setMaxPosition(maxPos); - state.setMaxPositionUnit(maxPosUnit.getSymbol()); + state.maxPosition = maxPos; + state.maxPositionUnit = maxPosUnit.getSymbol(); posMaxUnit = maxPosUnit; } @@ -457,7 +457,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { * Set <code>true</code> if locked, <code>false</code> otherwise. */ public void setLocked(boolean locked) { - getSplitterState().setLocked(locked); + getSplitterState().locked = locked; } /** @@ -467,7 +467,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { * @return <code>true</code> if locked, <code>false</code> otherwise. */ public boolean isLocked() { - return getSplitterState().isLocked(); + return getSplitterState().locked; } /** @@ -535,6 +535,6 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { } private SplitterState getSplitterState() { - return getState().getSplitterState(); + return getState().splitterState; } } diff --git a/server/src/com/vaadin/ui/AbstractTextField.java b/server/src/com/vaadin/ui/AbstractTextField.java index c187d9e198..0cb74dae6d 100644 --- a/server/src/com/vaadin/ui/AbstractTextField.java +++ b/server/src/com/vaadin/ui/AbstractTextField.java @@ -1,4 +1,4 @@ -/* +/* * Copyright 2011 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not @@ -27,9 +27,9 @@ import com.vaadin.event.FieldEvents.FocusNotifier; import com.vaadin.event.FieldEvents.TextChangeEvent; import com.vaadin.event.FieldEvents.TextChangeListener; import com.vaadin.event.FieldEvents.TextChangeNotifier; +import com.vaadin.server.LegacyComponent; import com.vaadin.server.PaintException; import com.vaadin.server.PaintTarget; -import com.vaadin.server.LegacyComponent; import com.vaadin.shared.ui.textfield.AbstractTextFieldState; import com.vaadin.shared.ui.textfield.TextFieldConstants; @@ -104,7 +104,7 @@ public abstract class AbstractTextField extends AbstractField<String> implements if (value == null) { value = getNullRepresentation(); } - getState().setText(value); + getState().text = value; } @Override @@ -312,7 +312,7 @@ public abstract class AbstractTextField extends AbstractField<String> implements * @return the maxLength */ public int getMaxLength() { - return getState().getMaxLength(); + return getState().maxLength; } /** @@ -323,7 +323,7 @@ public abstract class AbstractTextField extends AbstractField<String> implements * the maxLength to set */ public void setMaxLength(int maxLength) { - getState().setMaxLength(maxLength); + getState().maxLength = maxLength; } /** @@ -334,7 +334,7 @@ public abstract class AbstractTextField extends AbstractField<String> implements * @return the number of columns in the editor. */ public int getColumns() { - return getState().getColumns(); + return getState().columns; } /** @@ -349,7 +349,7 @@ public abstract class AbstractTextField extends AbstractField<String> implements if (columns < 0) { columns = 0; } - getState().setColumns(columns); + getState().columns = columns; } /** @@ -359,7 +359,7 @@ public abstract class AbstractTextField extends AbstractField<String> implements * @return the current input prompt, or null if not enabled */ public String getInputPrompt() { - return getState().getInputPrompt(); + return getState().inputPrompt; } /** @@ -369,7 +369,7 @@ public abstract class AbstractTextField extends AbstractField<String> implements * @param inputPrompt */ public void setInputPrompt(String inputPrompt) { - getState().setInputPrompt(inputPrompt); + getState().inputPrompt = inputPrompt; } /* ** Text Change Events ** */ @@ -521,6 +521,7 @@ public abstract class AbstractTextField extends AbstractField<String> implements * @deprecated Since 7.0, replaced by * {@link #addTextChangeListener(TextChangeListener)} **/ + @Override @Deprecated public void addListener(TextChangeListener listener) { addTextChangeListener(listener); @@ -536,6 +537,7 @@ public abstract class AbstractTextField extends AbstractField<String> implements * @deprecated Since 7.0, replaced by * {@link #removeTextChangeListener(TextChangeListener)} **/ + @Override @Deprecated public void removeListener(TextChangeListener listener) { removeTextChangeListener(listener); @@ -688,6 +690,7 @@ public abstract class AbstractTextField extends AbstractField<String> implements * @deprecated Since 7.0, replaced by * {@link #addFocusListener(FocusListener)} **/ + @Override @Deprecated public void addListener(FocusListener listener) { addFocusListener(listener); @@ -702,6 +705,7 @@ public abstract class AbstractTextField extends AbstractField<String> implements * @deprecated Since 7.0, replaced by * {@link #removeFocusListener(FocusListener)} **/ + @Override @Deprecated public void removeListener(FocusListener listener) { removeFocusListener(listener); @@ -716,6 +720,7 @@ public abstract class AbstractTextField extends AbstractField<String> implements /** * @deprecated Since 7.0, replaced by {@link #addBlurListener(BlurListener)} **/ + @Override @Deprecated public void addListener(BlurListener listener) { addBlurListener(listener); @@ -730,6 +735,7 @@ public abstract class AbstractTextField extends AbstractField<String> implements * @deprecated Since 7.0, replaced by * {@link #removeBlurListener(BlurListener)} **/ + @Override @Deprecated public void removeListener(BlurListener listener) { removeBlurListener(listener); diff --git a/server/src/com/vaadin/ui/Button.java b/server/src/com/vaadin/ui/Button.java index 2e026ebc52..bbed7d540f 100644 --- a/server/src/com/vaadin/ui/Button.java +++ b/server/src/com/vaadin/ui/Button.java @@ -367,6 +367,7 @@ public class Button extends AbstractComponent implements /** * @deprecated Since 7.0, replaced by {@link #addBlurListener(BlurListener)} **/ + @Override @Deprecated public void addListener(BlurListener listener) { addBlurListener(listener); @@ -381,6 +382,7 @@ public class Button extends AbstractComponent implements * @deprecated Since 7.0, replaced by * {@link #removeBlurListener(BlurListener)} **/ + @Override @Deprecated public void removeListener(BlurListener listener) { removeBlurListener(listener); @@ -396,6 +398,7 @@ public class Button extends AbstractComponent implements * @deprecated Since 7.0, replaced by * {@link #addFocusListener(FocusListener)} **/ + @Override @Deprecated public void addListener(FocusListener listener) { addFocusListener(listener); @@ -410,6 +413,7 @@ public class Button extends AbstractComponent implements * @deprecated Since 7.0, replaced by * {@link #removeFocusListener(FocusListener)} **/ + @Override @Deprecated public void removeListener(FocusListener listener) { removeFocusListener(listener); @@ -438,7 +442,7 @@ public class Button extends AbstractComponent implements } clickShortcut = new ClickShortcut(this, keyCode, modifiers); addShortcutListener(clickShortcut); - getState().setClickShortcutKeyCode(clickShortcut.getKeyCode()); + getState().clickShortcutKeyCode = clickShortcut.getKeyCode(); } /** @@ -449,7 +453,7 @@ public class Button extends AbstractComponent implements if (clickShortcut != null) { removeShortcutListener(clickShortcut); clickShortcut = null; - getState().setClickShortcutKeyCode(0); + getState().clickShortcutKeyCode = 0; } } @@ -517,7 +521,7 @@ public class Button extends AbstractComponent implements * @return true if the button is disabled when clicked, false otherwise */ public boolean isDisableOnClick() { - return getState().isDisableOnClick(); + return getState().disableOnClick; } /** @@ -533,7 +537,7 @@ public class Button extends AbstractComponent implements * true to disable button when it is clicked, false otherwise */ public void setDisableOnClick(boolean disableOnClick) { - getState().setDisableOnClick(disableOnClick); + getState().disableOnClick = disableOnClick; } /* @@ -543,7 +547,7 @@ public class Button extends AbstractComponent implements */ @Override public int getTabIndex() { - return getState().getTabIndex(); + return getState().tabIndex; } /* @@ -553,7 +557,7 @@ public class Button extends AbstractComponent implements */ @Override public void setTabIndex(int tabIndex) { - getState().setTabIndex(tabIndex); + getState().tabIndex = tabIndex; } @Override @@ -580,7 +584,7 @@ public class Button extends AbstractComponent implements * <code>false</code> otherwise */ public void setHtmlContentAllowed(boolean htmlContentAllowed) { - getState().setHtmlContentAllowed(htmlContentAllowed); + getState().htmlContentAllowed = htmlContentAllowed; } /** @@ -590,7 +594,7 @@ public class Button extends AbstractComponent implements * <code>false</code> otherwise */ public boolean isHtmlContentAllowed() { - return getState().isHtmlContentAllowed(); + return getState().htmlContentAllowed; } } diff --git a/server/src/com/vaadin/ui/CheckBox.java b/server/src/com/vaadin/ui/CheckBox.java index 149d4779d8..8a42182598 100644 --- a/server/src/com/vaadin/ui/CheckBox.java +++ b/server/src/com/vaadin/ui/CheckBox.java @@ -1,4 +1,4 @@ -/* +/* * Copyright 2011 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not @@ -116,7 +116,7 @@ public class CheckBox extends AbstractField<Boolean> { if (newValue == null) { newValue = false; } - getState().setChecked(newValue); + getState().checked = newValue; } public void addBlurListener(BlurListener listener) { diff --git a/server/src/com/vaadin/ui/CssLayout.java b/server/src/com/vaadin/ui/CssLayout.java index b63c8573ba..9ac29c4deb 100644 --- a/server/src/com/vaadin/ui/CssLayout.java +++ b/server/src/com/vaadin/ui/CssLayout.java @@ -199,12 +199,12 @@ public class CssLayout extends AbstractLayout implements LayoutClickNotifier { @Override public void beforeClientResponse(boolean initial) { super.beforeClientResponse(initial); - getState().getChildCss().clear(); + getState().childCss.clear(); for (Iterator<Component> ci = getComponentIterator(); ci.hasNext();) { Component child = ci.next(); String componentCssString = getCss(child); if (componentCssString != null) { - getState().getChildCss().put(child, componentCssString); + getState().childCss.put(child, componentCssString); } } @@ -291,6 +291,7 @@ public class CssLayout extends AbstractLayout implements LayoutClickNotifier { * @deprecated Since 7.0, replaced by * {@link #addLayoutClickListener(LayoutClickListener)} **/ + @Override @Deprecated public void addListener(LayoutClickListener listener) { addLayoutClickListener(listener); @@ -306,6 +307,7 @@ public class CssLayout extends AbstractLayout implements LayoutClickNotifier { * @deprecated Since 7.0, replaced by * {@link #removeLayoutClickListener(LayoutClickListener)} **/ + @Override @Deprecated public void removeListener(LayoutClickListener listener) { removeLayoutClickListener(listener); diff --git a/server/src/com/vaadin/ui/CustomLayout.java b/server/src/com/vaadin/ui/CustomLayout.java index f747b6ff3b..828a1b91ad 100644 --- a/server/src/com/vaadin/ui/CustomLayout.java +++ b/server/src/com/vaadin/ui/CustomLayout.java @@ -25,9 +25,9 @@ import java.util.Map; import java.util.Set; import com.vaadin.server.JsonPaintTarget; +import com.vaadin.server.LegacyComponent; import com.vaadin.server.PaintException; import com.vaadin.server.PaintTarget; -import com.vaadin.server.LegacyComponent; import com.vaadin.shared.ui.customlayout.CustomLayoutState; /** @@ -142,7 +142,7 @@ public class CustomLayout extends AbstractLayout implements LegacyComponent { removeComponent(old); } slots.put(location, c); - getState().getChildLocations().put(c, location); + getState().childLocations.put(c, location); c.setParent(this); fireComponentAttachEvent(c); } @@ -173,7 +173,7 @@ public class CustomLayout extends AbstractLayout implements LegacyComponent { return; } slots.values().remove(c); - getState().getChildLocations().remove(c); + getState().childLocations.remove(c); super.removeComponent(c); } @@ -247,19 +247,19 @@ public class CustomLayout extends AbstractLayout implements LegacyComponent { } else { slots.put(newLocation, oldComponent); slots.put(oldLocation, newComponent); - getState().getChildLocations().put(newComponent, oldLocation); - getState().getChildLocations().put(oldComponent, newLocation); + getState().childLocations.put(newComponent, oldLocation); + getState().childLocations.put(oldComponent, newLocation); } } /** Get the name of the template */ public String getTemplateName() { - return getState().getTemplateName(); + return getState().templateName; } /** Get the contents of the template */ public String getTemplateContents() { - return getState().getTemplateContents(); + return getState().templateContents; } /** @@ -272,8 +272,8 @@ public class CustomLayout extends AbstractLayout implements LegacyComponent { * @param templateName */ public void setTemplateName(String templateName) { - getState().setTemplateName(templateName); - getState().setTemplateContents(null); + getState().templateName = templateName; + getState().templateContents = null; } /** @@ -282,8 +282,8 @@ public class CustomLayout extends AbstractLayout implements LegacyComponent { * @param templateContents */ public void setTemplateContents(String templateContents) { - getState().setTemplateContents(templateContents); - getState().setTemplateName(null); + getState().templateContents = templateContents; + getState().templateName = null; } @Override @@ -295,7 +295,7 @@ public class CustomLayout extends AbstractLayout implements LegacyComponent { public void paintContent(PaintTarget target) throws PaintException { // Workaround to make the CommunicationManager read the template file // and send it to the client - String templateName = getState().getTemplateName(); + String templateName = getState().templateName; if (templateName != null && templateName.length() != 0) { Set<Object> usedResources = ((JsonPaintTarget) target) .getUsedResources(); diff --git a/server/src/com/vaadin/ui/Flash.java b/server/src/com/vaadin/ui/Flash.java index 0e6cf63a91..d39f34634e 100644 --- a/server/src/com/vaadin/ui/Flash.java +++ b/server/src/com/vaadin/ui/Flash.java @@ -33,10 +33,10 @@ public class Flash extends AbstractEmbedded { * The base path */ public void setCodebase(String codebase) { - if (codebase != getState().getCodebase() + if (codebase != getState().codebase || (codebase != null && !codebase.equals(getState() - .getCodebase()))) { - getState().setCodebase(codebase); +.codebase))) { + getState().codebase = codebase; requestRepaint(); } } @@ -52,10 +52,10 @@ public class Flash extends AbstractEmbedded { * the codetype to set. */ public void setCodetype(String codetype) { - if (codetype != getState().getCodetype() + if (codetype != getState().codetype || (codetype != null && !codetype.equals(getState() - .getCodetype()))) { - getState().setCodetype(codetype); +.codetype))) { + getState().codetype = codetype; requestRepaint(); } } @@ -73,17 +73,17 @@ public class Flash extends AbstractEmbedded { * object */ public void setArchive(String archive) { - if (archive != getState().getArchive() - || (archive != null && !archive.equals(getState().getArchive()))) { - getState().setArchive(archive); + if (archive != getState().archive + || (archive != null && !archive.equals(getState().archive))) { + getState().archive = archive; requestRepaint(); } } public void setStandby(String standby) { - if (standby != getState().getStandby() - || (standby != null && !standby.equals(getState().getStandby()))) { - getState().setStandby(standby); + if (standby != getState().standby + || (standby != null && !standby.equals(getState().standby))) { + getState().standby = standby; requestRepaint(); } } @@ -100,10 +100,10 @@ public class Flash extends AbstractEmbedded { * the value of the parameter. */ public void setParameter(String name, String value) { - if (getState().getEmbedParams() == null) { - getState().setEmbedParams(new HashMap<String, String>()); + if (getState().embedParams == null) { + getState().embedParams = new HashMap<String, String>(); } - getState().getEmbedParams().put(name, value); + getState().embedParams.put(name, value); requestRepaint(); } @@ -115,8 +115,8 @@ public class Flash extends AbstractEmbedded { * @return the Value of parameter or null if not found. */ public String getParameter(String name) { - return getState().getEmbedParams() != null ? getState() - .getEmbedParams().get(name) : null; + return getState().embedParams != null ? getState().embedParams + .get(name) : null; } /** @@ -126,10 +126,10 @@ public class Flash extends AbstractEmbedded { * the name of the parameter to remove. */ public void removeParameter(String name) { - if (getState().getEmbedParams() == null) { + if (getState().embedParams == null) { return; } - getState().getEmbedParams().remove(name); + getState().embedParams.remove(name); requestRepaint(); } diff --git a/server/src/com/vaadin/ui/Form.java b/server/src/com/vaadin/ui/Form.java index 7e77117acb..dd804ef67a 100644 --- a/server/src/com/vaadin/ui/Form.java +++ b/server/src/com/vaadin/ui/Form.java @@ -1,4 +1,4 @@ -/* +/* * Copyright 2011 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not @@ -39,10 +39,10 @@ import com.vaadin.event.ActionManager; import com.vaadin.server.AbstractErrorMessage; import com.vaadin.server.CompositeErrorMessage; import com.vaadin.server.ErrorMessage; +import com.vaadin.server.LegacyComponent; import com.vaadin.server.PaintException; import com.vaadin.server.PaintTarget; import com.vaadin.server.UserError; -import com.vaadin.server.LegacyComponent; import com.vaadin.shared.ui.form.FormState; /** @@ -776,7 +776,7 @@ public class Form extends AbstractField<Object> implements Item.Editor, * @return the Layout of the form. */ public Layout getLayout() { - return (Layout) getState().getLayout(); + return (Layout) getState().layout; } /** @@ -819,7 +819,7 @@ public class Form extends AbstractField<Object> implements Item.Editor, // Replace the previous layout layout.setParent(this); - getState().setLayout(layout); + getState().layout = layout; } /** @@ -1214,7 +1214,7 @@ public class Form extends AbstractField<Object> implements Item.Editor, * @return layout rendered below normal form contents. */ public Layout getFooter() { - return (Layout) getState().getFooter(); + return (Layout) getState().footer; } /** @@ -1233,7 +1233,7 @@ public class Form extends AbstractField<Object> implements Item.Editor, footer = new HorizontalLayout(); } - getState().setFooter(footer); + getState().footer = footer; footer.setParent(this); } diff --git a/server/src/com/vaadin/ui/GridLayout.java b/server/src/com/vaadin/ui/GridLayout.java index 21602c6802..de167962e7 100644 --- a/server/src/com/vaadin/ui/GridLayout.java +++ b/server/src/com/vaadin/ui/GridLayout.java @@ -27,10 +27,10 @@ import java.util.Map.Entry; import com.vaadin.event.LayoutEvents.LayoutClickEvent; import com.vaadin.event.LayoutEvents.LayoutClickListener; import com.vaadin.event.LayoutEvents.LayoutClickNotifier; +import com.vaadin.server.LegacyComponent; import com.vaadin.server.LegacyPaint; import com.vaadin.server.PaintException; import com.vaadin.server.PaintTarget; -import com.vaadin.server.LegacyComponent; import com.vaadin.shared.Connector; import com.vaadin.shared.EventId; import com.vaadin.shared.MouseEventDetails; @@ -961,7 +961,7 @@ public class GridLayout extends AbstractLayout implements } } - getState().setColumns(columns); + getState().columns = columns; } /** @@ -970,7 +970,7 @@ public class GridLayout extends AbstractLayout implements * @return the number of columns in the grid. */ public int getColumns() { - return getState().getColumns(); + return getState().columns; } /** @@ -1003,7 +1003,7 @@ public class GridLayout extends AbstractLayout implements } } - getState().setRows(rows); + getState().rows = rows; } /** @@ -1012,7 +1012,7 @@ public class GridLayout extends AbstractLayout implements * @return the number of rows in the grid. */ public int getRows() { - return getState().getRows(); + return getState().rows; } /** @@ -1127,7 +1127,7 @@ public class GridLayout extends AbstractLayout implements */ @Override public void setSpacing(boolean spacing) { - getState().setSpacing(spacing); + getState().spacing = spacing; } /* @@ -1137,7 +1137,7 @@ public class GridLayout extends AbstractLayout implements */ @Override public boolean isSpacing() { - return getState().isSpacing(); + return getState().spacing; } /** @@ -1405,7 +1405,7 @@ public class GridLayout extends AbstractLayout implements */ @Override public void setMargin(MarginInfo marginInfo) { - getState().setMarginsBitmask(marginInfo.getBitMask()); + getState().marginsBitmask = marginInfo.getBitMask(); } /* @@ -1415,7 +1415,7 @@ public class GridLayout extends AbstractLayout implements */ @Override public MarginInfo getMargin() { - return new MarginInfo(getState().getMarginsBitmask()); + return new MarginInfo(getState().marginsBitmask); } } diff --git a/server/src/com/vaadin/ui/Panel.java b/server/src/com/vaadin/ui/Panel.java index 6f399bcc19..de34c0be2c 100644 --- a/server/src/com/vaadin/ui/Panel.java +++ b/server/src/com/vaadin/ui/Panel.java @@ -25,10 +25,10 @@ import com.vaadin.event.Action.Handler; import com.vaadin.event.ActionManager; import com.vaadin.event.MouseEvents.ClickEvent; import com.vaadin.event.MouseEvents.ClickListener; +import com.vaadin.server.LegacyComponent; import com.vaadin.server.PaintException; import com.vaadin.server.PaintTarget; import com.vaadin.server.Scrollable; -import com.vaadin.server.LegacyComponent; import com.vaadin.shared.EventId; import com.vaadin.shared.MouseEventDetails; import com.vaadin.shared.ui.panel.PanelServerRpc; @@ -83,7 +83,7 @@ public class Panel extends AbstractComponentContainer implements Scrollable, registerRpc(rpc); setContent(content); setWidth(100, Unit.PERCENTAGE); - getState().setTabIndex(-1); + getState().tabIndex = -1; } /** @@ -269,11 +269,11 @@ public class Panel extends AbstractComponentContainer implements Scrollable, final Integer newScrollY = (Integer) variables.get("scrollTop"); if (newScrollX != null && newScrollX.intValue() != getScrollLeft()) { // set internally, not to fire request repaint - getState().setScrollLeft(newScrollX.intValue()); + getState().scrollLeft = newScrollX.intValue(); } if (newScrollY != null && newScrollY.intValue() != getScrollTop()) { // set internally, not to fire request repaint - getState().setScrollTop(newScrollY.intValue()); + getState().scrollTop = newScrollY.intValue(); } // Actions @@ -292,7 +292,7 @@ public class Panel extends AbstractComponentContainer implements Scrollable, */ @Override public int getScrollLeft() { - return getState().getScrollLeft(); + return getState().scrollLeft; } /* @@ -302,7 +302,7 @@ public class Panel extends AbstractComponentContainer implements Scrollable, */ @Override public int getScrollTop() { - return getState().getScrollTop(); + return getState().scrollTop; } /* @@ -316,7 +316,7 @@ public class Panel extends AbstractComponentContainer implements Scrollable, throw new IllegalArgumentException( "Scroll offset must be at least 0"); } - getState().setScrollLeft(scrollLeft); + getState().scrollLeft = scrollLeft; } /* @@ -330,7 +330,7 @@ public class Panel extends AbstractComponentContainer implements Scrollable, throw new IllegalArgumentException( "Scroll offset must be at least 0"); } - getState().setScrollTop(scrollTop); + getState().scrollTop = scrollTop; } /* Documented in superclass */ @@ -471,7 +471,7 @@ public class Panel extends AbstractComponentContainer implements Scrollable, */ @Override public int getTabIndex() { - return getState().getTabIndex(); + return getState().tabIndex; } /** @@ -479,7 +479,7 @@ public class Panel extends AbstractComponentContainer implements Scrollable, */ @Override public void setTabIndex(int tabIndex) { - getState().setTabIndex(tabIndex); + getState().tabIndex = tabIndex; } /** diff --git a/server/src/com/vaadin/ui/Slider.java b/server/src/com/vaadin/ui/Slider.java index 660bf739ae..fe913f6b2c 100644 --- a/server/src/com/vaadin/ui/Slider.java +++ b/server/src/com/vaadin/ui/Slider.java @@ -1,4 +1,4 @@ -/* +/* * Copyright 2011 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not @@ -25,10 +25,10 @@ import com.vaadin.shared.ui.slider.SliderState; * * Example code: <code> * class MyPlayer extends CustomComponent implements ValueChangeListener { - * + * * Label volumeIndicator = new Label(); * Slider slider; - * + * * public MyPlayer() { * VerticalLayout vl = new VerticalLayout(); * setCompositionRoot(vl); @@ -68,11 +68,11 @@ public class Slider extends AbstractField<Double> { } catch (final ValueOutOfBoundsException e) { // Convert to nearest bound double out = e.getValue().doubleValue(); - if (out < getState().getMinValue()) { - out = getState().getMinValue(); + if (out < getState().minValue) { + out = getState().minValue; } - if (out > getState().getMaxValue()) { - out = getState().getMaxValue(); + if (out > getState().maxValue) { + out = getState().maxValue; } Slider.super.setValue(new Double(out), false); } @@ -88,7 +88,7 @@ public class Slider extends AbstractField<Double> { public Slider() { super(); registerRpc(rpc); - super.setValue(new Double(getState().getMinValue())); + super.setValue(new Double(getState().minValue)); } /** @@ -164,7 +164,7 @@ public class Slider extends AbstractField<Double> { * @return the largest value the slider can have */ public double getMax() { - return getState().getMaxValue(); + return getState().maxValue; } /** @@ -175,7 +175,7 @@ public class Slider extends AbstractField<Double> { * The new maximum slider value */ public void setMax(double max) { - getState().setMaxValue(max); + getState().maxValue = max; if (getValue() > max) { setValue(max); } @@ -187,7 +187,7 @@ public class Slider extends AbstractField<Double> { * @return the smallest value the slider can have */ public double getMin() { - return getState().getMinValue(); + return getState().minValue; } /** @@ -198,7 +198,7 @@ public class Slider extends AbstractField<Double> { * The new minimum slider value */ public void setMin(double min) { - getState().setMinValue(min); + getState().minValue = min; if (getValue() < min) { setValue(min); } @@ -211,7 +211,7 @@ public class Slider extends AbstractField<Double> { * {@link SliderOrientation#VERTICAL} */ public SliderOrientation getOrientation() { - return getState().getOrientation(); + return getState().orientation; } /** @@ -223,7 +223,7 @@ public class Slider extends AbstractField<Double> { * {@link SliderOrientation#VERTICAL} */ public void setOrientation(SliderOrientation orientation) { - getState().setOrientation(orientation); + getState().orientation = orientation; } /** @@ -233,7 +233,7 @@ public class Slider extends AbstractField<Double> { * @return resolution */ public int getResolution() { - return getState().getResolution(); + return getState().resolution; } /** @@ -250,7 +250,7 @@ public class Slider extends AbstractField<Double> { throw new IllegalArgumentException( "Cannot set a negative resolution to Slider"); } - getState().setResolution(resolution); + getState().resolution = resolution; } /** @@ -284,7 +284,7 @@ public class Slider extends AbstractField<Double> { } } - getState().setValue(newValue); + getState().value = newValue; super.setValue(newValue, repaintIsNotNeeded); } @@ -296,7 +296,7 @@ public class Slider extends AbstractField<Double> { } super.setValue(newFieldValue); // The cast is safe if the above call returned without throwing - getState().setValue((Double) newFieldValue); + getState().value = (Double) newFieldValue; } /** diff --git a/server/src/com/vaadin/ui/TextArea.java b/server/src/com/vaadin/ui/TextArea.java index 0dc9722eb3..cc8e947e24 100644 --- a/server/src/com/vaadin/ui/TextArea.java +++ b/server/src/com/vaadin/ui/TextArea.java @@ -1,4 +1,4 @@ -/* +/* * Copyright 2011 Vaadin Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not @@ -95,7 +95,7 @@ public class TextArea extends AbstractTextField { if (rows < 0) { rows = 0; } - getState().setRows(rows); + getState().rows = rows; } /** @@ -104,7 +104,7 @@ public class TextArea extends AbstractTextField { * @return number of explicitly set rows. */ public int getRows() { - return getState().getRows(); + return getState().rows; } /** @@ -115,7 +115,7 @@ public class TextArea extends AbstractTextField { * word-wrap mode. */ public void setWordwrap(boolean wordwrap) { - getState().setWordwrap(wordwrap); + getState().wordwrap = wordwrap; } /** @@ -125,7 +125,7 @@ public class TextArea extends AbstractTextField { * <code>false</code> if not. */ public boolean isWordwrap() { - return getState().isWordwrap(); + return getState().wordwrap; } } diff --git a/server/src/com/vaadin/ui/UI.java b/server/src/com/vaadin/ui/UI.java index a59b96d27a..d86d46c155 100644 --- a/server/src/com/vaadin/ui/UI.java +++ b/server/src/com/vaadin/ui/UI.java @@ -35,14 +35,14 @@ import com.vaadin.event.ActionManager; import com.vaadin.event.MouseEvents.ClickEvent; import com.vaadin.event.MouseEvents.ClickListener; import com.vaadin.server.AbstractApplicationServlet; +import com.vaadin.server.LegacyComponent; import com.vaadin.server.Page; +import com.vaadin.server.Page.BrowserWindowResizeEvent; +import com.vaadin.server.Page.BrowserWindowResizeListener; import com.vaadin.server.PaintException; import com.vaadin.server.PaintTarget; import com.vaadin.server.Resource; -import com.vaadin.server.LegacyComponent; import com.vaadin.server.WrappedRequest; -import com.vaadin.server.Page.BrowserWindowResizeEvent; -import com.vaadin.server.Page.BrowserWindowResizeListener; import com.vaadin.server.WrappedRequest.BrowserDetails; import com.vaadin.shared.EventId; import com.vaadin.shared.MouseEventDetails; @@ -385,7 +385,7 @@ public abstract class UI extends AbstractComponentContainer implements @Override public void setCaption(String caption) { // Override to provide backwards compatibility - getState().setCaption(caption); + getState().caption = caption; getPage().setTitle(caption); } @@ -879,7 +879,7 @@ public abstract class UI extends AbstractComponentContainer implements * @see #createDefaultLayout() */ public ComponentContainer getContent() { - return (ComponentContainer) getState().getContent(); + return (ComponentContainer) getState().content; } /** @@ -911,10 +911,10 @@ public abstract class UI extends AbstractComponentContainer implements content = createDefaultLayout(); } - if (getState().getContent() != null) { - super.removeComponent((Component) getState().getContent()); + if (getState().content != null) { + super.removeComponent((Component) getState().content); } - getState().setContent(content); + getState().content = content; if (content != null) { super.addComponent(content); } diff --git a/server/src/com/vaadin/ui/Window.java b/server/src/com/vaadin/ui/Window.java index aaf0fbc492..5c94a4c929 100644 --- a/server/src/com/vaadin/ui/Window.java +++ b/server/src/com/vaadin/ui/Window.java @@ -31,9 +31,9 @@ import com.vaadin.event.ShortcutAction; import com.vaadin.event.ShortcutAction.KeyCode; import com.vaadin.event.ShortcutAction.ModifierKey; import com.vaadin.event.ShortcutListener; +import com.vaadin.server.LegacyComponent; import com.vaadin.server.PaintException; import com.vaadin.server.PaintTarget; -import com.vaadin.server.LegacyComponent; import com.vaadin.shared.MouseEventDetails; import com.vaadin.shared.ui.window.WindowServerRpc; import com.vaadin.shared.ui.window.WindowState; @@ -242,7 +242,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, * @since 4.0.0 */ public int getPositionX() { - return getState().getPositionX(); + return getState().positionX; } /** @@ -255,8 +255,8 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, * @since 4.0.0 */ public void setPositionX(int positionX) { - getState().setPositionX(positionX); - getState().setCentered(false); + getState().positionX = positionX; + getState().centered = false; } /** @@ -269,7 +269,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, * @since 4.0.0 */ public int getPositionY() { - return getState().getPositionY(); + return getState().positionY; } /** @@ -283,8 +283,8 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, * @since 4.0.0 */ public void setPositionY(int positionY) { - getState().setPositionY(positionY); - getState().setCentered(false); + getState().positionY = positionY; + getState().centered = false; } private static final Method WINDOW_CLOSE_METHOD; @@ -540,7 +540,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, * true if modality is to be turned on */ public void setModal(boolean modal) { - getState().setModal(modal); + getState().modal = modal; center(); } @@ -548,7 +548,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, * @return true if this window is modal. */ public boolean isModal() { - return getState().isModal(); + return getState().modal; } /** @@ -558,7 +558,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, * true if resizability is to be turned on */ public void setResizable(boolean resizable) { - getState().setResizable(resizable); + getState().resizable = resizable; } /** @@ -566,7 +566,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, * @return true if window is resizable by the end-user, otherwise false. */ public boolean isResizable() { - return getState().isResizable(); + return getState().resizable; } /** @@ -575,7 +575,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, * sizes are recalculated immediately. */ public boolean isResizeLazy() { - return getState().isResizeLazy(); + return getState().resizeLazy; } /** @@ -591,7 +591,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, * calculate immediately. */ public void setResizeLazy(boolean resizeLazy) { - getState().setResizeLazy(resizeLazy); + getState().resizeLazy = resizeLazy; } /** @@ -604,7 +604,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, * Please refer to http://dev.vaadin.com/ticket/8971 for details. */ public void center() { - getState().setCentered(true); + getState().centered = true; } /** @@ -655,7 +655,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, * true if the sub window can be dragged by the user */ public boolean isDraggable() { - return getState().isDraggable(); + return getState().draggable; } /** @@ -668,7 +668,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, * true if the sub window can be dragged by the user */ public void setDraggable(boolean draggable) { - getState().setDraggable(draggable); + getState().draggable = draggable; } /* @@ -793,6 +793,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, * @deprecated Since 7.0, replaced by * {@link #addFocusListener(FocusListener)} **/ + @Override @Deprecated public void addListener(FocusListener listener) { addFocusListener(listener); @@ -807,6 +808,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, * @deprecated Since 7.0, replaced by * {@link #removeFocusListener(FocusListener)} **/ + @Override @Deprecated public void removeListener(FocusListener listener) { removeFocusListener(listener); @@ -829,6 +831,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, /** * @deprecated Since 7.0, replaced by {@link #addBlurListener(BlurListener)} **/ + @Override @Deprecated public void addListener(BlurListener listener) { addBlurListener(listener); @@ -843,6 +846,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, * @deprecated Since 7.0, replaced by * {@link #removeBlurListener(BlurListener)} **/ + @Override @Deprecated public void removeListener(BlurListener listener) { removeBlurListener(listener); |