aboutsummaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorJohn Ahlroos <john@vaadin.com>2012-10-08 16:05:20 +0300
committerJohn Ahlroos <john@vaadin.com>2012-10-08 16:05:20 +0300
commitd43d15454d7cbc70f0a03d4e6666c747d7a4f657 (patch)
treef7165ebd646165e9602a2eb8c0dcc07f37ccb8cb /client
parentf296b46c8de6705baaa137fd5854cd55aefe5bc6 (diff)
parent107f77ecda9d510fabf976d7a81d350b933c9765 (diff)
downloadvaadin-framework-d43d15454d7cbc70f0a03d4e6666c747d7a4f657.tar.gz
vaadin-framework-d43d15454d7cbc70f0a03d4e6666c747d7a4f657.zip
Merge branch 'sass'
Diffstat (limited to 'client')
-rw-r--r--client/src/com/vaadin/client/ui/AbstractComponentConnector.java12
-rw-r--r--client/src/com/vaadin/client/ui/absolutelayout/VAbsoluteLayout.java4
-rw-r--r--client/src/com/vaadin/client/ui/browserframe/VBrowserFrame.java4
-rw-r--r--client/src/com/vaadin/client/ui/button/VButton.java20
-rw-r--r--client/src/com/vaadin/client/ui/combobox/ComboBoxConnector.java6
-rw-r--r--client/src/com/vaadin/client/ui/combobox/VFilterSelect.java2
-rw-r--r--client/src/com/vaadin/client/ui/csslayout/VCssLayout.java4
-rw-r--r--client/src/com/vaadin/client/ui/datefield/InlineDateFieldConnector.java6
-rw-r--r--client/src/com/vaadin/client/ui/datefield/PopupDateFieldConnector.java6
-rw-r--r--client/src/com/vaadin/client/ui/datefield/TextualDateConnector.java6
-rw-r--r--client/src/com/vaadin/client/ui/embedded/EmbeddedConnector.java6
-rw-r--r--client/src/com/vaadin/client/ui/flash/VFlash.java4
-rw-r--r--client/src/com/vaadin/client/ui/gridlayout/VGridLayout.java4
-rw-r--r--client/src/com/vaadin/client/ui/image/VImage.java4
-rw-r--r--client/src/com/vaadin/client/ui/link/LinkConnector.java6
-rw-r--r--client/src/com/vaadin/client/ui/menubar/MenuBarConnector.java6
-rw-r--r--client/src/com/vaadin/client/ui/nativebutton/NativeButtonConnector.java6
-rw-r--r--client/src/com/vaadin/client/ui/optiongroup/OptionGroupConnector.java6
-rw-r--r--client/src/com/vaadin/client/ui/orderedlayout/HorizontalLayoutConnector.java6
-rw-r--r--client/src/com/vaadin/client/ui/orderedlayout/VHorizontalLayout.java15
-rw-r--r--client/src/com/vaadin/client/ui/orderedlayout/VOrderedLayout.java24
-rw-r--r--client/src/com/vaadin/client/ui/orderedlayout/VVerticalLayout.java15
-rw-r--r--client/src/com/vaadin/client/ui/orderedlayout/VerticalLayoutConnector.java5
-rw-r--r--client/src/com/vaadin/client/ui/splitpanel/HorizontalSplitPanelConnector.java6
-rw-r--r--client/src/com/vaadin/client/ui/splitpanel/VerticalSplitPanelConnector.java6
-rw-r--r--client/src/com/vaadin/client/ui/table/TableConnector.java12
-rw-r--r--client/src/com/vaadin/client/ui/table/VScrollTable.java322
-rw-r--r--client/src/com/vaadin/client/ui/tabsheet/TabsheetConnector.java6
-rw-r--r--client/src/com/vaadin/client/ui/tree/TreeConnector.java6
-rw-r--r--client/src/com/vaadin/client/ui/treetable/TreeTableConnector.java6
-rw-r--r--client/src/com/vaadin/client/ui/twincolselect/TwinColSelectConnector.java6
-rw-r--r--client/src/com/vaadin/client/ui/twincolselect/VTwinColSelect.java2
-rw-r--r--client/src/com/vaadin/client/ui/video/VVideo.java2
33 files changed, 386 insertions, 165 deletions
diff --git a/client/src/com/vaadin/client/ui/AbstractComponentConnector.java b/client/src/com/vaadin/client/ui/AbstractComponentConnector.java
index b1d31370b3..6ff51b3766 100644
--- a/client/src/com/vaadin/client/ui/AbstractComponentConnector.java
+++ b/client/src/com/vaadin/client/ui/AbstractComponentConnector.java
@@ -72,8 +72,6 @@ public abstract class AbstractComponentConnector extends AbstractConnector
getConnection().getVTooltip().connectHandlersToWidget(getWidget());
- // Set the core 'v' style name for the widget
- getWidget().setStyleName(StyleConstants.UI_WIDGET, true);
}
/**
@@ -272,6 +270,16 @@ public abstract class AbstractComponentConnector extends AbstractConnector
ComponentState state = getState();
String primaryStyleName = getWidget().getStylePrimaryName();
+ if (state.primaryStyleName != null) {
+ /*
+ * We overwrite the widgets primary stylename if state defines a
+ * primary stylename. Clears all previous stylenames.
+ */
+ getWidget().setStylePrimaryName(state.primaryStyleName);
+ }
+
+ // Set the core 'v' style name for the widget
+ setWidgetStyleName(StyleConstants.UI_WIDGET, true);
// should be in AbstractFieldConnector ?
// add / remove read-only style name
diff --git a/client/src/com/vaadin/client/ui/absolutelayout/VAbsoluteLayout.java b/client/src/com/vaadin/client/ui/absolutelayout/VAbsoluteLayout.java
index 229ef7b676..1f5b58bef3 100644
--- a/client/src/com/vaadin/client/ui/absolutelayout/VAbsoluteLayout.java
+++ b/client/src/com/vaadin/client/ui/absolutelayout/VAbsoluteLayout.java
@@ -45,8 +45,8 @@ public class VAbsoluteLayout extends ComplexPanel {
public VAbsoluteLayout() {
setElement(Document.get().createDivElement());
- setStyleName(StyleConstants.UI_LAYOUT);
- addStyleName(CLASSNAME);
+ setStyleName(CLASSNAME);
+ addStyleName(StyleConstants.UI_LAYOUT);
marginElement = Document.get().createDivElement();
canvas.getStyle().setProperty("position", "relative");
canvas.getStyle().setProperty("overflow", "hidden");
diff --git a/client/src/com/vaadin/client/ui/browserframe/VBrowserFrame.java b/client/src/com/vaadin/client/ui/browserframe/VBrowserFrame.java
index da2c981a8d..aac8151d96 100644
--- a/client/src/com/vaadin/client/ui/browserframe/VBrowserFrame.java
+++ b/client/src/com/vaadin/client/ui/browserframe/VBrowserFrame.java
@@ -11,11 +11,13 @@ public class VBrowserFrame extends Widget {
protected Element altElement;
protected String altText;
+ public static final String CLASSNAME = "v-browserframe";
+
public VBrowserFrame() {
Element root = Document.get().createDivElement();
setElement(root);
- setStylePrimaryName("v-browserframe");
+ setStyleName(CLASSNAME);
createAltTextElement();
}
diff --git a/client/src/com/vaadin/client/ui/button/VButton.java b/client/src/com/vaadin/client/ui/button/VButton.java
index d4cd40e2e9..52987b01c1 100644
--- a/client/src/com/vaadin/client/ui/button/VButton.java
+++ b/client/src/com/vaadin/client/ui/button/VButton.java
@@ -97,19 +97,31 @@ public class VButton extends FocusWidget implements ClickHandler {
sinkEvents(Event.ONCLICK | Event.MOUSEEVENTS | Event.FOCUSEVENTS
| Event.KEYEVENTS);
- setStyleName(CLASSNAME);
-
// Add a11y role "button"
Accessibility.setRole(getElement(), Accessibility.ROLE_BUTTON);
- wrapper.setClassName(getStylePrimaryName() + "-wrap");
getElement().appendChild(wrapper);
- captionElement.setClassName(getStylePrimaryName() + "-caption");
wrapper.appendChild(captionElement);
+ setStyleName(CLASSNAME);
+
addClickHandler(this);
}
+ @Override
+ public void setStyleName(String style) {
+ super.setStyleName(style);
+ wrapper.setClassName(getStylePrimaryName() + "-wrap");
+ captionElement.setClassName(getStylePrimaryName() + "-caption");
+ }
+
+ @Override
+ public void setStylePrimaryName(String style) {
+ super.setStylePrimaryName(style);
+ wrapper.setClassName(getStylePrimaryName() + "-wrap");
+ captionElement.setClassName(getStylePrimaryName() + "-caption");
+ }
+
public void setText(String text) {
captionElement.setInnerText(text);
}
diff --git a/client/src/com/vaadin/client/ui/combobox/ComboBoxConnector.java b/client/src/com/vaadin/client/ui/combobox/ComboBoxConnector.java
index bcab8e71fc..697ade43e7 100644
--- a/client/src/com/vaadin/client/ui/combobox/ComboBoxConnector.java
+++ b/client/src/com/vaadin/client/ui/combobox/ComboBoxConnector.java
@@ -27,6 +27,7 @@ import com.vaadin.client.ui.combobox.VFilterSelect.FilterSelectSuggestion;
import com.vaadin.client.ui.menubar.MenuItem;
import com.vaadin.shared.ui.Connect;
import com.vaadin.shared.ui.combobox.ComboBoxConstants;
+import com.vaadin.shared.ui.combobox.ComboBoxState;
import com.vaadin.shared.ui.combobox.FilteringMode;
import com.vaadin.ui.ComboBox;
@@ -246,6 +247,11 @@ public class ComboBoxConnector extends AbstractFieldConnector implements
}
@Override
+ public ComboBoxState getState() {
+ return (ComboBoxState) super.getState();
+ }
+
+ @Override
public void layout() {
VFilterSelect widget = getWidget();
if (widget.initDone) {
diff --git a/client/src/com/vaadin/client/ui/combobox/VFilterSelect.java b/client/src/com/vaadin/client/ui/combobox/VFilterSelect.java
index 203f982180..3e8cf396d7 100644
--- a/client/src/com/vaadin/client/ui/combobox/VFilterSelect.java
+++ b/client/src/com/vaadin/client/ui/combobox/VFilterSelect.java
@@ -835,7 +835,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler,
@Deprecated
public static final FilteringMode FILTERINGMODE_CONTAINS = FilteringMode.CONTAINS;
- private static final String CLASSNAME = "v-filterselect";
+ public static final String CLASSNAME = "v-filterselect";
private static final String STYLE_NO_INPUT = "no-input";
protected int pageLength = 10;
diff --git a/client/src/com/vaadin/client/ui/csslayout/VCssLayout.java b/client/src/com/vaadin/client/ui/csslayout/VCssLayout.java
index 17666cce13..212a6307be 100644
--- a/client/src/com/vaadin/client/ui/csslayout/VCssLayout.java
+++ b/client/src/com/vaadin/client/ui/csslayout/VCssLayout.java
@@ -33,8 +33,8 @@ public class VCssLayout extends FlowPanel {
*/
public VCssLayout() {
super();
- setStyleName(StyleConstants.UI_LAYOUT);
- addStyleName(CLASSNAME);
+ setStyleName(CLASSNAME);
+ addStyleName(StyleConstants.UI_LAYOUT);
}
/**
diff --git a/client/src/com/vaadin/client/ui/datefield/InlineDateFieldConnector.java b/client/src/com/vaadin/client/ui/datefield/InlineDateFieldConnector.java
index 2f2dd380d6..1800125402 100644
--- a/client/src/com/vaadin/client/ui/datefield/InlineDateFieldConnector.java
+++ b/client/src/com/vaadin/client/ui/datefield/InlineDateFieldConnector.java
@@ -23,6 +23,7 @@ import com.vaadin.client.UIDL;
import com.vaadin.client.ui.datefield.VCalendarPanel.FocusChangeListener;
import com.vaadin.client.ui.datefield.VCalendarPanel.TimeChangeListener;
import com.vaadin.shared.ui.Connect;
+import com.vaadin.shared.ui.datefield.InlineDateFieldState;
import com.vaadin.shared.ui.datefield.Resolution;
import com.vaadin.ui.InlineDateField;
@@ -111,4 +112,9 @@ public class InlineDateFieldConnector extends AbstractDateFieldConnector {
public VDateFieldCalendar getWidget() {
return (VDateFieldCalendar) super.getWidget();
}
+
+ @Override
+ public InlineDateFieldState getState() {
+ return (InlineDateFieldState) super.getState();
+ }
}
diff --git a/client/src/com/vaadin/client/ui/datefield/PopupDateFieldConnector.java b/client/src/com/vaadin/client/ui/datefield/PopupDateFieldConnector.java
index f5be276575..fbc7bcc88c 100644
--- a/client/src/com/vaadin/client/ui/datefield/PopupDateFieldConnector.java
+++ b/client/src/com/vaadin/client/ui/datefield/PopupDateFieldConnector.java
@@ -24,6 +24,7 @@ import com.vaadin.client.UIDL;
import com.vaadin.client.ui.datefield.VCalendarPanel.FocusChangeListener;
import com.vaadin.client.ui.datefield.VCalendarPanel.TimeChangeListener;
import com.vaadin.shared.ui.Connect;
+import com.vaadin.shared.ui.datefield.PopupDateFieldState;
import com.vaadin.shared.ui.datefield.Resolution;
import com.vaadin.ui.DateField;
@@ -123,6 +124,11 @@ public class PopupDateFieldConnector extends TextualDateConnector {
}
@Override
+ public PopupDateFieldState getState() {
+ return (PopupDateFieldState) super.getState();
+ }
+
+ @Override
protected void setWidgetStyleName(String styleName, boolean add) {
super.setWidgetStyleName(styleName, add);
diff --git a/client/src/com/vaadin/client/ui/datefield/TextualDateConnector.java b/client/src/com/vaadin/client/ui/datefield/TextualDateConnector.java
index ef4b53f9f4..ececdb6775 100644
--- a/client/src/com/vaadin/client/ui/datefield/TextualDateConnector.java
+++ b/client/src/com/vaadin/client/ui/datefield/TextualDateConnector.java
@@ -19,6 +19,7 @@ package com.vaadin.client.ui.datefield;
import com.vaadin.client.ApplicationConnection;
import com.vaadin.client.UIDL;
import com.vaadin.shared.ui.datefield.Resolution;
+import com.vaadin.shared.ui.datefield.TextualDateFieldState;
public class TextualDateConnector extends AbstractDateFieldConnector {
@@ -59,4 +60,9 @@ public class TextualDateConnector extends AbstractDateFieldConnector {
public VTextualDate getWidget() {
return (VTextualDate) super.getWidget();
}
+
+ @Override
+ public TextualDateFieldState getState() {
+ return (TextualDateFieldState) super.getState();
+ }
}
diff --git a/client/src/com/vaadin/client/ui/embedded/EmbeddedConnector.java b/client/src/com/vaadin/client/ui/embedded/EmbeddedConnector.java
index 2a1b4dcc44..1b56a56fe8 100644
--- a/client/src/com/vaadin/client/ui/embedded/EmbeddedConnector.java
+++ b/client/src/com/vaadin/client/ui/embedded/EmbeddedConnector.java
@@ -39,6 +39,7 @@ import com.vaadin.shared.MouseEventDetails;
import com.vaadin.shared.ui.Connect;
import com.vaadin.shared.ui.embedded.EmbeddedConstants;
import com.vaadin.shared.ui.embedded.EmbeddedServerRpc;
+import com.vaadin.shared.ui.embedded.EmbeddedState;
import com.vaadin.ui.Embedded;
@Connect(Embedded.class)
@@ -221,6 +222,11 @@ public class EmbeddedConnector extends AbstractComponentConnector implements
return (VEmbedded) super.getWidget();
}
+ @Override
+ public EmbeddedState getState() {
+ return (EmbeddedState) super.getState();
+ }
+
protected final ClickEventHandler clickEventHandler = new ClickEventHandler(
this) {
diff --git a/client/src/com/vaadin/client/ui/flash/VFlash.java b/client/src/com/vaadin/client/ui/flash/VFlash.java
index 1f94f21056..0f91ff88e7 100644
--- a/client/src/com/vaadin/client/ui/flash/VFlash.java
+++ b/client/src/com/vaadin/client/ui/flash/VFlash.java
@@ -8,6 +8,8 @@ import com.vaadin.client.Util;
public class VFlash extends HTML {
+ public static final String CLASSNAME = "v-flash";
+
protected String source;
protected String altText;
protected String classId;
@@ -21,7 +23,7 @@ public class VFlash extends HTML {
protected String height;
public VFlash() {
- setStylePrimaryName("v-flash");
+ setStyleName(CLASSNAME);
}
public void setSource(String source) {
diff --git a/client/src/com/vaadin/client/ui/gridlayout/VGridLayout.java b/client/src/com/vaadin/client/ui/gridlayout/VGridLayout.java
index 1664a6568f..770499e9b5 100644
--- a/client/src/com/vaadin/client/ui/gridlayout/VGridLayout.java
+++ b/client/src/com/vaadin/client/ui/gridlayout/VGridLayout.java
@@ -71,8 +71,8 @@ public class VGridLayout extends ComplexPanel {
spacingStyle.setPosition(Position.ABSOLUTE);
getElement().appendChild(spacingMeasureElement);
- setStyleName(StyleConstants.UI_LAYOUT);
- addStyleName(CLASSNAME);
+ setStyleName(CLASSNAME);
+ addStyleName(StyleConstants.UI_LAYOUT);
}
private GridLayoutConnector getConnector() {
diff --git a/client/src/com/vaadin/client/ui/image/VImage.java b/client/src/com/vaadin/client/ui/image/VImage.java
index 51603a2e5f..b05357b547 100644
--- a/client/src/com/vaadin/client/ui/image/VImage.java
+++ b/client/src/com/vaadin/client/ui/image/VImage.java
@@ -4,7 +4,9 @@ import com.google.gwt.user.client.ui.Image;
public class VImage extends Image {
+ public static final String CLASSNAME = "v-image";
+
public VImage() {
- setStylePrimaryName("v-image");
+ setStylePrimaryName(CLASSNAME);
}
}
diff --git a/client/src/com/vaadin/client/ui/link/LinkConnector.java b/client/src/com/vaadin/client/ui/link/LinkConnector.java
index d7e5f0b25f..f970855769 100644
--- a/client/src/com/vaadin/client/ui/link/LinkConnector.java
+++ b/client/src/com/vaadin/client/ui/link/LinkConnector.java
@@ -27,6 +27,7 @@ import com.vaadin.client.ui.Icon;
import com.vaadin.shared.ui.BorderStyle;
import com.vaadin.shared.ui.Connect;
import com.vaadin.shared.ui.link.LinkConstants;
+import com.vaadin.shared.ui.link.LinkState;
import com.vaadin.ui.Link;
@Connect(Link.class)
@@ -49,6 +50,11 @@ public class LinkConnector extends AbstractComponentConnector implements
}
@Override
+ public LinkState getState() {
+ return (LinkState) super.getState();
+ }
+
+ @Override
public boolean delegateCaptionHandling() {
return false;
}
diff --git a/client/src/com/vaadin/client/ui/menubar/MenuBarConnector.java b/client/src/com/vaadin/client/ui/menubar/MenuBarConnector.java
index fcd1a3bdac..29030fbd7d 100644
--- a/client/src/com/vaadin/client/ui/menubar/MenuBarConnector.java
+++ b/client/src/com/vaadin/client/ui/menubar/MenuBarConnector.java
@@ -33,6 +33,7 @@ import com.vaadin.shared.ui.ComponentStateUtil;
import com.vaadin.shared.ui.Connect;
import com.vaadin.shared.ui.Connect.LoadStyle;
import com.vaadin.shared.ui.menubar.MenuBarConstants;
+import com.vaadin.shared.ui.menubar.MenuBarState;
@Connect(value = com.vaadin.ui.MenuBar.class, loadStyle = LoadStyle.LAZY)
public class MenuBarConnector extends AbstractComponentConnector implements
@@ -178,6 +179,11 @@ public class MenuBarConnector extends AbstractComponentConnector implements
}
@Override
+ public MenuBarState getState() {
+ return (MenuBarState) super.getState();
+ }
+
+ @Override
public void layout() {
getWidget().iLayout();
}
diff --git a/client/src/com/vaadin/client/ui/nativebutton/NativeButtonConnector.java b/client/src/com/vaadin/client/ui/nativebutton/NativeButtonConnector.java
index 75a4d3f893..6bcb2c8cbf 100644
--- a/client/src/com/vaadin/client/ui/nativebutton/NativeButtonConnector.java
+++ b/client/src/com/vaadin/client/ui/nativebutton/NativeButtonConnector.java
@@ -29,7 +29,7 @@ import com.vaadin.client.ui.Icon;
import com.vaadin.shared.communication.FieldRpc.FocusAndBlurServerRpc;
import com.vaadin.shared.ui.Connect;
import com.vaadin.shared.ui.button.ButtonServerRpc;
-import com.vaadin.shared.ui.button.ButtonState;
+import com.vaadin.shared.ui.button.NativeButtonState;
import com.vaadin.ui.NativeButton;
@Connect(NativeButton.class)
@@ -115,8 +115,8 @@ public class NativeButtonConnector extends AbstractComponentConnector implements
}
@Override
- public ButtonState getState() {
- return (ButtonState) super.getState();
+ public NativeButtonState getState() {
+ return (NativeButtonState) super.getState();
}
@Override
diff --git a/client/src/com/vaadin/client/ui/optiongroup/OptionGroupConnector.java b/client/src/com/vaadin/client/ui/optiongroup/OptionGroupConnector.java
index b6581a8c02..0c3c06a270 100644
--- a/client/src/com/vaadin/client/ui/optiongroup/OptionGroupConnector.java
+++ b/client/src/com/vaadin/client/ui/optiongroup/OptionGroupConnector.java
@@ -26,6 +26,7 @@ import com.vaadin.client.UIDL;
import com.vaadin.shared.EventId;
import com.vaadin.shared.ui.Connect;
import com.vaadin.shared.ui.optiongroup.OptionGroupConstants;
+import com.vaadin.shared.ui.optiongroup.OptionGroupState;
import com.vaadin.ui.OptionGroup;
@Connect(OptionGroup.class)
@@ -77,4 +78,9 @@ public class OptionGroupConnector extends OptionGroupBaseConnector {
public VOptionGroup getWidget() {
return (VOptionGroup) super.getWidget();
}
+
+ @Override
+ public OptionGroupState getState() {
+ return (OptionGroupState) super.getState();
+ }
}
diff --git a/client/src/com/vaadin/client/ui/orderedlayout/HorizontalLayoutConnector.java b/client/src/com/vaadin/client/ui/orderedlayout/HorizontalLayoutConnector.java
index aa33e99f45..e6829563f9 100644
--- a/client/src/com/vaadin/client/ui/orderedlayout/HorizontalLayoutConnector.java
+++ b/client/src/com/vaadin/client/ui/orderedlayout/HorizontalLayoutConnector.java
@@ -17,6 +17,7 @@ package com.vaadin.client.ui.orderedlayout;
import com.vaadin.shared.ui.Connect;
import com.vaadin.shared.ui.Connect.LoadStyle;
+import com.vaadin.shared.ui.orderedlayout.HorizontalLayoutState;
import com.vaadin.ui.HorizontalLayout;
/**
@@ -38,4 +39,9 @@ public class HorizontalLayoutConnector extends AbstractOrderedLayoutConnector {
return (VHorizontalLayout) super.getWidget();
}
+ @Override
+ public HorizontalLayoutState getState() {
+ return (HorizontalLayoutState) super.getState();
+ }
+
}
diff --git a/client/src/com/vaadin/client/ui/orderedlayout/VHorizontalLayout.java b/client/src/com/vaadin/client/ui/orderedlayout/VHorizontalLayout.java
index f80db5113f..b1ebebe1a9 100644
--- a/client/src/com/vaadin/client/ui/orderedlayout/VHorizontalLayout.java
+++ b/client/src/com/vaadin/client/ui/orderedlayout/VHorizontalLayout.java
@@ -15,18 +15,27 @@
*/
package com.vaadin.client.ui.orderedlayout;
+import com.vaadin.client.StyleConstants;
+
/**
* Represents a layout where the children is ordered vertically
*/
public class VHorizontalLayout extends VOrderedLayout {
- private static final String CLASSNAME = "v-horizontallayout";
+ public static final String CLASSNAME = "v-horizontallayout";
/**
* Default constructor
*/
public VHorizontalLayout() {
- setVertical(false);
- addStyleName(CLASSNAME);
+ super(false);
+ setStyleName(CLASSNAME);
+ }
+
+ @Override
+ public void setStyleName(String style) {
+ super.setStyleName(style);
+ addStyleName(StyleConstants.UI_LAYOUT);
+ addStyleName("v-horizontal");
}
}
diff --git a/client/src/com/vaadin/client/ui/orderedlayout/VOrderedLayout.java b/client/src/com/vaadin/client/ui/orderedlayout/VOrderedLayout.java
index a9397b39c2..e9cdc42b86 100644
--- a/client/src/com/vaadin/client/ui/orderedlayout/VOrderedLayout.java
+++ b/client/src/com/vaadin/client/ui/orderedlayout/VOrderedLayout.java
@@ -56,31 +56,9 @@ public class VOrderedLayout extends FlowPanel {
private LayoutManager layoutManager;
- /**
- * Constructor
- */
- public VOrderedLayout() {
- setStyleName(StyleConstants.UI_LAYOUT);
- setVertical(true);
- }
- /**
- * Does the layout order its children horizontally or vertically
- *
- * @param vertical
- * true to order the childer vertically, false to order them
- * horizontally
- *
- */
- protected void setVertical(boolean vertical) {
+ public VOrderedLayout(boolean vertical) {
this.vertical = vertical;
- if (vertical) {
- addStyleName("v-vertical");
- removeStyleName("v-horizontal");
- } else {
- addStyleName("v-horizontal");
- removeStyleName("v-vertical");
- }
}
/**
diff --git a/client/src/com/vaadin/client/ui/orderedlayout/VVerticalLayout.java b/client/src/com/vaadin/client/ui/orderedlayout/VVerticalLayout.java
index 17de447b9a..bea85f7cee 100644
--- a/client/src/com/vaadin/client/ui/orderedlayout/VVerticalLayout.java
+++ b/client/src/com/vaadin/client/ui/orderedlayout/VVerticalLayout.java
@@ -15,18 +15,27 @@
*/
package com.vaadin.client.ui.orderedlayout;
+import com.vaadin.client.StyleConstants;
+
/**
* Represents a layout where the children is ordered vertically
*/
public class VVerticalLayout extends VOrderedLayout {
- private static final String CLASSNAME = "v-verticallayout";
+ public static final String CLASSNAME = "v-verticallayout";
/**
* Default constructor
*/
public VVerticalLayout() {
- setVertical(true);
- addStyleName(CLASSNAME);
+ super(true);
+ setStyleName(CLASSNAME);
+ }
+
+ @Override
+ public void setStyleName(String style) {
+ super.setStyleName(style);
+ addStyleName(StyleConstants.UI_LAYOUT);
+ addStyleName("v-vertical");
}
}
diff --git a/client/src/com/vaadin/client/ui/orderedlayout/VerticalLayoutConnector.java b/client/src/com/vaadin/client/ui/orderedlayout/VerticalLayoutConnector.java
index 13e9b3ecf7..d073e78c9c 100644
--- a/client/src/com/vaadin/client/ui/orderedlayout/VerticalLayoutConnector.java
+++ b/client/src/com/vaadin/client/ui/orderedlayout/VerticalLayoutConnector.java
@@ -17,6 +17,7 @@ package com.vaadin.client.ui.orderedlayout;
import com.vaadin.shared.ui.Connect;
import com.vaadin.shared.ui.Connect.LoadStyle;
+import com.vaadin.shared.ui.orderedlayout.VerticalLayoutState;
import com.vaadin.ui.VerticalLayout;
/**
@@ -38,4 +39,8 @@ public class VerticalLayoutConnector extends AbstractOrderedLayoutConnector {
return (VVerticalLayout) super.getWidget();
}
+ @Override
+ public VerticalLayoutState getState() {
+ return (VerticalLayoutState) super.getState();
+ }
}
diff --git a/client/src/com/vaadin/client/ui/splitpanel/HorizontalSplitPanelConnector.java b/client/src/com/vaadin/client/ui/splitpanel/HorizontalSplitPanelConnector.java
index c07bb59289..848e9068fe 100644
--- a/client/src/com/vaadin/client/ui/splitpanel/HorizontalSplitPanelConnector.java
+++ b/client/src/com/vaadin/client/ui/splitpanel/HorizontalSplitPanelConnector.java
@@ -17,6 +17,7 @@ package com.vaadin.client.ui.splitpanel;
import com.vaadin.shared.ui.Connect;
import com.vaadin.shared.ui.Connect.LoadStyle;
+import com.vaadin.shared.ui.splitpanel.HorizontalSplitPanelState;
import com.vaadin.ui.HorizontalSplitPanel;
@Connect(value = HorizontalSplitPanel.class, loadStyle = LoadStyle.EAGER)
@@ -27,4 +28,9 @@ public class HorizontalSplitPanelConnector extends AbstractSplitPanelConnector {
return (VSplitPanelHorizontal) super.getWidget();
}
+ @Override
+ public HorizontalSplitPanelState getState() {
+ return (HorizontalSplitPanelState) super.getState();
+ }
+
}
diff --git a/client/src/com/vaadin/client/ui/splitpanel/VerticalSplitPanelConnector.java b/client/src/com/vaadin/client/ui/splitpanel/VerticalSplitPanelConnector.java
index 7a4c4cbb93..2a57be7523 100644
--- a/client/src/com/vaadin/client/ui/splitpanel/VerticalSplitPanelConnector.java
+++ b/client/src/com/vaadin/client/ui/splitpanel/VerticalSplitPanelConnector.java
@@ -17,6 +17,7 @@ package com.vaadin.client.ui.splitpanel;
import com.vaadin.shared.ui.Connect;
import com.vaadin.shared.ui.Connect.LoadStyle;
+import com.vaadin.shared.ui.splitpanel.VerticalSplitPanelState;
import com.vaadin.ui.VerticalSplitPanel;
@Connect(value = VerticalSplitPanel.class, loadStyle = LoadStyle.EAGER)
@@ -27,4 +28,9 @@ public class VerticalSplitPanelConnector extends AbstractSplitPanelConnector {
return (VSplitPanelVertical) super.getWidget();
}
+ @Override
+ public VerticalSplitPanelState getState() {
+ return (VerticalSplitPanelState) super.getState();
+ }
+
}
diff --git a/client/src/com/vaadin/client/ui/table/TableConnector.java b/client/src/com/vaadin/client/ui/table/TableConnector.java
index a84a321653..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
@@ -212,10 +212,12 @@ public class TableConnector extends AbstractComponentContainerConnector
showSavedContextMenu(contextMenuBeforeUpdate);
if (!getWidget().isSelectable()) {
- getWidget().scrollBody.addStyleName(VScrollTable.CLASSNAME
+ getWidget().scrollBody.addStyleName(getWidget()
+ .getStylePrimaryName()
+ "-body-noselection");
} else {
- getWidget().scrollBody.removeStyleName(VScrollTable.CLASSNAME
+ getWidget().scrollBody.removeStyleName(getWidget()
+ .getStylePrimaryName()
+ "-body-noselection");
}
@@ -338,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 633f60be23..6a171c5b30 100644
--- a/client/src/com/vaadin/client/ui/table/VScrollTable.java
+++ b/client/src/com/vaadin/client/ui/table/VScrollTable.java
@@ -35,6 +35,7 @@ import com.google.gwt.dom.client.Node;
import com.google.gwt.dom.client.NodeList;
import com.google.gwt.dom.client.Style;
import com.google.gwt.dom.client.Style.Display;
+import com.google.gwt.dom.client.Style.Overflow;
import com.google.gwt.dom.client.Style.Position;
import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.dom.client.Style.Visibility;
@@ -131,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;
@@ -146,9 +149,6 @@ public class VScrollTable extends FlowPanel implements HasWidgets,
private static final String ROW_HEADER_COLUMN_KEY = "0";
- public static final String CLASSNAME = "v-table";
- public static final String CLASSNAME_SELECTION_FOCUS = CLASSNAME + "-focus";
-
private static final double CACHE_RATE_DEFAULT = 2;
/**
@@ -516,12 +516,10 @@ public class VScrollTable extends FlowPanel implements HasWidgets,
public VScrollTable() {
setMultiSelectMode(MULTISELECT_MODE_DEFAULT);
- scrollBodyPanel.addStyleName(CLASSNAME + "-body-wrapper");
scrollBodyPanel.addFocusHandler(this);
scrollBodyPanel.addBlurHandler(this);
scrollBodyPanel.addScrollHandler(this);
- scrollBodyPanel.addStyleName(CLASSNAME + "-body");
/*
* Firefox auto-repeat works correctly only if we use a key press
@@ -546,7 +544,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets,
}
}, ContextMenuEvent.getType());
- setStyleName(CLASSNAME);
+ setStyleName(STYLENAME);
add(tHead);
add(scrollBodyPanel);
@@ -555,6 +553,43 @@ public class VScrollTable extends FlowPanel implements HasWidgets,
rowRequestHandler = new RowRequestHandler();
}
+ @Override
+ public void setStyleName(String style) {
+ updateStyleNames(style, false);
+ }
+
+ @Override
+ public void setStylePrimaryName(String style) {
+ updateStyleNames(style, true);
+ }
+
+ private void updateStyleNames(String newStyle, boolean isPrimary) {
+ scrollBodyPanel
+ .removeStyleName(getStylePrimaryName() + "-body-wrapper");
+ scrollBodyPanel.removeStyleName(getStylePrimaryName() + "-body");
+
+ if (scrollBody != null) {
+ scrollBody.removeStyleName(getStylePrimaryName()
+ + "-body-noselection");
+ }
+
+ if (isPrimary) {
+ super.setStylePrimaryName(newStyle);
+ } else {
+ super.setStyleName(newStyle);
+ }
+
+ scrollBodyPanel.addStyleName(getStylePrimaryName() + "-body-wrapper");
+ scrollBodyPanel.addStyleName(getStylePrimaryName() + "-body");
+
+ tHead.updateStyleNames(getStylePrimaryName());
+ tFoot.updateStyleNames(getStylePrimaryName());
+
+ if (scrollBody != null) {
+ scrollBody.updateStyleNames(getStylePrimaryName());
+ }
+ }
+
public void init(ApplicationConnection client) {
this.client = client;
// Add a handler to clear saved context menu details when the menu
@@ -1941,7 +1976,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets,
private void announceScrollPosition() {
if (scrollPositionElement == null) {
scrollPositionElement = DOM.createDiv();
- scrollPositionElement.setClassName(CLASSNAME + "-scrollposition");
+ scrollPositionElement.setClassName(getStylePrimaryName()
+ + "-scrollposition");
scrollPositionElement.getStyle().setPosition(Position.ABSOLUTE);
scrollPositionElement.getStyle().setDisplay(Display.NONE);
getElement().appendChild(scrollPositionElement);
@@ -2180,24 +2216,15 @@ public class VScrollTable extends FlowPanel implements HasWidgets,
public HeaderCell(String colId, String headerText) {
cid = colId;
- DOM.setElementProperty(colResizeWidget, "className", CLASSNAME
- + "-resizer");
-
setText(headerText);
- DOM.appendChild(td, colResizeWidget);
-
- DOM.setElementProperty(sortIndicator, "className", CLASSNAME
- + "-sort-indicator");
- DOM.appendChild(td, sortIndicator);
-
- DOM.setElementProperty(captionContainer, "className", CLASSNAME
- + "-caption-container");
+ td.appendChild(colResizeWidget);
// ensure no clipping initially (problem on column additions)
- DOM.setStyleAttribute(captionContainer, "overflow", "visible");
+ captionContainer.getStyle().setOverflow(Overflow.VISIBLE);
- DOM.appendChild(td, captionContainer);
+ td.appendChild(sortIndicator);
+ td.appendChild(captionContainer);
DOM.sinkEvents(td, Event.MOUSEEVENTS | Event.ONDBLCLICK
| Event.ONCONTEXTMENU | Event.TOUCHEVENTS);
@@ -2207,6 +2234,38 @@ public class VScrollTable extends FlowPanel implements HasWidgets,
setAlign(ALIGN_LEFT);
}
+ protected void updateStyleNames(String primaryStyleName) {
+ colResizeWidget.setClassName(primaryStyleName + "-resizer");
+ sortIndicator.setClassName(primaryStyleName + "-sort-indicator");
+ captionContainer.setClassName(primaryStyleName
+ + "-caption-container");
+ if (sorted) {
+ if (sortAscending) {
+ setStyleName(primaryStyleName + "-header-cell-asc");
+ } else {
+ setStyleName(primaryStyleName + "-header-cell-desc");
+ }
+ } else {
+ setStyleName(primaryStyleName + "-header-cell");
+ }
+
+ final String ALIGN_PREFIX = primaryStyleName
+ + "-caption-container-align-";
+
+ switch (align) {
+ case ALIGN_CENTER:
+ captionContainer.addClassName(ALIGN_PREFIX + "center");
+ break;
+ case ALIGN_RIGHT:
+ captionContainer.addClassName(ALIGN_PREFIX + "right");
+ break;
+ default:
+ captionContainer.addClassName(ALIGN_PREFIX + "left");
+ break;
+ }
+
+ }
+
public void disableAutoWidthCalculation() {
definedWidth = true;
expandRatio = 0;
@@ -2280,15 +2339,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets,
private void setSorted(boolean sorted) {
this.sorted = sorted;
- if (sorted) {
- if (sortAscending) {
- this.setStyleName(CLASSNAME + "-header-cell-asc");
- } else {
- this.setStyleName(CLASSNAME + "-header-cell-desc");
- }
- } else {
- this.setStyleName(CLASSNAME + "-header-cell");
- }
+ updateStyleNames(VScrollTable.this.getStylePrimaryName());
}
/**
@@ -2342,7 +2393,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets,
floatingCopyOfHeaderCell = DOM
.getChild(floatingCopyOfHeaderCell, 2);
DOM.setElementProperty(floatingCopyOfHeaderCell, "className",
- CLASSNAME + "-header-drag");
+ VScrollTable.this.getStylePrimaryName() + "-header-drag");
// otherwise might wrap or be cut if narrow column
DOM.setStyleAttribute(floatingCopyOfHeaderCell, "width", "auto");
updateFloatingCopysPosition(DOM.getAbsoluteLeft(td),
@@ -2590,24 +2641,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets,
}
public void setAlign(char c) {
- final String ALIGN_PREFIX = CLASSNAME + "-caption-container-align-";
- if (align != c) {
- captionContainer.removeClassName(ALIGN_PREFIX + "center");
- captionContainer.removeClassName(ALIGN_PREFIX + "right");
- captionContainer.removeClassName(ALIGN_PREFIX + "left");
- switch (c) {
- case ALIGN_CENTER:
- captionContainer.addClassName(ALIGN_PREFIX + "center");
- break;
- case ALIGN_RIGHT:
- captionContainer.addClassName(ALIGN_PREFIX + "right");
- break;
- default:
- captionContainer.addClassName(ALIGN_PREFIX + "left");
- break;
- }
- }
align = c;
+ updateStyleNames(VScrollTable.this.getStylePrimaryName());
}
public char getAlign() {
@@ -2679,7 +2714,13 @@ public class VScrollTable extends FlowPanel implements HasWidgets,
RowHeadersHeaderCell() {
super(ROW_HEADER_COLUMN_KEY, "");
- this.setStyleName(CLASSNAME + "-header-cell-rowheader");
+ updateStyleNames(VScrollTable.this.getStylePrimaryName());
+ }
+
+ @Override
+ protected void updateStyleNames(String primaryStyleName) {
+ super.updateStyleNames(primaryStyleName);
+ setStyleName(primaryStyleName + "-header-cell-rowheader");
}
@Override
@@ -2714,12 +2755,6 @@ public class VScrollTable extends FlowPanel implements HasWidgets,
}
DOM.setStyleAttribute(hTableWrapper, "overflow", "hidden");
- DOM.setElementProperty(hTableWrapper, "className", CLASSNAME
- + "-header");
-
- // TODO move styles to CSS
- DOM.setElementProperty(columnSelector, "className", CLASSNAME
- + "-column-selector");
DOM.setStyleAttribute(columnSelector, "display", "none");
DOM.appendChild(table, headerTableBody);
@@ -2730,14 +2765,21 @@ public class VScrollTable extends FlowPanel implements HasWidgets,
DOM.appendChild(div, columnSelector);
setElement(div);
- setStyleName(CLASSNAME + "-header-wrap");
-
DOM.sinkEvents(columnSelector, Event.ONCLICK);
availableCells.put(ROW_HEADER_COLUMN_KEY,
new RowHeadersHeaderCell());
}
+ protected void updateStyleNames(String primaryStyleName) {
+ hTableWrapper.setClassName(primaryStyleName + "-header");
+ columnSelector.setClassName(primaryStyleName + "-column-selector");
+ setStyleName(primaryStyleName + "-header-wrap");
+ for (HeaderCell c : availableCells.values()) {
+ c.updateStyleNames(primaryStyleName);
+ }
+ }
+
public void resizeCaptionContainer(HeaderCell cell) {
HeaderCell lastcell = getHeaderCell(visibleCells.size() - 1);
@@ -3004,15 +3046,17 @@ public class VScrollTable extends FlowPanel implements HasWidgets,
private void focusSlot(int index) {
removeSlotFocus();
if (index > 0) {
- DOM.setElementProperty(
- DOM.getFirstChild(DOM.getChild(tr, index - 1)),
- "className", CLASSNAME + "-resizer " + CLASSNAME
- + "-focus-slot-right");
+ Element child = tr.getChild(index - 1).getFirstChild().cast();
+ child.setClassName(VScrollTable.this.getStylePrimaryName()
+ + "-resizer");
+ child.addClassName(VScrollTable.this.getStylePrimaryName()
+ + "-focus-slot-right");
} else {
- DOM.setElementProperty(
- DOM.getFirstChild(DOM.getChild(tr, index)),
- "className", CLASSNAME + "-resizer " + CLASSNAME
- + "-focus-slot-left");
+ Element child = tr.getChild(index).getFirstChild().cast();
+ child.setClassName(VScrollTable.this.getStylePrimaryName()
+ + "-resizer");
+ child.addClassName(VScrollTable.this.getStylePrimaryName()
+ + "-focus-slot-left");
}
focusedSlot = index;
}
@@ -3022,13 +3066,14 @@ public class VScrollTable extends FlowPanel implements HasWidgets,
return;
}
if (focusedSlot == 0) {
- DOM.setElementProperty(
- DOM.getFirstChild(DOM.getChild(tr, focusedSlot)),
- "className", CLASSNAME + "-resizer");
+ Element child = tr.getChild(focusedSlot).getFirstChild().cast();
+ child.setClassName(VScrollTable.this.getStylePrimaryName()
+ + "-resizer");
} else if (focusedSlot > 0) {
- DOM.setElementProperty(
- DOM.getFirstChild(DOM.getChild(tr, focusedSlot - 1)),
- "className", CLASSNAME + "-resizer");
+ Element child = tr.getChild(focusedSlot - 1).getFirstChild()
+ .cast();
+ child.setClassName(VScrollTable.this.getStylePrimaryName()
+ + "-resizer");
}
focusedSlot = -1;
}
@@ -3228,9 +3273,6 @@ public class VScrollTable extends FlowPanel implements HasWidgets,
setText(headerText);
- DOM.setElementProperty(captionContainer, "className", CLASSNAME
- + "-footer-container");
-
// ensure no clipping initially (problem on column additions)
DOM.setStyleAttribute(captionContainer, "overflow", "visible");
@@ -3242,6 +3284,13 @@ public class VScrollTable extends FlowPanel implements HasWidgets,
| Event.ONCONTEXTMENU);
setElement(td);
+
+ updateStyleNames(VScrollTable.this.getStylePrimaryName());
+ }
+
+ protected void updateStyleNames(String primaryStyleName) {
+ captionContainer.setClassName(primaryStyleName
+ + "-footer-container");
}
/**
@@ -3555,8 +3604,6 @@ public class VScrollTable extends FlowPanel implements HasWidgets,
public TableFooter() {
DOM.setStyleAttribute(hTableWrapper, "overflow", "hidden");
- DOM.setElementProperty(hTableWrapper, "className", CLASSNAME
- + "-footer");
DOM.appendChild(table, headerTableBody);
DOM.appendChild(headerTableBody, tr);
@@ -3565,10 +3612,18 @@ public class VScrollTable extends FlowPanel implements HasWidgets,
DOM.appendChild(div, hTableWrapper);
setElement(div);
- setStyleName(CLASSNAME + "-footer-wrap");
-
availableCells.put(ROW_HEADER_COLUMN_KEY,
new RowHeadersFooterCell());
+
+ updateStyleNames(VScrollTable.this.getStylePrimaryName());
+ }
+
+ protected void updateStyleNames(String primaryStyleName) {
+ hTableWrapper.setClassName(primaryStyleName + "-footer");
+ setStyleName(primaryStyleName + "-footer-wrap");
+ for (FooterCell c : availableCells.values()) {
+ c.updateStyleNames(primaryStyleName);
+ }
}
@Override
@@ -3872,14 +3927,9 @@ public class VScrollTable extends FlowPanel implements HasWidgets,
}
private void constructDOM() {
- DOM.setElementProperty(table, "className", CLASSNAME + "-table");
if (BrowserInfo.get().isIE()) {
table.setPropertyInt("cellSpacing", 0);
}
- DOM.setElementProperty(preSpacer, "className", CLASSNAME
- + "-row-spacer");
- DOM.setElementProperty(postSpacer, "className", CLASSNAME
- + "-row-spacer");
table.appendChild(tBodyElement);
DOM.appendChild(container, preSpacer);
@@ -3893,7 +3943,17 @@ public class VScrollTable extends FlowPanel implements HasWidgets,
"translate3d(0,0,0)");
}
}
+ updateStyleNames(VScrollTable.this.getStylePrimaryName());
+ }
+ protected void updateStyleNames(String primaryStyleName) {
+ table.setClassName(primaryStyleName + "-table");
+ preSpacer.setClassName(primaryStyleName + "-row-spacer");
+ postSpacer.setClassName(primaryStyleName + "-row-spacer");
+ for (Widget w : renderedRows) {
+ VScrollTableRow row = (VScrollTableRow) w;
+ row.updateStyleNames(primaryStyleName);
+ }
}
public int getAvailableWidth() {
@@ -4367,6 +4427,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets,
if (rows.getLength() == 0) {
/* need to temporary add empty row and detect */
VScrollTableRow scrollTableRow = new VScrollTableRow();
+ scrollTableRow.updateStyleNames(VScrollTable.this
+ .getStylePrimaryName());
tBodyElement.appendChild(scrollTableRow.getElement());
detectExtrawidth();
tBodyElement.removeChild(scrollTableRow.getElement());
@@ -4450,9 +4512,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets,
private final TableRowElement rowElement;
private int index;
private Event touchStart;
- private static final String ROW_CLASSNAME_EVEN = CLASSNAME + "-row";
- private static final String ROW_CLASSNAME_ODD = CLASSNAME
- + "-row-odd";
+
private static final int TOUCH_CONTEXT_MENU_TIMEOUT = 500;
private Timer contextTouchTimeout;
private Timer dragTouchTimeout;
@@ -4461,6 +4521,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets,
private TooltipInfo tooltipInfo = null;
private Map<TableCellElement, TooltipInfo> cellToolTips = new HashMap<TableCellElement, TooltipInfo>();
private boolean isDragging = false;
+ private String rowStyle = null;
private VScrollTableRow(int rowKey) {
this.rowKey = rowKey;
@@ -4480,10 +4541,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets,
*/
getElement().getStyle().setProperty("visibility", "hidden");
- String rowStyle = uidl.getStringAttribute("rowstyle");
- if (rowStyle != null) {
- addStyleName(CLASSNAME + "-row-" + rowStyle);
- }
+ rowStyle = uidl.getStringAttribute("rowstyle");
+ updateStyleNames(VScrollTable.this.getStylePrimaryName());
String rowDescription = uidl.getStringAttribute("rowdescr");
if (rowDescription != null && !rowDescription.equals("")) {
@@ -4515,6 +4574,25 @@ public class VScrollTable extends FlowPanel implements HasWidgets,
}
}
+ protected void updateStyleNames(String primaryStyleName) {
+
+ if (getStylePrimaryName().contains("odd")) {
+ setStyleName(primaryStyleName + "-row-odd");
+ } else {
+ setStyleName(primaryStyleName + "-row");
+ }
+
+ if (rowStyle != null) {
+ addStyleName(primaryStyleName + "-row-" + rowStyle);
+ }
+
+ for (int i = 0; i < rowElement.getChildCount(); i++) {
+ TableCellElement cell = (TableCellElement) rowElement
+ .getChild(i);
+ updateCellStyleNames(cell, primaryStyleName);
+ }
+ }
+
public TooltipInfo getTooltipInfo() {
return tooltipInfo;
}
@@ -4524,7 +4602,6 @@ public class VScrollTable extends FlowPanel implements HasWidgets,
*/
public VScrollTableRow() {
this(0);
- addStyleName(CLASSNAME + "-row");
addCell(null, "_", 'b', "", true, false);
}
@@ -4635,12 +4712,16 @@ public class VScrollTable extends FlowPanel implements HasWidgets,
//
// First remove any old styles so that both styles aren't
// applied when indexes are updated.
- removeStyleName(ROW_CLASSNAME_ODD);
- removeStyleName(ROW_CLASSNAME_EVEN);
+ String primaryStyleName = getStylePrimaryName();
+ if (primaryStyleName != null && !primaryStyleName.equals("")) {
+ removeStyleName(getStylePrimaryName());
+ }
if (!isOdd) {
- addStyleName(ROW_CLASSNAME_ODD);
+ addStyleName(VScrollTable.this.getStylePrimaryName()
+ + "-row-odd");
} else {
- addStyleName(ROW_CLASSNAME_EVEN);
+ addStyleName(VScrollTable.this.getStylePrimaryName()
+ + "-row");
}
}
@@ -4676,15 +4757,22 @@ public class VScrollTable extends FlowPanel implements HasWidgets,
String style, boolean textIsHTML, boolean sorted,
String description, final TableCellElement td) {
final Element container = DOM.createDiv();
- String className = CLASSNAME + "-cell-content";
+ container.setClassName(VScrollTable.this.getStylePrimaryName()
+ + "-cell-wrapper");
+
+ td.setClassName(VScrollTable.this.getStylePrimaryName()
+ + "-cell-content");
+
if (style != null && !style.equals("")) {
- className += " " + CLASSNAME + "-cell-content-" + style;
+ td.addClassName(VScrollTable.this.getStylePrimaryName()
+ + "-cell-content-" + style);
}
+
if (sorted) {
- className += " " + CLASSNAME + "-cell-content-sorted";
+ td.addClassName(VScrollTable.this.getStylePrimaryName()
+ + "-cell-content-sorted");
}
- td.setClassName(className);
- container.setClassName(CLASSNAME + "-cell-wrapper");
+
if (textIsHTML) {
container.setInnerHTML(text);
} else {
@@ -4713,6 +4801,20 @@ public class VScrollTable extends FlowPanel implements HasWidgets,
getElement().appendChild(td);
}
+ protected void updateCellStyleNames(TableCellElement td,
+ String primaryStyleName) {
+ Element container = td.getFirstChild().cast();
+ container.setClassName(primaryStyleName + "-cell-wrapper");
+
+ /*
+ * Replace old primary style name with new one
+ */
+ String className = td.getClassName();
+ String oldPrimaryName = className.split("-cell-content")[0];
+ td.setClassName(className.replaceAll(oldPrimaryName,
+ primaryStyleName));
+ }
+
public void addCell(UIDL rowUidl, Widget w, char align,
String style, boolean sorted) {
final TableCellElement td = DOM.createTD().cast();
@@ -4722,15 +4824,19 @@ public class VScrollTable extends FlowPanel implements HasWidgets,
protected void initCellWithWidget(Widget w, char align,
String style, boolean sorted, final TableCellElement td) {
final Element container = DOM.createDiv();
- String className = CLASSNAME + "-cell-content";
+ String className = VScrollTable.this.getStylePrimaryName()
+ + "-cell-content";
if (style != null && !style.equals("")) {
- className += " " + CLASSNAME + "-cell-content-" + style;
+ className += " " + VScrollTable.this.getStylePrimaryName()
+ + "-cell-content-" + style;
}
if (sorted) {
- className += " " + CLASSNAME + "-cell-content-sorted";
+ className += " " + VScrollTable.this.getStylePrimaryName()
+ + "-cell-content-sorted";
}
td.setClassName(className);
- container.setClassName(CLASSNAME + "-cell-wrapper");
+ container.setClassName(VScrollTable.this.getStylePrimaryName()
+ + "-cell-wrapper");
// TODO most components work with this, but not all (e.g.
// Select)
// Old comment: make widget cells respect align.
@@ -6319,7 +6425,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets,
}
private void deEmphasis() {
- UIObject.setStyleName(getElement(), CLASSNAME + "-drag", false);
+ UIObject.setStyleName(getElement(),
+ VScrollTable.this.getStylePrimaryName() + "-drag", false);
if (lastEmphasized == null) {
return;
}
@@ -6344,7 +6451,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets,
*/
private void emphasis(TableDDDetails details) {
deEmphasis();
- UIObject.setStyleName(getElement(), CLASSNAME + "-drag", true);
+ UIObject.setStyleName(getElement(),
+ VScrollTable.this.getStylePrimaryName() + "-drag", true);
// iterate old and new emphasized row
for (Widget w : scrollBody.renderedRows) {
VScrollTableRow row = (VScrollTableRow) w;
@@ -6395,13 +6503,13 @@ public class VScrollTable extends FlowPanel implements HasWidgets,
// Remove previous selection
if (focusedRow != null && focusedRow != row) {
- focusedRow.removeStyleName(CLASSNAME_SELECTION_FOCUS);
+ focusedRow.removeStyleName(getStylePrimaryName());
}
if (row != null) {
// Apply focus style to new selection
- row.addStyleName(CLASSNAME_SELECTION_FOCUS);
+ row.addStyleName(getStylePrimaryName() + "-focus");
/*
* Trying to set focus on already focused row
diff --git a/client/src/com/vaadin/client/ui/tabsheet/TabsheetConnector.java b/client/src/com/vaadin/client/ui/tabsheet/TabsheetConnector.java
index 9c30d1037d..aff5af2a95 100644
--- a/client/src/com/vaadin/client/ui/tabsheet/TabsheetConnector.java
+++ b/client/src/com/vaadin/client/ui/tabsheet/TabsheetConnector.java
@@ -25,6 +25,7 @@ import com.vaadin.client.Util;
import com.vaadin.client.ui.SimpleManagedLayout;
import com.vaadin.client.ui.layout.MayScrollChildren;
import com.vaadin.shared.ui.Connect;
+import com.vaadin.shared.ui.tabsheet.TabsheetState;
import com.vaadin.ui.TabSheet;
@Connect(TabSheet.class)
@@ -82,6 +83,11 @@ public class TabsheetConnector extends TabsheetBaseConnector implements
}
@Override
+ public TabsheetState getState() {
+ return (TabsheetState) super.getState();
+ }
+
+ @Override
public void updateCaption(ComponentConnector component) {
/* Tabsheet does not render its children's captions */
}
diff --git a/client/src/com/vaadin/client/ui/tree/TreeConnector.java b/client/src/com/vaadin/client/ui/tree/TreeConnector.java
index 10a3c0fb95..b7491f8d92 100644
--- a/client/src/com/vaadin/client/ui/tree/TreeConnector.java
+++ b/client/src/com/vaadin/client/ui/tree/TreeConnector.java
@@ -28,10 +28,10 @@ import com.vaadin.client.UIDL;
import com.vaadin.client.Util;
import com.vaadin.client.ui.AbstractComponentConnector;
import com.vaadin.client.ui.tree.VTree.TreeNode;
-import com.vaadin.shared.AbstractFieldState;
import com.vaadin.shared.ui.Connect;
import com.vaadin.shared.ui.MultiSelectMode;
import com.vaadin.shared.ui.tree.TreeConstants;
+import com.vaadin.shared.ui.tree.TreeState;
import com.vaadin.ui.Tree;
@Connect(Tree.class)
@@ -262,8 +262,8 @@ public class TreeConnector extends AbstractComponentConnector implements
}
@Override
- public AbstractFieldState getState() {
- return (AbstractFieldState) super.getState();
+ public TreeState getState() {
+ return (TreeState) super.getState();
}
@Override
diff --git a/client/src/com/vaadin/client/ui/treetable/TreeTableConnector.java b/client/src/com/vaadin/client/ui/treetable/TreeTableConnector.java
index 5bf1beaf16..4539fbd12a 100644
--- a/client/src/com/vaadin/client/ui/treetable/TreeTableConnector.java
+++ b/client/src/com/vaadin/client/ui/treetable/TreeTableConnector.java
@@ -23,6 +23,7 @@ import com.vaadin.client.ui.table.VScrollTable.VScrollTableBody.VScrollTableRow;
import com.vaadin.client.ui.treetable.VTreeTable.PendingNavigationEvent;
import com.vaadin.shared.ui.Connect;
import com.vaadin.shared.ui.treetable.TreeTableConstants;
+import com.vaadin.shared.ui.treetable.TreeTableState;
import com.vaadin.ui.TreeTable;
@Connect(TreeTable.class)
@@ -105,4 +106,9 @@ public class TreeTableConnector extends TableConnector {
public VTreeTable getWidget() {
return (VTreeTable) super.getWidget();
}
+
+ @Override
+ public TreeTableState getState() {
+ return (TreeTableState) super.getState();
+ }
}
diff --git a/client/src/com/vaadin/client/ui/twincolselect/TwinColSelectConnector.java b/client/src/com/vaadin/client/ui/twincolselect/TwinColSelectConnector.java
index 745de9fe6c..f9767bb727 100644
--- a/client/src/com/vaadin/client/ui/twincolselect/TwinColSelectConnector.java
+++ b/client/src/com/vaadin/client/ui/twincolselect/TwinColSelectConnector.java
@@ -21,6 +21,7 @@ import com.vaadin.client.DirectionalManagedLayout;
import com.vaadin.client.UIDL;
import com.vaadin.client.ui.optiongroup.OptionGroupBaseConnector;
import com.vaadin.shared.ui.Connect;
+import com.vaadin.shared.ui.twincolselect.TwinColSelectState;
import com.vaadin.ui.TwinColSelect;
@Connect(TwinColSelect.class)
@@ -58,6 +59,11 @@ public class TwinColSelectConnector extends OptionGroupBaseConnector implements
}
@Override
+ public TwinColSelectState getState() {
+ return (TwinColSelectState) super.getState();
+ }
+
+ @Override
public void layoutVertically() {
if (isUndefinedHeight()) {
getWidget().clearInternalHeights();
diff --git a/client/src/com/vaadin/client/ui/twincolselect/VTwinColSelect.java b/client/src/com/vaadin/client/ui/twincolselect/VTwinColSelect.java
index cd985876df..494db81e40 100644
--- a/client/src/com/vaadin/client/ui/twincolselect/VTwinColSelect.java
+++ b/client/src/com/vaadin/client/ui/twincolselect/VTwinColSelect.java
@@ -48,7 +48,7 @@ import com.vaadin.shared.ui.twincolselect.TwinColSelectConstants;
public class VTwinColSelect extends VOptionGroupBase implements KeyDownHandler,
MouseDownHandler, DoubleClickHandler, SubPartAware {
- private static final String CLASSNAME = "v-select-twincol";
+ public static final String CLASSNAME = "v-select-twincol";
private static final int VISIBLE_COUNT = 10;
diff --git a/client/src/com/vaadin/client/ui/video/VVideo.java b/client/src/com/vaadin/client/ui/video/VVideo.java
index c1f5f1b353..2f9fbe44be 100644
--- a/client/src/com/vaadin/client/ui/video/VVideo.java
+++ b/client/src/com/vaadin/client/ui/video/VVideo.java
@@ -25,7 +25,7 @@ import com.vaadin.client.ui.VMediaBase;
public class VVideo extends VMediaBase {
- private static String CLASSNAME = "v-video";
+ public static String CLASSNAME = "v-video";
private VideoElement video;