From: John Ahlroos Date: Wed, 26 Sep 2012 12:45:06 +0000 (+0300) Subject: Added TableState with default primary style name #9724 X-Git-Tag: 7.0.0.beta6~87^2~13^2~12 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=1888d8fdcb32f8111122430cf8c6f782287d97f6;p=vaadin-framework.git Added TableState with default primary style name #9724 --- diff --git a/client/src/com/vaadin/client/ui/table/TableConnector.java b/client/src/com/vaadin/client/ui/table/TableConnector.java index 301a9464a0..e5e8cbb9ad 100644 --- a/client/src/com/vaadin/client/ui/table/TableConnector.java +++ b/client/src/com/vaadin/client/ui/table/TableConnector.java @@ -36,9 +36,9 @@ import com.vaadin.client.ui.AbstractComponentContainerConnector; import com.vaadin.client.ui.PostLayoutListener; import com.vaadin.client.ui.table.VScrollTable.ContextMenuDetails; import com.vaadin.client.ui.table.VScrollTable.VScrollTableBody.VScrollTableRow; -import com.vaadin.shared.AbstractFieldState; import com.vaadin.shared.ui.Connect; import com.vaadin.shared.ui.table.TableConstants; +import com.vaadin.shared.ui.table.TableState; @Connect(com.vaadin.ui.Table.class) public class TableConnector extends AbstractComponentContainerConnector @@ -340,8 +340,8 @@ public class TableConnector extends AbstractComponentContainerConnector } @Override - public AbstractFieldState getState() { - return (AbstractFieldState) super.getState(); + public TableState getState() { + return (TableState) super.getState(); } /** diff --git a/client/src/com/vaadin/client/ui/table/VScrollTable.java b/client/src/com/vaadin/client/ui/table/VScrollTable.java index f295758603..f4c881d26d 100644 --- a/client/src/com/vaadin/client/ui/table/VScrollTable.java +++ b/client/src/com/vaadin/client/ui/table/VScrollTable.java @@ -132,6 +132,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, ScrollHandler, VHasDropHandler, FocusHandler, BlurHandler, Focusable, ActionOwner { + public static final String STYLENAME = "v-table"; + public enum SelectMode { NONE(0), SINGLE(1), MULTI(2); private int id; @@ -542,7 +544,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, } }, ContextMenuEvent.getType()); - setStyleName("v-table"); + setStyleName(STYLENAME); add(tHead); add(scrollBodyPanel); diff --git a/shared/src/com/vaadin/shared/ui/table/TableState.java b/shared/src/com/vaadin/shared/ui/table/TableState.java new file mode 100644 index 0000000000..58e6850f31 --- /dev/null +++ b/shared/src/com/vaadin/shared/ui/table/TableState.java @@ -0,0 +1,10 @@ +package com.vaadin.shared.ui.table; + +import com.vaadin.client.ui.table.VScrollTable; +import com.vaadin.shared.AbstractFieldState; + +public class TableState extends AbstractFieldState { + { + primaryStyleName = VScrollTable.STYLENAME; + } +}