Conflicts: src/com/vaadin/terminal/gwt/client/ui/ClickEventHandler.java src/com/vaadin/terminal/gwt/client/ui/combobox/VFilterSelect.java src/com/vaadin/terminal/gwt/client/ui/splitpanel/VAbstractSplitPanel.java src/com/vaadin/ui/AbstractSplitPanel.javatags/7.0.0.alpha3
@@ -913,7 +913,7 @@ public class Util { | |||
/** | |||
* Find the element corresponding to the coordinates in the passed mouse | |||
* event. Please note that this is not always the same as the target of the | |||
* element e.g. if event capture is used. | |||
* event e.g. if event capture is used. | |||
* | |||
* @param event | |||
* the mouse event to get coordinates from |
@@ -69,7 +69,8 @@ import com.vaadin.terminal.gwt.client.ui.menubar.MenuItem; | |||
*/ | |||
@SuppressWarnings("deprecation") | |||
public class VFilterSelect extends Composite implements Field, KeyDownHandler, | |||
KeyUpHandler, ClickHandler, FocusHandler, BlurHandler, Focusable { | |||
KeyUpHandler, ClickHandler, FocusHandler, BlurHandler, Focusable, | |||
SubPartAware { | |||
/** | |||
* Represents a suggestion in the suggestion popup box | |||
@@ -1689,4 +1690,24 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, | |||
super.onDetach(); | |||
suggestionPopup.hide(); | |||
} | |||
@Override | |||
public Element getSubPartElement(String subPart) { | |||
if ("textbox".equals(subPart)) { | |||
return this.tb.getElement(); | |||
} else if ("button".equals(subPart)) { | |||
return this.popupOpener.getElement(); | |||
} | |||
return null; | |||
} | |||
@Override | |||
public String getSubPartName(Element subElement) { | |||
if (tb.getElement().isOrHasChild(subElement)) { | |||
return "textbox"; | |||
} else if (popupOpener.getElement().isOrHasChild(subElement)) { | |||
return "button"; | |||
} | |||
return null; | |||
} | |||
} |
@@ -41,6 +41,7 @@ public abstract class AbstractSplitPanelConnector extends | |||
getWidget().addHandler(new SplitterMoveHandler() { | |||
@Override | |||
public void splitterMoved(SplitterMoveEvent event) { | |||
String position = getWidget().getSplitterPosition(); | |||
float pos = 0; | |||
@@ -61,6 +62,7 @@ public abstract class AbstractSplitPanelConnector extends | |||
}, SplitterMoveEvent.TYPE); | |||
} | |||
@Override | |||
public void updateCaption(ComponentConnector component) { | |||
// TODO Implement caption handling | |||
} | |||
@@ -127,6 +129,12 @@ public abstract class AbstractSplitPanelConnector extends | |||
getWidget().setStylenames(); | |||
getWidget().minimumPosition = splitterState.getMinPosition() | |||
+ splitterState.getMinPositionUnit(); | |||
getWidget().maximumPosition = splitterState.getMaxPosition() | |||
+ splitterState.getMaxPositionUnit(); | |||
getWidget().position = splitterState.getPosition() | |||
+ splitterState.getPositionUnit(); | |||
@@ -138,6 +146,7 @@ public abstract class AbstractSplitPanelConnector extends | |||
} | |||
@Override | |||
public void layout() { | |||
VAbstractSplitPanel splitPanel = getWidget(); | |||
splitPanel.setSplitPosition(splitPanel.position); |
@@ -49,6 +49,10 @@ public class AbstractSplitPanelState extends ComponentState { | |||
public static class SplitterState implements Serializable { | |||
private float position; | |||
private String positionUnit; | |||
private float minPosition; | |||
private String minPositionUnit; | |||
private float maxPosition; | |||
private String maxPositionUnit; | |||
private boolean positionReversed = false; | |||
private boolean locked = false; | |||
@@ -68,6 +72,38 @@ public class AbstractSplitPanelState extends ComponentState { | |||
this.positionUnit = positionUnit; | |||
} | |||
public float getMinPosition() { | |||
return minPosition; | |||
} | |||
public void setMinPosition(float minPosition) { | |||
this.minPosition = minPosition; | |||
} | |||
public String getMinPositionUnit() { | |||
return minPositionUnit; | |||
} | |||
public void setMinPositionUnit(String minPositionUnit) { | |||
this.minPositionUnit = minPositionUnit; | |||
} | |||
public float getMaxPosition() { | |||
return maxPosition; | |||
} | |||
public void setMaxPosition(float maxPosition) { | |||
this.maxPosition = maxPosition; | |||
} | |||
public String getMaxPositionUnit() { | |||
return maxPositionUnit; | |||
} | |||
public void setMaxPositionUnit(String maxPositionUnit) { | |||
this.maxPositionUnit = maxPositionUnit; | |||
} | |||
public boolean isPositionReversed() { | |||
return positionReversed; | |||
} |
@@ -88,6 +88,10 @@ public class VAbstractSplitPanel extends ComplexPanel { | |||
/* The current position of the split handle in either percentages or pixels */ | |||
String position; | |||
String maximumPosition; | |||
String minimumPosition; | |||
private final TouchScrollHandler touchScrollHandler; | |||
protected Element scrolledContainer; | |||
@@ -222,11 +226,113 @@ public class VAbstractSplitPanel extends ComplexPanel { | |||
} | |||
} | |||
/** | |||
* Converts given split position string (in pixels or percentage) to a | |||
* floating point pixel value. | |||
* | |||
* @param pos | |||
* @return | |||
*/ | |||
private float convertToPixels(String pos) { | |||
float posAsFloat; | |||
if (pos.indexOf("%") > 0) { | |||
posAsFloat = Math.round(Float.parseFloat(pos.substring(0, | |||
pos.length() - 1)) | |||
/ 100 | |||
* (orientation == ORIENTATION_HORIZONTAL ? getOffsetWidth() | |||
: getOffsetHeight())); | |||
} else { | |||
posAsFloat = Float.parseFloat(pos.substring(0, pos.length() - 2)); | |||
} | |||
return posAsFloat; | |||
} | |||
/** | |||
* Converts given split position string (in pixels or percentage) to a float | |||
* percentage value. | |||
* | |||
* @param pos | |||
* @return | |||
*/ | |||
private float convertToPercentage(String pos) { | |||
float posAsFloat = 0; | |||
if (pos.indexOf("px") > 0) { | |||
int posAsInt = Integer.parseInt(pos.substring(0, pos.length() - 2)); | |||
int offsetLength = orientation == ORIENTATION_HORIZONTAL ? getOffsetWidth() | |||
: getOffsetHeight(); | |||
// 100% needs special handling | |||
if (posAsInt + getSplitterSize() >= offsetLength) { | |||
posAsInt = offsetLength; | |||
} | |||
// Reversed position | |||
if (positionReversed) { | |||
posAsInt = offsetLength - posAsInt - getSplitterSize(); | |||
} | |||
posAsFloat = ((float) posAsInt / (float) getOffsetWidth() * 100); | |||
} else { | |||
posAsFloat = Float.parseFloat(pos.substring(0, pos.length() - 1)); | |||
} | |||
return posAsFloat; | |||
} | |||
/** | |||
* Returns the given position clamped to the range between current minimum | |||
* and maximum positions. | |||
* | |||
* TODO Should this be in the connector? | |||
* | |||
* @param pos | |||
* Position of the splitter as a CSS string, either pixels or a | |||
* percentage. | |||
* @return minimumPosition if pos is less than minimumPosition; | |||
* maximumPosition if pos is greater than maximumPosition; pos | |||
* otherwise. | |||
*/ | |||
private String checkSplitPositionLimits(String pos) { | |||
float positionAsFloat = convertToPixels(pos); | |||
float maximumAsFloat = convertToPixels(maximumPosition); | |||
float minimumAsFloat = convertToPixels(minimumPosition); | |||
if (maximumAsFloat < positionAsFloat) { | |||
pos = maximumPosition; | |||
} else if (minimumAsFloat > positionAsFloat) { | |||
pos = minimumPosition; | |||
} | |||
return pos; | |||
} | |||
/** | |||
* Converts given string to the same units as the split position is. | |||
* | |||
* @param pos | |||
* position to be converted | |||
* @return converted position string | |||
*/ | |||
private String convertToPositionUnits(String pos) { | |||
if (position.indexOf("%") != -1 && pos.indexOf("%") == -1) { | |||
// position is in percentage, pos in pixels | |||
pos = convertToPercentage(pos) + "%"; | |||
} else if (position.indexOf("px") > 0 && pos.indexOf("px") == -1) { | |||
// position is in pixels and pos in percentage | |||
pos = convertToPixels(pos) + "px"; | |||
} | |||
return pos; | |||
} | |||
void setSplitPosition(String pos) { | |||
if (pos == null) { | |||
return; | |||
} | |||
pos = checkSplitPositionLimits(pos); | |||
if (!pos.equals(position)) { | |||
position = convertToPositionUnits(pos); | |||
} | |||
// Convert percentage values to pixels | |||
if (pos.indexOf("%") > 0) { | |||
int size = orientation == ORIENTATION_HORIZONTAL ? getOffsetWidth() | |||
@@ -470,16 +576,7 @@ public class VAbstractSplitPanel extends ComplexPanel { | |||
} | |||
if (position.indexOf("%") > 0) { | |||
float pos = newX; | |||
// 100% needs special handling | |||
if (newX + getSplitterSize() >= getOffsetWidth()) { | |||
pos = getOffsetWidth(); | |||
} | |||
// Reversed position | |||
if (positionReversed) { | |||
pos = getOffsetWidth() - pos - getSplitterSize(); | |||
} | |||
position = (pos / getOffsetWidth() * 100) + "%"; | |||
position = convertToPositionUnits(newX + "px"); | |||
} else { | |||
// Reversed position | |||
if (positionReversed) { | |||
@@ -512,16 +609,7 @@ public class VAbstractSplitPanel extends ComplexPanel { | |||
} | |||
if (position.indexOf("%") > 0) { | |||
float pos = newY; | |||
// 100% needs special handling | |||
if (newY + getSplitterSize() >= getOffsetHeight()) { | |||
pos = getOffsetHeight(); | |||
} | |||
// Reversed position | |||
if (positionReversed) { | |||
pos = getOffsetHeight() - pos - getSplitterSize(); | |||
} | |||
position = pos / getOffsetHeight() * 100 + "%"; | |||
position = convertToPositionUnits(newY + "px"); | |||
} else { | |||
// Reversed position | |||
if (positionReversed) { | |||
@@ -647,7 +735,7 @@ public class VAbstractSplitPanel extends ComplexPanel { | |||
return splitterSize; | |||
} | |||
private void setStylenames() { | |||
void setStylenames() { | |||
final String splitterClass = CLASSNAME | |||
+ (orientation == ORIENTATION_HORIZONTAL ? "-hsplitter" | |||
: "-vsplitter"); |
@@ -22,7 +22,7 @@ import com.vaadin.tools.ReflectTools; | |||
* AbstractSplitPanel. | |||
* | |||
* <code>AbstractSplitPanel</code> is base class for a component container that | |||
* can contain two components. The comopnents are split by a divider element. | |||
* can contain two components. The components are split by a divider element. | |||
* | |||
* @author Vaadin Ltd. | |||
* @version | |||
@@ -31,17 +31,22 @@ import com.vaadin.tools.ReflectTools; | |||
*/ | |||
public abstract class AbstractSplitPanel extends AbstractComponentContainer { | |||
// TODO use Unit in AbstractSplitPanelState and remove these | |||
private Unit posUnit; | |||
private Unit posMinUnit = Unit.PERCENTAGE; | |||
private Unit posMaxUnit = Unit.PERCENTAGE; | |||
private AbstractSplitPanelRpc rpc = new AbstractSplitPanelRpc() { | |||
@Override | |||
public void splitterClick(MouseEventDetails mouseDetails) { | |||
fireEvent(new SplitterClickEvent(AbstractSplitPanel.this, | |||
mouseDetails)); | |||
} | |||
@Override | |||
public void setSplitterPosition(float position) { | |||
getState().getSplitterState().setPosition(position); | |||
getSplitterState().setPosition(position); | |||
} | |||
}; | |||
@@ -59,6 +64,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { | |||
int i = 0; | |||
@Override | |||
public boolean hasNext() { | |||
if (i < getComponentCount()) { | |||
return true; | |||
@@ -66,6 +72,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { | |||
return false; | |||
} | |||
@Override | |||
public Component next() { | |||
if (!hasNext()) { | |||
return null; | |||
@@ -80,6 +87,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { | |||
return null; | |||
} | |||
@Override | |||
public void remove() { | |||
if (i == 1) { | |||
if (getFirstComponent() != null) { | |||
@@ -204,6 +212,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { | |||
* | |||
* @see com.vaadin.ui.ComponentContainer#getComponentIterator() | |||
*/ | |||
@Override | |||
public Iterator<Component> getComponentIterator() { | |||
return new ComponentIterator(); | |||
} | |||
@@ -214,6 +223,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { | |||
* | |||
* @return the number of contained components (zero, one or two) | |||
*/ | |||
@Override | |||
public int getComponentCount() { | |||
int count = 0; | |||
if (getFirstComponent() != null) { | |||
@@ -226,6 +236,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { | |||
} | |||
/* Documented in superclass */ | |||
@Override | |||
public void replaceComponent(Component oldComponent, Component newComponent) { | |||
if (oldComponent == getFirstComponent()) { | |||
setFirstComponent(newComponent); | |||
@@ -297,7 +308,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { | |||
if (unit != Unit.PERCENTAGE) { | |||
pos = Math.round(pos); | |||
} | |||
SplitterState splitterState = getState().getSplitterState(); | |||
SplitterState splitterState = getSplitterState(); | |||
splitterState.setPosition(pos); | |||
splitterState.setPositionUnit(unit.getSymbol()); | |||
splitterState.setPositionReversed(reverse); | |||
@@ -313,7 +324,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { | |||
* @return position of the splitter | |||
*/ | |||
public float getSplitPosition() { | |||
return getState().getSplitterState().getPosition(); | |||
return getSplitterState().getPosition(); | |||
} | |||
/** | |||
@@ -325,6 +336,110 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { | |||
return posUnit; | |||
} | |||
/** | |||
* Sets the minimum split position to the given position and unit. If the | |||
* split position is reversed, maximum and minimum are also reversed. | |||
* | |||
* @param pos | |||
* the minimum position of the split | |||
* @param unit | |||
* the unit (from {@link Sizeable}) in which the size is given. | |||
* Allowed units are UNITS_PERCENTAGE and UNITS_PIXELS | |||
*/ | |||
public void setMinimumSplitPosition(int pos, Unit unit) { | |||
setSplitPositionLimits(pos, unit, getSplitterState().getMaxPosition(), | |||
posMaxUnit); | |||
} | |||
/** | |||
* Returns the current minimum position of the splitter, in | |||
* {@link #getMinSplitPositionUnit()} units. | |||
* | |||
* @return the minimum position of the splitter | |||
*/ | |||
public float getMinSplitPosition() { | |||
return getSplitterState().getMinPosition(); | |||
} | |||
/** | |||
* Returns the unit of the minimum position of the splitter. | |||
* | |||
* @return the unit of the minimum position of the splitter | |||
*/ | |||
public Unit getMinSplitPositionUnit() { | |||
return posMinUnit; | |||
} | |||
/** | |||
* Sets the maximum split position to the given position and unit. If the | |||
* split position is reversed, maximum and minimum are also reversed. | |||
* | |||
* @param pos | |||
* the maximum position of the split | |||
* @param unit | |||
* the unit (from {@link Sizeable}) in which the size is given. | |||
* Allowed units are UNITS_PERCENTAGE and UNITS_PIXELS | |||
*/ | |||
public void setMaxSplitPosition(int pos, Unit unit) { | |||
setSplitPositionLimits(getSplitterState().getMinPosition(), posMinUnit, | |||
pos, unit); | |||
} | |||
/** | |||
* Returns the current maximum position of the splitter, in | |||
* {@link #getMaxSplitPositionUnit()} units. | |||
* | |||
* @return the maximum position of the splitter | |||
*/ | |||
public float getMaxSplitPosition() { | |||
return getSplitterState().getMaxPosition(); | |||
} | |||
/** | |||
* Returns the unit of the maximum position of the splitter | |||
* | |||
* @return the unit of the maximum position of the splitter | |||
*/ | |||
public Unit getMaxSplitPositionUnit() { | |||
return posMaxUnit; | |||
} | |||
/** | |||
* Sets the maximum and minimum position of the splitter. If the split | |||
* position is reversed, maximum and minimum are also reversed. | |||
* | |||
* @param minPos | |||
* the new minimum position | |||
* @param minPosUnit | |||
* the unit (from {@link Sizeable}) in which the minimum position | |||
* is given. | |||
* @param maxPos | |||
* the new maximum position | |||
* @param maxPosUnit | |||
* the unit (from {@link Sizeable}) in which the maximum position | |||
* is given. | |||
*/ | |||
private void setSplitPositionLimits(float minPos, Unit minPosUnit, | |||
float maxPos, Unit maxPosUnit) { | |||
if ((minPosUnit != Unit.PERCENTAGE && minPosUnit != Unit.PIXELS) | |||
|| (maxPosUnit != Unit.PERCENTAGE && maxPosUnit != Unit.PIXELS)) { | |||
throw new IllegalArgumentException( | |||
"Only percentage and pixel units are allowed"); | |||
} | |||
SplitterState state = getSplitterState(); | |||
state.setMinPosition(minPos); | |||
state.setMinPositionUnit("" + minPosUnit); | |||
posMinUnit = minPosUnit; | |||
state.setMaxPosition(maxPos); | |||
state.setMaxPositionUnit("" + maxPosUnit); | |||
posMaxUnit = maxPosUnit; | |||
requestRepaint(); | |||
} | |||
/** | |||
* Lock the SplitPanels position, disabling the user from dragging the split | |||
* handle. | |||
@@ -333,7 +448,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { | |||
* Set <code>true</code> if locked, <code>false</code> otherwise. | |||
*/ | |||
public void setLocked(boolean locked) { | |||
getState().getSplitterState().setLocked(locked); | |||
getSplitterState().setLocked(locked); | |||
requestRepaint(); | |||
} | |||
@@ -344,7 +459,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { | |||
* @return <code>true</code> if locked, <code>false</code> otherwise. | |||
*/ | |||
public boolean isLocked() { | |||
return getState().getSplitterState().isLocked(); | |||
return getSplitterState().isLocked(); | |||
} | |||
/** | |||
@@ -394,4 +509,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { | |||
return (AbstractSplitPanelState) super.getState(); | |||
} | |||
private SplitterState getSplitterState() { | |||
return getState().getSplitterState(); | |||
} | |||
} |
@@ -0,0 +1,207 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |||
<head profile="http://selenium-ide.openqa.org/profiles/test-case"> | |||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | |||
<link rel="selenium.base" href="" /> | |||
<title>SplitPanelWithMinimumAndMaximum</title> | |||
</head> | |||
<body> | |||
<table cellpadding="1" cellspacing="1" border="1"> | |||
<thead> | |||
<tr><td rowspan="1" colspan="3">SplitPanelWithMinimumAndMaximum</td></tr> | |||
</thead><tbody> | |||
<tr> | |||
<td>open</td> | |||
<td>/run/com.vaadin.tests.components.splitpanel.SplitPanelWithMinimumAndMaximum?restartApplication</td> | |||
<td></td> | |||
</tr> | |||
<tr> | |||
<td>dragAndDrop</td> | |||
<td>vaadin=runcomvaadintestscomponentssplitpanelSplitPanelWithMinimumAndMaximum::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VSplitPanelHorizontal[0]/domChild[0]/domChild[2]/domChild[0]</td> | |||
<td>-239,0</td> | |||
</tr> | |||
<tr> | |||
<td>dragAndDrop</td> | |||
<td>vaadin=runcomvaadintestscomponentssplitpanelSplitPanelWithMinimumAndMaximum::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/ChildComponentContainer[1]/VSplitPanelHorizontal[0]/domChild[0]/domChild[2]/domChild[0]</td> | |||
<td>-340,0</td> | |||
</tr> | |||
<tr> | |||
<td>dragAndDrop</td> | |||
<td>vaadin=runcomvaadintestscomponentssplitpanelSplitPanelWithMinimumAndMaximum::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/ChildComponentContainer[2]/VSplitPanelHorizontal[0]/domChild[0]/domChild[2]/domChild[0]</td> | |||
<td>-300,0</td> | |||
</tr> | |||
<tr> | |||
<td>dragAndDrop</td> | |||
<td>vaadin=runcomvaadintestscomponentssplitpanelSplitPanelWithMinimumAndMaximum::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/ChildComponentContainer[3]/VSplitPanelHorizontal[0]/domChild[0]/domChild[2]/domChild[0]</td> | |||
<td>-79,0</td> | |||
</tr> | |||
<tr> | |||
<td>dragAndDrop</td> | |||
<td>vaadin=runcomvaadintestscomponentssplitpanelSplitPanelWithMinimumAndMaximum::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/ChildComponentContainer[4]/VSplitPanelHorizontal[0]/domChild[0]/domChild[2]/domChild[0]</td> | |||
<td>-179,0</td> | |||
</tr> | |||
<tr> | |||
<td>dragAndDrop</td> | |||
<td>vaadin=runcomvaadintestscomponentssplitpanelSplitPanelWithMinimumAndMaximum::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/ChildComponentContainer[5]/VSplitPanelHorizontal[0]/domChild[0]/domChild[2]/domChild[0]</td> | |||
<td>-78,0</td> | |||
</tr> | |||
<tr> | |||
<td>dragAndDrop</td> | |||
<td>vaadin=runcomvaadintestscomponentssplitpanelSplitPanelWithMinimumAndMaximum::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/ChildComponentContainer[6]/VSplitPanelHorizontal[0]/domChild[0]/domChild[2]/domChild[0]</td> | |||
<td>-150,0</td> | |||
</tr> | |||
<tr> | |||
<td>dragAndDrop</td> | |||
<td>vaadin=runcomvaadintestscomponentssplitpanelSplitPanelWithMinimumAndMaximum::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/ChildComponentContainer[7]/VSplitPanelHorizontal[0]/domChild[0]/domChild[2]/domChild[0]</td> | |||
<td>-371,0</td> | |||
</tr> | |||
<tr> | |||
<td>screenCapture</td> | |||
<td></td> | |||
<td>horizontal-splits-left</td> | |||
</tr> | |||
<tr> | |||
<td>dragAndDrop</td> | |||
<td>vaadin=runcomvaadintestscomponentssplitpanelSplitPanelWithMinimumAndMaximum::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VSplitPanelHorizontal[0]/domChild[0]/domChild[2]/domChild[0]</td> | |||
<td>418,0</td> | |||
</tr> | |||
<tr> | |||
<td>dragAndDrop</td> | |||
<td>vaadin=runcomvaadintestscomponentssplitpanelSplitPanelWithMinimumAndMaximum::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/ChildComponentContainer[1]/VSplitPanelHorizontal[0]/domChild[0]/domChild[2]/domChild[0]</td> | |||
<td>418,0</td> | |||
</tr> | |||
<tr> | |||
<td>dragAndDrop</td> | |||
<td>vaadin=runcomvaadintestscomponentssplitpanelSplitPanelWithMinimumAndMaximum::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/ChildComponentContainer[2]/VSplitPanelHorizontal[0]/domChild[0]/domChild[2]/domChild[0]</td> | |||
<td>450,0</td> | |||
</tr> | |||
<tr> | |||
<td>dragAndDrop</td> | |||
<td>vaadin=runcomvaadintestscomponentssplitpanelSplitPanelWithMinimumAndMaximum::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/ChildComponentContainer[3]/VSplitPanelHorizontal[0]/domChild[0]/domChild[2]/domChild[0]</td> | |||
<td>450,0</td> | |||
</tr> | |||
<tr> | |||
<td>dragAndDrop</td> | |||
<td>vaadin=runcomvaadintestscomponentssplitpanelSplitPanelWithMinimumAndMaximum::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/ChildComponentContainer[4]/VSplitPanelHorizontal[0]/domChild[0]/domChild[2]/domChild[0]</td> | |||
<td>418,0</td> | |||
</tr> | |||
<tr> | |||
<td>dragAndDrop</td> | |||
<td>vaadin=runcomvaadintestscomponentssplitpanelSplitPanelWithMinimumAndMaximum::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/ChildComponentContainer[5]/VSplitPanelHorizontal[0]/domChild[0]/domChild[2]/domChild[0]</td> | |||
<td>418,0</td> | |||
</tr> | |||
<tr> | |||
<td>dragAndDrop</td> | |||
<td>vaadin=runcomvaadintestscomponentssplitpanelSplitPanelWithMinimumAndMaximum::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/ChildComponentContainer[6]/VSplitPanelHorizontal[0]/domChild[0]/domChild[2]/domChild[0]</td> | |||
<td>450,0</td> | |||
</tr> | |||
<tr> | |||
<td>dragAndDrop</td> | |||
<td>vaadin=runcomvaadintestscomponentssplitpanelSplitPanelWithMinimumAndMaximum::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/ChildComponentContainer[7]/VSplitPanelHorizontal[0]/domChild[0]/domChild[2]/domChild[0]</td> | |||
<td>450,0</td> | |||
</tr> | |||
<tr> | |||
<td>screenCapture</td> | |||
<td></td> | |||
<td>horizontal-splits-right</td> | |||
</tr> | |||
<tr> | |||
<td>mouseClick</td> | |||
<td>vaadin=runcomvaadintestscomponentssplitpanelSplitPanelWithMinimumAndMaximum::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTabsheet[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]</td> | |||
<td>44,2</td> | |||
</tr> | |||
<tr> | |||
<td>dragAndDrop</td> | |||
<td>vaadin=runcomvaadintestscomponentssplitpanelSplitPanelWithMinimumAndMaximum::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTabsheet[0]/VTabsheetPanel[0]/VHorizontalLayout[0]/ChildComponentContainer[0]/VSplitPanelVertical[0]/domChild[0]/domChild[2]/domChild[0]</td> | |||
<td>0,-206</td> | |||
</tr> | |||
<tr> | |||
<td>dragAndDrop</td> | |||
<td>vaadin=runcomvaadintestscomponentssplitpanelSplitPanelWithMinimumAndMaximum::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTabsheet[0]/VTabsheetPanel[0]/VHorizontalLayout[0]/ChildComponentContainer[1]/VSplitPanelVertical[0]/domChild[0]/domChild[2]/domChild[0]</td> | |||
<td>0,-348</td> | |||
</tr> | |||
<tr> | |||
<td>dragAndDrop</td> | |||
<td>vaadin=runcomvaadintestscomponentssplitpanelSplitPanelWithMinimumAndMaximum::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTabsheet[0]/VTabsheetPanel[0]/VHorizontalLayout[0]/ChildComponentContainer[2]/VSplitPanelVertical[0]/domChild[0]/domChild[2]/domChild[0]</td> | |||
<td>0,-300</td> | |||
</tr> | |||
<tr> | |||
<td>dragAndDrop</td> | |||
<td>vaadin=runcomvaadintestscomponentssplitpanelSplitPanelWithMinimumAndMaximum::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTabsheet[0]/VTabsheetPanel[0]/VHorizontalLayout[0]/ChildComponentContainer[3]/VSplitPanelVertical[0]/domChild[0]/domChild[2]/domChild[0]</td> | |||
<td>0,-55</td> | |||
</tr> | |||
<tr> | |||
<td>dragAndDrop</td> | |||
<td>vaadin=runcomvaadintestscomponentssplitpanelSplitPanelWithMinimumAndMaximum::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTabsheet[0]/VTabsheetPanel[0]/VHorizontalLayout[0]/ChildComponentContainer[4]/VSplitPanelVertical[0]/domChild[0]/domChild[2]/domChild[0]</td> | |||
<td>0,-155</td> | |||
</tr> | |||
<tr> | |||
<td>dragAndDrop</td> | |||
<td>vaadin=runcomvaadintestscomponentssplitpanelSplitPanelWithMinimumAndMaximum::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTabsheet[0]/VTabsheetPanel[0]/VHorizontalLayout[0]/ChildComponentContainer[5]/VSplitPanelVertical[0]/domChild[0]/domChild[2]/domChild[0]</td> | |||
<td>0,-13</td> | |||
</tr> | |||
<tr> | |||
<td>dragAndDrop</td> | |||
<td>vaadin=runcomvaadintestscomponentssplitpanelSplitPanelWithMinimumAndMaximum::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTabsheet[0]/VTabsheetPanel[0]/VHorizontalLayout[0]/ChildComponentContainer[7]/VSplitPanelVertical[0]/domChild[0]/domChild[2]/domChild[0]</td> | |||
<td>0,-300</td> | |||
</tr> | |||
<tr> | |||
<td>dragAndDrop</td> | |||
<td>vaadin=runcomvaadintestscomponentssplitpanelSplitPanelWithMinimumAndMaximum::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTabsheet[0]/VTabsheetPanel[0]/VHorizontalLayout[0]/ChildComponentContainer[6]/VSplitPanelVertical[0]/domChild[0]/domChild[2]/domChild[0]</td> | |||
<td>0,-300</td> | |||
</tr> | |||
<tr> | |||
<td>screenCapture</td> | |||
<td></td> | |||
<td>vertical-splits-up</td> | |||
</tr> | |||
<tr> | |||
<td>dragAndDrop</td> | |||
<td>vaadin=runcomvaadintestscomponentssplitpanelSplitPanelWithMinimumAndMaximum::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTabsheet[0]/VTabsheetPanel[0]/VHorizontalLayout[0]/ChildComponentContainer[0]/VSplitPanelVertical[0]/domChild[0]/domChild[2]/domChild[0]</td> | |||
<td>0,361</td> | |||
</tr> | |||
<tr> | |||
<td>dragAndDrop</td> | |||
<td>vaadin=runcomvaadintestscomponentssplitpanelSplitPanelWithMinimumAndMaximum::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTabsheet[0]/VTabsheetPanel[0]/VHorizontalLayout[0]/ChildComponentContainer[1]/VSplitPanelVertical[0]/domChild[0]/domChild[2]/domChild[0]</td> | |||
<td>0,361</td> | |||
</tr> | |||
<tr> | |||
<td>dragAndDrop</td> | |||
<td>vaadin=runcomvaadintestscomponentssplitpanelSplitPanelWithMinimumAndMaximum::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTabsheet[0]/VTabsheetPanel[0]/VHorizontalLayout[0]/ChildComponentContainer[2]/VSplitPanelVertical[0]/domChild[0]/domChild[2]/domChild[0]</td> | |||
<td>0,350</td> | |||
</tr> | |||
<tr> | |||
<td>dragAndDrop</td> | |||
<td>vaadin=runcomvaadintestscomponentssplitpanelSplitPanelWithMinimumAndMaximum::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTabsheet[0]/VTabsheetPanel[0]/VHorizontalLayout[0]/ChildComponentContainer[3]/VSplitPanelVertical[0]/domChild[0]/domChild[2]/domChild[0]</td> | |||
<td>0,350</td> | |||
</tr> | |||
<tr> | |||
<td>dragAndDrop</td> | |||
<td>vaadin=runcomvaadintestscomponentssplitpanelSplitPanelWithMinimumAndMaximum::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTabsheet[0]/VTabsheetPanel[0]/VHorizontalLayout[0]/ChildComponentContainer[4]/VSplitPanelVertical[0]/domChild[0]/domChild[2]/domChild[0]</td> | |||
<td>0,361</td> | |||
</tr> | |||
<tr> | |||
<td>dragAndDrop</td> | |||
<td>vaadin=runcomvaadintestscomponentssplitpanelSplitPanelWithMinimumAndMaximum::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTabsheet[0]/VTabsheetPanel[0]/VHorizontalLayout[0]/ChildComponentContainer[5]/VSplitPanelVertical[0]/domChild[0]/domChild[2]/domChild[0]</td> | |||
<td>0,361</td> | |||
</tr> | |||
<tr> | |||
<td>dragAndDrop</td> | |||
<td>vaadin=runcomvaadintestscomponentssplitpanelSplitPanelWithMinimumAndMaximum::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTabsheet[0]/VTabsheetPanel[0]/VHorizontalLayout[0]/ChildComponentContainer[6]/VSplitPanelVertical[0]/domChild[0]/domChild[2]/domChild[0]</td> | |||
<td>0,300</td> | |||
</tr> | |||
<tr> | |||
<td>dragAndDrop</td> | |||
<td>vaadin=runcomvaadintestscomponentssplitpanelSplitPanelWithMinimumAndMaximum::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTabsheet[0]/VTabsheetPanel[0]/VHorizontalLayout[0]/ChildComponentContainer[7]/VSplitPanelVertical[0]/domChild[0]/domChild[2]/domChild[0]</td> | |||
<td>0,300</td> | |||
</tr> | |||
<tr> | |||
<td>screenCapture</td> | |||
<td></td> | |||
<td>vertical-splits-down</td> | |||
</tr> | |||
</tbody></table> | |||
</body> | |||
</html> |
@@ -0,0 +1,276 @@ | |||
package com.vaadin.tests.components.splitpanel; | |||
import com.vaadin.terminal.Sizeable; | |||
import com.vaadin.tests.components.TestBase; | |||
import com.vaadin.ui.HorizontalLayout; | |||
import com.vaadin.ui.HorizontalSplitPanel; | |||
import com.vaadin.ui.Label; | |||
import com.vaadin.ui.TabSheet; | |||
import com.vaadin.ui.VerticalLayout; | |||
import com.vaadin.ui.VerticalSplitPanel; | |||
public class SplitPanelWithMinimumAndMaximum extends TestBase { | |||
@Override | |||
protected void setup() { | |||
TabSheet tabs = new TabSheet(); | |||
VerticalLayout horizontalSplitsLayout = new VerticalLayout(); | |||
horizontalSplitsLayout.setCaption("Horizontal splits"); | |||
HorizontalSplitPanel percentagePositionWithPercentageLimitsHorizontal = new HorizontalSplitPanel(); | |||
percentagePositionWithPercentageLimitsHorizontal | |||
.setMinimumSplitPosition(10, Sizeable.UNITS_PERCENTAGE); | |||
percentagePositionWithPercentageLimitsHorizontal.setMaxSplitPosition( | |||
80, Sizeable.UNITS_PERCENTAGE); | |||
percentagePositionWithPercentageLimitsHorizontal | |||
.setFirstComponent(new Label("Min 10 % - 50 % position")); | |||
percentagePositionWithPercentageLimitsHorizontal | |||
.setSecondComponent(new Label("Max 80 %")); | |||
percentagePositionWithPercentageLimitsHorizontal.setSplitPosition(50, | |||
Sizeable.UNITS_PERCENTAGE); | |||
horizontalSplitsLayout | |||
.addComponent(percentagePositionWithPercentageLimitsHorizontal); | |||
HorizontalSplitPanel pixelPositionWithPercentageLimitsHorizontal = new HorizontalSplitPanel(); | |||
pixelPositionWithPercentageLimitsHorizontal.setMinimumSplitPosition(10, | |||
Sizeable.UNITS_PERCENTAGE); | |||
pixelPositionWithPercentageLimitsHorizontal.setMaxSplitPosition(80, | |||
Sizeable.UNITS_PERCENTAGE); | |||
pixelPositionWithPercentageLimitsHorizontal | |||
.setFirstComponent(new Label("Min 10 % - 400 px position")); | |||
pixelPositionWithPercentageLimitsHorizontal | |||
.setSecondComponent(new Label("Max 80 %")); | |||
pixelPositionWithPercentageLimitsHorizontal.setSplitPosition(400, | |||
Sizeable.UNITS_PIXELS); | |||
horizontalSplitsLayout | |||
.addComponent(pixelPositionWithPercentageLimitsHorizontal); | |||
HorizontalSplitPanel pixelPositionWithPixelLimitsHorizontal = new HorizontalSplitPanel(); | |||
pixelPositionWithPixelLimitsHorizontal.setMinimumSplitPosition(100, | |||
Sizeable.UNITS_PIXELS); | |||
pixelPositionWithPixelLimitsHorizontal.setMaxSplitPosition(550, | |||
Sizeable.UNITS_PIXELS); | |||
pixelPositionWithPixelLimitsHorizontal.setFirstComponent(new Label( | |||
"Min 100 px - 400 px position")); | |||
pixelPositionWithPixelLimitsHorizontal.setSecondComponent(new Label( | |||
"Max 550 px")); | |||
pixelPositionWithPixelLimitsHorizontal.setSplitPosition(400, | |||
Sizeable.UNITS_PIXELS); | |||
horizontalSplitsLayout | |||
.addComponent(pixelPositionWithPixelLimitsHorizontal); | |||
HorizontalSplitPanel percentagePositionWithPixelLimitsHorizontal = new HorizontalSplitPanel(); | |||
percentagePositionWithPixelLimitsHorizontal.setMinimumSplitPosition( | |||
100, Sizeable.UNITS_PIXELS); | |||
percentagePositionWithPixelLimitsHorizontal.setMaxSplitPosition(550, | |||
Sizeable.UNITS_PIXELS); | |||
percentagePositionWithPixelLimitsHorizontal | |||
.setFirstComponent(new Label("Min 100 px - 30 % position")); | |||
percentagePositionWithPixelLimitsHorizontal | |||
.setSecondComponent(new Label("Max 550 px")); | |||
percentagePositionWithPixelLimitsHorizontal.setSplitPosition(30, | |||
Sizeable.UNITS_PERCENTAGE); | |||
horizontalSplitsLayout | |||
.addComponent(percentagePositionWithPixelLimitsHorizontal); | |||
HorizontalSplitPanel percentagePositionWithPercentageLimitsHorizontalResersed = new HorizontalSplitPanel(); | |||
percentagePositionWithPercentageLimitsHorizontalResersed | |||
.setMinimumSplitPosition(10, Sizeable.UNITS_PERCENTAGE); | |||
percentagePositionWithPercentageLimitsHorizontalResersed | |||
.setMaxSplitPosition(80, Sizeable.UNITS_PERCENTAGE); | |||
percentagePositionWithPercentageLimitsHorizontalResersed | |||
.setFirstComponent(new Label( | |||
"Max 80 % - Reversed 50 % position")); | |||
percentagePositionWithPercentageLimitsHorizontalResersed | |||
.setSecondComponent(new Label("Min 10 %")); | |||
percentagePositionWithPercentageLimitsHorizontalResersed | |||
.setSplitPosition(50, Sizeable.UNITS_PERCENTAGE, true); | |||
horizontalSplitsLayout | |||
.addComponent(percentagePositionWithPercentageLimitsHorizontalResersed); | |||
HorizontalSplitPanel pixelPositionWithPercentageLimitsHorizontalResersed = new HorizontalSplitPanel(); | |||
pixelPositionWithPercentageLimitsHorizontalResersed | |||
.setMinimumSplitPosition(10, Sizeable.UNITS_PERCENTAGE); | |||
pixelPositionWithPercentageLimitsHorizontalResersed | |||
.setMaxSplitPosition(80, Sizeable.UNITS_PERCENTAGE); | |||
pixelPositionWithPercentageLimitsHorizontalResersed | |||
.setFirstComponent(new Label( | |||
"Max 80 % - Reversed 400 px position")); | |||
pixelPositionWithPercentageLimitsHorizontalResersed | |||
.setSecondComponent(new Label("Min 10 %")); | |||
pixelPositionWithPercentageLimitsHorizontalResersed.setSplitPosition( | |||
400, Sizeable.UNITS_PIXELS, true); | |||
horizontalSplitsLayout | |||
.addComponent(pixelPositionWithPercentageLimitsHorizontalResersed); | |||
HorizontalSplitPanel pixelPositionWithPixelLimitsHorizontalResersed = new HorizontalSplitPanel(); | |||
pixelPositionWithPixelLimitsHorizontalResersed.setMinimumSplitPosition( | |||
100, Sizeable.UNITS_PIXELS); | |||
pixelPositionWithPixelLimitsHorizontalResersed.setMaxSplitPosition(550, | |||
Sizeable.UNITS_PIXELS); | |||
pixelPositionWithPixelLimitsHorizontalResersed | |||
.setFirstComponent(new Label( | |||
"Max 550 px - Reversed 400 px position")); | |||
pixelPositionWithPixelLimitsHorizontalResersed | |||
.setSecondComponent(new Label("Min 100 px")); | |||
pixelPositionWithPixelLimitsHorizontalResersed.setSplitPosition(400, | |||
Sizeable.UNITS_PIXELS, true); | |||
horizontalSplitsLayout | |||
.addComponent(pixelPositionWithPixelLimitsHorizontalResersed); | |||
HorizontalSplitPanel percentagePositionWithPixelLimitsHorizontalResersed = new HorizontalSplitPanel(); | |||
percentagePositionWithPixelLimitsHorizontalResersed | |||
.setMinimumSplitPosition(100, Sizeable.UNITS_PIXELS); | |||
percentagePositionWithPixelLimitsHorizontalResersed | |||
.setMaxSplitPosition(550, Sizeable.UNITS_PIXELS); | |||
percentagePositionWithPixelLimitsHorizontalResersed | |||
.setFirstComponent(new Label( | |||
"Max 550 px - Reversed 30 % position")); | |||
percentagePositionWithPixelLimitsHorizontalResersed | |||
.setSecondComponent(new Label("Min 100 px")); | |||
percentagePositionWithPixelLimitsHorizontalResersed.setSplitPosition( | |||
30, Sizeable.UNITS_PERCENTAGE, true); | |||
horizontalSplitsLayout | |||
.addComponent(percentagePositionWithPixelLimitsHorizontalResersed); | |||
horizontalSplitsLayout.setSizeFull(); | |||
tabs.addComponent(horizontalSplitsLayout); | |||
HorizontalLayout verticalSplitsLayout = new HorizontalLayout(); | |||
verticalSplitsLayout.setCaption("Vertical splits"); | |||
VerticalSplitPanel percentagePositionWithPercentageLimitsVertical = new VerticalSplitPanel(); | |||
percentagePositionWithPercentageLimitsVertical.setMinimumSplitPosition( | |||
10, Sizeable.UNITS_PERCENTAGE); | |||
percentagePositionWithPercentageLimitsVertical.setMaxSplitPosition(80, | |||
Sizeable.UNITS_PERCENTAGE); | |||
percentagePositionWithPercentageLimitsVertical | |||
.setFirstComponent(new Label("Min 10 % - 50 % position")); | |||
percentagePositionWithPercentageLimitsVertical | |||
.setSecondComponent(new Label("Max 80 %")); | |||
percentagePositionWithPercentageLimitsVertical.setSplitPosition(50, | |||
Sizeable.UNITS_PERCENTAGE); | |||
verticalSplitsLayout | |||
.addComponent(percentagePositionWithPercentageLimitsVertical); | |||
VerticalSplitPanel pixelPositionWithPercentageLimitsVertical = new VerticalSplitPanel(); | |||
pixelPositionWithPercentageLimitsVertical.setMinimumSplitPosition(10, | |||
Sizeable.UNITS_PERCENTAGE); | |||
pixelPositionWithPercentageLimitsVertical.setMaxSplitPosition(80, | |||
Sizeable.UNITS_PERCENTAGE); | |||
pixelPositionWithPercentageLimitsVertical.setFirstComponent(new Label( | |||
"Min 10 % - 400 px position")); | |||
pixelPositionWithPercentageLimitsVertical.setSecondComponent(new Label( | |||
"Max 80 %")); | |||
pixelPositionWithPercentageLimitsVertical.setSplitPosition(400, | |||
Sizeable.UNITS_PIXELS); | |||
verticalSplitsLayout | |||
.addComponent(pixelPositionWithPercentageLimitsVertical); | |||
VerticalSplitPanel pixelPositionWithPixelLimitsVertical = new VerticalSplitPanel(); | |||
pixelPositionWithPixelLimitsVertical.setMinimumSplitPosition(100, | |||
Sizeable.UNITS_PIXELS); | |||
pixelPositionWithPixelLimitsVertical.setMaxSplitPosition(450, | |||
Sizeable.UNITS_PIXELS); | |||
pixelPositionWithPixelLimitsVertical.setFirstComponent(new Label( | |||
"Min 100 px - 400 px position")); | |||
pixelPositionWithPixelLimitsVertical.setSecondComponent(new Label( | |||
"Max 450 px")); | |||
pixelPositionWithPixelLimitsVertical.setSplitPosition(400, | |||
Sizeable.UNITS_PIXELS); | |||
verticalSplitsLayout.addComponent(pixelPositionWithPixelLimitsVertical); | |||
VerticalSplitPanel percentagePositionWithPixelLimitsVertical = new VerticalSplitPanel(); | |||
percentagePositionWithPixelLimitsVertical.setMinimumSplitPosition(100, | |||
Sizeable.UNITS_PIXELS); | |||
percentagePositionWithPixelLimitsVertical.setMaxSplitPosition(450, | |||
Sizeable.UNITS_PIXELS); | |||
percentagePositionWithPixelLimitsVertical.setFirstComponent(new Label( | |||
"Min 100 px - 30 % position")); | |||
percentagePositionWithPixelLimitsVertical.setSecondComponent(new Label( | |||
"Max 450 px")); | |||
percentagePositionWithPixelLimitsVertical.setSplitPosition(30, | |||
Sizeable.UNITS_PERCENTAGE); | |||
verticalSplitsLayout | |||
.addComponent(percentagePositionWithPixelLimitsVertical); | |||
VerticalSplitPanel percentagePositionWithPercentageLimitsVerticalReversed = new VerticalSplitPanel(); | |||
percentagePositionWithPercentageLimitsVerticalReversed | |||
.setMinimumSplitPosition(10, Sizeable.UNITS_PERCENTAGE); | |||
percentagePositionWithPercentageLimitsVerticalReversed | |||
.setMaxSplitPosition(80, Sizeable.UNITS_PERCENTAGE); | |||
percentagePositionWithPercentageLimitsVerticalReversed | |||
.setFirstComponent(new Label( | |||
"Max 80 % - Reversed 50 % position")); | |||
percentagePositionWithPercentageLimitsVerticalReversed | |||
.setSecondComponent(new Label("Min 10 %")); | |||
percentagePositionWithPercentageLimitsVerticalReversed | |||
.setSplitPosition(50, Sizeable.UNITS_PERCENTAGE, true); | |||
verticalSplitsLayout | |||
.addComponent(percentagePositionWithPercentageLimitsVerticalReversed); | |||
VerticalSplitPanel pixelPositionWithPercentageLimitsVerticalReversed = new VerticalSplitPanel(); | |||
pixelPositionWithPercentageLimitsVerticalReversed | |||
.setMinimumSplitPosition(10, Sizeable.UNITS_PERCENTAGE); | |||
pixelPositionWithPercentageLimitsVerticalReversed.setMaxSplitPosition( | |||
80, Sizeable.UNITS_PERCENTAGE); | |||
pixelPositionWithPercentageLimitsVerticalReversed | |||
.setFirstComponent(new Label( | |||
"Max 80 % - Reversed 400 px position")); | |||
pixelPositionWithPercentageLimitsVerticalReversed | |||
.setSecondComponent(new Label("Min 10 %")); | |||
pixelPositionWithPercentageLimitsVerticalReversed.setSplitPosition(400, | |||
Sizeable.UNITS_PIXELS, true); | |||
verticalSplitsLayout | |||
.addComponent(pixelPositionWithPercentageLimitsVerticalReversed); | |||
VerticalSplitPanel pixelPositionWithPixelLimitsVerticalReversed = new VerticalSplitPanel(); | |||
pixelPositionWithPixelLimitsVerticalReversed.setMinimumSplitPosition( | |||
100, Sizeable.UNITS_PIXELS); | |||
pixelPositionWithPixelLimitsVerticalReversed.setMaxSplitPosition(400, | |||
Sizeable.UNITS_PIXELS); | |||
pixelPositionWithPixelLimitsVerticalReversed | |||
.setFirstComponent(new Label( | |||
"Max 400 px - Reversed 300 px position")); | |||
pixelPositionWithPixelLimitsVerticalReversed | |||
.setSecondComponent(new Label("Min 100 px")); | |||
pixelPositionWithPixelLimitsVerticalReversed.setSplitPosition(300, | |||
Sizeable.UNITS_PIXELS, true); | |||
verticalSplitsLayout | |||
.addComponent(pixelPositionWithPixelLimitsVerticalReversed); | |||
VerticalSplitPanel percentagePositionWithPixelLimitsVerticalReversed = new VerticalSplitPanel(); | |||
percentagePositionWithPixelLimitsVerticalReversed | |||
.setMinimumSplitPosition(100, Sizeable.UNITS_PIXELS); | |||
percentagePositionWithPixelLimitsVerticalReversed.setMaxSplitPosition( | |||
400, Sizeable.UNITS_PIXELS); | |||
percentagePositionWithPixelLimitsVerticalReversed | |||
.setFirstComponent(new Label( | |||
"Max 400 px - Reversed 30 % position")); | |||
percentagePositionWithPixelLimitsVerticalReversed | |||
.setSecondComponent(new Label("Min 100 px")); | |||
percentagePositionWithPixelLimitsVerticalReversed.setSplitPosition(30, | |||
Sizeable.UNITS_PERCENTAGE, true); | |||
verticalSplitsLayout | |||
.addComponent(percentagePositionWithPixelLimitsVerticalReversed); | |||
tabs.addComponent(verticalSplitsLayout); | |||
verticalSplitsLayout.setSizeFull(); | |||
addComponent(tabs); | |||
tabs.setHeight("550px"); | |||
tabs.setWidth("600px"); | |||
getLayout().setSizeFull(); | |||
} | |||
@Override | |||
protected String getDescription() { | |||
return "SplitPanel could have setMaxSplitPosition and setMinSplitPosition methods as a way to set maximum and minimum limits for the split position. This is not a very critical feature but could be useful in some situations."; | |||
} | |||
@Override | |||
protected Integer getTicketNumber() { | |||
return 1744; | |||
} | |||
} |