Since this is quite the change, I've taken the opportunity to rewrite smaller adjoining pieces to make more sense. Move methods from classes, and so on. These changes are, however, only on the code level, no other functionality will be introduced by this patch. Change-Id: I56f19c5af7dc4ccfd2fa4c9098f06e77dbfa12fbtags/7.2.0.beta1
@@ -123,4 +123,21 @@ public interface RowContainer { | |||
* @return the number of rows in the current row container | |||
*/ | |||
public int getRowCount(); | |||
/** | |||
* The default height of the rows in this RowContainer. | |||
* | |||
* @param px | |||
* the default height in pixels of the rows in this RowContainer | |||
* @throws IllegalArgumentException | |||
* if <code>px < 1</code> | |||
*/ | |||
public void setDefaultRowHeight(int px) throws IllegalArgumentException; | |||
/** | |||
* Returns the default height of the rows in this RowContainer. | |||
* | |||
* @return the default height of the rows in this RowContainer, in pixels | |||
*/ | |||
public int getDefaultRowHeight(); | |||
} |
@@ -289,6 +289,14 @@ public class BasicEscalator extends AbstractTestUI { | |||
grid.calculateColumnWidths(); | |||
} | |||
})); | |||
addComponent(new Button("Randomize row heights", | |||
new Button.ClickListener() { | |||
@Override | |||
public void buttonClick(ClickEvent event) { | |||
grid.randomizeDefaultRowHeight(); | |||
} | |||
})); | |||
} | |||
@Override |
@@ -43,4 +43,6 @@ public interface TestGridClientRpc extends ClientRpc { | |||
void setColumnWidth(int index, int px); | |||
void calculateColumnWidths(); | |||
void randomRowHeight(); | |||
} |
@@ -15,6 +15,7 @@ | |||
*/ | |||
package com.vaadin.tests.widgetset.client.grid; | |||
import com.google.gwt.user.client.Random; | |||
import com.vaadin.client.ui.AbstractComponentConnector; | |||
import com.vaadin.shared.ui.Connect; | |||
import com.vaadin.shared.ui.grid.ScrollDestination; | |||
@@ -112,6 +113,16 @@ public class TestGridConnector extends AbstractComponentConnector { | |||
public void calculateColumnWidths() { | |||
getWidget().calculateColumnWidths(); | |||
} | |||
@Override | |||
public void randomRowHeight() { | |||
getWidget().getHeader().setDefaultRowHeight( | |||
Random.nextInt(20) + 20); | |||
getWidget().getBody().setDefaultRowHeight( | |||
Random.nextInt(20) + 20); | |||
getWidget().getFooter().setDefaultRowHeight( | |||
Random.nextInt(20) + 20); | |||
} | |||
}); | |||
} | |||
@@ -206,6 +206,10 @@ public class VTestGrid extends Composite { | |||
return escalator.getHeader(); | |||
} | |||
public RowContainer getBody() { | |||
return escalator.getBody(); | |||
} | |||
public RowContainer getFooter() { | |||
return escalator.getFooter(); | |||
} |
@@ -89,4 +89,8 @@ public class TestGrid extends AbstractComponent { | |||
public void calculateColumnWidths() { | |||
rpc().calculateColumnWidths(); | |||
} | |||
public void randomizeDefaultRowHeight() { | |||
rpc().randomRowHeight(); | |||
} | |||
} |