diff options
author | Artur Signell <artur@vaadin.com> | 2011-12-16 16:31:22 +0200 |
---|---|---|
committer | Artur Signell <artur@vaadin.com> | 2011-12-19 13:06:59 +0200 |
commit | 9c6d34431fc3de18da06bcdbdd1dea6d600e4bd4 (patch) | |
tree | dfc959ddfdc69b63c57d6aa01150beb78ba741e0 /src | |
parent | e09e1c817bf955319800bca16a81ad7d2d55e37d (diff) | |
download | vaadin-framework-9c6d34431fc3de18da06bcdbdd1dea6d600e4bd4.tar.gz vaadin-framework-9c6d34431fc3de18da06bcdbdd1dea6d600e4bd4.zip |
#8026 Removed deprecated ExpandLayout and OrderedLayout.
Diffstat (limited to 'src')
-rw-r--r-- | src/com/vaadin/terminal/gwt/server/ComponentSizeValidator.java | 23 | ||||
-rw-r--r-- | src/com/vaadin/ui/ExpandLayout.java | 101 | ||||
-rw-r--r-- | src/com/vaadin/ui/FormLayout.java | 3 | ||||
-rw-r--r-- | src/com/vaadin/ui/OrderedLayout.java | 128 |
4 files changed, 5 insertions, 250 deletions
diff --git a/src/com/vaadin/terminal/gwt/server/ComponentSizeValidator.java b/src/com/vaadin/terminal/gwt/server/ComponentSizeValidator.java index 7889968e63..97ae19a8dd 100644 --- a/src/com/vaadin/terminal/gwt/server/ComponentSizeValidator.java +++ b/src/com/vaadin/terminal/gwt/server/ComponentSizeValidator.java @@ -25,7 +25,6 @@ import com.vaadin.ui.Form; import com.vaadin.ui.GridLayout; import com.vaadin.ui.GridLayout.Area; import com.vaadin.ui.Layout; -import com.vaadin.ui.OrderedLayout; import com.vaadin.ui.Panel; import com.vaadin.ui.SplitPanel; import com.vaadin.ui.TabSheet; @@ -198,11 +197,7 @@ public class ComponentSizeValidator implements Serializable { AbstractOrderedLayout ol = (AbstractOrderedLayout) parent; boolean vertical = false; - if (ol instanceof OrderedLayout) { - if (((OrderedLayout) ol).getOrientation() == OrderedLayout.ORIENTATION_VERTICAL) { - vertical = true; - } - } else if (ol instanceof VerticalLayout) { + if (ol instanceof VerticalLayout) { vertical = true; } @@ -231,11 +226,7 @@ public class ComponentSizeValidator implements Serializable { AbstractOrderedLayout ol = (AbstractOrderedLayout) parent; boolean horizontal = true; - if (ol instanceof OrderedLayout) { - if (((OrderedLayout) ol).getOrientation() == OrderedLayout.ORIENTATION_VERTICAL) { - horizontal = false; - } - } else if (ol instanceof VerticalLayout) { + if (ol instanceof VerticalLayout) { horizontal = false; } @@ -426,9 +417,7 @@ public class ComponentSizeValidator implements Serializable { if (parent instanceof AbstractOrderedLayout) { boolean horizontal = true; - if (parent instanceof OrderedLayout) { - horizontal = ((OrderedLayout) parent).getOrientation() == OrderedLayout.ORIENTATION_HORIZONTAL; - } else if (parent instanceof VerticalLayout) { + if (parent instanceof VerticalLayout) { horizontal = false; } if (horizontal @@ -528,11 +517,7 @@ public class ComponentSizeValidator implements Serializable { if (parent instanceof AbstractOrderedLayout) { AbstractOrderedLayout ol = (AbstractOrderedLayout) parent; boolean horizontal = true; - if (ol instanceof OrderedLayout) { - if (((OrderedLayout) ol).getOrientation() == OrderedLayout.ORIENTATION_VERTICAL) { - horizontal = false; - } - } else if (ol instanceof VerticalLayout) { + if (ol instanceof VerticalLayout) { horizontal = false; } diff --git a/src/com/vaadin/ui/ExpandLayout.java b/src/com/vaadin/ui/ExpandLayout.java deleted file mode 100644 index 55ee2ffdcf..0000000000 --- a/src/com/vaadin/ui/ExpandLayout.java +++ /dev/null @@ -1,101 +0,0 @@ -/* -@VaadinApache2LicenseForJavaFiles@ - */ - -package com.vaadin.ui; - -/** - * A layout that will give one of it's components as much space as possible, - * while still showing the other components in the layout. The other components - * will in effect be given a fixed sized space, while the space given to the - * expanded component will grow/shrink to fill the rest of the space available - - * for instance when re-sizing the window. - * - * Note that this layout is 100% in both directions by default ({link - * {@link #setSizeFull()}). Remember to set the units if you want to specify a - * fixed size. If the layout fails to show up, check that the parent layout is - * actually giving some space. - * - * @deprecated Deprecated in favor of the new OrderedLayout - */ -@SuppressWarnings("serial") -@Deprecated -public class ExpandLayout extends OrderedLayout { - - private Component expanded = null; - - public ExpandLayout() { - this(ORIENTATION_VERTICAL); - } - - public ExpandLayout(int orientation) { - super(orientation); - - setSizeFull(); - } - - /** - * @param c - * Component which container will be maximized - */ - public void expand(Component c) { - if (expanded != null) { - try { - setExpandRatio(expanded, 0.0f); - } catch (IllegalArgumentException e) { - // Ignore error if component has been removed - } - } - - expanded = c; - if (expanded != null) { - setExpandRatio(expanded, 1.0f); - } - - requestRepaint(); - } - - @Override - public void addComponent(Component c, int index) { - super.addComponent(c, index); - if (expanded == null) { - expand(c); - } - } - - @Override - public void addComponent(Component c) { - super.addComponent(c); - if (expanded == null) { - expand(c); - } - } - - @Override - public void addComponentAsFirst(Component c) { - super.addComponentAsFirst(c); - if (expanded == null) { - expand(c); - } - } - - @Override - public void removeComponent(Component c) { - super.removeComponent(c); - if (c == expanded) { - if (getComponentIterator().hasNext()) { - expand(getComponentIterator().next()); - } else { - expand(null); - } - } - } - - @Override - public void replaceComponent(Component oldComponent, Component newComponent) { - super.replaceComponent(oldComponent, newComponent); - if (oldComponent == expanded) { - expand(newComponent); - } - } -} diff --git a/src/com/vaadin/ui/FormLayout.java b/src/com/vaadin/ui/FormLayout.java index f61f5d544e..d33d3e94da 100644 --- a/src/com/vaadin/ui/FormLayout.java +++ b/src/com/vaadin/ui/FormLayout.java @@ -21,9 +21,8 @@ import com.vaadin.terminal.gwt.client.ui.VFormLayout; * bottom are by default on. * */ -@SuppressWarnings({ "deprecation", "serial" }) @ClientWidget(VFormLayout.class) -public class FormLayout extends OrderedLayout { +public class FormLayout extends AbstractOrderedLayout { public FormLayout() { super(); diff --git a/src/com/vaadin/ui/OrderedLayout.java b/src/com/vaadin/ui/OrderedLayout.java deleted file mode 100644 index 474fc89867..0000000000 --- a/src/com/vaadin/ui/OrderedLayout.java +++ /dev/null @@ -1,128 +0,0 @@ -/* -@VaadinApache2LicenseForJavaFiles@ - */ -package com.vaadin.ui; - -import com.vaadin.terminal.PaintException; -import com.vaadin.terminal.PaintTarget; -import com.vaadin.terminal.gwt.client.ui.VOrderedLayout; -import com.vaadin.ui.ClientWidget.LoadStyle; - -/** - * Ordered layout. - * - * <code>OrderedLayout</code> is a component container, which shows the - * subcomponents in the order of their addition in specified orientation. - * - * @author Vaadin Ltd. - * @version - * @VERSION@ - * @since 3.0 - * @deprecated Replaced by VerticalLayout/HorizontalLayout. For type checking - * please not that VerticalLayout/HorizontalLayout do not extend - * OrderedLayout but AbstractOrderedLayout (which also OrderedLayout - * extends). - */ -@SuppressWarnings("serial") -@Deprecated -@ClientWidget(value = VOrderedLayout.class, loadStyle = LoadStyle.EAGER) -public class OrderedLayout extends AbstractOrderedLayout { - /* Predefined orientations */ - - /** - * Components are to be laid out vertically. - */ - public static final int ORIENTATION_VERTICAL = 0; - - /** - * Components are to be laid out horizontally. - */ - public static final int ORIENTATION_HORIZONTAL = 1; - - /** - * Orientation of the layout. - */ - private int orientation; - - /** - * Creates a new ordered layout. The order of the layout is - * <code>ORIENTATION_VERTICAL</code>. - * - * @deprecated Use VerticalLayout instead. - */ - @Deprecated - public OrderedLayout() { - this(ORIENTATION_VERTICAL); - } - - /** - * Create a new ordered layout. The orientation of the layout is given as - * parameters. - * - * @param orientation - * the Orientation of the layout. - * - * @deprecated Use VerticalLayout/HorizontalLayout instead. - */ - @Deprecated - public OrderedLayout(int orientation) { - this.orientation = orientation; - if (orientation == ORIENTATION_VERTICAL) { - setWidth(100, UNITS_PERCENTAGE); - } - } - - /** - * Gets the orientation of the container. - * - * @return the Value of property orientation. - */ - public int getOrientation() { - return orientation; - } - - /** - * Sets the orientation of this OrderedLayout. This method should only be - * used before initial paint. - * - * @param orientation - * the New value of property orientation. - * @deprecated Use VerticalLayout/HorizontalLayout or define orientation in - * constructor instead - */ - @Deprecated - public void setOrientation(int orientation) { - setOrientation(orientation, true); - } - - /** - * Internal method to change orientation of layout. This method should only - * be used before initial paint. - * - * @param orientation - */ - protected void setOrientation(int orientation, boolean needsRepaint) { - // Checks the validity of the argument - if (orientation < ORIENTATION_VERTICAL - || orientation > ORIENTATION_HORIZONTAL) { - throw new IllegalArgumentException(); - } - - this.orientation = orientation; - if (needsRepaint) { - requestRepaint(); - } - } - - @Override - public void paintContent(PaintTarget target) throws PaintException { - super.paintContent(target); - - // Adds the orientation attributes (the default is vertical) - if (orientation == ORIENTATION_HORIZONTAL) { - target.addAttribute("orientation", "horizontal"); - } - - } - -} |