summaryrefslogtreecommitdiffstats
path: root/src/com/vaadin/ui
diff options
context:
space:
mode:
authorMatti Tahvonen <matti.tahvonen@itmill.com>2009-09-25 12:07:09 +0000
committerMatti Tahvonen <matti.tahvonen@itmill.com>2009-09-25 12:07:09 +0000
commit5ef5da15a7903262494d7e3fd7867dde7ed746c4 (patch)
treee8227a00f50dd110149c391301536c99a1dd035a /src/com/vaadin/ui
parent0da15b7ebb4b356e49bda9b9c0fb6faf95029fd2 (diff)
downloadvaadin-framework-5ef5da15a7903262494d7e3fd7867dde7ed746c4.tar.gz
vaadin-framework-5ef5da15a7903262494d7e3fd7867dde7ed746c4.zip
steps toward simpler widgetset creation. Still needs a lot of cleaning and refining.
svn changeset:8930/svn branch:2009-09-widget-packaging_3332
Diffstat (limited to 'src/com/vaadin/ui')
-rw-r--r--src/com/vaadin/ui/AbsoluteLayout.java1
-rw-r--r--src/com/vaadin/ui/AbstractComponent.java15
-rw-r--r--src/com/vaadin/ui/Accordion.java3
-rw-r--r--src/com/vaadin/ui/Button.java2
-rw-r--r--src/com/vaadin/ui/CheckBox.java5
-rw-r--r--src/com/vaadin/ui/ClientWidget.java21
-rw-r--r--src/com/vaadin/ui/CssLayout.java1
-rw-r--r--src/com/vaadin/ui/CustomComponent.java2
-rw-r--r--src/com/vaadin/ui/CustomLayout.java2
-rw-r--r--src/com/vaadin/ui/DateField.java2
-rw-r--r--src/com/vaadin/ui/Embedded.java2
-rw-r--r--src/com/vaadin/ui/Form.java2
-rw-r--r--src/com/vaadin/ui/FormLayout.java3
-rw-r--r--src/com/vaadin/ui/GridLayout.java2
-rw-r--r--src/com/vaadin/ui/HorizontalLayout.java3
-rw-r--r--src/com/vaadin/ui/Label.java2
-rw-r--r--src/com/vaadin/ui/Link.java2
-rw-r--r--src/com/vaadin/ui/ListSelect.java2
-rw-r--r--src/com/vaadin/ui/MenuBar.java13
-rw-r--r--src/com/vaadin/ui/NativeSelect.java2
-rw-r--r--src/com/vaadin/ui/OptionGroup.java2
-rw-r--r--src/com/vaadin/ui/OrderedLayout.java2
-rw-r--r--src/com/vaadin/ui/Panel.java2
-rw-r--r--src/com/vaadin/ui/PopupView.java2
-rw-r--r--src/com/vaadin/ui/ProgressIndicator.java2
-rw-r--r--src/com/vaadin/ui/RichTextArea.java2
-rw-r--r--src/com/vaadin/ui/Select.java2
-rw-r--r--src/com/vaadin/ui/Slider.java1008
-rw-r--r--src/com/vaadin/ui/SplitPanel.java12
-rw-r--r--src/com/vaadin/ui/TabSheet.java2
-rw-r--r--src/com/vaadin/ui/Table.java292
-rw-r--r--src/com/vaadin/ui/TextField.java2
-rw-r--r--src/com/vaadin/ui/Tree.java2
-rw-r--r--src/com/vaadin/ui/TwinColSelect.java2
-rw-r--r--src/com/vaadin/ui/Upload.java11
-rw-r--r--src/com/vaadin/ui/UriFragmentUtility.java2
-rw-r--r--src/com/vaadin/ui/VerticalLayout.java3
-rw-r--r--src/com/vaadin/ui/Window.java15
38 files changed, 780 insertions, 672 deletions
diff --git a/src/com/vaadin/ui/AbsoluteLayout.java b/src/com/vaadin/ui/AbsoluteLayout.java
index d9f40d7253..678919ca0b 100644
--- a/src/com/vaadin/ui/AbsoluteLayout.java
+++ b/src/com/vaadin/ui/AbsoluteLayout.java
@@ -20,6 +20,7 @@ import com.vaadin.terminal.gwt.client.ui.VAbsoluteLayout;
*
*/
@SuppressWarnings("serial")
+@ClientWidget(VAbsoluteLayout.class)
public class AbsoluteLayout extends AbstractLayout {
private Collection<Component> components = new LinkedHashSet<Component>();
diff --git a/src/com/vaadin/ui/AbstractComponent.java b/src/com/vaadin/ui/AbstractComponent.java
index 39a0cf4f83..54dfccd60c 100644
--- a/src/com/vaadin/ui/AbstractComponent.java
+++ b/src/com/vaadin/ui/AbstractComponent.java
@@ -146,8 +146,16 @@ public abstract class AbstractComponent implements Component, MethodEventSource
* Gets the UIDL tag corresponding to the component.
*
* @return the component's UIDL tag as <code>String</code>
+ * @deprecated tags are no more required for components. Instead of tags we
+ * are now using {@link ClientWidget} annotations to map server
+ * side components to client side counterparts. Generating
+ * identifier for component type is delegated to terminal.
+ * @see ClientWidget
*/
- public abstract String getTag();
+ @Deprecated
+ public String getTag() {
+ return "";
+ }
public void setDebugId(String id) {
testingId = id;
@@ -604,7 +612,8 @@ public abstract class AbstractComponent implements Component, MethodEventSource
* here, we use the default documentation from implemented interface.
*/
public final void paint(PaintTarget target) throws PaintException {
- if (!target.startTag(this, getTag()) || repaintRequestListenersNotified) {
+ final String tag = target.getTag(this);
+ if (!target.startTag(this, tag) || repaintRequestListenersNotified) {
// Paint the contents of the component
@@ -659,7 +668,7 @@ public abstract class AbstractComponent implements Component, MethodEventSource
// Contents have not changed, only cached presentation can be used
target.addAttribute("cached", true);
}
- target.endTag(getTag());
+ target.endTag(tag);
repaintRequestListenersNotified = false;
}
diff --git a/src/com/vaadin/ui/Accordion.java b/src/com/vaadin/ui/Accordion.java
index 73b4c03743..a5db02dd8a 100644
--- a/src/com/vaadin/ui/Accordion.java
+++ b/src/com/vaadin/ui/Accordion.java
@@ -1,6 +1,9 @@
package com.vaadin.ui;
+import com.vaadin.terminal.gwt.client.ui.VAccordion;
+
@SuppressWarnings("serial")
+@ClientWidget(VAccordion.class)
public class Accordion extends TabSheet {
@Override
diff --git a/src/com/vaadin/ui/Button.java b/src/com/vaadin/ui/Button.java
index e4ca734d34..94337eded6 100644
--- a/src/com/vaadin/ui/Button.java
+++ b/src/com/vaadin/ui/Button.java
@@ -12,6 +12,7 @@ import java.util.Map;
import com.vaadin.data.Property;
import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
+import com.vaadin.terminal.gwt.client.ui.VButton;
/**
* A generic button component.
@@ -22,6 +23,7 @@ import com.vaadin.terminal.PaintTarget;
* @since 3.0
*/
@SuppressWarnings("serial")
+@ClientWidget(VButton.class)
public class Button extends AbstractField {
/* Private members */
diff --git a/src/com/vaadin/ui/CheckBox.java b/src/com/vaadin/ui/CheckBox.java
index 32b47412a3..0ffafe3d02 100644
--- a/src/com/vaadin/ui/CheckBox.java
+++ b/src/com/vaadin/ui/CheckBox.java
@@ -9,6 +9,7 @@ import java.lang.reflect.Method;
import com.vaadin.data.Property;
@SuppressWarnings("serial")
+@ClientWidget(com.vaadin.terminal.gwt.client.ui.VCheckBox.class)
public class CheckBox extends Button {
/**
* Creates a new switch button.
@@ -47,8 +48,8 @@ public class CheckBox extends Button {
* listening button clicks. Using this method is discouraged because it
* cannot be checked during compilation. Use
* {@link #addListener(Class, Object, Method)} or
- * {@link #addListener(com.vaadin.ui.Component.Listener)} instead.
- * The method must have either no parameters, or only one parameter of
+ * {@link #addListener(com.vaadin.ui.Component.Listener)} instead. The
+ * method must have either no parameters, or only one parameter of
* Button.ClickEvent type.
*
* @param caption
diff --git a/src/com/vaadin/ui/ClientWidget.java b/src/com/vaadin/ui/ClientWidget.java
new file mode 100644
index 0000000000..2865c0d837
--- /dev/null
+++ b/src/com/vaadin/ui/ClientWidget.java
@@ -0,0 +1,21 @@
+/**
+ *
+ */
+package com.vaadin.ui;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import com.vaadin.terminal.gwt.client.Paintable;
+
+/**
+ * Annotation defining the default client side counterpart in GWT terminal for
+ * {@link Component}
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.TYPE)
+public @interface ClientWidget {
+ Class<? extends Paintable> value();
+}
diff --git a/src/com/vaadin/ui/CssLayout.java b/src/com/vaadin/ui/CssLayout.java
index 65cfa36b28..05d067d795 100644
--- a/src/com/vaadin/ui/CssLayout.java
+++ b/src/com/vaadin/ui/CssLayout.java
@@ -50,6 +50,7 @@ import com.vaadin.terminal.gwt.client.ui.VCssLayout;
* @since 6.1 brought in from "FastLayouts" incubator project
*
*/
+@ClientWidget(VCssLayout.class)
public class CssLayout extends AbstractLayout {
private static final long serialVersionUID = -6408703812053460073L;
diff --git a/src/com/vaadin/ui/CustomComponent.java b/src/com/vaadin/ui/CustomComponent.java
index 19fb081047..e9ea19bf8a 100644
--- a/src/com/vaadin/ui/CustomComponent.java
+++ b/src/com/vaadin/ui/CustomComponent.java
@@ -9,6 +9,7 @@ import java.util.Iterator;
import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
+import com.vaadin.terminal.gwt.client.ui.VCustomComponent;
/**
* Custom component provides simple implementation of Component interface for
@@ -25,6 +26,7 @@ import com.vaadin.terminal.PaintTarget;
* @since 3.0
*/
@SuppressWarnings("serial")
+@ClientWidget(VCustomComponent.class)
public class CustomComponent extends AbstractComponentContainer {
/**
diff --git a/src/com/vaadin/ui/CustomLayout.java b/src/com/vaadin/ui/CustomLayout.java
index d0d70fcc16..1dbd723759 100644
--- a/src/com/vaadin/ui/CustomLayout.java
+++ b/src/com/vaadin/ui/CustomLayout.java
@@ -12,6 +12,7 @@ import java.util.Iterator;
import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
+import com.vaadin.terminal.gwt.client.ui.VCustomLayout;
/**
* <p>
@@ -41,6 +42,7 @@ import com.vaadin.terminal.PaintTarget;
* @since 3.0
*/
@SuppressWarnings("serial")
+@ClientWidget(VCustomLayout.class)
public class CustomLayout extends AbstractLayout {
private static final int BUFFER_SIZE = 10000;
diff --git a/src/com/vaadin/ui/DateField.java b/src/com/vaadin/ui/DateField.java
index dc062be668..a0366258b9 100644
--- a/src/com/vaadin/ui/DateField.java
+++ b/src/com/vaadin/ui/DateField.java
@@ -14,6 +14,7 @@ import java.util.Map;
import com.vaadin.data.Property;
import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
+import com.vaadin.terminal.gwt.client.ui.VPopupCalendar;
/**
* <p>
@@ -34,6 +35,7 @@ import com.vaadin.terminal.PaintTarget;
* @since 3.0
*/
@SuppressWarnings("serial")
+@ClientWidget(VPopupCalendar.class)
public class DateField extends AbstractField {
/* Private members */
diff --git a/src/com/vaadin/ui/Embedded.java b/src/com/vaadin/ui/Embedded.java
index 3b0acfee5e..c6d393922e 100644
--- a/src/com/vaadin/ui/Embedded.java
+++ b/src/com/vaadin/ui/Embedded.java
@@ -10,6 +10,7 @@ import java.util.Iterator;
import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
import com.vaadin.terminal.Resource;
+import com.vaadin.terminal.gwt.client.ui.VEmbedded;
/**
* Component for embedding external objects.
@@ -20,6 +21,7 @@ import com.vaadin.terminal.Resource;
* @since 3.0
*/
@SuppressWarnings("serial")
+@ClientWidget(VEmbedded.class)
public class Embedded extends AbstractComponent {
/**
diff --git a/src/com/vaadin/ui/Form.java b/src/com/vaadin/ui/Form.java
index 1741fe591f..5078c25fcc 100644
--- a/src/com/vaadin/ui/Form.java
+++ b/src/com/vaadin/ui/Form.java
@@ -21,6 +21,7 @@ import com.vaadin.terminal.CompositeErrorMessage;
import com.vaadin.terminal.ErrorMessage;
import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
+import com.vaadin.terminal.gwt.client.ui.VForm;
/**
* Form component provides easy way of creating and managing sets fields.
@@ -54,6 +55,7 @@ import com.vaadin.terminal.PaintTarget;
* @since 3.0
*/
@SuppressWarnings("serial")
+@ClientWidget(VForm.class)
public class Form extends AbstractField implements Item.Editor, Buffered, Item,
Validatable {
diff --git a/src/com/vaadin/ui/FormLayout.java b/src/com/vaadin/ui/FormLayout.java
index 1fbfcf2ee4..fc6a8a21b9 100644
--- a/src/com/vaadin/ui/FormLayout.java
+++ b/src/com/vaadin/ui/FormLayout.java
@@ -4,6 +4,8 @@
package com.vaadin.ui;
+import com.vaadin.terminal.gwt.client.ui.VFormLayout;
+
/**
* FormLayout is used by {@link Form} to layout fields. It may also be used
* separately without {@link Form}.
@@ -20,6 +22,7 @@ package com.vaadin.ui;
*
*/
@SuppressWarnings( { "deprecation", "serial" })
+@ClientWidget(VFormLayout.class)
public class FormLayout extends OrderedLayout {
public FormLayout() {
diff --git a/src/com/vaadin/ui/GridLayout.java b/src/com/vaadin/ui/GridLayout.java
index 165b26491e..1207944f12 100644
--- a/src/com/vaadin/ui/GridLayout.java
+++ b/src/com/vaadin/ui/GridLayout.java
@@ -14,6 +14,7 @@ import java.util.Map.Entry;
import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
+import com.vaadin.terminal.gwt.client.ui.VGridLayout;
/**
* <p>
@@ -36,6 +37,7 @@ import com.vaadin.terminal.PaintTarget;
* @since 3.0
*/
@SuppressWarnings("serial")
+@ClientWidget(VGridLayout.class)
public class GridLayout extends AbstractLayout implements
Layout.AlignmentHandler, Layout.SpacingHandler {
diff --git a/src/com/vaadin/ui/HorizontalLayout.java b/src/com/vaadin/ui/HorizontalLayout.java
index 820b0c29de..16d677f6dc 100644
--- a/src/com/vaadin/ui/HorizontalLayout.java
+++ b/src/com/vaadin/ui/HorizontalLayout.java
@@ -1,5 +1,7 @@
package com.vaadin.ui;
+import com.vaadin.terminal.gwt.client.ui.VHorizontalLayout;
+
/**
* Horizontal layout
*
@@ -12,6 +14,7 @@ package com.vaadin.ui;
* @since 5.3
*/
@SuppressWarnings("serial")
+@ClientWidget(VHorizontalLayout.class)
public class HorizontalLayout extends AbstractOrderedLayout {
public HorizontalLayout() {
diff --git a/src/com/vaadin/ui/Label.java b/src/com/vaadin/ui/Label.java
index edd827d2a5..7c6727a1ba 100644
--- a/src/com/vaadin/ui/Label.java
+++ b/src/com/vaadin/ui/Label.java
@@ -10,6 +10,7 @@ import com.vaadin.data.Property;
import com.vaadin.data.util.ObjectProperty;
import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
+import com.vaadin.terminal.gwt.client.ui.VLabel;
/**
* Label component for showing non-editable short texts.
@@ -37,6 +38,7 @@ import com.vaadin.terminal.PaintTarget;
* @since 3.0
*/
@SuppressWarnings("serial")
+@ClientWidget(VLabel.class)
public class Label extends AbstractComponent implements Property,
Property.Viewer, Property.ValueChangeListener,
Property.ValueChangeNotifier, Comparable {
diff --git a/src/com/vaadin/ui/Link.java b/src/com/vaadin/ui/Link.java
index 6deb05a99a..3f83685930 100644
--- a/src/com/vaadin/ui/Link.java
+++ b/src/com/vaadin/ui/Link.java
@@ -7,6 +7,7 @@ package com.vaadin.ui;
import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
import com.vaadin.terminal.Resource;
+import com.vaadin.terminal.gwt.client.ui.VLink;
/**
* Link is used to create external or internal URL links.
@@ -17,6 +18,7 @@ import com.vaadin.terminal.Resource;
* @since 3.0
*/
@SuppressWarnings("serial")
+@ClientWidget(VLink.class)
public class Link extends AbstractComponent {
/* Target window border type constant: No window border */
diff --git a/src/com/vaadin/ui/ListSelect.java b/src/com/vaadin/ui/ListSelect.java
index 7860474433..b2c4866b4a 100644
--- a/src/com/vaadin/ui/ListSelect.java
+++ b/src/com/vaadin/ui/ListSelect.java
@@ -9,12 +9,14 @@ import java.util.Collection;
import com.vaadin.data.Container;
import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
+import com.vaadin.terminal.gwt.client.ui.VListSelect;
/**
* This is a simple list select without, for instance, support for new items,
* lazyloading, and other advanced features.
*/
@SuppressWarnings("serial")
+@ClientWidget(VListSelect.class)
public class ListSelect extends AbstractSelect {
private int columns = 0;
diff --git a/src/com/vaadin/ui/MenuBar.java b/src/com/vaadin/ui/MenuBar.java
index 0ce6e725d9..a77d57821a 100644
--- a/src/com/vaadin/ui/MenuBar.java
+++ b/src/com/vaadin/ui/MenuBar.java
@@ -10,6 +10,7 @@ import java.util.Stack;
import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
import com.vaadin.terminal.Resource;
+import com.vaadin.terminal.gwt.client.ui.VMenuBar;
/**
* <p>
@@ -19,6 +20,7 @@ import com.vaadin.terminal.Resource;
* </p>
*/
@SuppressWarnings("serial")
+@ClientWidget(VMenuBar.class)
public class MenuBar extends AbstractComponent {
// Items of the top-level menu
@@ -340,10 +342,9 @@ public class MenuBar extends AbstractComponent {
/**
* This interface contains the layer for menu commands of the
- * {@link com.vaadin.ui.MenuBar} class. It's method will fire when
- * the user clicks on the containing
- * {@link com.vaadin.ui.MenuBar.MenuItem}. The selected item is
- * given as an argument.
+ * {@link com.vaadin.ui.MenuBar} class. It's method will fire when the user
+ * clicks on the containing {@link com.vaadin.ui.MenuBar.MenuItem}. The
+ * selected item is given as an argument.
*/
public interface Command extends Serializable {
public void menuSelected(MenuBar.MenuItem selectedItem);
@@ -498,8 +499,8 @@ public class MenuBar extends AbstractComponent {
* For the containing item. This will return null if the item is in the
* top-level menu bar.
*
- * @return The containing {@link com.vaadin.ui.MenuBar.MenuItem}
- * , or null if there is none
+ * @return The containing {@link com.vaadin.ui.MenuBar.MenuItem} , or
+ * null if there is none
*/
public MenuBar.MenuItem getParent() {
return itsParent;
diff --git a/src/com/vaadin/ui/NativeSelect.java b/src/com/vaadin/ui/NativeSelect.java
index e178a39397..e57daeda55 100644
--- a/src/com/vaadin/ui/NativeSelect.java
+++ b/src/com/vaadin/ui/NativeSelect.java
@@ -9,6 +9,7 @@ import java.util.Collection;
import com.vaadin.data.Container;
import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
+import com.vaadin.terminal.gwt.client.ui.VNativeSelect;
/**
* This is a simple drop-down select without, for instance, support for
@@ -17,6 +18,7 @@ import com.vaadin.terminal.PaintTarget;
* better choice.
*/
@SuppressWarnings("serial")
+@ClientWidget(VNativeSelect.class)
public class NativeSelect extends AbstractSelect {
// width in characters, mimics TextField
diff --git a/src/com/vaadin/ui/OptionGroup.java b/src/com/vaadin/ui/OptionGroup.java
index 861b57f5c6..ab925f8785 100644
--- a/src/com/vaadin/ui/OptionGroup.java
+++ b/src/com/vaadin/ui/OptionGroup.java
@@ -9,11 +9,13 @@ import java.util.Collection;
import com.vaadin.data.Container;
import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
+import com.vaadin.terminal.gwt.client.ui.VOptionGroup;
/**
* Configures select to be used as an option group.
*/
@SuppressWarnings("serial")
+@ClientWidget(VOptionGroup.class)
public class OptionGroup extends AbstractSelect {
public OptionGroup() {
diff --git a/src/com/vaadin/ui/OrderedLayout.java b/src/com/vaadin/ui/OrderedLayout.java
index 572d621919..5689c76ed3 100644
--- a/src/com/vaadin/ui/OrderedLayout.java
+++ b/src/com/vaadin/ui/OrderedLayout.java
@@ -2,6 +2,7 @@ package com.vaadin.ui;
import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
+import com.vaadin.terminal.gwt.client.ui.VOrderedLayout;
/**
* Ordered layout.
@@ -20,6 +21,7 @@ import com.vaadin.terminal.PaintTarget;
*/
@SuppressWarnings("serial")
@Deprecated
+@ClientWidget(VOrderedLayout.class)
public class OrderedLayout extends AbstractOrderedLayout {
/* Predefined orientations */
diff --git a/src/com/vaadin/ui/Panel.java b/src/com/vaadin/ui/Panel.java
index b8c6b1f222..29d708a328 100644
--- a/src/com/vaadin/ui/Panel.java
+++ b/src/com/vaadin/ui/Panel.java
@@ -15,6 +15,7 @@ import com.vaadin.terminal.KeyMapper;
import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
import com.vaadin.terminal.Scrollable;
+import com.vaadin.terminal.gwt.client.ui.VPanel;
/**
* Panel - a simple single component container.
@@ -25,6 +26,7 @@ import com.vaadin.terminal.Scrollable;
* @since 3.0
*/
@SuppressWarnings("serial")
+@ClientWidget(VPanel.class)
public class Panel extends AbstractComponentContainer implements Scrollable,
ComponentContainer.ComponentAttachListener,
ComponentContainer.ComponentDetachListener, Action.Container {
diff --git a/src/com/vaadin/ui/PopupView.java b/src/com/vaadin/ui/PopupView.java
index f2d6259c75..8184d60b65 100644
--- a/src/com/vaadin/ui/PopupView.java
+++ b/src/com/vaadin/ui/PopupView.java
@@ -7,6 +7,7 @@ import java.util.Map;
import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
+import com.vaadin.terminal.gwt.client.ui.VPopupView;
/**
*
@@ -18,6 +19,7 @@ import com.vaadin.terminal.PaintTarget;
* @author IT Mill Ltd.
*/
@SuppressWarnings("serial")
+@ClientWidget(VPopupView.class)
public class PopupView extends AbstractComponentContainer {
private Content content;
diff --git a/src/com/vaadin/ui/ProgressIndicator.java b/src/com/vaadin/ui/ProgressIndicator.java
index 1ad5848dfb..bb346c26d5 100644
--- a/src/com/vaadin/ui/ProgressIndicator.java
+++ b/src/com/vaadin/ui/ProgressIndicator.java
@@ -8,6 +8,7 @@ import com.vaadin.data.Property;
import com.vaadin.data.util.ObjectProperty;
import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
+import com.vaadin.terminal.gwt.client.ui.VProgressIndicator;
/**
* <code>ProgressIndicator</code> is component that shows user state of a
@@ -24,6 +25,7 @@ import com.vaadin.terminal.PaintTarget;
* @since 4
*/
@SuppressWarnings("serial")
+@ClientWidget(VProgressIndicator.class)
public class ProgressIndicator extends AbstractField implements Property,
Property.Viewer, Property.ValueChangeListener {
diff --git a/src/com/vaadin/ui/RichTextArea.java b/src/com/vaadin/ui/RichTextArea.java
index 4c1c281811..49f329f586 100644
--- a/src/com/vaadin/ui/RichTextArea.java
+++ b/src/com/vaadin/ui/RichTextArea.java
@@ -6,6 +6,7 @@ package com.vaadin.ui;
import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
+import com.vaadin.terminal.gwt.client.ui.richtextarea.VRichTextArea;
/**
* A simple RichTextArea to edit HTML format text.
@@ -15,6 +16,7 @@ import com.vaadin.terminal.PaintTarget;
* into length of field.
*/
@SuppressWarnings("serial")
+@ClientWidget(VRichTextArea.class)
public class RichTextArea extends TextField {
@Override
diff --git a/src/com/vaadin/ui/Select.java b/src/com/vaadin/ui/Select.java
index 6d07aff5b3..899a936765 100644
--- a/src/com/vaadin/ui/Select.java
+++ b/src/com/vaadin/ui/Select.java
@@ -16,6 +16,7 @@ import com.vaadin.data.Container;
import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
import com.vaadin.terminal.Resource;
+import com.vaadin.terminal.gwt.client.ui.VFilterSelect;
/**
* <p>
@@ -36,6 +37,7 @@ import com.vaadin.terminal.Resource;
* @since 3.0
*/
@SuppressWarnings("serial")
+@ClientWidget(VFilterSelect.class)
public class Select extends AbstractSelect implements AbstractSelect.Filtering {
/**
diff --git a/src/com/vaadin/ui/Slider.java b/src/com/vaadin/ui/Slider.java
index ec9fc2c90b..24dd520ddd 100644
--- a/src/com/vaadin/ui/Slider.java
+++ b/src/com/vaadin/ui/Slider.java
@@ -1,503 +1,505 @@
-/*
-@ITMillApache2LicenseForJavaFiles@
- */
-
-package com.vaadin.ui;
-
-import java.util.Map;
-
-import com.vaadin.terminal.PaintException;
-import com.vaadin.terminal.PaintTarget;
-
-/**
- * A component for selecting a numerical value within a range.
- *
- * Example code: <code>
- * class MyPlayer extends CustomComponent implements ValueChangeListener {
- *
- * Label volumeIndicator = new Label();
- * Slider slider;
- *
- * public MyPlayer() {
- * VerticalLayout vl = new VerticalLayout();
- * setCompositionRoot(vl);
- * slider = new Slider("Volume", 0, 100);
- * slider.setImmediate(true);
- * slider.setValue(new Double(50));
- * vl.addComponent(slider);
- * vl.addComponent(volumeIndicator);
- * volumeIndicator.setValue("Current volume:" + 50.0);
- * slider.addListener(this);
- *
- * }
- *
- * public void setVolume(double d) {
- * volumeIndicator.setValue("Current volume: " + d);
- * }
- *
- * public void valueChange(ValueChangeEvent event) {
- * Double d = (Double) event.getProperty().getValue();
- * setVolume(d.doubleValue());
- * }
- * }
- *
- * </code>
- *
- * @author IT Mill Ltd.
- */
-@SuppressWarnings("serial")
-public class Slider extends AbstractField {
-
- public static final int ORIENTATION_HORIZONTAL = 0;
-
- public static final int ORIENTATION_VERTICAL = 1;
-
- /**
- * Style constant representing a scrollbar styled slider. Use this with
- * {@link #addStyleName(String)}. Default styling usually represents a
- * common slider found e.g. in Adobe Photoshop. The client side
- * implementation dictates how different styles will look.
- */
- @Deprecated
- public static final String STYLE_SCROLLBAR = "scrollbar";
-
- /** Minimum value of slider */
- private double min = 0;
-
- /** Maximum value of slider */
- private double max = 100;
-
- /**
- * Resolution, how many digits are considered relevant after desimal point.
- * Must be a non-negative value
- */
- private int resolution = 0;
-
- /**
- * Slider orientation (horizontal/vertical), defaults .
- */
- private int orientation = ORIENTATION_HORIZONTAL;
-
- /**
- * Slider size in pixels. In horizontal mode, if set to -1, allow 100% width
- * of container. In vertical mode, if set to -1, default height is
- * determined by the client-side implementation.
- *
- * @deprecated
- */
- @Deprecated
- private int size = -1;
-
- /**
- * Handle (draggable control element) size in percents relative to base
- * size. Must be a value between 1-99. Other values are converted to nearest
- * bound. A negative value sets the width to auto (client-side
- * implementation calculates).
- *
- * @deprecated The size is dictated by the current theme.
- */
- @Deprecated
- private int handleSize = -1;
-
- /**
- * Show arrows that can be pressed to slide the handle in some increments
- * (client-side implementation decides the increment, usually somewhere
- * between 5-10% of slide range).
- */
- @Deprecated
- private final boolean arrows = false;
-
- /**
- * Default Slider constructor. Sets all values to defaults and the slide
- * handle at minimum value.
- *
- */
- public Slider() {
- super();
- super.setValue(new Double(min));
- }
-
- /**
- * Create a new slider with the caption given as parameter. All slider
- * values set to defaults.
- *
- * @param caption
- * The caption for this Slider (e.g. "Volume").
- */
- public Slider(String caption) {
- this();
- setCaption(caption);
- }
-
- /**
- * Create a new slider with given range and resolution
- *
- * @param min
- * @param max
- * @param resolution
- */
- public Slider(double min, double max, int resolution) {
- this();
- setMin(min);
- setMax(max);
- setResolution(resolution);
- }
-
- /**
- * Create a new slider with given range
- *
- * @param min
- * @param max
- */
- public Slider(int min, int max) {
- this();
- setMin(min);
- setMax(max);
- setResolution(0);
- }
-
- /**
- * Create a new slider with given caption and range
- *
- * @param caption
- * @param min
- * @param max
- */
- public Slider(String caption, int min, int max) {
- this(min, max);
- setCaption(caption);
- }
-
- /**
- * Gets the biggest possible value in Sliders range.
- *
- * @return the biggest value 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.
- *
- * @param max
- * New maximum value of the Slider.
- */
- public void setMax(double max) {
- this.max = max;
- try {
- if ((new Double(getValue().toString())).doubleValue() > max) {
- super.setValue(new Double(max));
- }
- } catch (final ClassCastException e) {
- // FIXME: Handle exception
- /*
- * Where does ClassCastException come from? Can't see any casts
- * above
- */
- super.setValue(new Double(max));
- }
- requestRepaint();
- }
-
- /**
- * Gets the minimum value in Sliders range.
- *
- * @return the smalles value 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.
- *
- * @param min
- * New minimum value of the Slider.
- */
- public void setMin(double min) {
- this.min = min;
- try {
- if ((new Double(getValue().toString())).doubleValue() < min) {
- super.setValue(new Double(min));
- }
- } catch (final ClassCastException e) {
- // FIXME: Handle exception
- /*
- * Where does ClassCastException come from? Can't see any casts
- * above
- */
- super.setValue(new Double(min));
- }
- requestRepaint();
- }
-
- /**
- * Get the current orientation of the Slider (horizontal or vertical).
- *
- * @return orientation
- */
- public int getOrientation() {
- return orientation;
- }
-
- /**
- * Set the orientation of the Slider.
- *
- * @param int new orientation
- */
- public void setOrientation(int orientation) {
- this.orientation = orientation;
- requestRepaint();
- }
-
- /**
- * Get the current resolution of the Slider.
- *
- * @return resolution
- */
- public int getResolution() {
- return resolution;
- }
-
- /**
- * Set a new resolution for the Slider.
- *
- * @param resolution
- */
- public void setResolution(int resolution) {
- if (resolution < 0) {
- return;
- }
- this.resolution = resolution;
- requestRepaint();
- }
-
- /**
- * Set the value of this Slider.
- *
- * @param value
- * New value of Slider. Must be within Sliders range (min - max),
- * otherwise throws an exception.
- * @param repaintIsNotNeeded
- * If true, client-side is not requested to repaint itself.
- * @throws ValueOutOfBoundsException
- */
- public void setValue(Double value, boolean repaintIsNotNeeded)
- throws ValueOutOfBoundsException {
- final double v = value.doubleValue();
- double newValue;
- if (resolution > 0) {
- // Round up to resolution
- newValue = (int) (v * Math.pow(10, resolution));
- newValue = newValue / Math.pow(10, resolution);
- if (min > newValue || max < newValue) {
- throw new ValueOutOfBoundsException(value);
- }
- } else {
- newValue = (int) v;
- if (min > newValue || max < newValue) {
- throw new ValueOutOfBoundsException(value);
- }
- }
- super.setValue(new Double(newValue), repaintIsNotNeeded);
- }
-
- /**
- * Set the value of this Slider.
- *
- * @param value
- * New value of Slider. Must be within Sliders range (min - max),
- * otherwise throws an exception.
- * @throws ValueOutOfBoundsException
- */
- public void setValue(Double value) throws ValueOutOfBoundsException {
- setValue(value, false);
- }
-
- /**
- * Set the value of this Slider.
- *
- * @param value
- * New value of Slider. Must be within Sliders range (min - max),
- * otherwise throws an exception.
- * @throws ValueOutOfBoundsException
- */
- public void setValue(double value) throws ValueOutOfBoundsException {
- setValue(new Double(value), false);
- }
-
- /**
- * Get the current Slider size.
- *
- * @return size in pixels or -1 for auto sizing.
- * @deprecated use standard getWidth/getHeight instead
- */
- @Deprecated
- public int getSize() {
- return size;
- }
-
- /**
- * Set the size for this Slider.
- *
- * @param size
- * in pixels, or -1 auto sizing.
- * @deprecated use standard setWidth/setHeight instead
- */
- @Deprecated
- public void setSize(int size) {
- this.size = size;
- switch (orientation) {
- case ORIENTATION_HORIZONTAL:
- setWidth(size, UNITS_PIXELS);
- break;
- default:
- setHeight(size, UNITS_PIXELS);
- break;
- }
- requestRepaint();
- }
-
- /**
- * Get the handle size of this Slider.
- *
- * @return handle size in percentages.
- * @deprecated The size is dictated by the current theme.
- */
- @Deprecated
- public int getHandleSize() {
- return handleSize;
- }
-
- /**
- * Set the handle size of this Slider.
- *
- * @param handleSize
- * in percentages relative to slider base size.
- * @deprecated The size is dictated by the current theme.
- */
- @Deprecated
- public void setHandleSize(int handleSize) {
- if (handleSize < 0) {
- this.handleSize = -1;
- } else if (handleSize > 99) {
- this.handleSize = 99;
- } else if (handleSize < 1) {
- this.handleSize = 1;
- } else {
- this.handleSize = handleSize;
- }
- requestRepaint();
- }
-
- @Override
- public String getTag() {
- return "slider";
- }
-
- @Override
- public void paintContent(PaintTarget target) throws PaintException {
- super.paintContent(target);
-
- target.addAttribute("min", min);
- if (max > min) {
- target.addAttribute("max", max);
- } else {
- target.addAttribute("max", min);
- }
- target.addAttribute("resolution", resolution);
-
- if (resolution > 0) {
- target.addVariable(this, "value", ((Double) getValue())
- .doubleValue());
- } else {
- target.addVariable(this, "value", ((Double) getValue()).intValue());
- }
-
- if (orientation == ORIENTATION_VERTICAL) {
- target.addAttribute("vertical", true);
- }
-
- if (arrows) {
- target.addAttribute("arrows", true);
- }
-
- if (size > -1) {
- target.addAttribute("size", size);
- }
-
- if (min != max && min < max) {
- target.addAttribute("hsize", handleSize);
- } else {
- target.addAttribute("hsize", 100);
- }
-
- }
-
- /**
- * Invoked when the value of a variable has changed. Slider listeners are
- * notified if the slider value has changed.
- *
- * @param source
- * @param variables
- */
- @Override
- public void changeVariables(Object source, Map variables) {
- super.changeVariables(source, variables);
- if (variables.containsKey("value")) {
- final Object value = variables.get("value");
- final Double newValue = new Double(value.toString());
- if (newValue != null && newValue != getValue()
- && !newValue.equals(getValue())) {
- try {
- setValue(newValue, true);
- } catch (final ValueOutOfBoundsException e) {
- // Convert to nearest bound
- double out = e.getValue().doubleValue();
- if (out < min) {
- out = min;
- }
- if (out > max) {
- out = max;
- }
- super.setValue(new Double(out), false);
- }
- }
- }
- }
-
- /**
- * ValueOutOfBoundsException
- *
- * @author IT Mill Ltd.
- *
- */
- public class ValueOutOfBoundsException extends Exception {
-
- private final Double value;
-
- /**
- * Constructs an <code>ValueOutOfBoundsException</code> with the
- * specified detail message.
- *
- * @param valueOutOfBounds
- */
- public ValueOutOfBoundsException(Double valueOutOfBounds) {
- value = valueOutOfBounds;
- }
-
- public Double getValue() {
- return value;
- }
-
- }
-
- @Override
- public Class getType() {
- return Double.class;
- }
-
-}
+/*
+@ITMillApache2LicenseForJavaFiles@
+ */
+
+package com.vaadin.ui;
+
+import java.util.Map;
+
+import com.vaadin.terminal.PaintException;
+import com.vaadin.terminal.PaintTarget;
+import com.vaadin.terminal.gwt.client.ui.VSlider;
+
+/**
+ * A component for selecting a numerical value within a range.
+ *
+ * Example code: <code>
+ * class MyPlayer extends CustomComponent implements ValueChangeListener {
+ *
+ * Label volumeIndicator = new Label();
+ * Slider slider;
+ *
+ * public MyPlayer() {
+ * VerticalLayout vl = new VerticalLayout();
+ * setCompositionRoot(vl);
+ * slider = new Slider("Volume", 0, 100);
+ * slider.setImmediate(true);
+ * slider.setValue(new Double(50));
+ * vl.addComponent(slider);
+ * vl.addComponent(volumeIndicator);
+ * volumeIndicator.setValue("Current volume:" + 50.0);
+ * slider.addListener(this);
+ *
+ * }
+ *
+ * public void setVolume(double d) {
+ * volumeIndicator.setValue("Current volume: " + d);
+ * }
+ *
+ * public void valueChange(ValueChangeEvent event) {
+ * Double d = (Double) event.getProperty().getValue();
+ * setVolume(d.doubleValue());
+ * }
+ * }
+ *
+ * </code>
+ *
+ * @author IT Mill Ltd.
+ */
+@SuppressWarnings("serial")
+@ClientWidget(VSlider.class)
+public class Slider extends AbstractField {
+
+ public static final int ORIENTATION_HORIZONTAL = 0;
+
+ public static final int ORIENTATION_VERTICAL = 1;
+
+ /**
+ * Style constant representing a scrollbar styled slider. Use this with
+ * {@link #addStyleName(String)}. Default styling usually represents a
+ * common slider found e.g. in Adobe Photoshop. The client side
+ * implementation dictates how different styles will look.
+ */
+ @Deprecated
+ public static final String STYLE_SCROLLBAR = "scrollbar";
+
+ /** Minimum value of slider */
+ private double min = 0;
+
+ /** Maximum value of slider */
+ private double max = 100;
+
+ /**
+ * Resolution, how many digits are considered relevant after desimal point.
+ * Must be a non-negative value
+ */
+ private int resolution = 0;
+
+ /**
+ * Slider orientation (horizontal/vertical), defaults .
+ */
+ private int orientation = ORIENTATION_HORIZONTAL;
+
+ /**
+ * Slider size in pixels. In horizontal mode, if set to -1, allow 100% width
+ * of container. In vertical mode, if set to -1, default height is
+ * determined by the client-side implementation.
+ *
+ * @deprecated
+ */
+ @Deprecated
+ private int size = -1;
+
+ /**
+ * Handle (draggable control element) size in percents relative to base
+ * size. Must be a value between 1-99. Other values are converted to nearest
+ * bound. A negative value sets the width to auto (client-side
+ * implementation calculates).
+ *
+ * @deprecated The size is dictated by the current theme.
+ */
+ @Deprecated
+ private int handleSize = -1;
+
+ /**
+ * Show arrows that can be pressed to slide the handle in some increments
+ * (client-side implementation decides the increment, usually somewhere
+ * between 5-10% of slide range).
+ */
+ @Deprecated
+ private final boolean arrows = false;
+
+ /**
+ * Default Slider constructor. Sets all values to defaults and the slide
+ * handle at minimum value.
+ *
+ */
+ public Slider() {
+ super();
+ super.setValue(new Double(min));
+ }
+
+ /**
+ * Create a new slider with the caption given as parameter. All slider
+ * values set to defaults.
+ *
+ * @param caption
+ * The caption for this Slider (e.g. "Volume").
+ */
+ public Slider(String caption) {
+ this();
+ setCaption(caption);
+ }
+
+ /**
+ * Create a new slider with given range and resolution
+ *
+ * @param min
+ * @param max
+ * @param resolution
+ */
+ public Slider(double min, double max, int resolution) {
+ this();
+ setMin(min);
+ setMax(max);
+ setResolution(resolution);
+ }
+
+ /**
+ * Create a new slider with given range
+ *
+ * @param min
+ * @param max
+ */
+ public Slider(int min, int max) {
+ this();
+ setMin(min);
+ setMax(max);
+ setResolution(0);
+ }
+
+ /**
+ * Create a new slider with given caption and range
+ *
+ * @param caption
+ * @param min
+ * @param max
+ */
+ public Slider(String caption, int min, int max) {
+ this(min, max);
+ setCaption(caption);
+ }
+
+ /**
+ * Gets the biggest possible value in Sliders range.
+ *
+ * @return the biggest value 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.
+ *
+ * @param max
+ * New maximum value of the Slider.
+ */
+ public void setMax(double max) {
+ this.max = max;
+ try {
+ if ((new Double(getValue().toString())).doubleValue() > max) {
+ super.setValue(new Double(max));
+ }
+ } catch (final ClassCastException e) {
+ // FIXME: Handle exception
+ /*
+ * Where does ClassCastException come from? Can't see any casts
+ * above
+ */
+ super.setValue(new Double(max));
+ }
+ requestRepaint();
+ }
+
+ /**
+ * Gets the minimum value in Sliders range.
+ *
+ * @return the smalles value 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.
+ *
+ * @param min
+ * New minimum value of the Slider.
+ */
+ public void setMin(double min) {
+ this.min = min;
+ try {
+ if ((new Double(getValue().toString())).doubleValue() < min) {
+ super.setValue(new Double(min));
+ }
+ } catch (final ClassCastException e) {
+ // FIXME: Handle exception
+ /*
+ * Where does ClassCastException come from? Can't see any casts
+ * above
+ */
+ super.setValue(new Double(min));
+ }
+ requestRepaint();
+ }
+
+ /**
+ * Get the current orientation of the Slider (horizontal or vertical).
+ *
+ * @return orientation
+ */
+ public int getOrientation() {
+ return orientation;
+ }
+
+ /**
+ * Set the orientation of the Slider.
+ *
+ * @param int new orientation
+ */
+ public void setOrientation(int orientation) {
+ this.orientation = orientation;
+ requestRepaint();
+ }
+
+ /**
+ * Get the current resolution of the Slider.
+ *
+ * @return resolution
+ */
+ public int getResolution() {
+ return resolution;
+ }
+
+ /**
+ * Set a new resolution for the Slider.
+ *
+ * @param resolution
+ */
+ public void setResolution(int resolution) {
+ if (resolution < 0) {
+ return;
+ }
+ this.resolution = resolution;
+ requestRepaint();
+ }
+
+ /**
+ * Set the value of this Slider.
+ *
+ * @param value
+ * New value of Slider. Must be within Sliders range (min - max),
+ * otherwise throws an exception.
+ * @param repaintIsNotNeeded
+ * If true, client-side is not requested to repaint itself.
+ * @throws ValueOutOfBoundsException
+ */
+ public void setValue(Double value, boolean repaintIsNotNeeded)
+ throws ValueOutOfBoundsException {
+ final double v = value.doubleValue();
+ double newValue;
+ if (resolution > 0) {
+ // Round up to resolution
+ newValue = (int) (v * Math.pow(10, resolution));
+ newValue = newValue / Math.pow(10, resolution);
+ if (min > newValue || max < newValue) {
+ throw new ValueOutOfBoundsException(value);
+ }
+ } else {
+ newValue = (int) v;
+ if (min > newValue || max < newValue) {
+ throw new ValueOutOfBoundsException(value);
+ }
+ }
+ super.setValue(new Double(newValue), repaintIsNotNeeded);
+ }
+
+ /**
+ * Set the value of this Slider.
+ *
+ * @param value
+ * New value of Slider. Must be within Sliders range (min - max),
+ * otherwise throws an exception.
+ * @throws ValueOutOfBoundsException
+ */
+ public void setValue(Double value) throws ValueOutOfBoundsException {
+ setValue(value, false);
+ }
+
+ /**
+ * Set the value of this Slider.
+ *
+ * @param value
+ * New value of Slider. Must be within Sliders range (min - max),
+ * otherwise throws an exception.
+ * @throws ValueOutOfBoundsException
+ */
+ public void setValue(double value) throws ValueOutOfBoundsException {
+ setValue(new Double(value), false);
+ }
+
+ /**
+ * Get the current Slider size.
+ *
+ * @return size in pixels or -1 for auto sizing.
+ * @deprecated use standard getWidth/getHeight instead
+ */
+ @Deprecated
+ public int getSize() {
+ return size;
+ }
+
+ /**
+ * Set the size for this Slider.
+ *
+ * @param size
+ * in pixels, or -1 auto sizing.
+ * @deprecated use standard setWidth/setHeight instead
+ */
+ @Deprecated
+ public void setSize(int size) {
+ this.size = size;
+ switch (orientation) {
+ case ORIENTATION_HORIZONTAL:
+ setWidth(size, UNITS_PIXELS);
+ break;
+ default:
+ setHeight(size, UNITS_PIXELS);
+ break;
+ }
+ requestRepaint();
+ }
+
+ /**
+ * Get the handle size of this Slider.
+ *
+ * @return handle size in percentages.
+ * @deprecated The size is dictated by the current theme.
+ */
+ @Deprecated
+ public int getHandleSize() {
+ return handleSize;
+ }
+
+ /**
+ * Set the handle size of this Slider.
+ *
+ * @param handleSize
+ * in percentages relative to slider base size.
+ * @deprecated The size is dictated by the current theme.
+ */
+ @Deprecated
+ public void setHandleSize(int handleSize) {
+ if (handleSize < 0) {
+ this.handleSize = -1;
+ } else if (handleSize > 99) {
+ this.handleSize = 99;
+ } else if (handleSize < 1) {
+ this.handleSize = 1;
+ } else {
+ this.handleSize = handleSize;
+ }
+ requestRepaint();
+ }
+
+ @Override
+ public String getTag() {
+ return "slider";
+ }
+
+ @Override
+ public void paintContent(PaintTarget target) throws PaintException {
+ super.paintContent(target);
+
+ target.addAttribute("min", min);
+ if (max > min) {
+ target.addAttribute("max", max);
+ } else {
+ target.addAttribute("max", min);
+ }
+ target.addAttribute("resolution", resolution);
+
+ if (resolution > 0) {
+ target.addVariable(this, "value", ((Double) getValue())
+ .doubleValue());
+ } else {
+ target.addVariable(this, "value", ((Double) getValue()).intValue());
+ }
+
+ if (orientation == ORIENTATION_VERTICAL) {
+ target.addAttribute("vertical", true);
+ }
+
+ if (arrows) {
+ target.addAttribute("arrows", true);
+ }
+
+ if (size > -1) {
+ target.addAttribute("size", size);
+ }
+
+ if (min != max && min < max) {
+ target.addAttribute("hsize", handleSize);
+ } else {
+ target.addAttribute("hsize", 100);
+ }
+
+ }
+
+ /**
+ * Invoked when the value of a variable has changed. Slider listeners are
+ * notified if the slider value has changed.
+ *
+ * @param source
+ * @param variables
+ */
+ @Override
+ public void changeVariables(Object source, Map variables) {
+ super.changeVariables(source, variables);
+ if (variables.containsKey("value")) {
+ final Object value = variables.get("value");
+ final Double newValue = new Double(value.toString());
+ if (newValue != null && newValue != getValue()
+ && !newValue.equals(getValue())) {
+ try {
+ setValue(newValue, true);
+ } catch (final ValueOutOfBoundsException e) {
+ // Convert to nearest bound
+ double out = e.getValue().doubleValue();
+ if (out < min) {
+ out = min;
+ }
+ if (out > max) {
+ out = max;
+ }
+ super.setValue(new Double(out), false);
+ }
+ }
+ }
+ }
+
+ /**
+ * ValueOutOfBoundsException
+ *
+ * @author IT Mill Ltd.
+ *
+ */
+ public class ValueOutOfBoundsException extends Exception {
+
+ private final Double value;
+
+ /**
+ * Constructs an <code>ValueOutOfBoundsException</code> with the
+ * specified detail message.
+ *
+ * @param valueOutOfBounds
+ */
+ public ValueOutOfBoundsException(Double valueOutOfBounds) {
+ value = valueOutOfBounds;
+ }
+
+ public Double getValue() {
+ return value;
+ }
+
+ }
+
+ @Override
+ public Class getType() {
+ return Double.class;
+ }
+
+}
diff --git a/src/com/vaadin/ui/SplitPanel.java b/src/com/vaadin/ui/SplitPanel.java
index 8e67f9c41a..956eefc62b 100644
--- a/src/com/vaadin/ui/SplitPanel.java
+++ b/src/com/vaadin/ui/SplitPanel.java
@@ -10,6 +10,7 @@ import java.util.Map;
import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
import com.vaadin.terminal.Sizeable;
+import com.vaadin.terminal.gwt.client.ui.VSplitPanelHorizontal;
/**
* SplitPanel.
@@ -23,6 +24,7 @@ import com.vaadin.terminal.Sizeable;
* @since 5.0
*/
@SuppressWarnings("serial")
+@ClientWidget(VSplitPanelHorizontal.class)
public class SplitPanel extends AbstractLayout {
/* Predefined orientations */
@@ -80,11 +82,7 @@ public class SplitPanel extends AbstractLayout {
*/
@Override
public String getTag() {
- if (orientation == ORIENTATION_HORIZONTAL) {
- return "hsplitpanel";
- } else {
- return "vsplitpanel";
- }
+ return "splitpanel";
}
/**
@@ -218,6 +216,10 @@ public class SplitPanel extends AbstractLayout {
final String position = pos + UNIT_SYMBOLS[posUnit];
+ if (orientation == ORIENTATION_VERTICAL) {
+ target.addAttribute("vertical", true);
+ }
+
target.addAttribute("position", position);
if (isLocked()) {
diff --git a/src/com/vaadin/ui/TabSheet.java b/src/com/vaadin/ui/TabSheet.java
index f868902375..71a4ca8cf2 100644
--- a/src/com/vaadin/ui/TabSheet.java
+++ b/src/com/vaadin/ui/TabSheet.java
@@ -17,6 +17,7 @@ import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
import com.vaadin.terminal.Resource;
import com.vaadin.terminal.Paintable.RepaintRequestListener;
+import com.vaadin.terminal.gwt.client.ui.VTabsheet;
/**
* Tabsheet component.
@@ -27,6 +28,7 @@ import com.vaadin.terminal.Paintable.RepaintRequestListener;
* @since 3.0
*/
@SuppressWarnings("serial")
+@ClientWidget(VTabsheet.class)
public class TabSheet extends AbstractComponentContainer implements
RepaintRequestListener {
diff --git a/src/com/vaadin/ui/Table.java b/src/com/vaadin/ui/Table.java
index 4ba0a9cbc7..1a106becc1 100644
--- a/src/com/vaadin/ui/Table.java
+++ b/src/com/vaadin/ui/Table.java
@@ -32,25 +32,27 @@ import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
import com.vaadin.terminal.Resource;
import com.vaadin.terminal.gwt.client.MouseEventDetails;
+import com.vaadin.terminal.gwt.client.ui.VScrollTable;
/**
* <p>
* <code>TableComponent</code> is used for representing data or components in
* pageable and selectable table.
* </p>
- *
+ *
* <p>
* Note! Since version 5, components in Table will not have their caption nor
* icon rendered. In order to workaround this limitation, wrap your component in
* a Layout.
* </p>
- *
+ *
* @author IT Mill Ltd.
* @version
* @VERSION@
* @since 3.0
*/
@SuppressWarnings("serial")
+@ClientWidget(VScrollTable.class)
public class Table extends AbstractSelect implements Action.Container,
Container.Ordered, Container.Sortable, ItemClickSource {
@@ -338,7 +340,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Creates a new empty table with caption.
- *
+ *
* @param caption
*/
public Table(String caption) {
@@ -348,7 +350,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Creates a new table with caption and connect it to a Container.
- *
+ *
* @param caption
* @param dataSource
*/
@@ -362,11 +364,11 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Gets the array of visible column id:s, including generated columns.
- *
+ *
* <p>
* The columns are show in the order of their appearance in this array.
* </p>
- *
+ *
* @return an array of currently visible propertyIds and generated column
* ids.
*/
@@ -379,11 +381,11 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Sets the array of visible column property id:s.
- *
+ *
* <p>
* The columns are show in the order of their appearance in this array.
* </p>
- *
+ *
* @param visibleColumns
* the Array of shown property id:s.
*/
@@ -445,7 +447,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Gets the headers of the columns.
- *
+ *
* <p>
* The headers match the property id:s given my the set visible column
* headers. The table must be set in either
@@ -454,7 +456,7 @@ public class Table extends AbstractSelect implements Action.Container,
* headers. In the defaults mode any nulls in the headers array are replaced
* with id.toString() outputs when rendering.
* </p>
- *
+ *
* @return the Array of column headers.
*/
public String[] getColumnHeaders() {
@@ -472,7 +474,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Sets the headers of the columns.
- *
+ *
* <p>
* The headers match the property id:s given my the set visible column
* headers. The table must be set in either
@@ -481,7 +483,7 @@ public class Table extends AbstractSelect implements Action.Container,
* headers. In the defaults mode any nulls in the headers array are replaced
* with id.toString() outputs when rendering.
* </p>
- *
+ *
* @param columnHeaders
* the Array of column headers that match the
* <code>getVisibleColumns</code> method.
@@ -508,7 +510,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Gets the icons of the columns.
- *
+ *
* <p>
* The icons in headers match the property id:s given my the set visible
* column headers. The table must be set in either
@@ -516,7 +518,7 @@ public class Table extends AbstractSelect implements Action.Container,
* <code>COLUMN_HEADER_MODE_EXPLICIT_DEFAULTS_ID</code> mode to show the
* headers with icons.
* </p>
- *
+ *
* @return the Array of icons that match the <code>getVisibleColumns</code>.
*/
public Resource[] getColumnIcons() {
@@ -535,7 +537,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Sets the icons of the columns.
- *
+ *
* <p>
* The icons in headers match the property id:s given my the set visible
* column headers. The table must be set in either
@@ -543,7 +545,7 @@ public class Table extends AbstractSelect implements Action.Container,
* <code>COLUMN_HEADER_MODE_EXPLICIT_DEFAULTS_ID</code> mode to show the
* headers with icons.
* </p>
- *
+ *
* @param columnIcons
* the Array of icons that match the
* <code>getVisibleColumns</code>.
@@ -570,7 +572,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Gets the array of column alignments.
- *
+ *
* <p>
* The items in the array must match the properties identified by
* <code>getVisibleColumns()</code>. The possible values for the alignments
@@ -583,7 +585,7 @@ public class Table extends AbstractSelect implements Action.Container,
* The alignments default to <code>ALIGN_LEFT</code>: any null values are
* rendered as align lefts.
* </p>
- *
+ *
* @return the Column alignments array.
*/
public String[] getColumnAlignments() {
@@ -602,7 +604,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Sets the column alignments.
- *
+ *
* <p>
* The items in the array must match the properties identified by
* <code>getVisibleColumns()</code>. The possible values for the alignments
@@ -614,7 +616,7 @@ public class Table extends AbstractSelect implements Action.Container,
* </ul>
* The alignments default to <code>ALIGN_LEFT</code>
* </p>
- *
+ *
* @param columnAlignments
* the Column alignments array.
*/
@@ -654,11 +656,11 @@ public class Table extends AbstractSelect implements Action.Container,
* Sets columns width (in pixels). Theme may not necessary respect very
* small or very big values. Setting width to -1 (default) means that theme
* will make decision of width.
- *
+ *
*<p>
* Column can either have a fixed width or expand ratio. The latter one set
* is used. See @link {@link #setColumnExpandRatio(Object, float)}.
- *
+ *
* @param columnId
* colunmns property id
* @param width
@@ -682,27 +684,27 @@ public class Table extends AbstractSelect implements Action.Container,
* naturally. Excess space is the space that is not used by columns with
* explicit width (see {@link #setColumnWidth(Object, int)}) or with natural
* width (no width nor expand ratio).
- *
+ *
* <p>
* By default (without expand ratios) the excess space is divided
* proportionally to columns natural widths.
- *
+ *
* <p>
* Only expand ratios of visible columns are used in final calculations.
- *
+ *
* <p>
* Column can either have a fixed width or expand ratio. The latter one set
* is used.
- *
+ *
* <p>
* A column with expand ratio is considered to be minimum width by default
* (if no excess space exists). The minimum width is defined by terminal
* implementation.
- *
+ *
* <p>
* If terminal implementation supports re-sizeable columns the column
* becomes fixed width column if users resizes the column.
- *
+ *
* @param columnId
* colunmns property id
* @param expandRatio
@@ -728,7 +730,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Gets the pixel width of column
- *
+ *
* @param propertyId
* @return width of colun or -1 when value not set
*/
@@ -743,11 +745,11 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Gets the page length.
- *
+ *
* <p>
* Setting page length 0 disables paging.
* </p>
- *
+ *
* @return the Length of one page.
*/
public int getPageLength() {
@@ -756,16 +758,16 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Sets the page length.
- *
+ *
* <p>
* Setting page length 0 disables paging. The page length defaults to 15.
* </p>
- *
+ *
* <p>
* If Table has width set ({@link #setWidth(float, int)} ) the client side
* may update the page length automatically the correct value.
* </p>
- *
+ *
* @param pageLength
* the length of one page.
*/
@@ -780,18 +782,18 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* This method adjusts a possible caching mechanism of table implementation.
- *
+ *
* <p>
* Table component may fetch and render some rows outside visible area. With
* complex tables (for example containing layouts and components), the
* client side may become unresponsive. Setting the value lower, UI will
* become more responsive. With higher values scrolling in client will hit
* server less frequently.
- *
+ *
* <p>
* The amount of cached rows will be cacheRate multiplied with pageLength (
* {@link #setPageLength(int)} both below and above visible area..
- *
+ *
* @param cacheRate
* a value over 0 (fastest rendering time). Higher value will
* cache more rows on server (smoother scrolling). Default value
@@ -810,7 +812,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* @see #setCacheRate(double)
- *
+ *
* @return the current cache rate value
*/
public double getCacheRate() {
@@ -819,7 +821,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Getter for property currentPageFirstItem.
- *
+ *
* @return the Value of property currentPageFirstItem.
*/
public Object getCurrentPageFirstItemId() {
@@ -846,7 +848,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Setter for property currentPageFirstItemId.
- *
+ *
* @param currentPageFirstItemId
* the New value of property currentPageFirstItemId.
*/
@@ -899,7 +901,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Gets the icon Resource for the specified column.
- *
+ *
* @param propertyId
* the propertyId indentifying the column.
* @return the icon for the specified column; null if the column has no icon
@@ -914,7 +916,7 @@ public class Table extends AbstractSelect implements Action.Container,
* <p>
* Throws IllegalArgumentException if the specified column is not visible.
* </p>
- *
+ *
* @param propertyId
* the propertyId identifying the column.
* @param icon
@@ -935,7 +937,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Gets the header for the specified column.
- *
+ *
* @param propertyId
* the propertyId indentifying the column.
* @return the header for the specifed column if it has one.
@@ -956,7 +958,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Sets the column header for the specified column;
- *
+ *
* @param propertyId
* the propertyId indentifying the column.
* @param header
@@ -976,7 +978,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Gets the specified column's alignment.
- *
+ *
* @param propertyId
* the propertyID identifying the column.
* @return the specified column's alignment if it as one; null otherwise.
@@ -988,12 +990,12 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Sets the specified column's alignment.
- *
+ *
* <p>
* Throws IllegalArgumentException if the alignment is not one of the
* following: ALIGN_LEFT, ALIGN_CENTER or ALIGN_RIGHT
* </p>
- *
+ *
* @param propertyId
* the propertyID identifying the column.
* @param alignment
@@ -1022,7 +1024,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Checks if the specified column is collapsed.
- *
+ *
* @param propertyId
* the propertyID identifying the column.
* @return true if the column is collapsed; false otherwise;
@@ -1034,8 +1036,8 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Sets whether the specified column is collapsed or not.
- *
- *
+ *
+ *
* @param propertyId
* the propertyID identifying the column.
* @param collapsed
@@ -1061,7 +1063,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Checks if column collapsing is allowed.
- *
+ *
* @return true if columns can be collapsed; false otherwise.
*/
public boolean isColumnCollapsingAllowed() {
@@ -1070,7 +1072,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Sets whether column collapsing is allowed or not.
- *
+ *
* @param collapsingAllowed
* specifies whether column collapsing is allowed.
*/
@@ -1087,7 +1089,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Checks if column reordering is allowed.
- *
+ *
* @return true if columns can be reordered; false otherwise.
*/
public boolean isColumnReorderingAllowed() {
@@ -1096,7 +1098,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Sets whether column reordering is allowed or not.
- *
+ *
* @param reorderingAllowed
* specifies whether column reordering is allowed.
*/
@@ -1141,7 +1143,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Getter for property currentPageFirstItem.
- *
+ *
* @return the Value of property currentPageFirstItem.
*/
public int getCurrentPageFirstItemIndex() {
@@ -1245,7 +1247,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Setter for property currentPageFirstItem.
- *
+ *
* @param newIndex
* the New value of property currentPageFirstItem.
*/
@@ -1255,9 +1257,9 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Getter for property pageBuffering.
- *
+ *
* @deprecated functionality is not needed in ajax rendering model
- *
+ *
* @return the Value of property pageBuffering.
*/
@Deprecated
@@ -1267,9 +1269,9 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Setter for property pageBuffering.
- *
+ *
* @deprecated functionality is not needed in ajax rendering model
- *
+ *
* @param pageBuffering
* the New value of property pageBuffering.
*/
@@ -1280,11 +1282,11 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Getter for property selectable.
- *
+ *
* <p>
* The table is not selectable by default.
* </p>
- *
+ *
* @return the Value of property selectable.
*/
public boolean isSelectable() {
@@ -1293,11 +1295,11 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Setter for property selectable.
- *
+ *
* <p>
* The table is not selectable by default.
* </p>
- *
+ *
* @param selectable
* the New value of property selectable.
*/
@@ -1310,7 +1312,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Getter for property columnHeaderMode.
- *
+ *
* @return the Value of property columnHeaderMode.
*/
public int getColumnHeaderMode() {
@@ -1319,7 +1321,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Setter for property columnHeaderMode.
- *
+ *
* @param columnHeaderMode
* the New value of property columnHeaderMode.
*/
@@ -1568,7 +1570,7 @@ public class Table extends AbstractSelect implements Action.Container,
* Helper method to remove listeners and maintain correct component
* hierarchy. Detaches properties and components if those are no more
* rendered in client.
- *
+ *
* @param oldListenedProperties
* set of properties that where listened in last render
* @param oldVisibleComponents
@@ -1600,7 +1602,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Refreshes the current page contents.
- *
+ *
* @deprecated should not need to be used
*/
@Deprecated
@@ -1631,7 +1633,7 @@ public class Table extends AbstractSelect implements Action.Container,
* </ul>
* The default value is <code>ROW_HEADER_MODE_HIDDEN</code>
* </p>
- *
+ *
* @param mode
* the One of the modes listed above.
*/
@@ -1649,7 +1651,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Gets the row header mode.
- *
+ *
* @return the Row header mode.
* @see #setRowHeaderMode(int)
*/
@@ -1661,7 +1663,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Adds the new row to table and fill the visible cells (except generated
* columns) with given values.
- *
+ *
* @param cells
* the Object array that is used for filling the visible cells
* new row. The types must be settable to visible column property
@@ -1729,10 +1731,10 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Sets the Container that serves as the data source of the viewer.
- *
+ *
* As a side-effect Table's value (selection) is set to null due old
* selection not necessary exists in new Container.
- *
+ *
* @see com.vaadin.data.Container.Viewer#setContainerDataSource(Container)
*/
@Override
@@ -1792,7 +1794,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Invoked when the value of a variable has changed.
- *
+ *
* @see com.vaadin.ui.Select#changeVariables(java.lang.Object,
* java.util.Map)
*/
@@ -1948,7 +1950,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Handles click event
- *
+ *
* @param variables
*/
private void handleClickEvent(Map variables) {
@@ -1977,7 +1979,7 @@ public class Table extends AbstractSelect implements Action.Container,
* Go to mode where content updates are not done. This is due we want to
* bypass expensive content for some reason (like when we know we may have
* other content changes on their way).
- *
+ *
* @return true if content refresh flag was enabled prior this call
*/
protected boolean disableContentRefreshing() {
@@ -1988,7 +1990,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Go to mode where content content refreshing has effect.
- *
+ *
* @param refreshContent
* true if content refresh needs to be done
*/
@@ -2003,7 +2005,7 @@ public class Table extends AbstractSelect implements Action.Container,
/*
* (non-Javadoc)
- *
+ *
* @see com.vaadin.ui.AbstractSelect#paintContent(com.vaadin.
* terminal.PaintTarget)
*/
@@ -2366,7 +2368,7 @@ public class Table extends AbstractSelect implements Action.Container,
/*
* (non-Javadoc)
- *
+ *
* @see com.vaadin.ui.AbstractSelect#getTag()
*/
@Override
@@ -2376,7 +2378,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Gets the cached visible table contents.
- *
+ *
* @return the cached visible table contents.
*/
private Object[][] getVisibleCells() {
@@ -2388,11 +2390,11 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Gets the value of property.
- *
+ *
* By default if the table is editable the fieldFactory is used to create
* editors for table cells. Otherwise formatPropertyValue is used to format
* the value representation.
- *
+ *
* @param rowId
* the Id of the row (same as item Id).
* @param colId
@@ -2419,7 +2421,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Formats table cell property values. By default the property.toString()
* and return a empty string for null properties.
- *
+ *
* @param rowId
* the Id of the row (same as item Id).
* @param colId
@@ -2441,7 +2443,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Registers a new action handler for this container
- *
+ *
* @see com.vaadin.event.Action.Container#addActionHandler(Action.Handler)
*/
public void addActionHandler(Action.Handler actionHandler) {
@@ -2464,7 +2466,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Removes a previously registered action handler for the contents of this
* container.
- *
+ *
* @see com.vaadin.event.Action.Container#removeActionHandler(Action.Handler)
*/
public void removeActionHandler(Action.Handler actionHandler) {
@@ -2486,9 +2488,9 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Notifies this listener that the Property's value has changed.
- *
+ *
* Also listens changes in rendered items to refresh content area.
- *
+ *
* @see com.vaadin.data.Property.ValueChangeListener#valueChange(Property.ValueChangeEvent)
*/
@Override
@@ -2513,7 +2515,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Notifies the component that it is connected to an application.
- *
+ *
* @see com.vaadin.ui.Component#attach()
*/
@Override
@@ -2532,7 +2534,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Notifies the component that it is detached from the application
- *
+ *
* @see com.vaadin.ui.Component#detach()
*/
@Override
@@ -2549,7 +2551,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Removes all Items from the Container.
- *
+ *
* @see com.vaadin.data.Container#removeAllItems()
*/
@Override
@@ -2561,7 +2563,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Removes the Item identified by <code>ItemId</code> from the Container.
- *
+ *
* @see com.vaadin.data.Container#removeItem(Object)
*/
@Override
@@ -2581,7 +2583,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Removes a Property specified by the given Property ID from the Container.
- *
+ *
* @see com.vaadin.data.Container#removeContainerProperty(Object)
*/
@Override
@@ -2599,7 +2601,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Adds a new property to the table and show it as a visible column.
- *
+ *
* @param propertyId
* the Id of the proprty.
* @param type
@@ -2634,7 +2636,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Adds a new property to the table and show it as a visible column.
- *
+ *
* @param propertyId
* the Id of the proprty
* @param type
@@ -2683,7 +2685,7 @@ public class Table extends AbstractSelect implements Action.Container,
* Also note that getVisibleColumns() will return the generated columns,
* while getContainerPropertyIds() will not.
* </p>
- *
+ *
* @param id
* the id of the column to be added
* @param generatedColumn
@@ -2713,7 +2715,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Removes a generated column previously added with addGeneratedColumn.
- *
+ *
* @param columnId
* id of the generated column to remove
* @return true if the column could be removed (existed in the Table)
@@ -2736,7 +2738,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Returns the list of items on the current page
- *
+ *
* @see com.vaadin.ui.Select#getVisibleItemIds()
*/
@Override
@@ -2755,7 +2757,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Container datasource item set change. Table must flush its buffers on
* change.
- *
+ *
* @see com.vaadin.data.Container.ItemSetChangeListener#containerItemSetChange(com.vaadin.data.Container.ItemSetChangeEvent)
*/
@Override
@@ -2783,7 +2785,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Container datasource property set change. Table must flush its buffers on
* change.
- *
+ *
* @see com.vaadin.data.Container.PropertySetChangeListener#containerPropertySetChange(com.vaadin.data.Container.PropertySetChangeEvent)
*/
@Override
@@ -2797,7 +2799,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Adding new items is not supported.
- *
+ *
* @throws UnsupportedOperationException
* if set to true.
* @see com.vaadin.ui.Select#setNewItemsAllowed(boolean)
@@ -2812,7 +2814,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Focusing to this component is not supported.
- *
+ *
* @throws UnsupportedOperationException
* if invoked.
* @see com.vaadin.ui.AbstractField#focus()
@@ -2824,7 +2826,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Gets the ID of the Item following the Item that corresponds to itemId.
- *
+ *
* @see com.vaadin.data.Container.Ordered#nextItemId(java.lang.Object)
*/
public Object nextItemId(Object itemId) {
@@ -2834,7 +2836,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Gets the ID of the Item preceding the Item that corresponds to the
* itemId.
- *
+ *
* @see com.vaadin.data.Container.Ordered#prevItemId(java.lang.Object)
*/
public Object prevItemId(Object itemId) {
@@ -2843,7 +2845,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Gets the ID of the first Item in the Container.
- *
+ *
* @see com.vaadin.data.Container.Ordered#firstItemId()
*/
public Object firstItemId() {
@@ -2852,7 +2854,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Gets the ID of the last Item in the Container.
- *
+ *
* @see com.vaadin.data.Container.Ordered#lastItemId()
*/
public Object lastItemId() {
@@ -2862,7 +2864,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Tests if the Item corresponding to the given Item ID is the first Item in
* the Container.
- *
+ *
* @see com.vaadin.data.Container.Ordered#isFirstId(java.lang.Object)
*/
public boolean isFirstId(Object itemId) {
@@ -2872,7 +2874,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Tests if the Item corresponding to the given Item ID is the last Item in
* the Container.
- *
+ *
* @see com.vaadin.data.Container.Ordered#isLastId(java.lang.Object)
*/
public boolean isLastId(Object itemId) {
@@ -2881,7 +2883,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Adds new item after the given item.
- *
+ *
* @see com.vaadin.data.Container.Ordered#addItemAfter(java.lang.Object)
*/
public Object addItemAfter(Object previousItemId)
@@ -2897,7 +2899,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Adds new item after the given item.
- *
+ *
* @see com.vaadin.data.Container.Ordered#addItemAfter(java.lang.Object,
* java.lang.Object)
*/
@@ -2914,10 +2916,10 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Sets the TableFieldFactory that is used to create editor for table cells.
- *
+ *
* The TableFieldFactory is only used if the Table is editable. By default
* the DefaultFieldFactory is used.
- *
+ *
* @param fieldFactory
* the field factory to set.
* @see #isEditable
@@ -2929,9 +2931,9 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Gets the TableFieldFactory that is used to create editor for table cells.
- *
+ *
* The FieldFactory is only used if the Table is editable.
- *
+ *
* @return TableFieldFactory used to create the Field instances.
* @see #isEditable
*/
@@ -2941,9 +2943,9 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Gets the FieldFactory that is used to create editor for table cells.
- *
+ *
* The FieldFactory is only used if the Table is editable.
- *
+ *
* @return FieldFactory used to create the Field instances.
* @see #isEditable
* @deprecated use {@link #getTableFieldFactory()} instead
@@ -2959,10 +2961,10 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Sets the FieldFactory that is used to create editor for table cells.
- *
+ *
* The FieldFactory is only used if the Table is editable. By default the
* BaseFieldFactory is used.
- *
+ *
* @param fieldFactory
* the field factory to set.
* @see #isEditable
@@ -2980,18 +2982,18 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Is table editable.
- *
+ *
* If table is editable a editor of type Field is created for each table
* cell. The assigned FieldFactory is used to create the instances.
- *
+ *
* To provide custom editors for table cells create a class implementins the
* FieldFactory interface, and assign it to table, and set the editable
* property to true.
- *
+ *
* @return true if table is editable, false oterwise.
* @see Field
* @see FieldFactory
- *
+ *
*/
public boolean isEditable() {
return editable;
@@ -2999,19 +3001,19 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Sets the editable property.
- *
+ *
* If table is editable a editor of type Field is created for each table
* cell. The assigned FieldFactory is used to create the instances.
- *
+ *
* To provide custom editors for table cells create a class implementins the
* FieldFactory interface, and assign it to table, and set the editable
* property to true.
- *
+ *
* @param editable
* true if table should be editable by user.
* @see Field
* @see FieldFactory
- *
+ *
*/
public void setEditable(boolean editable) {
this.editable = editable;
@@ -3023,13 +3025,13 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Sorts the table.
- *
+ *
* @throws UnsupportedOperationException
* if the container data source does not implement
* Container.Sortable
* @see com.vaadin.data.Container.Sortable#sort(java.lang.Object[],
* boolean[])
- *
+ *
*/
public void sort(Object[] propertyId, boolean[] ascending)
throws UnsupportedOperationException {
@@ -3049,7 +3051,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Sorts the table by currently selected sorting column.
- *
+ *
* @throws UnsupportedOperationException
* if the container data source does not implement
* Container.Sortable
@@ -3064,7 +3066,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Gets the container property IDs, which can be used to sort the item.
- *
+ *
* @see com.vaadin.data.Container.Sortable#getSortableContainerPropertyIds()
*/
public Collection getSortableContainerPropertyIds() {
@@ -3078,7 +3080,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Gets the currently sorted column property ID.
- *
+ *
* @return the Container property id of the currently sorted column.
*/
public Object getSortContainerPropertyId() {
@@ -3087,7 +3089,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Sets the currently sorted column property id.
- *
+ *
* @param propertyId
* the Container property id of the currently sorted column.
*/
@@ -3098,7 +3100,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Internal method to set currently sorted column property id. With doSort
* flag actual sorting may be bypassed.
- *
+ *
* @param propertyId
* @param doSort
*/
@@ -3118,7 +3120,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Is the table currently sorted in ascending order.
- *
+ *
* @return <code>true</code> if ascending, <code>false</code> if descending.
*/
public boolean isSortAscending() {
@@ -3127,7 +3129,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Sets the table in ascending order.
- *
+ *
* @param ascending
* <code>true</code> if ascending, <code>false</code> if
* descending.
@@ -3139,7 +3141,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Internal method to set sort ascending. With doSort flag actual sort can
* be bypassed.
- *
+ *
* @param ascending
* @param doSort
*/
@@ -3156,10 +3158,10 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Is sorting disabled altogether.
- *
+ *
* True iff no sortable columns are given even in the case where data source
* would support this.
- *
+ *
* @return True iff sorting is disabled.
*/
public boolean isSortDisabled() {
@@ -3168,10 +3170,10 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Disables the sorting altogether.
- *
+ *
* To disable sorting altogether, set to true. In this case no sortable
* columns are given even in the case where datasource would support this.
- *
+ *
* @param sortDisabled
* True iff sorting is disabled.
*/
@@ -3185,7 +3187,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Table does not support lazy options loading mode. Setting this true will
* throw UnsupportedOperationException.
- *
+ *
* @see com.vaadin.ui.Select#setLazyLoading(boolean)
*/
public void setLazyLoading(boolean useLazyLoading) {
@@ -3210,14 +3212,14 @@ public class Table extends AbstractSelect implements Action.Container,
* Used to create "generated columns"; columns that exist only in the Table,
* not in the underlying Container. Implement this interface and pass it to
* Table.addGeneratedColumn along with an id for the column to be generated.
- *
+ *
*/
public interface ColumnGenerator extends Serializable {
/**
* Called by Table when a cell in a generated column needs to be
* generated.
- *
+ *
* @param source
* the source Table
* @param itemId
@@ -3233,7 +3235,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Set cell style generator for Table.
- *
+ *
* @param cellStyleGenerator
* New cell style generator or null to remove generator.
*/
@@ -3244,7 +3246,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Get the current cell style generator.
- *
+ *
*/
public CellStyleGenerator getCellStyleGenerator() {
return cellStyleGenerator;
@@ -3261,7 +3263,7 @@ public class Table extends AbstractSelect implements Action.Container,
/**
* Called by Table when a cell (and row) is painted.
- *
+ *
* @param itemId
* The itemId of the painted cell
* @param propertyId
diff --git a/src/com/vaadin/ui/TextField.java b/src/com/vaadin/ui/TextField.java
index 5271c9bbed..a43b2b1be8 100644
--- a/src/com/vaadin/ui/TextField.java
+++ b/src/com/vaadin/ui/TextField.java
@@ -10,6 +10,7 @@ import java.util.Map;
import com.vaadin.data.Property;
import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
+import com.vaadin.terminal.gwt.client.ui.VTextField;
/**
* <p>
@@ -32,6 +33,7 @@ import com.vaadin.terminal.PaintTarget;
* @since 3.0
*/
@SuppressWarnings("serial")
+@ClientWidget(VTextField.class)
public class TextField extends AbstractField {
/* Private members */
diff --git a/src/com/vaadin/ui/Tree.java b/src/com/vaadin/ui/Tree.java
index cb3f667a4f..67a036580b 100644
--- a/src/com/vaadin/ui/Tree.java
+++ b/src/com/vaadin/ui/Tree.java
@@ -31,6 +31,7 @@ import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
import com.vaadin.terminal.Resource;
import com.vaadin.terminal.gwt.client.MouseEventDetails;
+import com.vaadin.terminal.gwt.client.ui.VTree;
/**
* Tree component. A Tree can be used to select an item (or multiple items) from
@@ -42,6 +43,7 @@ import com.vaadin.terminal.gwt.client.MouseEventDetails;
* @since 3.0
*/
@SuppressWarnings("serial")
+@ClientWidget(VTree.class)
public class Tree extends AbstractSelect implements Container.Hierarchical,
Action.Container, ItemClickSource {
diff --git a/src/com/vaadin/ui/TwinColSelect.java b/src/com/vaadin/ui/TwinColSelect.java
index a619a5a0a9..bcbc86a275 100644
--- a/src/com/vaadin/ui/TwinColSelect.java
+++ b/src/com/vaadin/ui/TwinColSelect.java
@@ -9,12 +9,14 @@ import java.util.Collection;
import com.vaadin.data.Container;
import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
+import com.vaadin.terminal.gwt.client.ui.VTwinColSelect;
/**
* Multiselect component with two lists: left side for available items and right
* side for selected items.
*/
@SuppressWarnings("serial")
+@ClientWidget(VTwinColSelect.class)
public class TwinColSelect extends AbstractSelect {
private int columns = 0;
diff --git a/src/com/vaadin/ui/Upload.java b/src/com/vaadin/ui/Upload.java
index cdea1e6ce3..2ea347fc56 100644
--- a/src/com/vaadin/ui/Upload.java
+++ b/src/com/vaadin/ui/Upload.java
@@ -1,5 +1,5 @@
-/*
-@ITMillApache2LicenseForJavaFiles@
+/*
+ * @ITMillApache2LicenseForJavaFiles@
*/
package com.vaadin.ui;
@@ -17,6 +17,7 @@ import com.vaadin.Application;
import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
import com.vaadin.terminal.UploadStream;
+import com.vaadin.terminal.gwt.client.ui.VUpload;
/**
* Component for uploading files from client to server.
@@ -54,6 +55,7 @@ import com.vaadin.terminal.UploadStream;
* @since 3.0
*/
@SuppressWarnings("serial")
+@ClientWidget(VUpload.class)
public class Upload extends AbstractComponent implements Component.Focusable {
private boolean delayedFocus;
@@ -200,12 +202,13 @@ public class Upload extends AbstractComponent implements Component.Focusable {
try {
// still try to close output stream
out.close();
- } catch (IOException e1) {
- // NOP
+ } catch (IOException ignored) {
}
fireUploadInterrupted(filename, type, totalBytes, e);
endUpload();
interrupted = false;
+ // throw cause ahead
+ throw new IllegalStateException("Uploading failed", e);
}
}
}
diff --git a/src/com/vaadin/ui/UriFragmentUtility.java b/src/com/vaadin/ui/UriFragmentUtility.java
index eca646538f..d6c0dc9f51 100644
--- a/src/com/vaadin/ui/UriFragmentUtility.java
+++ b/src/com/vaadin/ui/UriFragmentUtility.java
@@ -6,6 +6,7 @@ import java.util.Map;
import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
+import com.vaadin.terminal.gwt.client.ui.VUriFragmentUtility;
/**
* Experimental web browser dependent component for URI fragment (part after
@@ -16,6 +17,7 @@ import com.vaadin.terminal.PaintTarget;
*
*/
@SuppressWarnings("serial")
+@ClientWidget(VUriFragmentUtility.class)
public class UriFragmentUtility extends AbstractComponent {
/**
diff --git a/src/com/vaadin/ui/VerticalLayout.java b/src/com/vaadin/ui/VerticalLayout.java
index 55f70a740f..13f1422b6a 100644
--- a/src/com/vaadin/ui/VerticalLayout.java
+++ b/src/com/vaadin/ui/VerticalLayout.java
@@ -1,5 +1,7 @@
package com.vaadin.ui;
+import com.vaadin.terminal.gwt.client.ui.VVerticalLayout;
+
/**
* Vertical layout
*
@@ -13,6 +15,7 @@ package com.vaadin.ui;
* @since 5.3
*/
@SuppressWarnings("serial")
+@ClientWidget(VVerticalLayout.class)
public class VerticalLayout extends AbstractOrderedLayout {
public VerticalLayout() {
diff --git a/src/com/vaadin/ui/Window.java b/src/com/vaadin/ui/Window.java
index 663aabbd79..1912a434ef 100644
--- a/src/com/vaadin/ui/Window.java
+++ b/src/com/vaadin/ui/Window.java
@@ -24,6 +24,7 @@ import com.vaadin.terminal.Resource;
import com.vaadin.terminal.Sizeable;
import com.vaadin.terminal.Terminal;
import com.vaadin.terminal.URIHandler;
+import com.vaadin.terminal.gwt.client.ui.VView;
/**
* Application window component.
@@ -34,6 +35,7 @@ import com.vaadin.terminal.URIHandler;
* @since 3.0
*/
@SuppressWarnings("serial")
+@ClientWidget(VView.class)
public class Window extends Panel implements URIHandler, ParameterHandler {
/**
@@ -535,10 +537,15 @@ public class Window extends Panel implements URIHandler, ParameterHandler {
// Window closing
target.addVariable(this, "close", false);
- // Paint subwindows
- for (final Iterator<Window> i = subwindows.iterator(); i.hasNext();) {
- final Window w = i.next();
- w.paint(target);
+ if (getParent() == null) {
+ // Paint subwindows
+ for (final Iterator<Window> i = subwindows.iterator(); i.hasNext();) {
+ final Window w = i.next();
+ w.paint(target);
+ }
+ } else {
+ // mark subwindows
+ target.addAttribute("sub", true);
}
// Paint notifications