diff options
author | Ahmed Ashour <asashour@yahoo.com> | 2017-09-21 12:35:06 +0200 |
---|---|---|
committer | Henri Sara <henri.sara@gmail.com> | 2017-09-21 13:35:06 +0300 |
commit | e118f4d860adeaca1690ef095906ae6be84f3cb5 (patch) | |
tree | 142f8464009b5aeecdea59827ea5980a76932ad4 | |
parent | a166d6f52bf99d7616959f8e16b3972ed6b074d0 (diff) | |
download | vaadin-framework-e118f4d860adeaca1690ef095906ae6be84f3cb5.tar.gz vaadin-framework-e118f4d860adeaca1690ef095906ae6be84f3cb5.zip |
Access static members in a static way (#10054)
11 files changed, 24 insertions, 25 deletions
diff --git a/client/src/main/java/com/vaadin/client/metadata/Type.java b/client/src/main/java/com/vaadin/client/metadata/Type.java index d598bf0271..587731aac6 100644 --- a/client/src/main/java/com/vaadin/client/metadata/Type.java +++ b/client/src/main/java/com/vaadin/client/metadata/Type.java @@ -133,7 +133,7 @@ public class Type { public Object createProxy(InvokationHandler invokationHandler) throws NoDataException { - return TypeDataStore.get().getProxyHandler(this) + return TypeDataStore.getProxyHandler(this) .createProxy(invokationHandler); } diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/datefield/AbstractDateFieldConnector.java b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/datefield/AbstractDateFieldConnector.java index 1c4932e6a4..8f0f9bf1b7 100644 --- a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/datefield/AbstractDateFieldConnector.java +++ b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/datefield/AbstractDateFieldConnector.java @@ -108,7 +108,7 @@ public class AbstractDateFieldConnector extends AbstractFieldConnector // Construct new date for this datefield (only if not null) if (year > -1) { - getWidget().setCurrentDate(new Date((long) getWidget().getTime(year, + getWidget().setCurrentDate(new Date((long) VDateField.getTime(year, month, day, hour, min, sec, 0))); } else { getWidget().setCurrentDate(null); diff --git a/uitest/src/main/java/com/vaadin/tests/application/ConfirmBrowserTabClose.java b/uitest/src/main/java/com/vaadin/tests/application/ConfirmBrowserTabClose.java index d977a4b079..f365c38ede 100644 --- a/uitest/src/main/java/com/vaadin/tests/application/ConfirmBrowserTabClose.java +++ b/uitest/src/main/java/com/vaadin/tests/application/ConfirmBrowserTabClose.java @@ -19,6 +19,7 @@ import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUIWithLog; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.JavaScript; public class ConfirmBrowserTabClose extends AbstractTestUIWithLog { @@ -38,7 +39,7 @@ public class ConfirmBrowserTabClose extends AbstractTestUIWithLog { } }); addComponent(b); - getPage().getJavaScript() + JavaScript .eval("window.addEventListener('beforeunload', function (e) {" + "var confirmationMessage = 'Please stay!';" + "e.returnValue = confirmationMessage;" diff --git a/uitest/src/main/java/com/vaadin/tests/components/gridlayout/GridLayoutRequiredIndicatorLocation.java b/uitest/src/main/java/com/vaadin/tests/components/gridlayout/GridLayoutRequiredIndicatorLocation.java index 10cf75be89..f1b564736c 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/gridlayout/GridLayoutRequiredIndicatorLocation.java +++ b/uitest/src/main/java/com/vaadin/tests/components/gridlayout/GridLayoutRequiredIndicatorLocation.java @@ -15,6 +15,7 @@ */ package com.vaadin.tests.components.gridlayout; +import com.vaadin.server.Page; import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractReindeerTestUI; import com.vaadin.ui.Alignment; @@ -31,13 +32,13 @@ public class GridLayoutRequiredIndicatorLocation @Override protected void setup(VaadinRequest request) { - getPage().getCurrent().getStyles() + Page.getCurrent().getStyles() .add(".allow-overflow { overflow: visible; }"); - getPage().getCurrent().getStyles() + Page.getCurrent().getStyles() .add(".colored { background: lime; overflow: visible; }"); - getPage().getCurrent().getStyles() + Page.getCurrent().getStyles() .add(".pink { background: pink; overflow: visible; }"); - getPage().getCurrent().getStyles() + Page.getCurrent().getStyles() .add(".v-gridlayout-slot { border: 1px solid red; }"); GridLayout rootLayout = new GridLayout(2, 2); diff --git a/uitest/src/main/java/com/vaadin/tests/components/uitest/components/AccordionsCssTest.java b/uitest/src/main/java/com/vaadin/tests/components/uitest/components/AccordionsCssTest.java index bca119815d..1cef44eafd 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/uitest/components/AccordionsCssTest.java +++ b/uitest/src/main/java/com/vaadin/tests/components/uitest/components/AccordionsCssTest.java @@ -43,9 +43,9 @@ public class AccordionsCssTest { Label l2 = new Label("There are no saved notes."); Label l3 = new Label("There are currently no issues."); - acc.addTab(l1, "Actions", new ThemeResource(parent.ICON_URL)); - acc.addTab(l2, "Notes", new ThemeResource(parent.ICON_URL)); - acc.addTab(l3, "Issues", new ThemeResource(parent.ICON_URL)); + acc.addTab(l1, "Actions", new ThemeResource(TestSampler.ICON_URL)); + acc.addTab(l2, "Notes", new ThemeResource(TestSampler.ICON_URL)); + acc.addTab(l3, "Issues", new ThemeResource(TestSampler.ICON_URL)); acc.getTab(l2).setEnabled(false); diff --git a/uitest/src/main/java/com/vaadin/tests/components/uitest/components/ButtonsCssTest.java b/uitest/src/main/java/com/vaadin/tests/components/uitest/components/ButtonsCssTest.java index 7811e5e79b..0e6d6b1902 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/uitest/components/ButtonsCssTest.java +++ b/uitest/src/main/java/com/vaadin/tests/components/uitest/components/ButtonsCssTest.java @@ -29,7 +29,7 @@ public class ButtonsCssTest extends GridLayout { addComponent(b); b = new Button("Button with icon"); - b.setIcon(new ThemeResource(parent.ICON_URL)); + b.setIcon(new ThemeResource(TestSampler.ICON_URL)); b.setId("button" + debugIdCounter++); addComponent(b); @@ -53,7 +53,7 @@ public class ButtonsCssTest extends GridLayout { addComponent(cb); cb = new CheckBox("Checkbox with icon"); - cb.setIcon(new ThemeResource(parent.ICON_URL)); + cb.setIcon(new ThemeResource(TestSampler.ICON_URL)); cb.setId("button" + debugIdCounter++); addComponent(cb); @@ -69,11 +69,11 @@ public class ButtonsCssTest extends GridLayout { createButtonWith("Tall", ChameleonTheme.BUTTON_TALL, null); createButtonWith("Borderless", ChameleonTheme.BUTTON_BORDERLESS, null); createButtonWith("Icn top", ChameleonTheme.BUTTON_ICON_ON_TOP, - parent.ICON_URL); + TestSampler.ICON_URL); createButtonWith("Icn right", ChameleonTheme.BUTTON_ICON_ON_RIGHT, - parent.ICON_URL); + TestSampler.ICON_URL); createButtonWith("Icon only", ChameleonTheme.BUTTON_ICON_ONLY, - parent.ICON_URL); + TestSampler.ICON_URL); createButtonWith("Down", ChameleonTheme.BUTTON_DOWN, null); } diff --git a/uitest/src/main/java/com/vaadin/tests/components/uitest/components/EmbeddedCssTest.java b/uitest/src/main/java/com/vaadin/tests/components/uitest/components/EmbeddedCssTest.java index 3108341216..81829a1127 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/uitest/components/EmbeddedCssTest.java +++ b/uitest/src/main/java/com/vaadin/tests/components/uitest/components/EmbeddedCssTest.java @@ -11,11 +11,11 @@ public class EmbeddedCssTest { public EmbeddedCssTest(TestSampler parent) { Embedded e = new Embedded("Embedded with a caption", - new ThemeResource(parent.ICON_URL)); + new ThemeResource(TestSampler.ICON_URL)); e.setId("embedded" + debugIdCounter); parent.addComponent(e); - e = new Embedded(null, new ThemeResource(parent.ICON_URL)); + e = new Embedded(null, new ThemeResource(TestSampler.ICON_URL)); e.setId("embedded" + debugIdCounter); parent.addComponent(e); diff --git a/uitest/src/main/java/com/vaadin/tests/components/uitest/components/LabelsCssTest.java b/uitest/src/main/java/com/vaadin/tests/components/uitest/components/LabelsCssTest.java index 1564d9d5b5..1aa05edb4f 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/uitest/components/LabelsCssTest.java +++ b/uitest/src/main/java/com/vaadin/tests/components/uitest/components/LabelsCssTest.java @@ -20,7 +20,7 @@ public class LabelsCssTest extends GridLayout { setColumns(5); createLabelWith(null, "Default empty label", null, null); - createLabelWith(null, "Label with icon", null, parent.ICON_URL); + createLabelWith(null, "Label with icon", null, TestSampler.ICON_URL); Label l = createLabelWith("The caption", "With caption and tooltip", null, null); l.setDescription("The tooltip"); diff --git a/uitest/src/main/java/com/vaadin/tests/components/uitest/components/LayoutsCssTest.java b/uitest/src/main/java/com/vaadin/tests/components/uitest/components/LayoutsCssTest.java index 11c9bc62bf..8106d8339c 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/uitest/components/LayoutsCssTest.java +++ b/uitest/src/main/java/com/vaadin/tests/components/uitest/components/LayoutsCssTest.java @@ -79,7 +79,7 @@ public class LayoutsCssTest extends GridLayout { horiz.setSplitPosition(50); horiz.setFirstComponent(new Label("Some content 1")); horiz.setSecondComponent(new Label("Some content 2")); - horiz.setIcon(new ThemeResource(parent.ICON_URL)); + horiz.setIcon(new ThemeResource(TestSampler.ICON_URL)); horiz.setCaption("HorizSplitPan"); horiz.setId("layout" + debugIdCounter++); @@ -137,7 +137,7 @@ public class LayoutsCssTest extends GridLayout { panelLayout.setMargin(true); Panel panel = new Panel(caption, panelLayout); panelLayout.addComponent(new Label("Some content")); - panel.setIcon(new ThemeResource(parent.ICON_URL)); + panel.setIcon(new ThemeResource(TestSampler.ICON_URL)); panel.setComponentError(new UserError("A error message...")); panel.setId("layout" + debugIdCounter++); diff --git a/uitest/src/main/java/com/vaadin/tests/components/uitest/components/TabSheetsCssTest.java b/uitest/src/main/java/com/vaadin/tests/components/uitest/components/TabSheetsCssTest.java index f94e87c813..08b2051f82 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/uitest/components/TabSheetsCssTest.java +++ b/uitest/src/main/java/com/vaadin/tests/components/uitest/components/TabSheetsCssTest.java @@ -10,12 +10,9 @@ import com.vaadin.v7.ui.themes.Runo; public class TabSheetsCssTest { - private TestSampler parent; private int debugIdCounter = 0; public TabSheetsCssTest(TestSampler parent) { - this.parent = parent; - TabSheet basic = createTabSheetWith("Basic TabSheet", null); parent.addComponent(basic); @@ -59,7 +56,7 @@ public class TabSheetsCssTest { ts.getTab(content2).setClosable(true); Label content3 = new Label("Third Component"); - ts.addTab(content3, "Third", new ThemeResource(parent.ICON_URL)); + ts.addTab(content3, "Third", new ThemeResource(TestSampler.ICON_URL)); ts.getTab(content3).setEnabled(false); if (styleName != null) { diff --git a/uitest/src/main/java/com/vaadin/tests/components/uitest/components/TablesCssTest.java b/uitest/src/main/java/com/vaadin/tests/components/uitest/components/TablesCssTest.java index 520722ba7b..4771df9f3a 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/uitest/components/TablesCssTest.java +++ b/uitest/src/main/java/com/vaadin/tests/components/uitest/components/TablesCssTest.java @@ -68,7 +68,7 @@ public class TablesCssTest extends GridLayout { t.setColumnCollapsingAllowed(true); // t.setColumnHeaders(new String[] { "Country", "Code", "Icon file" }); t.setColumnIcon(TestUtils.iso3166_PROPERTY_NAME, - new ThemeResource(parent.ICON_URL)); + new ThemeResource(TestSampler.ICON_URL)); // Actions (a.k.a context menu) t.addActionHandler(new Action.Handler() { |