6666
6767@ SuppressWarnings ("serial" )
6868@ CssImport (value = "./styles/multiselect-cb-hide.css" , themeFor = "vaadin-grid" )
69+ @ CssImport (value = "./styles/twin-col-grid-button.css" )
6970public class TwinColGrid <T > extends VerticalLayout
7071 implements HasValue <ValueChangeEvent <Set <T >>, Set <T >>, HasComponents , HasSize {
7172
@@ -115,13 +116,13 @@ public enum Orientation {
115116 /** @deprecated Use getRightGrid().getDataProvider() */
116117 @ Deprecated protected ListDataProvider <T > rightGridDataProvider ;
117118
118- private final Button addAllButton = new Button ();
119+ private final Button addAllButton = createActionButton ();
119120
120- private final Button addButton = new Button ();
121+ private final Button addButton = createActionButton ();
121122
122- private final Button removeButton = new Button ();
123+ private final Button removeButton = createActionButton ();
123124
124- private final Button removeAllButton = new Button ();
125+ private final Button removeAllButton = createActionButton ();
125126
126127 private Component buttonContainer ;
127128
@@ -203,7 +204,7 @@ public TwinColGrid(final ListDataProvider<T> dataProvider, String caption) {
203204
204205 /**
205206 * Sets orientation for TwinColGridComponent
206- *
207+ *
207208 * @param orientation
208209 * @return
209210 */
@@ -254,13 +255,9 @@ private VerticalLayout createVerticalContainer() {
254255
255256 private VerticalLayout getVerticalButtonContainer () {
256257 addButton .setIcon (VaadinIcon .ANGLE_RIGHT .create ());
257- addButton .setWidth ("3em" );
258258 addAllButton .setIcon (VaadinIcon .ANGLE_DOUBLE_RIGHT .create ());
259- addAllButton .setWidth ("3em" );
260259 removeButton .setIcon (VaadinIcon .ANGLE_LEFT .create ());
261- removeButton .setWidth ("3em" );
262260 removeAllButton .setIcon (VaadinIcon .ANGLE_DOUBLE_LEFT .create ());
263- removeAllButton .setWidth ("3em" );
264261
265262 VerticalLayout vButtonContainer =
266263 new VerticalLayout (
@@ -273,13 +270,9 @@ private VerticalLayout getVerticalButtonContainer() {
273270
274271 private HorizontalLayout getHorizontalButtonContainer () {
275272 addButton .setIcon (VaadinIcon .ANGLE_DOWN .create ());
276- addButton .setWidth ("3em" );
277273 addAllButton .setIcon (VaadinIcon .ANGLE_DOUBLE_DOWN .create ());
278- addAllButton .setWidth ("3em" );
279274 removeButton .setIcon (VaadinIcon .ANGLE_UP .create ());
280- removeButton .setWidth ("3em" );
281275 removeAllButton .setIcon (VaadinIcon .ANGLE_DOUBLE_UP .create ());
282- removeAllButton .setWidth ("3em" );
283276
284277 HorizontalLayout hButtonContainer =
285278 new HorizontalLayout (
@@ -766,4 +759,11 @@ public HasValue<? extends ValueChangeEvent<List<T>>, List<T>> asList() {
766759 public Set <T > getEmptyValue () {
767760 return Collections .emptySet ();
768761 }
762+
763+ private Button createActionButton () {
764+ Button button = new Button ();
765+ button .addThemeName ("twin-col-grid-button" );
766+ return button ;
767+ }
768+
769769}
0 commit comments