From f384748d47656ce76d1fde30f8c0d6f07fd3f91b Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Tue, 5 Oct 2010 09:27:23 +0000 Subject: [PATCH] Fix for #5735 - Deprecate AlignmentUtils and methods that uses it svn changeset:15406/svn branch:6.5 --- src/com/vaadin/ui/AbstractOrderedLayout.java | 12 ++++++++++++ src/com/vaadin/ui/AlignmentUtils.java | 5 ++++- src/com/vaadin/ui/GridLayout.java | 12 ++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/src/com/vaadin/ui/AbstractOrderedLayout.java b/src/com/vaadin/ui/AbstractOrderedLayout.java index 517c363dc8..73ab2e81fd 100644 --- a/src/com/vaadin/ui/AbstractOrderedLayout.java +++ b/src/com/vaadin/ui/AbstractOrderedLayout.java @@ -324,6 +324,18 @@ public abstract class AbstractOrderedLayout extends AbstractLayout implements return (ratio == null) ? 0 : ratio.floatValue(); } + /** + * Sets the component alignment using a short hand string notation. + * + * @deprecated Replaced by + * {@link #setComponentAlignment(Component, Alignment)} + * + * @param component + * A child component in this layout + * @param alignment + * A short hand notation described in {@link AlignmentUtils} + */ + @Deprecated public void setComponentAlignment(Component component, String alignment) { AlignmentUtils.setComponentAlignment(this, component, alignment); } diff --git a/src/com/vaadin/ui/AlignmentUtils.java b/src/com/vaadin/ui/AlignmentUtils.java index 470c093784..72c7b9e2de 100644 --- a/src/com/vaadin/ui/AlignmentUtils.java +++ b/src/com/vaadin/ui/AlignmentUtils.java @@ -26,13 +26,16 @@ import com.vaadin.ui.Layout.AlignmentHandler; * * r,right for right alignment * + * @deprecated {@code AlignmentUtils} has been replaced by {@link Alignment}. */ -@SuppressWarnings("serial") +@SuppressWarnings({ "serial" }) +@Deprecated public class AlignmentUtils implements Serializable { private static int horizontalMask = AlignmentHandler.ALIGNMENT_LEFT | AlignmentHandler.ALIGNMENT_HORIZONTAL_CENTER | AlignmentHandler.ALIGNMENT_RIGHT; + private static int verticalMask = AlignmentHandler.ALIGNMENT_TOP | AlignmentHandler.ALIGNMENT_VERTICAL_CENTER | AlignmentHandler.ALIGNMENT_BOTTOM; diff --git a/src/com/vaadin/ui/GridLayout.java b/src/com/vaadin/ui/GridLayout.java index 933007841c..b8619e5c76 100644 --- a/src/com/vaadin/ui/GridLayout.java +++ b/src/com/vaadin/ui/GridLayout.java @@ -1353,6 +1353,18 @@ public class GridLayout extends AbstractLayout implements return null; } + /** + * Sets the component alignment using a short hand string notation. + * + * @deprecated Replaced by + * {@link #setComponentAlignment(Component, Alignment)} + * + * @param component + * A child component in this layout + * @param alignment + * A short hand notation described in {@link AlignmentUtils} + */ + @Deprecated public void setComponentAlignment(Component component, String alignment) { AlignmentUtils.setComponentAlignment(this, component, alignment); } -- 2.39.5