Bläddra i källkod

#8169, #8326 Removed SplitPanel and special handling of SplitPanel on

client side
tags/7.0.0.alpha2
Artur Signell 12 år sedan
förälder
incheckning
1d01f9204b

+ 0
- 8
src/com/vaadin/terminal/gwt/client/WidgetSet.java Visa fil

@@ -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;

+ 3
- 3
src/com/vaadin/terminal/gwt/server/ComponentSizeValidator.java Visa fil

@@ -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

+ 0
- 114
src/com/vaadin/ui/SplitPanel.java Visa fil

@@ -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.
*
* <code>SplitPanel</code> 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
* <code>ORIENTATION_VERTICAL</code>.
*/
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();
}

}

+ 0
- 2
tests/server-side/com/vaadin/tests/VaadinClasses.java Visa fil

@@ -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<Class<? extends ComponentContainer>> getComponentContainersSupportingUnlimitedNumberOfComponents() {
List<Class<? extends ComponentContainer>> classes = getComponentContainersSupportingAddRemoveComponent();
classes.remove(SplitPanel.class);
classes.remove(VerticalSplitPanel.class);
classes.remove(HorizontalSplitPanel.class);
classes.remove(Window.class);

+ 0
- 37
tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanels.java Visa fil

@@ -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<SplitPanel> {
private Command<SplitPanel, Integer> orientationCommand = new Command<SplitPanel, Integer>() {
public void execute(SplitPanel c, Integer value, Object data) {
c.setOrientation(value);
}
};
@Override
protected Class<SplitPanel> getTestClass() {
return SplitPanel.class;
}
@Override
protected void createActions() {
super.createActions();
createOrientationSelect(CATEGORY_FEATURES);
}
private void createOrientationSelect(String category) {
LinkedHashMap<String, Integer> options = new LinkedHashMap<String, Integer>();
options.put("Horizontal", SplitPanel.ORIENTATION_HORIZONTAL);
options.put("Vertical", SplitPanel.ORIENTATION_VERTICAL);
createSelectAction("Orientation", category, options, "Horizontal",
orientationCommand);
}
}

Laddar…
Avbryt
Spara