diff options
author | Johannes Dahlström <johannesd@vaadin.com> | 2012-06-12 16:31:55 +0300 |
---|---|---|
committer | Johannes Dahlström <johannesd@vaadin.com> | 2012-06-12 16:31:55 +0300 |
commit | 30fb43e8f437d674a750dcbc5626bd251cb5c609 (patch) | |
tree | 8e1c869e4d5131c7aca7dd649c71e9a55d8b4cee | |
parent | 5fc8a1d9d0d4474af0465ecdb69bc586ab79a945 (diff) | |
parent | 6f729f5d55cdfb719e8de835d4c713225bfd7ef2 (diff) | |
download | vaadin-framework-30fb43e8f437d674a750dcbc5626bd251cb5c609.tar.gz vaadin-framework-30fb43e8f437d674a750dcbc5626bd251cb5c609.zip |
Merge commit '6f729'
Conflicts:
src/com/vaadin/terminal/gwt/client/ui/splitpanel/VAbstractSplitPanel.java
src/com/vaadin/ui/AbstractSplitPanel.java
7 files changed, 165 insertions, 47 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/ui/splitpanel/VAbstractSplitPanel.java b/src/com/vaadin/terminal/gwt/client/ui/splitpanel/VAbstractSplitPanel.java index 12ae3312c7..e112fac304 100644 --- a/src/com/vaadin/terminal/gwt/client/ui/splitpanel/VAbstractSplitPanel.java +++ b/src/com/vaadin/terminal/gwt/client/ui/splitpanel/VAbstractSplitPanel.java @@ -289,12 +289,12 @@ public class VAbstractSplitPanel extends ComplexPanel { */ private String checkSplitPositionLimits(String pos) { float positionAsFloat = convertToPixels(pos); - float maximumAsFloat = convertToPixels(maximumPosition); - float minimumAsFloat = convertToPixels(minimumPosition); - if (maximumAsFloat < positionAsFloat) { + if (maximumPosition != null + && convertToPixels(maximumPosition) < positionAsFloat) { pos = maximumPosition; - } else if (minimumAsFloat > positionAsFloat) { + } else if (minimumPosition != null + && convertToPixels(minimumPosition) > positionAsFloat) { pos = minimumPosition; } return pos; diff --git a/src/com/vaadin/ui/AbstractSplitPanel.java b/src/com/vaadin/ui/AbstractSplitPanel.java index 805640387f..6a7099ba9d 100644 --- a/src/com/vaadin/ui/AbstractSplitPanel.java +++ b/src/com/vaadin/ui/AbstractSplitPanel.java @@ -346,7 +346,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { * 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) { + public void setMinSplitPosition(int pos, Unit unit) { setSplitPositionLimits(pos, unit, getSplitterState().getMaxPosition(), posMaxUnit); } @@ -380,7 +380,7 @@ public abstract class AbstractSplitPanel extends AbstractComponentContainer { * 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) { + public void setMaxSplitPosition(float pos, Unit unit) { setSplitPositionLimits(getSplitterState().getMinPosition(), posMinUnit, pos, unit); } diff --git a/src/com/vaadin/ui/Table.java b/src/com/vaadin/ui/Table.java index 70d9570b01..5f4016de18 100644 --- a/src/com/vaadin/ui/Table.java +++ b/src/com/vaadin/ui/Table.java @@ -1296,31 +1296,38 @@ public class Table extends AbstractSelect implements Action.Container, } /** - * Sets whether a column can be collapsed or not. + * Sets whether the given column is collapsible. Note that collapsible + * columns can only be actually collapsed (via UI or with + * {@link #setColumnCollapsed(Object, boolean) setColumnCollapsed()}) if + * {@link #isColumnCollapsingAllowed()} is true. By default all columns are + * collapsible. * * @param propertyId * the propertyID identifying the column. * @param collapsible - * the desired collapsibleness + * true if the column should be collapsible, false otherwise. */ - public void setColumnNoncollapsible(Object propertyId, - boolean noncollapsible) { - if (noncollapsible) { + public void setColumnCollapsible(Object propertyId, boolean collapsible) { + if (collapsible) { + noncollapsibleColumns.remove(propertyId); + } else { noncollapsibleColumns.add(propertyId); collapsedColumns.remove(propertyId); - } else { - noncollapsibleColumns.remove(propertyId); } refreshRowCache(); } /** - * Checks if the column can be collapsed. + * Checks if the given column is collapsible. Note that even if this method + * returns <code>true</code>, the column can only be actually collapsed (via + * UI or with {@link #setColumnCollapsed(Object, boolean) + * setColumnCollapsed()}) if {@link #isColumnCollapsingAllowed()} is also + * true. * * @return true if the column can be collapsed; false otherwise. */ - public boolean isColumnNoncollapsible(Object propertyId) { - return noncollapsibleColumns.contains(propertyId); + public boolean isColumnCollapsible(Object propertyId) { + return !noncollapsibleColumns.contains(propertyId); } /** diff --git a/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelWithMinimumAndMaximum.html b/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelWithMinimumAndMaximum.html index 3aefedeff3..70d619edac 100644 --- a/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelWithMinimumAndMaximum.html +++ b/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelWithMinimumAndMaximum.html @@ -201,6 +201,61 @@ <td></td> <td>vertical-splits-down</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[2]/domChild[0]/domChild[0]/domChild[0]</td> + <td>25,5</td> +</tr> +<tr> + <td>dragAndDrop</td> + <td>vaadin=runcomvaadintestscomponentssplitpanelSplitPanelWithMinimumAndMaximum::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[1]/ChildComponentContainer[0]/VSplitPanelHorizontal[0]/domChild[0]/domChild[2]/domChild[0]</td> + <td>-239,0</td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>togglable-to-min-with-limit-enabled</td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentssplitpanelSplitPanelWithMinimumAndMaximum::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[1]/ChildComponentContainer[1]/VHorizontalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>dragAndDrop</td> + <td>vaadin=runcomvaadintestscomponentssplitpanelSplitPanelWithMinimumAndMaximum::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[1]/ChildComponentContainer[0]/VSplitPanelHorizontal[0]/domChild[0]/domChild[2]/domChild[0]</td> + <td>-60,0</td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>togglable-to-min-with-limit-disabled</td> +</tr> +<tr> + <td>dragAndDrop</td> + <td>vaadin=runcomvaadintestscomponentssplitpanelSplitPanelWithMinimumAndMaximum::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[1]/ChildComponentContainer[0]/VSplitPanelHorizontal[0]/domChild[0]/domChild[2]/domChild[0]</td> + <td>478,0</td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>togglable-to-max-with-limit-enabled</td> +</tr> +<tr> + <td>click</td> + <td>vaadin=runcomvaadintestscomponentssplitpanelSplitPanelWithMinimumAndMaximum::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[1]/ChildComponentContainer[1]/VHorizontalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td> + <td></td> +</tr> +<tr> + <td>dragAndDrop</td> + <td>vaadin=runcomvaadintestscomponentssplitpanelSplitPanelWithMinimumAndMaximum::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[1]/ChildComponentContainer[0]/VSplitPanelHorizontal[0]/domChild[0]/domChild[2]/domChild[0]</td> + <td>113,0</td> +</tr> +<tr> + <td>screenCapture</td> + <td></td> + <td>togglable-to-max-with-limit-disabled</td> +</tr> </tbody></table> </body> diff --git a/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelWithMinimumAndMaximum.java b/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelWithMinimumAndMaximum.java index 9fa6fc18a3..f7c3dd84e4 100644 --- a/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelWithMinimumAndMaximum.java +++ b/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelWithMinimumAndMaximum.java @@ -2,6 +2,7 @@ package com.vaadin.tests.components.splitpanel; import com.vaadin.terminal.Sizeable; import com.vaadin.tests.components.TestBase; +import com.vaadin.ui.Button; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.HorizontalSplitPanel; import com.vaadin.ui.Label; @@ -19,8 +20,8 @@ public class SplitPanelWithMinimumAndMaximum extends TestBase { horizontalSplitsLayout.setCaption("Horizontal splits"); HorizontalSplitPanel percentagePositionWithPercentageLimitsHorizontal = new HorizontalSplitPanel(); - percentagePositionWithPercentageLimitsHorizontal - .setMinimumSplitPosition(10, Sizeable.UNITS_PERCENTAGE); + percentagePositionWithPercentageLimitsHorizontal.setMinSplitPosition( + 10, Sizeable.UNITS_PERCENTAGE); percentagePositionWithPercentageLimitsHorizontal.setMaxSplitPosition( 80, Sizeable.UNITS_PERCENTAGE); percentagePositionWithPercentageLimitsHorizontal @@ -33,7 +34,7 @@ public class SplitPanelWithMinimumAndMaximum extends TestBase { .addComponent(percentagePositionWithPercentageLimitsHorizontal); HorizontalSplitPanel pixelPositionWithPercentageLimitsHorizontal = new HorizontalSplitPanel(); - pixelPositionWithPercentageLimitsHorizontal.setMinimumSplitPosition(10, + pixelPositionWithPercentageLimitsHorizontal.setMinSplitPosition(10, Sizeable.UNITS_PERCENTAGE); pixelPositionWithPercentageLimitsHorizontal.setMaxSplitPosition(80, Sizeable.UNITS_PERCENTAGE); @@ -47,7 +48,7 @@ public class SplitPanelWithMinimumAndMaximum extends TestBase { .addComponent(pixelPositionWithPercentageLimitsHorizontal); HorizontalSplitPanel pixelPositionWithPixelLimitsHorizontal = new HorizontalSplitPanel(); - pixelPositionWithPixelLimitsHorizontal.setMinimumSplitPosition(100, + pixelPositionWithPixelLimitsHorizontal.setMinSplitPosition(100, Sizeable.UNITS_PIXELS); pixelPositionWithPixelLimitsHorizontal.setMaxSplitPosition(550, Sizeable.UNITS_PIXELS); @@ -61,8 +62,8 @@ public class SplitPanelWithMinimumAndMaximum extends TestBase { .addComponent(pixelPositionWithPixelLimitsHorizontal); HorizontalSplitPanel percentagePositionWithPixelLimitsHorizontal = new HorizontalSplitPanel(); - percentagePositionWithPixelLimitsHorizontal.setMinimumSplitPosition( - 100, Sizeable.UNITS_PIXELS); + percentagePositionWithPixelLimitsHorizontal.setMinSplitPosition(100, + Sizeable.UNITS_PIXELS); percentagePositionWithPixelLimitsHorizontal.setMaxSplitPosition(550, Sizeable.UNITS_PIXELS); percentagePositionWithPixelLimitsHorizontal @@ -76,7 +77,7 @@ public class SplitPanelWithMinimumAndMaximum extends TestBase { HorizontalSplitPanel percentagePositionWithPercentageLimitsHorizontalResersed = new HorizontalSplitPanel(); percentagePositionWithPercentageLimitsHorizontalResersed - .setMinimumSplitPosition(10, Sizeable.UNITS_PERCENTAGE); + .setMinSplitPosition(10, Sizeable.UNITS_PERCENTAGE); percentagePositionWithPercentageLimitsHorizontalResersed .setMaxSplitPosition(80, Sizeable.UNITS_PERCENTAGE); percentagePositionWithPercentageLimitsHorizontalResersed @@ -91,7 +92,7 @@ public class SplitPanelWithMinimumAndMaximum extends TestBase { HorizontalSplitPanel pixelPositionWithPercentageLimitsHorizontalResersed = new HorizontalSplitPanel(); pixelPositionWithPercentageLimitsHorizontalResersed - .setMinimumSplitPosition(10, Sizeable.UNITS_PERCENTAGE); + .setMinSplitPosition(10, Sizeable.UNITS_PERCENTAGE); pixelPositionWithPercentageLimitsHorizontalResersed .setMaxSplitPosition(80, Sizeable.UNITS_PERCENTAGE); pixelPositionWithPercentageLimitsHorizontalResersed @@ -105,8 +106,8 @@ public class SplitPanelWithMinimumAndMaximum extends TestBase { .addComponent(pixelPositionWithPercentageLimitsHorizontalResersed); HorizontalSplitPanel pixelPositionWithPixelLimitsHorizontalResersed = new HorizontalSplitPanel(); - pixelPositionWithPixelLimitsHorizontalResersed.setMinimumSplitPosition( - 100, Sizeable.UNITS_PIXELS); + pixelPositionWithPixelLimitsHorizontalResersed.setMinSplitPosition(100, + Sizeable.UNITS_PIXELS); pixelPositionWithPixelLimitsHorizontalResersed.setMaxSplitPosition(550, Sizeable.UNITS_PIXELS); pixelPositionWithPixelLimitsHorizontalResersed @@ -121,7 +122,7 @@ public class SplitPanelWithMinimumAndMaximum extends TestBase { HorizontalSplitPanel percentagePositionWithPixelLimitsHorizontalResersed = new HorizontalSplitPanel(); percentagePositionWithPixelLimitsHorizontalResersed - .setMinimumSplitPosition(100, Sizeable.UNITS_PIXELS); + .setMinSplitPosition(100, Sizeable.UNITS_PIXELS); percentagePositionWithPixelLimitsHorizontalResersed .setMaxSplitPosition(550, Sizeable.UNITS_PIXELS); percentagePositionWithPixelLimitsHorizontalResersed @@ -141,8 +142,8 @@ public class SplitPanelWithMinimumAndMaximum extends TestBase { verticalSplitsLayout.setCaption("Vertical splits"); VerticalSplitPanel percentagePositionWithPercentageLimitsVertical = new VerticalSplitPanel(); - percentagePositionWithPercentageLimitsVertical.setMinimumSplitPosition( - 10, Sizeable.UNITS_PERCENTAGE); + percentagePositionWithPercentageLimitsVertical.setMinSplitPosition(10, + Sizeable.UNITS_PERCENTAGE); percentagePositionWithPercentageLimitsVertical.setMaxSplitPosition(80, Sizeable.UNITS_PERCENTAGE); percentagePositionWithPercentageLimitsVertical @@ -155,7 +156,7 @@ public class SplitPanelWithMinimumAndMaximum extends TestBase { .addComponent(percentagePositionWithPercentageLimitsVertical); VerticalSplitPanel pixelPositionWithPercentageLimitsVertical = new VerticalSplitPanel(); - pixelPositionWithPercentageLimitsVertical.setMinimumSplitPosition(10, + pixelPositionWithPercentageLimitsVertical.setMinSplitPosition(10, Sizeable.UNITS_PERCENTAGE); pixelPositionWithPercentageLimitsVertical.setMaxSplitPosition(80, Sizeable.UNITS_PERCENTAGE); @@ -169,7 +170,7 @@ public class SplitPanelWithMinimumAndMaximum extends TestBase { .addComponent(pixelPositionWithPercentageLimitsVertical); VerticalSplitPanel pixelPositionWithPixelLimitsVertical = new VerticalSplitPanel(); - pixelPositionWithPixelLimitsVertical.setMinimumSplitPosition(100, + pixelPositionWithPixelLimitsVertical.setMinSplitPosition(100, Sizeable.UNITS_PIXELS); pixelPositionWithPixelLimitsVertical.setMaxSplitPosition(450, Sizeable.UNITS_PIXELS); @@ -182,7 +183,7 @@ public class SplitPanelWithMinimumAndMaximum extends TestBase { verticalSplitsLayout.addComponent(pixelPositionWithPixelLimitsVertical); VerticalSplitPanel percentagePositionWithPixelLimitsVertical = new VerticalSplitPanel(); - percentagePositionWithPixelLimitsVertical.setMinimumSplitPosition(100, + percentagePositionWithPixelLimitsVertical.setMinSplitPosition(100, Sizeable.UNITS_PIXELS); percentagePositionWithPixelLimitsVertical.setMaxSplitPosition(450, Sizeable.UNITS_PIXELS); @@ -197,7 +198,7 @@ public class SplitPanelWithMinimumAndMaximum extends TestBase { VerticalSplitPanel percentagePositionWithPercentageLimitsVerticalReversed = new VerticalSplitPanel(); percentagePositionWithPercentageLimitsVerticalReversed - .setMinimumSplitPosition(10, Sizeable.UNITS_PERCENTAGE); + .setMinSplitPosition(10, Sizeable.UNITS_PERCENTAGE); percentagePositionWithPercentageLimitsVerticalReversed .setMaxSplitPosition(80, Sizeable.UNITS_PERCENTAGE); percentagePositionWithPercentageLimitsVerticalReversed @@ -211,8 +212,8 @@ public class SplitPanelWithMinimumAndMaximum extends TestBase { .addComponent(percentagePositionWithPercentageLimitsVerticalReversed); VerticalSplitPanel pixelPositionWithPercentageLimitsVerticalReversed = new VerticalSplitPanel(); - pixelPositionWithPercentageLimitsVerticalReversed - .setMinimumSplitPosition(10, Sizeable.UNITS_PERCENTAGE); + pixelPositionWithPercentageLimitsVerticalReversed.setMinSplitPosition( + 10, Sizeable.UNITS_PERCENTAGE); pixelPositionWithPercentageLimitsVerticalReversed.setMaxSplitPosition( 80, Sizeable.UNITS_PERCENTAGE); pixelPositionWithPercentageLimitsVerticalReversed @@ -226,8 +227,8 @@ public class SplitPanelWithMinimumAndMaximum extends TestBase { .addComponent(pixelPositionWithPercentageLimitsVerticalReversed); VerticalSplitPanel pixelPositionWithPixelLimitsVerticalReversed = new VerticalSplitPanel(); - pixelPositionWithPixelLimitsVerticalReversed.setMinimumSplitPosition( - 100, Sizeable.UNITS_PIXELS); + pixelPositionWithPixelLimitsVerticalReversed.setMinSplitPosition(100, + Sizeable.UNITS_PIXELS); pixelPositionWithPixelLimitsVerticalReversed.setMaxSplitPosition(400, Sizeable.UNITS_PIXELS); pixelPositionWithPixelLimitsVerticalReversed @@ -241,8 +242,8 @@ public class SplitPanelWithMinimumAndMaximum extends TestBase { .addComponent(pixelPositionWithPixelLimitsVerticalReversed); VerticalSplitPanel percentagePositionWithPixelLimitsVerticalReversed = new VerticalSplitPanel(); - percentagePositionWithPixelLimitsVerticalReversed - .setMinimumSplitPosition(100, Sizeable.UNITS_PIXELS); + percentagePositionWithPixelLimitsVerticalReversed.setMinSplitPosition( + 100, Sizeable.UNITS_PIXELS); percentagePositionWithPixelLimitsVerticalReversed.setMaxSplitPosition( 400, Sizeable.UNITS_PIXELS); percentagePositionWithPixelLimitsVerticalReversed @@ -258,6 +259,61 @@ public class SplitPanelWithMinimumAndMaximum extends TestBase { tabs.addComponent(verticalSplitsLayout); verticalSplitsLayout.setSizeFull(); + final VerticalLayout togglableSplitPanelLayout = new VerticalLayout(); + togglableSplitPanelLayout.setCaption("Togglable minimum/maximum"); + + final HorizontalSplitPanel togglableSplitPanel = new HorizontalSplitPanel(); + togglableSplitPanel.setMinSplitPosition(10, Sizeable.UNITS_PERCENTAGE); + togglableSplitPanel.setMaxSplitPosition(80, Sizeable.UNITS_PERCENTAGE); + togglableSplitPanel.setFirstComponent(new Label( + "Min 10 % - 50 % position")); + togglableSplitPanel.setSecondComponent(new Label("Max 80 %")); + togglableSplitPanel.setSplitPosition(50, Sizeable.UNITS_PERCENTAGE); + togglableSplitPanel.setHeight("250px"); + togglableSplitPanelLayout.addComponent(togglableSplitPanel); + + final HorizontalLayout buttonLayout = new HorizontalLayout(); + + Button disableMinimum = new Button("Disable min limit", + new Button.ClickListener() { + public void buttonClick(Button.ClickEvent event) { + togglableSplitPanel.setMinSplitPosition(0, + Sizeable.UNITS_PERCENTAGE); + + } + }); + Button enableMinimum = new Button("Enable min limit", + new Button.ClickListener() { + public void buttonClick(Button.ClickEvent event) { + togglableSplitPanel.setMinSplitPosition(10, + Sizeable.UNITS_PERCENTAGE); + + } + }); + Button disableMaximum = new Button("Disable max limit", + new Button.ClickListener() { + public void buttonClick(Button.ClickEvent event) { + togglableSplitPanel.setMaxSplitPosition(100, + Sizeable.UNITS_PERCENTAGE); + + } + }); + Button enableMaximum = new Button("Enable max limit", + new Button.ClickListener() { + public void buttonClick(Button.ClickEvent event) { + togglableSplitPanel.setMaxSplitPosition(80, + Sizeable.UNITS_PERCENTAGE); + + } + }); + buttonLayout.addComponent(disableMinimum); + buttonLayout.addComponent(enableMinimum); + buttonLayout.addComponent(disableMaximum); + buttonLayout.addComponent(enableMaximum); + + togglableSplitPanelLayout.addComponent(buttonLayout); + tabs.addComponent(togglableSplitPanelLayout); + addComponent(tabs); tabs.setHeight("550px"); tabs.setWidth("600px"); diff --git a/tests/testbench/com/vaadin/tests/components/table/TableWithNoncollapsibleColumns.java b/tests/testbench/com/vaadin/tests/components/table/TableWithNoncollapsibleColumns.java index 9e8c201452..404ba5d779 100644 --- a/tests/testbench/com/vaadin/tests/components/table/TableWithNoncollapsibleColumns.java +++ b/tests/testbench/com/vaadin/tests/components/table/TableWithNoncollapsibleColumns.java @@ -25,7 +25,7 @@ public class TableWithNoncollapsibleColumns extends TestBase { table.addContainerProperty("Column 3 - toggle collapsing", String.class, null); - table.setColumnNoncollapsible("Column 1 - noncollapsible", true); + table.setColumnCollapsible("Column 1 - noncollapsible", false); layout.addComponent(table); final Button button1 = new Button("Column 1: collapse/show", @@ -57,9 +57,9 @@ public class TableWithNoncollapsibleColumns extends TestBase { "Column 3: make noncollapsible/collapsible", new Button.ClickListener() { public void buttonClick(ClickEvent event) { - table.setColumnNoncollapsible( + table.setColumnCollapsible( "Column 3 - toggle collapsing", - !table.isColumnNoncollapsible("Column 3 - toggle collapsing")); + !table.isColumnCollapsible("Column 3 - toggle collapsing")); } }); diff --git a/tests/testbench/com/vaadin/tests/components/table/Tables.java b/tests/testbench/com/vaadin/tests/components/table/Tables.java index b84ab65d87..11ffff0655 100644 --- a/tests/testbench/com/vaadin/tests/components/table/Tables.java +++ b/tests/testbench/com/vaadin/tests/components/table/Tables.java @@ -78,10 +78,10 @@ public class Tables<T extends Table> extends AbstractSelectTestCase<T> } }; - private Command<T, Boolean> columnNonCollapsibleCommand = new Command<T, Boolean>() { + private Command<T, Boolean> columnCollapsibleCommand = new Command<T, Boolean>() { - public void execute(T c, Boolean noncollapsible, Object propertyId) { - c.setColumnNoncollapsible(propertyId, noncollapsible); + public void execute(T c, Boolean collapsible, Object propertyId) { + c.setColumnCollapsible(propertyId, collapsible); } }; @@ -656,8 +656,8 @@ public class Tables<T extends Table> extends AbstractSelectTestCase<T> createSelectAction("Expand ratio", category, expandOptions, "- remove -", columnExpandRatioCommand, propertyId); t.log("Expand"); - createBooleanAction("Noncollapsible", category, false, - columnNonCollapsibleCommand, propertyId); + createBooleanAction("Collapsible", category, true, + columnCollapsibleCommand, propertyId); // Footer text (move) // Header text (move) |