diff options
Diffstat (limited to 'src/com/vaadin/ui')
79 files changed, 427 insertions, 199 deletions
diff --git a/src/com/vaadin/ui/AbsoluteLayout.java b/src/com/vaadin/ui/AbsoluteLayout.java index c7a1583d28..7872e05774 100644 --- a/src/com/vaadin/ui/AbsoluteLayout.java +++ b/src/com/vaadin/ui/AbsoluteLayout.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui; diff --git a/src/com/vaadin/ui/AbstractComponent.java b/src/com/vaadin/ui/AbstractComponent.java index 3038d4f334..70d7fe32a9 100644 --- a/src/com/vaadin/ui/AbstractComponent.java +++ b/src/com/vaadin/ui/AbstractComponent.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui; @@ -37,7 +37,7 @@ import com.vaadin.tools.ReflectTools; * external component can inherit this class to easily qualify as Vaadin * components. Most components in Vaadin do just that. * - * @author IT Mill Ltd. + * @author Vaadin Ltd. * @version * @VERSION@ * @since 3.0 diff --git a/src/com/vaadin/ui/AbstractComponentContainer.java b/src/com/vaadin/ui/AbstractComponentContainer.java index 73093c4123..5d5218307a 100644 --- a/src/com/vaadin/ui/AbstractComponentContainer.java +++ b/src/com/vaadin/ui/AbstractComponentContainer.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui; @@ -18,7 +18,7 @@ import com.vaadin.terminal.gwt.server.ComponentSizeValidator; * components that need to contain other components inherit this class to easily * qualify as a component container. * - * @author IT Mill Ltd + * @author Vaadin Ltd * @version * @VERSION@ * @since 3.0 diff --git a/src/com/vaadin/ui/AbstractField.java b/src/com/vaadin/ui/AbstractField.java index 44fb71ac84..34c7be3bf1 100644 --- a/src/com/vaadin/ui/AbstractField.java +++ b/src/com/vaadin/ui/AbstractField.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui; @@ -49,7 +49,7 @@ import com.vaadin.terminal.PaintTarget; * sure the value contained in the field is valid. * </p> * - * @author IT Mill Ltd. + * @author Vaadin Ltd. * @version * @VERSION@ * @since 3.0 @@ -1073,7 +1073,7 @@ public abstract class AbstractField<T> extends AbstractComponent implements * An <code>Event</code> object specifying the Property whose read-only * status has changed. * - * @author IT Mill Ltd. + * @author Vaadin Ltd. * @version * @VERSION@ * @since 3.0 diff --git a/src/com/vaadin/ui/AbstractLayout.java b/src/com/vaadin/ui/AbstractLayout.java index d0cc549138..378a59a4ad 100644 --- a/src/com/vaadin/ui/AbstractLayout.java +++ b/src/com/vaadin/ui/AbstractLayout.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui; @@ -18,7 +18,7 @@ import com.vaadin.ui.Layout.MarginHandler; * An abstract class that defines default implementation for the {@link Layout} * interface. * - * @author IT Mill Ltd. + * @author Vaadin Ltd. * @version * @VERSION@ * @since 5.0 diff --git a/src/com/vaadin/ui/AbstractMedia.java b/src/com/vaadin/ui/AbstractMedia.java index 44f4fefcc7..9117bce997 100644 --- a/src/com/vaadin/ui/AbstractMedia.java +++ b/src/com/vaadin/ui/AbstractMedia.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui; diff --git a/src/com/vaadin/ui/AbstractOrderedLayout.java b/src/com/vaadin/ui/AbstractOrderedLayout.java index 0b0fff2a34..8bba9fc46d 100644 --- a/src/com/vaadin/ui/AbstractOrderedLayout.java +++ b/src/com/vaadin/ui/AbstractOrderedLayout.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui; @@ -53,6 +53,8 @@ public abstract class AbstractOrderedLayout extends AbstractLayout implements */ @Override public void addComponent(Component c) { + // Add to components before calling super.addComponent + // so that it is available to AttachListeners components.add(c); try { super.addComponent(c); @@ -71,6 +73,11 @@ public abstract class AbstractOrderedLayout extends AbstractLayout implements * the component to be added. */ public void addComponentAsFirst(Component c) { + // If c is already in this, we must remove it before proceeding + // see ticket #7668 + if (c.getParent() == this) { + removeComponent(c); + } components.addFirst(c); try { super.addComponent(c); @@ -87,10 +94,19 @@ public abstract class AbstractOrderedLayout extends AbstractLayout implements * @param c * the component to be added. * @param index - * the Index of the component position. The components currently + * the index of the component position. The components currently * in and after the position are shifted forwards. */ public void addComponent(Component c, int index) { + // If c is already in this, we must remove it before proceeding + // see ticket #7668 + if (c.getParent() == this) { + // When c is removed, all components after it are shifted down + if (index > getComponentIndex(c)) { + index--; + } + removeComponent(c); + } components.add(index, c); try { super.addComponent(c); diff --git a/src/com/vaadin/ui/AbstractSelect.java b/src/com/vaadin/ui/AbstractSelect.java index 4361e1e9dd..8b6def08a6 100644 --- a/src/com/vaadin/ui/AbstractSelect.java +++ b/src/com/vaadin/ui/AbstractSelect.java @@ -1,5 +1,5 @@ /* - * @ITMillApache2LicenseForJavaFiles@ + * @VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui; @@ -49,7 +49,7 @@ import com.vaadin.terminal.gwt.client.ui.dd.VerticalDropLocation; * simultaneously. * </p> * - * @author IT Mill Ltd. + * @author Vaadin Ltd. * @version * @VERSION@ * @since 5.0 @@ -1628,7 +1628,7 @@ public abstract class AbstractSelect extends AbstractField<Object> implements * * <p> * Data interface does not support nulls as item ids. Selecting the item - * idetified by this id is the same as selecting no items at all. This + * identified by this id is the same as selecting no items at all. This * setting only affects the single select mode. * </p> * diff --git a/src/com/vaadin/ui/AbstractSplitPanel.java b/src/com/vaadin/ui/AbstractSplitPanel.java index 799a2df6e2..adb84f9d9d 100644 --- a/src/com/vaadin/ui/AbstractSplitPanel.java +++ b/src/com/vaadin/ui/AbstractSplitPanel.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui; diff --git a/src/com/vaadin/ui/AbstractTextField.java b/src/com/vaadin/ui/AbstractTextField.java index 9eb2ff076d..e843cf43b4 100644 --- a/src/com/vaadin/ui/AbstractTextField.java +++ b/src/com/vaadin/ui/AbstractTextField.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui; diff --git a/src/com/vaadin/ui/Accordion.java b/src/com/vaadin/ui/Accordion.java index 1f31009f91..5cf805615c 100644 --- a/src/com/vaadin/ui/Accordion.java +++ b/src/com/vaadin/ui/Accordion.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui; diff --git a/src/com/vaadin/ui/Alignment.java b/src/com/vaadin/ui/Alignment.java index 2c228e88f1..eb9e75e4d2 100644 --- a/src/com/vaadin/ui/Alignment.java +++ b/src/com/vaadin/ui/Alignment.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui; diff --git a/src/com/vaadin/ui/AlignmentUtils.java b/src/com/vaadin/ui/AlignmentUtils.java index 72c7b9e2de..029fc8c9b5 100644 --- a/src/com/vaadin/ui/AlignmentUtils.java +++ b/src/com/vaadin/ui/AlignmentUtils.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui; diff --git a/src/com/vaadin/ui/Audio.java b/src/com/vaadin/ui/Audio.java index 322b0a720f..574c1f4186 100644 --- a/src/com/vaadin/ui/Audio.java +++ b/src/com/vaadin/ui/Audio.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui; diff --git a/src/com/vaadin/ui/BaseFieldFactory.java b/src/com/vaadin/ui/BaseFieldFactory.java index d1dcf940e5..5e92c0c239 100644 --- a/src/com/vaadin/ui/BaseFieldFactory.java +++ b/src/com/vaadin/ui/BaseFieldFactory.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui; @@ -17,7 +17,7 @@ import com.vaadin.data.Property; * <b>default field type</b>: TextField. * <p> * - * @author IT Mill Ltd. + * @author Vaadin Ltd. * @version * @VERSION@ * @since 3.1 diff --git a/src/com/vaadin/ui/Button.java b/src/com/vaadin/ui/Button.java index 69b1ce993a..6d9ef0b59d 100644 --- a/src/com/vaadin/ui/Button.java +++ b/src/com/vaadin/ui/Button.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui; @@ -30,7 +30,7 @@ import com.vaadin.ui.Component.Focusable; /** * A generic button component. * - * @author IT Mill Ltd. + * @author Vaadin Ltd. * @version * @VERSION@ * @since 3.0 @@ -137,7 +137,7 @@ public class Button extends AbstractComponent implements /** * Click event. This event is thrown, when the button is clicked. * - * @author IT Mill Ltd. + * @author Vaadin Ltd. * @version * @VERSION@ * @since 3.0 @@ -298,7 +298,7 @@ public class Button extends AbstractComponent implements * Interface for listening for a {@link ClickEvent} fired by a * {@link Component}. * - * @author IT Mill Ltd. + * @author Vaadin Ltd. * @version * @VERSION@ * @since 3.0 diff --git a/src/com/vaadin/ui/CheckBox.java b/src/com/vaadin/ui/CheckBox.java index 250ab5f095..0d5f1ecdc1 100644 --- a/src/com/vaadin/ui/CheckBox.java +++ b/src/com/vaadin/ui/CheckBox.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui; diff --git a/src/com/vaadin/ui/ClientWidget.java b/src/com/vaadin/ui/ClientWidget.java index 1bfe58da66..8817f8f776 100644 --- a/src/com/vaadin/ui/ClientWidget.java +++ b/src/com/vaadin/ui/ClientWidget.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ /** * diff --git a/src/com/vaadin/ui/ComboBox.java b/src/com/vaadin/ui/ComboBox.java index bea6e61a3f..0fb8b9d873 100644 --- a/src/com/vaadin/ui/ComboBox.java +++ b/src/com/vaadin/ui/ComboBox.java @@ -1,5 +1,5 @@ /*
-@ITMillApache2LicenseForJavaFiles@
+@VaadinApache2LicenseForJavaFiles@
*/
package com.vaadin.ui;
diff --git a/src/com/vaadin/ui/Component.java b/src/com/vaadin/ui/Component.java index e5e1bb473e..53fdfdb4ff 100644 --- a/src/com/vaadin/ui/Component.java +++ b/src/com/vaadin/ui/Component.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui; @@ -47,7 +47,7 @@ import com.vaadin.terminal.VariableOwner; * main window of the application through its containment hierarchy. * </p> * - * @author IT Mill Ltd. + * @author Vaadin Ltd. * @version * @VERSION@ * @since 3.0 diff --git a/src/com/vaadin/ui/ComponentContainer.java b/src/com/vaadin/ui/ComponentContainer.java index d7254932ca..1e1f0796ca 100644 --- a/src/com/vaadin/ui/ComponentContainer.java +++ b/src/com/vaadin/ui/ComponentContainer.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui; @@ -12,7 +12,7 @@ import java.util.Iterator; * contain other components. All UI elements that can have child elements * implement this interface. * - * @author IT Mill Ltd. + * @author Vaadin Ltd. * @version * @VERSION@ * @since 3.0 diff --git a/src/com/vaadin/ui/CssLayout.java b/src/com/vaadin/ui/CssLayout.java index 5789a65ed3..b952609b20 100644 --- a/src/com/vaadin/ui/CssLayout.java +++ b/src/com/vaadin/ui/CssLayout.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui; @@ -76,6 +76,8 @@ public class CssLayout extends AbstractLayout implements LayoutClickNotifier { */ @Override public void addComponent(Component c) { + // Add to components before calling super.addComponent + // so that it is available to AttachListeners components.add(c); try { super.addComponent(c); @@ -94,6 +96,11 @@ public class CssLayout extends AbstractLayout implements LayoutClickNotifier { * the component to be added. */ public void addComponentAsFirst(Component c) { + // If c is already in this, we must remove it before proceeding + // see ticket #7668 + if (c.getParent() == this) { + removeComponent(c); + } components.addFirst(c); try { super.addComponent(c); @@ -110,10 +117,19 @@ public class CssLayout extends AbstractLayout implements LayoutClickNotifier { * @param c * the component to be added. * @param index - * the Index of the component position. The components currently + * the index of the component position. The components currently * in and after the position are shifted forwards. */ public void addComponent(Component c, int index) { + // If c is already in this, we must remove it before proceeding + // see ticket #7668 + if (c.getParent() == this) { + // When c is removed, all components after it are shifted down + if (index > components.indexOf(c)) { + index--; + } + removeComponent(c); + } components.add(index, c); try { super.addComponent(c); diff --git a/src/com/vaadin/ui/CustomComponent.java b/src/com/vaadin/ui/CustomComponent.java index c638e01fa5..0f891ac0fa 100644 --- a/src/com/vaadin/ui/CustomComponent.java +++ b/src/com/vaadin/ui/CustomComponent.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui; @@ -21,7 +21,7 @@ import com.vaadin.ui.ClientWidget.LoadStyle; * contain more components, but their interfaces are hidden from the users. * </p> * - * @author IT Mill Ltd. + * @author Vaadin Ltd. * @version * @VERSION@ * @since 3.0 diff --git a/src/com/vaadin/ui/CustomLayout.java b/src/com/vaadin/ui/CustomLayout.java index 47d1a970ac..dc473fb549 100644 --- a/src/com/vaadin/ui/CustomLayout.java +++ b/src/com/vaadin/ui/CustomLayout.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui; @@ -36,7 +36,7 @@ import com.vaadin.terminal.gwt.client.ui.VCustomLayout; * subcomponents just as in OrderedLayout. * </p> * - * @author IT Mill Ltd. + * @author Vaadin Ltd. * @author Duy B. Vo (<a * href="mailto:devduy@gmail.com?subject=Vaadin">devduy@gmail.com</a>) * @version diff --git a/src/com/vaadin/ui/DateField.java b/src/com/vaadin/ui/DateField.java index 2daac4a613..9e72a671f1 100644 --- a/src/com/vaadin/ui/DateField.java +++ b/src/com/vaadin/ui/DateField.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui; @@ -41,7 +41,7 @@ import com.vaadin.terminal.gwt.client.ui.VPopupCalendar; * enable buffering. * </p> * - * @author IT Mill Ltd. + * @author Vaadin Ltd. * @version * @VERSION@ * @since 3.0 diff --git a/src/com/vaadin/ui/DefaultFieldFactory.java b/src/com/vaadin/ui/DefaultFieldFactory.java index 3fd7f169ba..029174d3d1 100644 --- a/src/com/vaadin/ui/DefaultFieldFactory.java +++ b/src/com/vaadin/ui/DefaultFieldFactory.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui; diff --git a/src/com/vaadin/ui/DragAndDropWrapper.java b/src/com/vaadin/ui/DragAndDropWrapper.java index 9e06382eac..c6522f15c7 100644 --- a/src/com/vaadin/ui/DragAndDropWrapper.java +++ b/src/com/vaadin/ui/DragAndDropWrapper.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui; diff --git a/src/com/vaadin/ui/Embedded.java b/src/com/vaadin/ui/Embedded.java index 55991eafb2..dc14cc6ef8 100644 --- a/src/com/vaadin/ui/Embedded.java +++ b/src/com/vaadin/ui/Embedded.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui; @@ -19,7 +19,7 @@ import com.vaadin.terminal.gwt.client.ui.VEmbedded; /** * Component for embedding external objects. * - * @author IT Mill Ltd. + * @author Vaadin Ltd. * @version * @VERSION@ * @since 3.0 diff --git a/src/com/vaadin/ui/ExpandLayout.java b/src/com/vaadin/ui/ExpandLayout.java index a0d03fa3e5..55ee2ffdcf 100644 --- a/src/com/vaadin/ui/ExpandLayout.java +++ b/src/com/vaadin/ui/ExpandLayout.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui; diff --git a/src/com/vaadin/ui/Field.java b/src/com/vaadin/ui/Field.java index b4fb6047a7..6cc11daf08 100644 --- a/src/com/vaadin/ui/Field.java +++ b/src/com/vaadin/ui/Field.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui; @@ -10,6 +10,7 @@ import com.vaadin.ui.Component.Focusable; /** * TODO document + * @author Vaadin Ltd. * * @param T * the type of values in the field, which might not be the same type @@ -63,7 +64,7 @@ public interface Field<T> extends Component, BufferedValidatable, Property<T>, * An <code>Event</code> object specifying the Field whose value has been * changed. * - * @author IT Mill Ltd. + * @author Vaadin Ltd. * @version * @VERSION@ * @since 3.0 diff --git a/src/com/vaadin/ui/FieldFactory.java b/src/com/vaadin/ui/FieldFactory.java index 4c32b827b6..a021870612 100644 --- a/src/com/vaadin/ui/FieldFactory.java +++ b/src/com/vaadin/ui/FieldFactory.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui; @@ -10,7 +10,7 @@ import com.vaadin.data.Property; * Factory for creating new Field-instances based on type, datasource and/or * context. * - * @author IT Mill Ltd. + * @author Vaadin Ltd. * @version * @VERSION@ * @since 3.1 @@ -43,4 +43,4 @@ public interface FieldFactory extends FormFieldFactory, TableFieldFactory { */ Field<?> createField(Property property, Component uiContext); -}
\ No newline at end of file +} diff --git a/src/com/vaadin/ui/Form.java b/src/com/vaadin/ui/Form.java index 10a4427b9b..8cc21d5a82 100644 --- a/src/com/vaadin/ui/Form.java +++ b/src/com/vaadin/ui/Form.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui; @@ -54,7 +54,7 @@ import com.vaadin.terminal.gwt.client.ui.VForm; * {@link com.vaadin.data.util.BeanItem}. * </p> * - * @author IT Mill Ltd. + * @author Vaadin Ltd. * @version * @VERSION@ * @since 3.0 diff --git a/src/com/vaadin/ui/FormFieldFactory.java b/src/com/vaadin/ui/FormFieldFactory.java index 99254d975f..1efa05c5f5 100644 --- a/src/com/vaadin/ui/FormFieldFactory.java +++ b/src/com/vaadin/ui/FormFieldFactory.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui; @@ -15,7 +15,7 @@ import com.vaadin.data.Item; * * <p> * - * @author IT Mill Ltd. + * @author Vaadin Ltd. * @version * @VERSION@ * @since 6.0 diff --git a/src/com/vaadin/ui/FormLayout.java b/src/com/vaadin/ui/FormLayout.java index 97b5b0c7fc..f61f5d544e 100644 --- a/src/com/vaadin/ui/FormLayout.java +++ b/src/com/vaadin/ui/FormLayout.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui; diff --git a/src/com/vaadin/ui/GridLayout.java b/src/com/vaadin/ui/GridLayout.java index 83fd5f2a01..24a57d462b 100644 --- a/src/com/vaadin/ui/GridLayout.java +++ b/src/com/vaadin/ui/GridLayout.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui; @@ -35,7 +35,7 @@ import com.vaadin.terminal.gwt.client.ui.VGridLayout; * with cursor automatically extends the grid by increasing the grid height. * </p> * - * @author IT Mill Ltd. + * @author Vaadin Ltd. * @version * @VERSION@ * @since 3.0 @@ -666,7 +666,7 @@ public class GridLayout extends AbstractLayout implements * its upper left corner (column1,row1) and lower right corner * (column2,row2). * - * @author IT Mill Ltd. + * @author Vaadin Ltd. * @version * @VERSION@ * @since 3.0 @@ -852,7 +852,7 @@ public class GridLayout extends AbstractLayout implements * <code>OverlapsException</code> is thrown when a component already exists * (even partly) at the same space on a grid with the new component. * - * @author IT Mill Ltd. + * @author Vaadin Ltd. * @version * @VERSION@ * @since 3.0 @@ -910,7 +910,7 @@ public class GridLayout extends AbstractLayout implements * An <code>Exception</code> object which is thrown when an area exceeds the * bounds of the grid. * - * @author IT Mill Ltd. + * @author Vaadin Ltd. * @version * @VERSION@ * @since 3.0 diff --git a/src/com/vaadin/ui/HorizontalLayout.java b/src/com/vaadin/ui/HorizontalLayout.java index 7840d50027..ed1cad8184 100644 --- a/src/com/vaadin/ui/HorizontalLayout.java +++ b/src/com/vaadin/ui/HorizontalLayout.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui; @@ -12,7 +12,7 @@ import com.vaadin.ui.ClientWidget.LoadStyle; * <code>HorizontalLayout</code> is a component container, which shows the * subcomponents in the order of their addition (horizontally). * - * @author IT Mill Ltd. + * @author Vaadin Ltd. * @version * @VERSION@ * @since 5.3 diff --git a/src/com/vaadin/ui/HorizontalSplitPanel.java b/src/com/vaadin/ui/HorizontalSplitPanel.java index 381678dfed..d9368635df 100644 --- a/src/com/vaadin/ui/HorizontalSplitPanel.java +++ b/src/com/vaadin/ui/HorizontalSplitPanel.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui; diff --git a/src/com/vaadin/ui/Html5File.java b/src/com/vaadin/ui/Html5File.java index 760855aca1..aa3fb558fa 100644 --- a/src/com/vaadin/ui/Html5File.java +++ b/src/com/vaadin/ui/Html5File.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui; diff --git a/src/com/vaadin/ui/InlineDateField.java b/src/com/vaadin/ui/InlineDateField.java index d1066dc28a..0bf7924d34 100644 --- a/src/com/vaadin/ui/InlineDateField.java +++ b/src/com/vaadin/ui/InlineDateField.java @@ -1,5 +1,5 @@ /*
-@ITMillApache2LicenseForJavaFiles@
+@VaadinApache2LicenseForJavaFiles@
*/
package com.vaadin.ui;
@@ -17,7 +17,7 @@ import com.vaadin.terminal.gwt.client.ui.VDateFieldCalendar; *
* @see DateField
* @see PopupDateField
- * @author IT Mill Ltd.
+ * @author Vaadin Ltd.
* @version
* @VERSION@
* @since 5.0
diff --git a/src/com/vaadin/ui/Label.java b/src/com/vaadin/ui/Label.java index 5397875e60..96aa332ab4 100644 --- a/src/com/vaadin/ui/Label.java +++ b/src/com/vaadin/ui/Label.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui; @@ -33,7 +33,7 @@ import com.vaadin.ui.ClientWidget.LoadStyle; * the list recursively. * </p> * - * @author IT Mill Ltd. + * @author Vaadin Ltd. * @version * @VERSION@ * @since 3.0 @@ -413,7 +413,7 @@ public class Label extends AbstractComponent implements Property, /** * Value change event * - * @author IT Mill Ltd. + * @author Vaadin Ltd. * @version * @VERSION@ * @since 3.0 diff --git a/src/com/vaadin/ui/Layout.java b/src/com/vaadin/ui/Layout.java index df4798b0c2..a7cd0abdb4 100644 --- a/src/com/vaadin/ui/Layout.java +++ b/src/com/vaadin/ui/Layout.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui; @@ -15,7 +15,7 @@ import com.vaadin.terminal.gwt.client.ui.VMarginInfo; * various layout components to enable them to place other components in * specific locations in the UI. * - * @author IT Mill Ltd. + * @author Vaadin Ltd. * @version * @VERSION@ * @since 3.0 diff --git a/src/com/vaadin/ui/Link.java b/src/com/vaadin/ui/Link.java index c9aed3294a..99d742ec17 100644 --- a/src/com/vaadin/ui/Link.java +++ b/src/com/vaadin/ui/Link.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui; @@ -12,7 +12,7 @@ import com.vaadin.terminal.gwt.client.ui.VLink; /** * Link is used to create external or internal URL links. * - * @author IT Mill Ltd. + * @author Vaadin Ltd. * @version * @VERSION@ * @since 3.0 diff --git a/src/com/vaadin/ui/ListSelect.java b/src/com/vaadin/ui/ListSelect.java index 9aabc7514a..5c879f00f5 100644 --- a/src/com/vaadin/ui/ListSelect.java +++ b/src/com/vaadin/ui/ListSelect.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui; diff --git a/src/com/vaadin/ui/LoginForm.java b/src/com/vaadin/ui/LoginForm.java index 122f495b97..369bc45fe4 100644 --- a/src/com/vaadin/ui/LoginForm.java +++ b/src/com/vaadin/ui/LoginForm.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui; @@ -35,7 +35,6 @@ import com.vaadin.terminal.gwt.client.ApplicationConnection; * Login page html can be overridden by replacing protected getLoginHTML method. * As the login page is actually an iframe, styles must be handled manually. By * default component tries to guess the right place for theme css. - * <p> * * @since 5.3 */ diff --git a/src/com/vaadin/ui/MenuBar.java b/src/com/vaadin/ui/MenuBar.java index 4aae9b2621..3469f77ebb 100644 --- a/src/com/vaadin/ui/MenuBar.java +++ b/src/com/vaadin/ui/MenuBar.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui; @@ -511,7 +511,7 @@ public class MenuBar extends AbstractComponent { * items in a menu, to make it easier for users to find what they are * looking for in the menu. * - * @author Jouni Koivuviita / IT Mill Ltd. + * @author Jouni Koivuviita / Vaadin Ltd. * @since 6.2.0 */ public MenuBar.MenuItem addSeparator() { diff --git a/src/com/vaadin/ui/NativeButton.java b/src/com/vaadin/ui/NativeButton.java index 3a781c8ec2..46d13c4150 100644 --- a/src/com/vaadin/ui/NativeButton.java +++ b/src/com/vaadin/ui/NativeButton.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui; @@ -21,4 +21,4 @@ public class NativeButton extends Button { super(caption, listener); } -}
\ No newline at end of file +} diff --git a/src/com/vaadin/ui/NativeSelect.java b/src/com/vaadin/ui/NativeSelect.java index a99373dae8..e701d212b4 100644 --- a/src/com/vaadin/ui/NativeSelect.java +++ b/src/com/vaadin/ui/NativeSelect.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui; diff --git a/src/com/vaadin/ui/OptionGroup.java b/src/com/vaadin/ui/OptionGroup.java index 8daf6b6f99..884e58824a 100644 --- a/src/com/vaadin/ui/OptionGroup.java +++ b/src/com/vaadin/ui/OptionGroup.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui; diff --git a/src/com/vaadin/ui/OrderedLayout.java b/src/com/vaadin/ui/OrderedLayout.java index 4718c839ba..474fc89867 100644 --- a/src/com/vaadin/ui/OrderedLayout.java +++ b/src/com/vaadin/ui/OrderedLayout.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui; @@ -14,7 +14,7 @@ import com.vaadin.ui.ClientWidget.LoadStyle; * <code>OrderedLayout</code> is a component container, which shows the * subcomponents in the order of their addition in specified orientation. * - * @author IT Mill Ltd. + * @author Vaadin Ltd. * @version * @VERSION@ * @since 3.0 diff --git a/src/com/vaadin/ui/Panel.java b/src/com/vaadin/ui/Panel.java index 999b45cfa3..a69413c28b 100644 --- a/src/com/vaadin/ui/Panel.java +++ b/src/com/vaadin/ui/Panel.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui; @@ -24,7 +24,7 @@ import com.vaadin.ui.themes.Runo; /** * Panel - a simple single component container. * - * @author IT Mill Ltd. + * @author Vaadin Ltd. * @version * @VERSION@ * @since 3.0 diff --git a/src/com/vaadin/ui/PasswordField.java b/src/com/vaadin/ui/PasswordField.java index 609108c62f..99874147d5 100644 --- a/src/com/vaadin/ui/PasswordField.java +++ b/src/com/vaadin/ui/PasswordField.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui; diff --git a/src/com/vaadin/ui/PopupDateField.java b/src/com/vaadin/ui/PopupDateField.java index 7501c9fe15..d25608a4c4 100644 --- a/src/com/vaadin/ui/PopupDateField.java +++ b/src/com/vaadin/ui/PopupDateField.java @@ -1,5 +1,5 @@ /*
-@ITMillApache2LicenseForJavaFiles@
+@VaadinApache2LicenseForJavaFiles@
*/
package com.vaadin.ui;
@@ -18,7 +18,7 @@ import com.vaadin.terminal.PaintTarget; *
* @see DateField
* @see InlineDateField
- * @author IT Mill Ltd.
+ * @author Vaadin Ltd.
* @version
* @VERSION@
* @since 5.0
diff --git a/src/com/vaadin/ui/PopupView.java b/src/com/vaadin/ui/PopupView.java index 4e1f387504..fcad727510 100644 --- a/src/com/vaadin/ui/PopupView.java +++ b/src/com/vaadin/ui/PopupView.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui; @@ -19,7 +19,7 @@ import com.vaadin.terminal.gwt.client.ui.VPopupView; * view is displayed on a popup. The inner class {@link PopupView.Content} is * used to deliver contents to this component. * - * @author IT Mill Ltd. + * @author Vaadin Ltd. */ @SuppressWarnings("serial") @ClientWidget(VPopupView.class) diff --git a/src/com/vaadin/ui/ProgressIndicator.java b/src/com/vaadin/ui/ProgressIndicator.java index 7bf4bc56af..30555f9427 100644 --- a/src/com/vaadin/ui/ProgressIndicator.java +++ b/src/com/vaadin/ui/ProgressIndicator.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui; @@ -19,7 +19,7 @@ import com.vaadin.terminal.gwt.client.ui.VProgressIndicator; * * May view an other property that indicates progress 0...1 * - * @author IT Mill Ltd. + * @author Vaadin Ltd. * @version * @VERSION@ * @since 4 diff --git a/src/com/vaadin/ui/RichTextArea.java b/src/com/vaadin/ui/RichTextArea.java index 545a0e0a21..1ef843b789 100644 --- a/src/com/vaadin/ui/RichTextArea.java +++ b/src/com/vaadin/ui/RichTextArea.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui; diff --git a/src/com/vaadin/ui/Select.java b/src/com/vaadin/ui/Select.java index 439efdb864..0ea331dc40 100644 --- a/src/com/vaadin/ui/Select.java +++ b/src/com/vaadin/ui/Select.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui; @@ -38,7 +38,7 @@ import com.vaadin.terminal.gwt.client.ui.VFilterSelect; * simultaneously. * </p> * - * @author IT Mill Ltd. + * @author Vaadin Ltd. * @version * @VERSION@ * @since 3.0 diff --git a/src/com/vaadin/ui/Slider.java b/src/com/vaadin/ui/Slider.java index ae10e91e22..35ced877bb 100644 --- a/src/com/vaadin/ui/Slider.java +++ b/src/com/vaadin/ui/Slider.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui; @@ -44,9 +44,8 @@ import com.vaadin.terminal.gwt.client.ui.VSlider; * * </code> * - * @author IT Mill Ltd. + * @author Vaadin Ltd. */ -@SuppressWarnings("serial") @ClientWidget(VSlider.class) public class Slider extends AbstractField<Number> { @@ -110,7 +109,7 @@ public class Slider extends AbstractField<Number> { private final boolean arrows = false; /** - * Default Slider constructor. Sets all values to defaults and the slide + * Default slider constructor. Sets all values to defaults and the slide * handle at minimum value. * */ @@ -120,11 +119,13 @@ public class Slider extends AbstractField<Number> { } /** - * Create a new slider with the caption given as parameter. All slider - * values set to defaults. + * Create a new slider with the caption given as parameter. + * + * The range of the slider is set to 0-100 and only integer values are + * allowed. * * @param caption - * The caption for this Slider (e.g. "Volume"). + * The caption for this slider (e.g. "Volume"). */ public Slider(String caption) { this(); @@ -132,11 +133,14 @@ public class Slider extends AbstractField<Number> { } /** - * Create a new slider with given range and resolution + * Create a new slider with the given range and resolution. * * @param min + * The minimum value of the slider * @param max + * The maximum value of the slider * @param resolution + * The number of digits after the decimal point. */ public Slider(double min, double max, int resolution) { this(); @@ -146,10 +150,12 @@ public class Slider extends AbstractField<Number> { } /** - * Create a new slider with given range + * Create a new slider with the given range that only allows integer values. * * @param min + * The minimum value of the slider * @param max + * The maximum value of the slider */ public Slider(int min, int max) { this(); @@ -159,11 +165,15 @@ public class Slider extends AbstractField<Number> { } /** - * Create a new slider with given caption and range + * Create a new slider with the given caption and range that only allows + * integer values. * * @param caption + * The caption for the slider * @param min + * The minimum value of the slider * @param max + * The maximum value of the slider */ public Slider(String caption, int min, int max) { this(min, max); @@ -171,20 +181,20 @@ public class Slider extends AbstractField<Number> { } /** - * Gets the biggest possible value in Sliders range. + * Gets the maximum slider value * - * @return the biggest value slider can have + * @return the largest value the slider can have */ public double getMax() { return max; } /** - * Set the maximum value of the Slider. If the current value of the Slider - * is out of new bounds, the value is set to new minimum. + * Set the maximum slider value. If the current value of the slider is + * larger than this, the value is set to the new maximum. * * @param max - * New maximum value of the Slider. + * The new maximum slider value */ public void setMax(double max) { this.max = max; @@ -204,20 +214,20 @@ public class Slider extends AbstractField<Number> { } /** - * Gets the minimum value in Sliders range. + * Gets the minimum slider value * - * @return the smalles value slider can have + * @return the smallest value the slider can have */ public double getMin() { return min; } /** - * Set the minimum value of the Slider. If the current value of the Slider - * is out of new bounds, the value is set to new minimum. + * Set the minimum slider value. If the current value of the slider is + * smaller than this, the value is set to the new minimum. * - * @param min - * New minimum value of the Slider. + * @param max + * The new minimum slider value */ public void setMin(double min) { this.min = min; @@ -237,18 +247,21 @@ public class Slider extends AbstractField<Number> { } /** - * Get the current orientation of the Slider (horizontal or vertical). + * Get the current orientation of the slider (horizontal or vertical). * - * @return orientation + * @return {@link #ORIENTATION_HORIZONTAL} or + * {@link #ORIENTATION_HORIZONTAL} */ public int getOrientation() { return orientation; } /** - * Set the orientation of the Slider. + * Set the orientation of the slider. * - * @param int new orientation + * @param The + * new orientation, either {@link #ORIENTATION_HORIZONTAL} or + * {@link #ORIENTATION_VERTICAL} */ public void setOrientation(int orientation) { this.orientation = orientation; @@ -256,7 +269,8 @@ public class Slider extends AbstractField<Number> { } /** - * Get the current resolution of the Slider. + * Get the current resolution of the slider. The resolution is the number of + * digits after the decimal point. * * @return resolution */ @@ -265,7 +279,8 @@ public class Slider extends AbstractField<Number> { } /** - * Set a new resolution for the Slider. + * Set a new resolution for the slider. The resolution is the number of + * digits after the decimal point. * * @param resolution */ @@ -278,14 +293,15 @@ public class Slider extends AbstractField<Number> { } /** - * Set the value of this Slider. + * Sets the value of the slider. * * @param value - * New value of Slider. Must be within Sliders range (min - max), - * otherwise throws an exception. + * The new value of the slider. * @param repaintIsNotNeeded * If true, client-side is not requested to repaint itself. * @throws ValueOutOfBoundsException + * If the given value is not inside the range of the slider. + * @see #setMin(double) {@link #setMax(double)} */ public void setValue(Double value, boolean repaintIsNotNeeded) throws ValueOutOfBoundsException { @@ -308,31 +324,33 @@ public class Slider extends AbstractField<Number> { } /** - * Set the value of this Slider. + * Sets the value of the slider. * * @param value - * New value of Slider. Must be within Sliders range (min - max), - * otherwise throws an exception. + * The new value of the slider. * @throws ValueOutOfBoundsException + * If the given value is not inside the range of the slider. + * @see #setMin(double) {@link #setMax(double)} */ public void setValue(Double value) throws ValueOutOfBoundsException { setValue(value, false); } /** - * Set the value of this Slider. + * Sets the value of the slider. * * @param value - * New value of Slider. Must be within Sliders range (min - max), - * otherwise throws an exception. + * The new value of the slider. * @throws ValueOutOfBoundsException + * If the given value is not inside the range of the slider. + * @see #setMin(double) {@link #setMax(double)} */ public void setValue(double value) throws ValueOutOfBoundsException { setValue(new Double(value), false); } /** - * Get the current Slider size. + * Get the current slider size. * * @return size in pixels or -1 for auto sizing. * @deprecated use standard getWidth/getHeight instead @@ -343,7 +361,7 @@ public class Slider extends AbstractField<Number> { } /** - * Set the size for this Slider. + * Set the size for this slider. * * @param size * in pixels, or -1 auto sizing. @@ -364,7 +382,7 @@ public class Slider extends AbstractField<Number> { } /** - * Get the handle size of this Slider. + * Get the handle size of this slider. * * @return handle size in percentages. * @deprecated The size is dictated by the current theme. @@ -375,7 +393,7 @@ public class Slider extends AbstractField<Number> { } /** - * Set the handle size of this Slider. + * Set the handle size of this slider. * * @param handleSize * in percentages relative to slider base size. @@ -466,9 +484,10 @@ public class Slider extends AbstractField<Number> { } /** - * ValueOutOfBoundsException + * Thrown when the value of the slider is about to be set to a value that is + * outside the valid range of the slider. * - * @author IT Mill Ltd. + * @author Vaadin Ltd. * */ public class ValueOutOfBoundsException extends Exception { @@ -485,6 +504,11 @@ public class Slider extends AbstractField<Number> { value = valueOutOfBounds; } + /** + * Gets the value that is outside the valid range of the slider. + * + * @return the value that is out of bounds + */ public Double getValue() { return value; } diff --git a/src/com/vaadin/ui/SplitPanel.java b/src/com/vaadin/ui/SplitPanel.java index 246a77c896..bae1bf7ce0 100644 --- a/src/com/vaadin/ui/SplitPanel.java +++ b/src/com/vaadin/ui/SplitPanel.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui; @@ -15,7 +15,7 @@ import com.vaadin.ui.ClientWidget.LoadStyle; * <code>SplitPanel</code> is a component container, that can contain two * components (possibly containers) which are split by divider element. * - * @author IT Mill Ltd. + * @author Vaadin Ltd. * @version * @VERSION@ * @since 5.0 diff --git a/src/com/vaadin/ui/TabSheet.java b/src/com/vaadin/ui/TabSheet.java index a7db4cdbd3..a13c336943 100644 --- a/src/com/vaadin/ui/TabSheet.java +++ b/src/com/vaadin/ui/TabSheet.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui; @@ -48,7 +48,7 @@ import com.vaadin.ui.themes.Runo; * The current implementation does not load the tabs to the UI before the first * time they are shown, but this may change in future releases. * - * @author IT Mill Ltd. + * @author Vaadin Ltd. * @version * @VERSION@ * @since 3.0 @@ -774,7 +774,7 @@ public class TabSheet extends AbstractComponentContainer { * Selected tab change event. This event is sent when the selected (shown) * tab in the tab sheet is changed. * - * @author IT Mill Ltd. + * @author Vaadin Ltd. * @version * @VERSION@ * @since 3.0 @@ -806,7 +806,7 @@ public class TabSheet extends AbstractComponentContainer { * another tab is selected, including when adding the first tab to a * tabsheet. * - * @author IT Mill Ltd. + * @author Vaadin Ltd. * * @version * @VERSION@ @@ -1165,7 +1165,7 @@ public class TabSheet extends AbstractComponentContainer { * CloseHandler is used to process tab closing events. Default behavior is * to remove the tab from the TabSheet. * - * @author Jouni Koivuviita / IT Mill Ltd. + * @author Jouni Koivuviita / Vaadin Ltd. * @since 6.2.0 * */ diff --git a/src/com/vaadin/ui/Table.java b/src/com/vaadin/ui/Table.java index 759a667259..574704d3bf 100644 --- a/src/com/vaadin/ui/Table.java +++ b/src/com/vaadin/ui/Table.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui; @@ -67,7 +67,7 @@ import com.vaadin.terminal.gwt.client.ui.dd.VLazyInitItemIdentifiers; * Components in a Table will not have their caption nor icon rendered. * </p> * - * @author IT Mill Ltd. + * @author Vaadin Ltd. * @version * @VERSION@ * @since 3.0 @@ -2716,7 +2716,7 @@ public class Table extends AbstractSelect implements Action.Container, rowCacheInvalidated = invalidated; } - private boolean isRowCacheInvalidated() { + protected boolean isRowCacheInvalidated() { return rowCacheInvalidated; } @@ -3834,8 +3834,12 @@ public class Table extends AbstractSelect implements Action.Container, final LinkedList<Object> visible = new LinkedList<Object>(); final Object[][] cells = getVisibleCells(); - for (int i = 0; i < cells[CELL_ITEMID].length; i++) { - visible.add(cells[CELL_ITEMID][i]); + // may be null if the table has not been rendered yet (e.g. not attached + // to a layout) + if (null != cells) { + for (int i = 0; i < cells[CELL_ITEMID].length; i++) { + visible.add(cells[CELL_ITEMID][i]); + } } return visible; @@ -4027,6 +4031,9 @@ public class Table extends AbstractSelect implements Action.Container, */ public void setTableFieldFactory(TableFieldFactory fieldFactory) { this.fieldFactory = fieldFactory; + + // Assure visual refresh + refreshRowCache(); } /** diff --git a/src/com/vaadin/ui/TableFieldFactory.java b/src/com/vaadin/ui/TableFieldFactory.java index 56539ef004..6c9a641aa8 100644 --- a/src/com/vaadin/ui/TableFieldFactory.java +++ b/src/com/vaadin/ui/TableFieldFactory.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui; @@ -16,7 +16,7 @@ import com.vaadin.data.Container; * * <p> * - * @author IT Mill Ltd. + * @author Vaadin Ltd. * @version * @VERSION@ * @since 6.0 diff --git a/src/com/vaadin/ui/TextArea.java b/src/com/vaadin/ui/TextArea.java index 5d1136d2c6..e1e5aeabd4 100644 --- a/src/com/vaadin/ui/TextArea.java +++ b/src/com/vaadin/ui/TextArea.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui; diff --git a/src/com/vaadin/ui/TextField.java b/src/com/vaadin/ui/TextField.java index 5702c47770..0d719efd12 100644 --- a/src/com/vaadin/ui/TextField.java +++ b/src/com/vaadin/ui/TextField.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui; @@ -25,7 +25,7 @@ import com.vaadin.ui.ClientWidget.LoadStyle; * to enable buffering. * </p> * - * @author IT Mill Ltd. + * @author Vaadin Ltd. * @version * @VERSION@ * @since 3.0 diff --git a/src/com/vaadin/ui/Tree.java b/src/com/vaadin/ui/Tree.java index ede37f2c60..554afda97c 100644 --- a/src/com/vaadin/ui/Tree.java +++ b/src/com/vaadin/ui/Tree.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui; @@ -54,7 +54,7 @@ import com.vaadin.tools.ReflectTools; * Tree component. A Tree can be used to select an item (or multiple items) from * a hierarchical set of items. * - * @author IT Mill Ltd. + * @author Vaadin Ltd. * @version * @VERSION@ * @since 3.0 @@ -834,7 +834,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, * is to be expanded. it can me used to dynamically fill the sub-nodes of * the node. * - * @author IT Mill Ltd. + * @author Vaadin Ltd. * @version * @VERSION@ * @since 3.0 @@ -868,7 +868,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /** * Expand event listener. * - * @author IT Mill Ltd. + * @author Vaadin Ltd. * @version * @VERSION@ * @since 3.0 @@ -923,7 +923,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /** * Collapse event * - * @author IT Mill Ltd. + * @author Vaadin Ltd. * @version * @VERSION@ * @since 3.0 @@ -957,7 +957,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, /** * Collapse event listener. * - * @author IT Mill Ltd. + * @author Vaadin Ltd. * @version * @VERSION@ * @since 3.0 diff --git a/src/com/vaadin/ui/TreeTable.java b/src/com/vaadin/ui/TreeTable.java index fb12ffe323..43bc7a80fe 100644 --- a/src/com/vaadin/ui/TreeTable.java +++ b/src/com/vaadin/ui/TreeTable.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui; @@ -385,7 +385,7 @@ public class TreeTable extends Table implements Hierarchical { String object = (String) variables.get("toggleCollapsed"); Object itemId = itemIdMapper.get(object); toggledItemId = itemId; - toggleChildVisibility(itemId); + toggleChildVisibility(itemId, false); if (variables.containsKey("selectCollapsed")) { // ensure collapsed is selected unless opened with selection // head @@ -470,7 +470,8 @@ public class TreeTable extends Table implements Hierarchical { @Override protected boolean isPartialRowUpdate() { - return toggledItemId != null && containerSupportsPartialUpdates; + return toggledItemId != null && containerSupportsPartialUpdates + && !isRowCacheInvalidated(); } @Override @@ -516,7 +517,7 @@ public class TreeTable extends Table implements Hierarchical { return !getContainerStrategy().isNodeOpen(toggledItemId); } - private void toggleChildVisibility(Object itemId) { + private void toggleChildVisibility(Object itemId, boolean forceFullRefresh) { getContainerStrategy().toggleChildVisibility(itemId); // ensure that page still has first item in page, DON'T clear the // caches. @@ -528,7 +529,7 @@ public class TreeTable extends Table implements Hierarchical { fireExpandEvent(itemId); } - if (containerSupportsPartialUpdates) { + if (containerSupportsPartialUpdates && !forceFullRefresh) { requestRepaint(); } else { // For containers that do not send item set change events, always do @@ -646,8 +647,8 @@ public class TreeTable extends Table implements Hierarchical { } /** - * Sets the Item specified by given identifier collapsed or expanded. If the - * Item is collapsed, its children is not displayed in for the user. + * Sets the Item specified by given identifier as collapsed or expanded. If + * the Item is collapsed, its children are not displayed to the user. * * @param itemId * the identifier of the Item @@ -656,7 +657,18 @@ public class TreeTable extends Table implements Hierarchical { */ public void setCollapsed(Object itemId, boolean collapsed) { if (isCollapsed(itemId) != collapsed) { - toggleChildVisibility(itemId); + if (null == toggledItemId && !isRowCacheInvalidated() + && getVisibleItemIds().contains(itemId)) { + // optimization: partial refresh if only one item is + // collapsed/expanded + toggledItemId = itemId; + toggleChildVisibility(itemId, false); + } else { + // make sure a full refresh takes place - otherwise neither + // partial nor full repaint of table content is performed + toggledItemId = null; + toggleChildVisibility(itemId, true); + } } } diff --git a/src/com/vaadin/ui/TwinColSelect.java b/src/com/vaadin/ui/TwinColSelect.java index 848aae7244..1c1fe07a5c 100644 --- a/src/com/vaadin/ui/TwinColSelect.java +++ b/src/com/vaadin/ui/TwinColSelect.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui; diff --git a/src/com/vaadin/ui/Upload.java b/src/com/vaadin/ui/Upload.java index 0a8227699a..9d684291a5 100644 --- a/src/com/vaadin/ui/Upload.java +++ b/src/com/vaadin/ui/Upload.java @@ -1,5 +1,5 @@ /* - * @ITMillApache2LicenseForJavaFiles@ + * @VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui; @@ -55,7 +55,7 @@ import com.vaadin.ui.ClientWidget.LoadStyle; * element, setting size for Upload component is not supported. For some * browsers setting size may work to some extend. * - * @author IT Mill Ltd. + * @author Vaadin Ltd. * @version * @VERSION@ * @since 3.0 @@ -182,7 +182,7 @@ public class Upload extends AbstractComponent implements Component.Focusable { * Interface that must be implemented by the upload receivers to provide the * Upload component an output stream to write the uploaded data. * - * @author IT Mill Ltd. + * @author Vaadin Ltd. * @version * @VERSION@ * @since 3.0 @@ -237,7 +237,7 @@ public class Upload extends AbstractComponent implements Component.Focusable { * distinguish between the two cases, use either SucceededEvent or * FailedEvent, which are both subclasses of the FinishedEvent. * - * @author IT Mill Ltd. + * @author Vaadin Ltd. * @version * @VERSION@ * @since 3.0 @@ -320,7 +320,7 @@ public class Upload extends AbstractComponent implements Component.Focusable { * Upload.FailedEvent event is sent when the upload is received, but the * reception is interrupted for some reason. * - * @author IT Mill Ltd. + * @author Vaadin Ltd. * @version * @VERSION@ * @since 3.0 @@ -408,7 +408,7 @@ public class Upload extends AbstractComponent implements Component.Focusable { * Upload.SucceededEvent event is sent when the upload is received * successfully. * - * @author IT Mill Ltd. + * @author Vaadin Ltd. * @version * @VERSION@ * @since 3.0 @@ -432,7 +432,7 @@ public class Upload extends AbstractComponent implements Component.Focusable { /** * Upload.StartedEvent event is sent when the upload is started to received. * - * @author IT Mill Ltd. + * @author Vaadin Ltd. * @version * @VERSION@ * @since 5.0 @@ -500,7 +500,7 @@ public class Upload extends AbstractComponent implements Component.Focusable { /** * Receives the events when the upload starts. * - * @author IT Mill Ltd. + * @author Vaadin Ltd. * @version * @VERSION@ * @since 5.0 @@ -519,7 +519,7 @@ public class Upload extends AbstractComponent implements Component.Focusable { /** * Receives the events when the uploads are ready. * - * @author IT Mill Ltd. + * @author Vaadin Ltd. * @version * @VERSION@ * @since 3.0 @@ -538,7 +538,7 @@ public class Upload extends AbstractComponent implements Component.Focusable { /** * Receives events when the uploads are finished, but unsuccessful. * - * @author IT Mill Ltd. + * @author Vaadin Ltd. * @version * @VERSION@ * @since 3.0 @@ -557,7 +557,7 @@ public class Upload extends AbstractComponent implements Component.Focusable { /** * Receives events when the uploads are successfully finished. * - * @author IT Mill Ltd. + * @author Vaadin Ltd. * @version * @VERSION@ * @since 3.0 diff --git a/src/com/vaadin/ui/UriFragmentUtility.java b/src/com/vaadin/ui/UriFragmentUtility.java new file mode 100644 index 0000000000..5eaffbde6f --- /dev/null +++ b/src/com/vaadin/ui/UriFragmentUtility.java @@ -0,0 +1,153 @@ +/* +@VaadinApache2LicenseForJavaFiles@ + */ +package com.vaadin.ui; + +import java.io.Serializable; +import java.lang.reflect.Method; +import java.util.Map; + +import com.vaadin.terminal.PaintException; +import com.vaadin.terminal.PaintTarget; +import com.vaadin.terminal.gwt.client.ui.VUriFragmentUtility; +import com.vaadin.ui.ClientWidget.LoadStyle; + +/** + * Experimental web browser dependent component for URI fragment (part after + * hash mark "#") reading and writing. + * + * Component can be used to workaround common ajax web applications pitfalls: + * bookmarking a program state and back button. + * + */ +@SuppressWarnings("serial") +@ClientWidget(value = VUriFragmentUtility.class, loadStyle = LoadStyle.EAGER) +public class UriFragmentUtility extends AbstractComponent { + + /** + * Listener that listens changes in URI fragment. + */ + public interface FragmentChangedListener extends Serializable { + + public void fragmentChanged(FragmentChangedEvent source); + + } + + /** + * Event fired when uri fragment changes. + */ + public class FragmentChangedEvent extends Component.Event { + + /** + * Creates a new instance of UriFragmentReader change event. + * + * @param source + * the Source of the event. + */ + public FragmentChangedEvent(Component source) { + super(source); + } + + /** + * Gets the UriFragmentReader where the event occurred. + * + * @return the Source of the event. + */ + public UriFragmentUtility getUriFragmentUtility() { + return (UriFragmentUtility) getSource(); + } + } + + private static final Method FRAGMENT_CHANGED_METHOD; + + static { + try { + FRAGMENT_CHANGED_METHOD = FragmentChangedListener.class + .getDeclaredMethod("fragmentChanged", + new Class[] { FragmentChangedEvent.class }); + } catch (final java.lang.NoSuchMethodException e) { + // This should never happen + throw new java.lang.RuntimeException( + "Internal error finding methods in FragmentChangedListener"); + } + } + + public void addListener(FragmentChangedListener listener) { + addListener(FragmentChangedEvent.class, listener, + FRAGMENT_CHANGED_METHOD); + } + + public void removeListener(FragmentChangedListener listener) { + removeListener(FragmentChangedEvent.class, listener, + FRAGMENT_CHANGED_METHOD); + } + + private String fragment; + + public UriFragmentUtility() { + // immediate by default + setImmediate(true); + } + + @Override + public void paintContent(PaintTarget target) throws PaintException { + super.paintContent(target); + target.addVariable(this, "fragment", fragment); + } + + @Override + public void changeVariables(Object source, Map<String, Object> variables) { + super.changeVariables(source, variables); + fragment = (String) variables.get("fragment"); + fireEvent(new FragmentChangedEvent(this)); + } + + /** + * Gets currently set URI fragment. + * <p> + * To listen changes in fragment, hook a {@link FragmentChangedListener}. + * <p> + * Note that initial URI fragment that user used to enter the application + * will be read after application init. It fires FragmentChangedEvent only + * if it is not the same as on server side. + * + * @return the current fragment in browser uri or null if not known + */ + public String getFragment() { + return fragment; + } + + /** + * Sets URI fragment. Optionally fires a {@link FragmentChangedEvent} + * + * @param newFragment + * id of the new fragment + * @param fireEvent + * true to fire event + * @see FragmentChangedEvent + * @see FragmentChangedListener + */ + public void setFragment(String newFragment, boolean fireEvent) { + if ((newFragment == null && fragment != null) + || (newFragment != null && !newFragment.equals(fragment))) { + fragment = newFragment; + if (fireEvent) { + fireEvent(new FragmentChangedEvent(this)); + } + requestRepaint(); + } + } + + /** + * Sets URI fragment. This method fires a {@link FragmentChangedEvent} + * + * @param newFragment + * id of the new fragment + * @see FragmentChangedEvent + * @see FragmentChangedListener + */ + public void setFragment(String newFragment) { + setFragment(newFragment, true); + } + +} diff --git a/src/com/vaadin/ui/VerticalLayout.java b/src/com/vaadin/ui/VerticalLayout.java index 40ea05b697..c40aeaea30 100644 --- a/src/com/vaadin/ui/VerticalLayout.java +++ b/src/com/vaadin/ui/VerticalLayout.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui; @@ -13,7 +13,7 @@ import com.vaadin.ui.ClientWidget.LoadStyle; * subcomponents in the order of their addition (vertically). A vertical layout * is by default 100% wide. * - * @author IT Mill Ltd. + * @author Vaadin Ltd. * @version * @VERSION@ * @since 5.3 diff --git a/src/com/vaadin/ui/VerticalSplitPanel.java b/src/com/vaadin/ui/VerticalSplitPanel.java index bb4edc4c2c..699bd9287c 100644 --- a/src/com/vaadin/ui/VerticalSplitPanel.java +++ b/src/com/vaadin/ui/VerticalSplitPanel.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui; diff --git a/src/com/vaadin/ui/Video.java b/src/com/vaadin/ui/Video.java index 26d79a438f..ed6588f96a 100644 --- a/src/com/vaadin/ui/Video.java +++ b/src/com/vaadin/ui/Video.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui; diff --git a/src/com/vaadin/ui/Window.java b/src/com/vaadin/ui/Window.java index 037bb64873..46e16eb986 100644 --- a/src/com/vaadin/ui/Window.java +++ b/src/com/vaadin/ui/Window.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui; @@ -65,7 +65,7 @@ import com.vaadin.terminal.gwt.client.ui.VWindow; * Sub window is to be split into a separate component in Vaadin 7. * </p> * - * @author IT Mill Ltd. + * @author Vaadin Ltd. * @version * @VERSION@ * @since 3.0 @@ -436,8 +436,8 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier { * user closes the window. * * <p> - * Since Vaadin 6.5, removing windows using {@link #removeWindow(Window)} - * does fire the CloseListener. + * Since Vaadin 6.5, removing a window using {@link #removeWindow(Window)} + * fires the CloseListener. * </p> */ public interface CloseListener extends Serializable { diff --git a/src/com/vaadin/ui/themes/BaseTheme.java b/src/com/vaadin/ui/themes/BaseTheme.java index b501f8a05c..c652a8a675 100644 --- a/src/com/vaadin/ui/themes/BaseTheme.java +++ b/src/com/vaadin/ui/themes/BaseTheme.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui.themes; diff --git a/src/com/vaadin/ui/themes/ChameleonTheme.java b/src/com/vaadin/ui/themes/ChameleonTheme.java index b750b668fc..bfb9686018 100644 --- a/src/com/vaadin/ui/themes/ChameleonTheme.java +++ b/src/com/vaadin/ui/themes/ChameleonTheme.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui.themes; diff --git a/src/com/vaadin/ui/themes/LiferayTheme.java b/src/com/vaadin/ui/themes/LiferayTheme.java index 458a6af784..9b48306ac2 100644 --- a/src/com/vaadin/ui/themes/LiferayTheme.java +++ b/src/com/vaadin/ui/themes/LiferayTheme.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui.themes; diff --git a/src/com/vaadin/ui/themes/Reindeer.java b/src/com/vaadin/ui/themes/Reindeer.java index b2d588d9bd..7aaae8faa2 100644 --- a/src/com/vaadin/ui/themes/Reindeer.java +++ b/src/com/vaadin/ui/themes/Reindeer.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui.themes; diff --git a/src/com/vaadin/ui/themes/Runo.java b/src/com/vaadin/ui/themes/Runo.java index bc36dbc1cf..28a19e8dcd 100644 --- a/src/com/vaadin/ui/themes/Runo.java +++ b/src/com/vaadin/ui/themes/Runo.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui.themes; diff --git a/src/com/vaadin/ui/treetable/Collapsible.java b/src/com/vaadin/ui/treetable/Collapsible.java index e14192ccf5..bec0ba9ae9 100644 --- a/src/com/vaadin/ui/treetable/Collapsible.java +++ b/src/com/vaadin/ui/treetable/Collapsible.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui.treetable; diff --git a/src/com/vaadin/ui/treetable/HierarchicalContainerOrderedWrapper.java b/src/com/vaadin/ui/treetable/HierarchicalContainerOrderedWrapper.java index 73bc8ee07c..f826c59bf7 100644 --- a/src/com/vaadin/ui/treetable/HierarchicalContainerOrderedWrapper.java +++ b/src/com/vaadin/ui/treetable/HierarchicalContainerOrderedWrapper.java @@ -1,5 +1,5 @@ /* -@ITMillApache2LicenseForJavaFiles@ +@VaadinApache2LicenseForJavaFiles@ */ package com.vaadin.ui.treetable; |