From: Artur Signell Date: Tue, 31 Jan 2012 13:06:03 +0000 (+0200) Subject: #8169, #8326 Removed SplitPanel and special handling of SplitPanel on X-Git-Tag: 7.0.0.alpha2~486 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=1d01f9204bd760789592238be039acef57616109;p=vaadin-framework.git #8169, #8326 Removed SplitPanel and special handling of SplitPanel on client side --- diff --git a/src/com/vaadin/terminal/gwt/client/WidgetSet.java b/src/com/vaadin/terminal/gwt/client/WidgetSet.java index 03dde5fd2f..390d79ce17 100644 --- a/src/com/vaadin/terminal/gwt/client/WidgetSet.java +++ b/src/com/vaadin/terminal/gwt/client/WidgetSet.java @@ -7,10 +7,8 @@ package com.vaadin.terminal.gwt.client; import com.google.gwt.core.client.GWT; import com.google.gwt.user.client.ui.Widget; import com.vaadin.terminal.gwt.client.ui.VFilterSelectPaintable; -import com.vaadin.terminal.gwt.client.ui.VHorizontalSplitPanelPaintable; import com.vaadin.terminal.gwt.client.ui.VListSelectPaintable; import com.vaadin.terminal.gwt.client.ui.VUnknownComponentPaintable; -import com.vaadin.terminal.gwt.client.ui.VVerticalSplitPanelPaintable; public class WidgetSet { @@ -80,11 +78,7 @@ public class WidgetSet { return VListSelectPaintable.class; } } - } else if (widgetClass == VHorizontalSplitPanelPaintable.class - && uidl.hasAttribute("vertical")) { - return VVerticalSplitPanelPaintable.class; } - return widgetClass; } @@ -129,8 +123,6 @@ public class WidgetSet { */ if (fullyqualifiedName.equals("com.vaadin.ui.Select")) { loadImplementation(VListSelectPaintable.class); - } else if (fullyqualifiedName.equals("com.vaadin.ui.SplitPanel")) { - loadImplementation(VVerticalSplitPanelPaintable.class); } return implementationByServerSideClassName; diff --git a/src/com/vaadin/terminal/gwt/server/ComponentSizeValidator.java b/src/com/vaadin/terminal/gwt/server/ComponentSizeValidator.java index fad5220eb7..d3095512bb 100644 --- a/src/com/vaadin/terminal/gwt/server/ComponentSizeValidator.java +++ b/src/com/vaadin/terminal/gwt/server/ComponentSizeValidator.java @@ -18,6 +18,7 @@ import java.util.logging.Logger; import com.vaadin.terminal.Sizeable.Unit; import com.vaadin.ui.AbstractOrderedLayout; +import com.vaadin.ui.AbstractSplitPanel; import com.vaadin.ui.Component; import com.vaadin.ui.ComponentContainer; import com.vaadin.ui.CustomComponent; @@ -26,7 +27,6 @@ import com.vaadin.ui.GridLayout; import com.vaadin.ui.GridLayout.Area; import com.vaadin.ui.Layout; import com.vaadin.ui.Panel; -import com.vaadin.ui.SplitPanel; import com.vaadin.ui.TabSheet; import com.vaadin.ui.VerticalLayout; import com.vaadin.ui.Window; @@ -449,7 +449,7 @@ public class ComponentSizeValidator implements Serializable { } } - if (parent instanceof Panel || parent instanceof SplitPanel + if (parent instanceof Panel || parent instanceof AbstractSplitPanel || parent instanceof TabSheet || parent instanceof CustomComponent) { // height undefined, we know how how component works and no @@ -552,7 +552,7 @@ public class ComponentSizeValidator implements Serializable { * the component width */ return hasNonRelativeWidthComponent((Form) parent); - } else if (parent instanceof SplitPanel + } else if (parent instanceof AbstractSplitPanel || parent instanceof TabSheet || parent instanceof CustomComponent) { // FIXME Could we use com.vaadin package name here and diff --git a/src/com/vaadin/ui/SplitPanel.java b/src/com/vaadin/ui/SplitPanel.java deleted file mode 100644 index f4c5b7e666..0000000000 --- a/src/com/vaadin/ui/SplitPanel.java +++ /dev/null @@ -1,114 +0,0 @@ -/* -@VaadinApache2LicenseForJavaFiles@ - */ - -package com.vaadin.ui; - -import com.vaadin.terminal.PaintException; -import com.vaadin.terminal.PaintTarget; -import com.vaadin.terminal.gwt.client.ui.VHorizontalSplitPanelPaintable; -import com.vaadin.ui.ClientWidget.LoadStyle; - -/** - * SplitPanel. - * - * SplitPanel is a component container, that can contain two - * components (possibly containers) which are split by divider element. - * - * @author Vaadin Ltd. - * @version - * @VERSION@ - * @since 5.0 - * @deprecated in 6.5. Use {@link HorizontalSplitPanel} or - * {@link VerticalSplitPanel} instead. - */ -@Deprecated -@ClientWidget(value = VHorizontalSplitPanelPaintable.class, loadStyle = LoadStyle.EAGER) -public class SplitPanel extends AbstractSplitPanel { - - /* 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 split panel. The orientation of the panels is - * ORIENTATION_VERTICAL. - */ - public SplitPanel() { - super(); - orientation = ORIENTATION_VERTICAL; - setSizeFull(); - } - - /** - * Create a new split panels. The orientation of the panel is given as - * parameters. - * - * @param orientation - * the Orientation of the layout. - */ - public SplitPanel(int orientation) { - this(); - setOrientation(orientation); - } - - /** - * Paints the content of this component. - * - * @param target - * the Paint Event. - * @throws PaintException - * if the paint operation failed. - */ - @Override - public void paintContent(PaintTarget target) throws PaintException { - super.paintContent(target); - - if (orientation == ORIENTATION_VERTICAL) { - target.addAttribute("vertical", true); - } - - } - - /** - * Gets the orientation of the split panel. - * - * @return the Value of property orientation. - * - */ - public int getOrientation() { - return orientation; - } - - /** - * Sets the orientation of the split panel. - * - * @param orientation - * the New value of property orientation. - */ - public void setOrientation(int orientation) { - - // Checks the validity of the argument - if (orientation < ORIENTATION_VERTICAL - || orientation > ORIENTATION_HORIZONTAL) { - throw new IllegalArgumentException(); - } - - this.orientation = orientation; - requestRepaint(); - } - -} diff --git a/tests/server-side/com/vaadin/tests/VaadinClasses.java b/tests/server-side/com/vaadin/tests/VaadinClasses.java index 707fc020b6..b74af660e4 100644 --- a/tests/server-side/com/vaadin/tests/VaadinClasses.java +++ b/tests/server-side/com/vaadin/tests/VaadinClasses.java @@ -27,7 +27,6 @@ import com.vaadin.ui.HorizontalSplitPanel; import com.vaadin.ui.LoginForm; import com.vaadin.ui.PopupView; import com.vaadin.ui.Root; -import com.vaadin.ui.SplitPanel; import com.vaadin.ui.VerticalSplitPanel; import com.vaadin.ui.Window; @@ -105,7 +104,6 @@ public class VaadinClasses { public static List> getComponentContainersSupportingUnlimitedNumberOfComponents() { List> classes = getComponentContainersSupportingAddRemoveComponent(); - classes.remove(SplitPanel.class); classes.remove(VerticalSplitPanel.class); classes.remove(HorizontalSplitPanel.class); classes.remove(Window.class); diff --git a/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanels.java b/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanels.java deleted file mode 100644 index ebe94271cc..0000000000 --- a/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanels.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.vaadin.tests.components.splitpanel; - -import java.util.LinkedHashMap; - -import com.vaadin.ui.SplitPanel; - -@SuppressWarnings("deprecation") -public class SplitPanels extends AbstractSplitPanelTest { - - private Command orientationCommand = new Command() { - - public void execute(SplitPanel c, Integer value, Object data) { - c.setOrientation(value); - } - }; - - @Override - protected Class getTestClass() { - return SplitPanel.class; - } - - @Override - protected void createActions() { - super.createActions(); - createOrientationSelect(CATEGORY_FEATURES); - - } - - private void createOrientationSelect(String category) { - LinkedHashMap options = new LinkedHashMap(); - options.put("Horizontal", SplitPanel.ORIENTATION_HORIZONTAL); - options.put("Vertical", SplitPanel.ORIENTATION_VERTICAL); - createSelectAction("Orientation", category, options, "Horizontal", - orientationCommand); - - } -}