diff options
author | Artur Signell <artur@vaadin.com> | 2016-08-30 13:16:41 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2016-08-30 14:09:58 +0000 |
commit | b965c256e86dd14b8baf607f4456da58f6f1d21a (patch) | |
tree | baa94383dba95bbf3628d4aa593bcad30827cbd6 /compatibility-client | |
parent | b30006bf24791d68fa8c5322564e6224803031e2 (diff) | |
download | vaadin-framework-b965c256e86dd14b8baf607f4456da58f6f1d21a.tar.gz vaadin-framework-b965c256e86dd14b8baf607f4456da58f6f1d21a.zip |
Move and duplicate client side and state to compatibility package
* Calendar
* CheckBox
* CustomField
* Label
* RichTextArea
* TextField
* TextArea
Change-Id: Iba8915195e4d205fb4db9a4df5d96a4a10ab2f96
Diffstat (limited to 'compatibility-client')
17 files changed, 113 insertions, 24 deletions
diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VCalendar.java b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VCalendar.java index dbe42ce1e9..9130a3faec 100644 --- a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VCalendar.java +++ b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VCalendar.java @@ -31,7 +31,6 @@ import com.google.gwt.user.client.ui.DockPanel; import com.google.gwt.user.client.ui.ScrollPanel; import com.google.gwt.user.client.ui.Widget; import com.vaadin.client.ui.dd.VHasDropHandler; -import com.vaadin.shared.ui.calendar.DateConstants; import com.vaadin.v7.client.ui.calendar.schedule.CalendarDay; import com.vaadin.v7.client.ui.calendar.schedule.CalendarEvent; import com.vaadin.v7.client.ui.calendar.schedule.DayToolbar; @@ -42,6 +41,7 @@ import com.vaadin.v7.client.ui.calendar.schedule.SimpleWeekToolbar; import com.vaadin.v7.client.ui.calendar.schedule.WeekGrid; import com.vaadin.v7.client.ui.calendar.schedule.WeeklyLongEvents; import com.vaadin.v7.client.ui.calendar.schedule.dd.CalendarDropHandler; +import com.vaadin.v7.shared.ui.calendar.DateConstants; /** * Client side implementation for Calendar diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VCustomComponent.java b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VCustomComponent.java new file mode 100644 index 0000000000..fc76e269ac --- /dev/null +++ b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VCustomComponent.java @@ -0,0 +1,30 @@ +/* + * Copyright 2000-2016 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.vaadin.v7.client.ui; + +import com.google.gwt.user.client.ui.SimplePanel; + +public class VCustomComponent extends SimplePanel { + + private static final String CLASSNAME = "v-customcomponent"; + + public VCustomComponent() { + super(); + setStyleName(CLASSNAME); + } + +} diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VLabel.java b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VLabel.java new file mode 100644 index 0000000000..ebe28c0d31 --- /dev/null +++ b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VLabel.java @@ -0,0 +1,60 @@ +/* + * Copyright 2000-2016 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.vaadin.v7.client.ui; + +import com.google.gwt.user.client.Event; +import com.google.gwt.user.client.ui.HTML; +import com.vaadin.client.Util; +import com.vaadin.client.VTooltip; + +public class VLabel extends HTML { + + public static final String CLASSNAME = "v-label"; + private static final String CLASSNAME_UNDEFINED_WIDTH = "v-label-undef-w"; + + public VLabel() { + super(); + setStyleName(CLASSNAME); + sinkEvents(VTooltip.TOOLTIP_EVENTS); + } + + public VLabel(String text) { + super(text); + setStyleName(CLASSNAME); + } + + @Override + public void onBrowserEvent(Event event) { + super.onBrowserEvent(event); + if (event.getTypeInt() == Event.ONLOAD) { + Util.notifyParentOfSizeChange(this, true); + event.stopPropagation(); + return; + } + } + + @Override + public void setWidth(String width) { + super.setWidth(width); + if (width == null || width.equals("")) { + setStyleName(getElement(), CLASSNAME_UNDEFINED_WIDTH, true); + } else { + setStyleName(getElement(), CLASSNAME_UNDEFINED_WIDTH, false); + } + } + +} diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VScrollTable.java b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VScrollTable.java index 252f78ca86..524e7f88cf 100644 --- a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VScrollTable.java +++ b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VScrollTable.java @@ -102,7 +102,6 @@ import com.vaadin.client.ui.TouchScrollDelegate; import com.vaadin.client.ui.TreeAction; import com.vaadin.client.ui.VContextMenu; import com.vaadin.client.ui.VEmbedded; -import com.vaadin.client.ui.VLabel; import com.vaadin.client.ui.VOverlay; import com.vaadin.client.ui.dd.DDUtil; import com.vaadin.client.ui.dd.VAbstractDropHandler; diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VTextField.java b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VTextField.java index 9fb529ff20..36d272644e 100644 --- a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VTextField.java +++ b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/VTextField.java @@ -37,7 +37,7 @@ import com.vaadin.client.BrowserInfo; import com.vaadin.client.WidgetUtil; import com.vaadin.client.ui.Field; import com.vaadin.shared.EventId; -import com.vaadin.shared.v7.ui.textfield.LegacyTextFieldConstants; +import com.vaadin.v7.shared.ui.textfield.LegacyTextFieldConstants; /** * This class represents a basic text input field with one row. diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/calendar/CalendarConnector.java b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/calendar/CalendarConnector.java index 6ce348d0d0..ea3aa49833 100644 --- a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/calendar/CalendarConnector.java +++ b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/calendar/CalendarConnector.java @@ -45,11 +45,6 @@ import com.vaadin.client.ui.ActionOwner; import com.vaadin.client.ui.SimpleManagedLayout; import com.vaadin.shared.ui.Connect; import com.vaadin.shared.ui.Connect.LoadStyle; -import com.vaadin.shared.ui.calendar.CalendarClientRpc; -import com.vaadin.shared.ui.calendar.CalendarEventId; -import com.vaadin.shared.ui.calendar.CalendarServerRpc; -import com.vaadin.shared.ui.calendar.CalendarState; -import com.vaadin.shared.ui.calendar.DateConstants; import com.vaadin.v7.client.ui.VCalendar; import com.vaadin.v7.client.ui.VCalendar.BackwardListener; import com.vaadin.v7.client.ui.VCalendar.DateClickListener; @@ -72,6 +67,11 @@ import com.vaadin.v7.client.ui.calendar.schedule.DateCell.DateCellSlot; import com.vaadin.v7.client.ui.calendar.schedule.dd.CalendarDropHandler; import com.vaadin.v7.client.ui.calendar.schedule.dd.CalendarMonthDropHandler; import com.vaadin.v7.client.ui.calendar.schedule.dd.CalendarWeekDropHandler; +import com.vaadin.v7.shared.ui.calendar.CalendarClientRpc; +import com.vaadin.v7.shared.ui.calendar.CalendarEventId; +import com.vaadin.v7.shared.ui.calendar.CalendarServerRpc; +import com.vaadin.v7.shared.ui.calendar.CalendarState; +import com.vaadin.v7.shared.ui.calendar.DateConstants; import com.vaadin.v7.ui.Calendar; /** diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/calendar/VCalendarAction.java b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/calendar/VCalendarAction.java index a5c54e5c4a..9e81ea22dc 100644 --- a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/calendar/VCalendarAction.java +++ b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/calendar/VCalendarAction.java @@ -19,9 +19,9 @@ import java.util.Date; import com.google.gwt.i18n.client.DateTimeFormat; import com.vaadin.client.ui.Action; -import com.vaadin.shared.ui.calendar.CalendarServerRpc; -import com.vaadin.shared.ui.calendar.DateConstants; import com.vaadin.v7.client.ui.calendar.schedule.CalendarEvent; +import com.vaadin.v7.shared.ui.calendar.CalendarServerRpc; +import com.vaadin.v7.shared.ui.calendar.DateConstants; /** * Action performed by the calendar diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/calendar/schedule/CalendarEvent.java b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/calendar/schedule/CalendarEvent.java index dfb84f3788..abb657c4b4 100644 --- a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/calendar/schedule/CalendarEvent.java +++ b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/calendar/schedule/CalendarEvent.java @@ -18,7 +18,7 @@ package com.vaadin.v7.client.ui.calendar.schedule; import java.util.Date; import com.google.gwt.i18n.client.DateTimeFormat; -import com.vaadin.shared.ui.calendar.DateConstants; +import com.vaadin.v7.shared.ui.calendar.DateConstants; /** * A client side implementation of a calendar event diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/calendar/schedule/DateCellDayEvent.java b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/calendar/schedule/DateCellDayEvent.java index 52c4e56a21..5695365db8 100644 --- a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/calendar/schedule/DateCellDayEvent.java +++ b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/calendar/schedule/DateCellDayEvent.java @@ -42,7 +42,7 @@ import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.Event; import com.google.gwt.user.client.ui.HorizontalPanel; import com.vaadin.client.WidgetUtil; -import com.vaadin.shared.ui.calendar.DateConstants; +import com.vaadin.v7.shared.ui.calendar.DateConstants; /** * Internally used by the calendar diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/calendar/schedule/DateUtil.java b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/calendar/schedule/DateUtil.java index b8abb31262..d0ed6f9149 100644 --- a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/calendar/schedule/DateUtil.java +++ b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/calendar/schedule/DateUtil.java @@ -18,7 +18,7 @@ package com.vaadin.v7.client.ui.calendar.schedule; import java.util.Date; import com.google.gwt.i18n.client.DateTimeFormat; -import com.vaadin.shared.ui.calendar.DateConstants; +import com.vaadin.v7.shared.ui.calendar.DateConstants; /** * Utility class for {@link Date} operations diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/calendar/schedule/SimpleDayCell.java b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/calendar/schedule/SimpleDayCell.java index eb206824ec..f671d7c21d 100644 --- a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/calendar/schedule/SimpleDayCell.java +++ b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/calendar/schedule/SimpleDayCell.java @@ -38,8 +38,8 @@ import com.google.gwt.user.client.ui.HTML; import com.google.gwt.user.client.ui.Label; import com.google.gwt.user.client.ui.Widget; import com.vaadin.client.ui.FocusableFlowPanel; -import com.vaadin.shared.ui.calendar.DateConstants; import com.vaadin.v7.client.ui.VCalendar; +import com.vaadin.v7.shared.ui.calendar.DateConstants; /** * A class representing a single cell within the calendar in month-view diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/calendar/schedule/WeekGrid.java b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/calendar/schedule/WeekGrid.java index 687333e4b8..736c5d873f 100644 --- a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/calendar/schedule/WeekGrid.java +++ b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/calendar/schedule/WeekGrid.java @@ -32,8 +32,8 @@ import com.google.gwt.user.client.ui.SimplePanel; import com.google.gwt.user.client.ui.Widget; import com.vaadin.client.DateTimeService; import com.vaadin.client.WidgetUtil; -import com.vaadin.shared.ui.calendar.DateConstants; import com.vaadin.v7.client.ui.VCalendar; +import com.vaadin.v7.shared.ui.calendar.DateConstants; /** * diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/checkbox/CheckBoxConnector.java b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/checkbox/CheckBoxConnector.java index 67e83a754f..5d103e419f 100644 --- a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/checkbox/CheckBoxConnector.java +++ b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/checkbox/CheckBoxConnector.java @@ -31,9 +31,9 @@ import com.vaadin.client.ui.VCheckBox; import com.vaadin.shared.EventId; import com.vaadin.shared.MouseEventDetails; import com.vaadin.shared.ui.Connect; -import com.vaadin.shared.ui.checkbox.CheckBoxServerRpc; -import com.vaadin.shared.ui.checkbox.CheckBoxState; import com.vaadin.v7.client.ui.AbstractFieldConnector; +import com.vaadin.v7.shared.ui.checkbox.CheckBoxServerRpc; +import com.vaadin.v7.shared.ui.checkbox.CheckBoxState; import com.vaadin.v7.ui.CheckBox; @Connect(CheckBox.class) diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/customfield/CustomFieldConnector.java b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/customfield/CustomFieldConnector.java index 33495a399d..9da418279d 100644 --- a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/customfield/CustomFieldConnector.java +++ b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/customfield/CustomFieldConnector.java @@ -25,8 +25,8 @@ import com.vaadin.client.ConnectorHierarchyChangeEvent; import com.vaadin.client.ConnectorHierarchyChangeEvent.ConnectorHierarchyChangeHandler; import com.vaadin.client.HasComponentsConnector; import com.vaadin.client.ui.AbstractFieldConnector; -import com.vaadin.client.ui.VCustomComponent; import com.vaadin.shared.ui.Connect; +import com.vaadin.v7.client.ui.VCustomComponent; import com.vaadin.v7.ui.CustomField; @Connect(value = CustomField.class) diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/label/LabelConnector.java b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/label/LabelConnector.java index d8c35a275d..7e37aa5f77 100644 --- a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/label/LabelConnector.java +++ b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/label/LabelConnector.java @@ -21,9 +21,9 @@ import com.vaadin.client.Profiler; import com.vaadin.client.WidgetUtil; import com.vaadin.client.communication.StateChangeEvent; import com.vaadin.client.ui.AbstractComponentConnector; -import com.vaadin.client.ui.VLabel; import com.vaadin.shared.ui.Connect; import com.vaadin.shared.ui.Connect.LoadStyle; +import com.vaadin.v7.client.ui.VLabel; import com.vaadin.v7.shared.ui.label.LabelState; import com.vaadin.v7.ui.Label; diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/richtextarea/RichTextAreaConnector.java b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/richtextarea/RichTextAreaConnector.java index fc96e9b16f..0bdf78fa3a 100644 --- a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/richtextarea/RichTextAreaConnector.java +++ b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/richtextarea/RichTextAreaConnector.java @@ -23,10 +23,10 @@ import com.vaadin.client.UIDL; import com.vaadin.client.ui.SimpleManagedLayout; import com.vaadin.shared.ui.Connect; import com.vaadin.shared.ui.Connect.LoadStyle; -import com.vaadin.shared.ui.textarea.RichTextAreaState; import com.vaadin.shared.util.SharedUtil; import com.vaadin.v7.client.ui.AbstractFieldConnector; import com.vaadin.v7.client.ui.VRichTextArea; +import com.vaadin.v7.shared.ui.textarea.RichTextAreaState; import com.vaadin.v7.ui.RichTextArea; @Connect(value = RichTextArea.class, loadStyle = LoadStyle.LAZY) diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/textfield/TextFieldConnector.java b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/textfield/TextFieldConnector.java index 34f6c7068a..2bb9b37fc8 100644 --- a/compatibility-client/src/main/java/com/vaadin/v7/client/ui/textfield/TextFieldConnector.java +++ b/compatibility-client/src/main/java/com/vaadin/v7/client/ui/textfield/TextFieldConnector.java @@ -25,9 +25,9 @@ import com.vaadin.client.Util; import com.vaadin.client.ui.AbstractFieldConnector; import com.vaadin.shared.ui.Connect; import com.vaadin.shared.ui.Connect.LoadStyle; -import com.vaadin.shared.v7.ui.textfield.LegacyAbstractTextFieldState; -import com.vaadin.shared.v7.ui.textfield.LegacyTextFieldConstants; import com.vaadin.v7.client.ui.VTextField; +import com.vaadin.v7.shared.ui.textfield.AbstractTextFieldState; +import com.vaadin.v7.shared.ui.textfield.LegacyTextFieldConstants; import com.vaadin.v7.ui.TextField; @Deprecated @@ -36,8 +36,8 @@ public class TextFieldConnector extends AbstractFieldConnector implements Paintable { @Override - public LegacyAbstractTextFieldState getState() { - return (LegacyAbstractTextFieldState) super.getState(); + public AbstractTextFieldState getState() { + return (AbstractTextFieldState) super.getState(); } @Override |