diff --git a/demo-v14/src/main/java/org/vaadin/miki/MainView.java b/demo-v14/src/main/java/org/vaadin/miki/MainView.java index 88280a1e..9f4a3c03 100644 --- a/demo-v14/src/main/java/org/vaadin/miki/MainView.java +++ b/demo-v14/src/main/java/org/vaadin/miki/MainView.java @@ -25,7 +25,7 @@ import org.vaadin.miki.markers.HasLocale; import org.vaadin.miki.superfields.dates.DatePattern; import org.vaadin.miki.superfields.dates.DatePatterns; -import org.vaadin.miki.superfields.dates.HasDatePattern; +import org.vaadin.miki.markers.HasDatePattern; import org.vaadin.miki.superfields.dates.SuperDatePicker; import org.vaadin.miki.superfields.dates.SuperDateTimePicker; import org.vaadin.miki.superfields.itemgrid.ItemGrid; @@ -40,11 +40,11 @@ import org.vaadin.miki.superfields.tabs.SuperTabs; import org.vaadin.miki.superfields.tabs.TabHandler; import org.vaadin.miki.superfields.tabs.TabHandlers; -import org.vaadin.miki.superfields.text.CanReceiveSelectionEventsFromClient; -import org.vaadin.miki.superfields.text.CanSelectText; +import org.vaadin.miki.markers.CanReceiveSelectionEventsFromClient; +import org.vaadin.miki.markers.CanSelectText; import org.vaadin.miki.superfields.text.SuperTextArea; import org.vaadin.miki.superfields.text.SuperTextField; -import org.vaadin.miki.superfields.text.TextSelectionNotifier; +import org.vaadin.miki.events.text.TextSelectionNotifier; import org.vaadin.miki.superfields.unload.UnloadObserver; import java.time.LocalDate; diff --git a/superfields/src/main/java/org/vaadin/miki/superfields/text/TextSelectionEvent.java b/superfields/src/main/java/org/vaadin/miki/events/text/TextSelectionEvent.java similarity index 95% rename from superfields/src/main/java/org/vaadin/miki/superfields/text/TextSelectionEvent.java rename to superfields/src/main/java/org/vaadin/miki/events/text/TextSelectionEvent.java index 13155984..e379a95f 100644 --- a/superfields/src/main/java/org/vaadin/miki/superfields/text/TextSelectionEvent.java +++ b/superfields/src/main/java/org/vaadin/miki/events/text/TextSelectionEvent.java @@ -1,7 +1,8 @@ -package org.vaadin.miki.superfields.text; +package org.vaadin.miki.events.text; import com.vaadin.flow.component.Component; import com.vaadin.flow.component.ComponentEvent; +import org.vaadin.miki.markers.CanSelectText; import java.util.Optional; diff --git a/superfields/src/main/java/org/vaadin/miki/superfields/text/TextSelectionListener.java b/superfields/src/main/java/org/vaadin/miki/events/text/TextSelectionListener.java similarity index 80% rename from superfields/src/main/java/org/vaadin/miki/superfields/text/TextSelectionListener.java rename to superfields/src/main/java/org/vaadin/miki/events/text/TextSelectionListener.java index 1f007f6d..2275b2c6 100644 --- a/superfields/src/main/java/org/vaadin/miki/superfields/text/TextSelectionListener.java +++ b/superfields/src/main/java/org/vaadin/miki/events/text/TextSelectionListener.java @@ -1,7 +1,8 @@ -package org.vaadin.miki.superfields.text; +package org.vaadin.miki.events.text; import com.vaadin.flow.component.Component; import com.vaadin.flow.component.ComponentEventListener; +import org.vaadin.miki.markers.CanSelectText; /** * Marker interface for objects diff --git a/superfields/src/main/java/org/vaadin/miki/superfields/text/TextSelectionNotifier.java b/superfields/src/main/java/org/vaadin/miki/events/text/TextSelectionNotifier.java similarity index 87% rename from superfields/src/main/java/org/vaadin/miki/superfields/text/TextSelectionNotifier.java rename to superfields/src/main/java/org/vaadin/miki/events/text/TextSelectionNotifier.java index 97d3e3f7..d92887e8 100644 --- a/superfields/src/main/java/org/vaadin/miki/superfields/text/TextSelectionNotifier.java +++ b/superfields/src/main/java/org/vaadin/miki/events/text/TextSelectionNotifier.java @@ -1,7 +1,8 @@ -package org.vaadin.miki.superfields.text; +package org.vaadin.miki.events.text; import com.vaadin.flow.component.Component; import com.vaadin.flow.shared.Registration; +import org.vaadin.miki.markers.CanSelectText; /** * Marker interface for objects that broadcast {@link TextSelectionEvent}. diff --git a/superfields/src/main/java/org/vaadin/miki/superfields/text/CanReceiveSelectionEventsFromClient.java b/superfields/src/main/java/org/vaadin/miki/markers/CanReceiveSelectionEventsFromClient.java similarity index 91% rename from superfields/src/main/java/org/vaadin/miki/superfields/text/CanReceiveSelectionEventsFromClient.java rename to superfields/src/main/java/org/vaadin/miki/markers/CanReceiveSelectionEventsFromClient.java index be5f3a19..2a1b468d 100644 --- a/superfields/src/main/java/org/vaadin/miki/superfields/text/CanReceiveSelectionEventsFromClient.java +++ b/superfields/src/main/java/org/vaadin/miki/markers/CanReceiveSelectionEventsFromClient.java @@ -1,4 +1,6 @@ -package org.vaadin.miki.superfields.text; +package org.vaadin.miki.markers; + +import org.vaadin.miki.events.text.TextSelectionEvent; /** * Marker interface for objects capable of receiving text selection events from client-side code. diff --git a/superfields/src/main/java/org/vaadin/miki/superfields/text/CanSelectText.java b/superfields/src/main/java/org/vaadin/miki/markers/CanSelectText.java similarity index 94% rename from superfields/src/main/java/org/vaadin/miki/superfields/text/CanSelectText.java rename to superfields/src/main/java/org/vaadin/miki/markers/CanSelectText.java index 9867e46b..22aa17a2 100644 --- a/superfields/src/main/java/org/vaadin/miki/superfields/text/CanSelectText.java +++ b/superfields/src/main/java/org/vaadin/miki/markers/CanSelectText.java @@ -1,4 +1,4 @@ -package org.vaadin.miki.superfields.text; +package org.vaadin.miki.markers; import com.vaadin.flow.component.HasElement; diff --git a/superfields/src/main/java/org/vaadin/miki/superfields/dates/HasDatePattern.java b/superfields/src/main/java/org/vaadin/miki/markers/HasDatePattern.java similarity index 87% rename from superfields/src/main/java/org/vaadin/miki/superfields/dates/HasDatePattern.java rename to superfields/src/main/java/org/vaadin/miki/markers/HasDatePattern.java index 9f30ad1f..489d28a1 100644 --- a/superfields/src/main/java/org/vaadin/miki/superfields/dates/HasDatePattern.java +++ b/superfields/src/main/java/org/vaadin/miki/markers/HasDatePattern.java @@ -1,4 +1,6 @@ -package org.vaadin.miki.superfields.dates; +package org.vaadin.miki.markers; + +import org.vaadin.miki.superfields.dates.DatePattern; /** * Marker interface for objects that have a {@link DatePattern}. diff --git a/superfields/src/main/java/org/vaadin/miki/superfields/dates/WithDatePatternMixin.java b/superfields/src/main/java/org/vaadin/miki/markers/WithDatePatternMixin.java similarity index 87% rename from superfields/src/main/java/org/vaadin/miki/superfields/dates/WithDatePatternMixin.java rename to superfields/src/main/java/org/vaadin/miki/markers/WithDatePatternMixin.java index 43154506..86ed73dd 100644 --- a/superfields/src/main/java/org/vaadin/miki/superfields/dates/WithDatePatternMixin.java +++ b/superfields/src/main/java/org/vaadin/miki/markers/WithDatePatternMixin.java @@ -1,4 +1,6 @@ -package org.vaadin.miki.superfields.dates; +package org.vaadin.miki.markers; + +import org.vaadin.miki.superfields.dates.DatePattern; /** * Mixin interface to allow chaining {@link #setDatePattern(DatePattern)}. diff --git a/superfields/src/main/java/org/vaadin/miki/superfields/text/WithReceivingSelectionEventsFromClientMixin.java b/superfields/src/main/java/org/vaadin/miki/markers/WithReceivingSelectionEventsFromClientMixin.java similarity index 95% rename from superfields/src/main/java/org/vaadin/miki/superfields/text/WithReceivingSelectionEventsFromClientMixin.java rename to superfields/src/main/java/org/vaadin/miki/markers/WithReceivingSelectionEventsFromClientMixin.java index cb9fbde0..7e7e2dcb 100644 --- a/superfields/src/main/java/org/vaadin/miki/superfields/text/WithReceivingSelectionEventsFromClientMixin.java +++ b/superfields/src/main/java/org/vaadin/miki/markers/WithReceivingSelectionEventsFromClientMixin.java @@ -1,4 +1,4 @@ -package org.vaadin.miki.superfields.text; +package org.vaadin.miki.markers; /** * Marker interface for chaining {@link #setReceivingSelectionEventsFromClient(boolean)}. diff --git a/superfields/src/main/java/org/vaadin/miki/superfields/text/TextSelectionDelegate.java b/superfields/src/main/java/org/vaadin/miki/shared/text/TextSelectionDelegate.java similarity index 96% rename from superfields/src/main/java/org/vaadin/miki/superfields/text/TextSelectionDelegate.java rename to superfields/src/main/java/org/vaadin/miki/shared/text/TextSelectionDelegate.java index 48f64a16..6b96f197 100644 --- a/superfields/src/main/java/org/vaadin/miki/superfields/text/TextSelectionDelegate.java +++ b/superfields/src/main/java/org/vaadin/miki/shared/text/TextSelectionDelegate.java @@ -1,7 +1,10 @@ -package org.vaadin.miki.superfields.text; +package org.vaadin.miki.shared.text; import com.vaadin.flow.component.Component; import com.vaadin.flow.component.ComponentEventBus; +import org.vaadin.miki.markers.CanReceiveSelectionEventsFromClient; +import org.vaadin.miki.markers.CanSelectText; +import org.vaadin.miki.events.text.TextSelectionEvent; import java.io.Serializable; import java.util.Objects; diff --git a/superfields/src/main/java/org/vaadin/miki/superfields/dates/DatePatternDelegate.java b/superfields/src/main/java/org/vaadin/miki/superfields/dates/DatePatternDelegate.java index fe9e0dcc..6a0ba097 100644 --- a/superfields/src/main/java/org/vaadin/miki/superfields/dates/DatePatternDelegate.java +++ b/superfields/src/main/java/org/vaadin/miki/superfields/dates/DatePatternDelegate.java @@ -2,6 +2,7 @@ import com.vaadin.flow.component.AttachEvent; import com.vaadin.flow.component.Component; +import org.vaadin.miki.markers.HasDatePattern; import java.io.Serializable; import java.time.LocalDate; diff --git a/superfields/src/main/java/org/vaadin/miki/superfields/dates/SuperDatePicker.java b/superfields/src/main/java/org/vaadin/miki/superfields/dates/SuperDatePicker.java index 4de96215..e286e8b5 100644 --- a/superfields/src/main/java/org/vaadin/miki/superfields/dates/SuperDatePicker.java +++ b/superfields/src/main/java/org/vaadin/miki/superfields/dates/SuperDatePicker.java @@ -8,21 +8,23 @@ import com.vaadin.flow.component.datepicker.DatePicker; import com.vaadin.flow.component.dependency.JsModule; import com.vaadin.flow.shared.Registration; +import org.vaadin.miki.markers.HasDatePattern; import org.vaadin.miki.markers.HasLabel; import org.vaadin.miki.markers.HasLocale; import org.vaadin.miki.markers.HasPlaceholder; +import org.vaadin.miki.markers.WithDatePatternMixin; import org.vaadin.miki.markers.WithIdMixin; import org.vaadin.miki.markers.WithLabelMixin; import org.vaadin.miki.markers.WithLocaleMixin; import org.vaadin.miki.markers.WithPlaceholderMixin; import org.vaadin.miki.markers.WithValueMixin; -import org.vaadin.miki.superfields.text.CanReceiveSelectionEventsFromClient; -import org.vaadin.miki.superfields.text.CanSelectText; -import org.vaadin.miki.superfields.text.TextSelectionDelegate; -import org.vaadin.miki.superfields.text.TextSelectionEvent; -import org.vaadin.miki.superfields.text.TextSelectionListener; -import org.vaadin.miki.superfields.text.TextSelectionNotifier; -import org.vaadin.miki.superfields.text.WithReceivingSelectionEventsFromClientMixin; +import org.vaadin.miki.markers.CanReceiveSelectionEventsFromClient; +import org.vaadin.miki.markers.CanSelectText; +import org.vaadin.miki.shared.text.TextSelectionDelegate; +import org.vaadin.miki.events.text.TextSelectionEvent; +import org.vaadin.miki.events.text.TextSelectionListener; +import org.vaadin.miki.events.text.TextSelectionNotifier; +import org.vaadin.miki.markers.WithReceivingSelectionEventsFromClientMixin; import java.time.LocalDate; import java.time.format.DateTimeFormatter; diff --git a/superfields/src/main/java/org/vaadin/miki/superfields/dates/SuperDateTimePicker.java b/superfields/src/main/java/org/vaadin/miki/superfields/dates/SuperDateTimePicker.java index c00bbdc1..9c00cbd5 100644 --- a/superfields/src/main/java/org/vaadin/miki/superfields/dates/SuperDateTimePicker.java +++ b/superfields/src/main/java/org/vaadin/miki/superfields/dates/SuperDateTimePicker.java @@ -6,8 +6,10 @@ import com.vaadin.flow.component.datetimepicker.DateTimePicker; import com.vaadin.flow.component.dependency.JsModule; import com.vaadin.flow.component.timepicker.TimePicker; +import org.vaadin.miki.markers.HasDatePattern; import org.vaadin.miki.markers.HasLabel; import org.vaadin.miki.markers.HasLocale; +import org.vaadin.miki.markers.WithDatePatternMixin; import org.vaadin.miki.markers.WithIdMixin; import org.vaadin.miki.markers.WithLabelMixin; import org.vaadin.miki.markers.WithLocaleMixin; @@ -29,7 +31,7 @@ public class SuperDateTimePicker extends DateTimePicker implements HasLocale, HasLabel, HasDatePattern, WithLocaleMixin, WithLabelMixin, - WithDatePatternMixin, WithIdMixin, + WithDatePatternMixin, WithIdMixin, WithValueMixin, LocalDateTime, SuperDateTimePicker> { // so, this component is a composition of DatePicker and TimePicker diff --git a/superfields/src/main/java/org/vaadin/miki/superfields/numbers/AbstractSuperNumberField.java b/superfields/src/main/java/org/vaadin/miki/superfields/numbers/AbstractSuperNumberField.java index 0bcde9c5..2ebdd3f5 100644 --- a/superfields/src/main/java/org/vaadin/miki/superfields/numbers/AbstractSuperNumberField.java +++ b/superfields/src/main/java/org/vaadin/miki/superfields/numbers/AbstractSuperNumberField.java @@ -23,13 +23,13 @@ import org.vaadin.miki.markers.WithPlaceholderMixin; import org.vaadin.miki.markers.WithTitleMixin; import org.vaadin.miki.markers.WithValueMixin; -import org.vaadin.miki.superfields.text.CanReceiveSelectionEventsFromClient; -import org.vaadin.miki.superfields.text.CanSelectText; +import org.vaadin.miki.markers.CanReceiveSelectionEventsFromClient; +import org.vaadin.miki.markers.CanSelectText; import org.vaadin.miki.superfields.text.SuperTextField; -import org.vaadin.miki.superfields.text.TextSelectionEvent; -import org.vaadin.miki.superfields.text.TextSelectionListener; -import org.vaadin.miki.superfields.text.TextSelectionNotifier; -import org.vaadin.miki.superfields.text.WithReceivingSelectionEventsFromClientMixin; +import org.vaadin.miki.events.text.TextSelectionEvent; +import org.vaadin.miki.events.text.TextSelectionListener; +import org.vaadin.miki.events.text.TextSelectionNotifier; +import org.vaadin.miki.markers.WithReceivingSelectionEventsFromClientMixin; import java.text.DecimalFormat; import java.text.NumberFormat; diff --git a/superfields/src/main/java/org/vaadin/miki/superfields/text/SuperTextArea.java b/superfields/src/main/java/org/vaadin/miki/superfields/text/SuperTextArea.java index 026d2980..4127224b 100644 --- a/superfields/src/main/java/org/vaadin/miki/superfields/text/SuperTextArea.java +++ b/superfields/src/main/java/org/vaadin/miki/superfields/text/SuperTextArea.java @@ -1,17 +1,25 @@ package org.vaadin.miki.superfields.text; import com.vaadin.flow.component.AbstractField; +import com.vaadin.flow.component.AttachEvent; import com.vaadin.flow.component.ClientCallable; +import com.vaadin.flow.component.DetachEvent; import com.vaadin.flow.component.Tag; import com.vaadin.flow.component.dependency.JsModule; import com.vaadin.flow.component.textfield.TextArea; import com.vaadin.flow.shared.Registration; +import org.vaadin.miki.events.text.TextSelectionEvent; +import org.vaadin.miki.events.text.TextSelectionListener; +import org.vaadin.miki.events.text.TextSelectionNotifier; +import org.vaadin.miki.markers.CanSelectText; import org.vaadin.miki.markers.HasLabel; import org.vaadin.miki.markers.HasPlaceholder; import org.vaadin.miki.markers.WithIdMixin; import org.vaadin.miki.markers.WithLabelMixin; import org.vaadin.miki.markers.WithPlaceholderMixin; +import org.vaadin.miki.markers.WithReceivingSelectionEventsFromClientMixin; import org.vaadin.miki.markers.WithValueMixin; +import org.vaadin.miki.shared.text.TextSelectionDelegate; /** * An extension of {@link TextArea} with some useful features. @@ -57,6 +65,21 @@ public SuperTextArea(String label, String initialValue, ValueChangeListener & CanReceiveSelectionEventsFromClient & TextSelectionNotifier> {