diff options
author | Aleksi Hietanen <aleksi@vaadin.com> | 2017-11-21 17:03:25 +0200 |
---|---|---|
committer | Teemu Suo-Anttila <tsuoanttila@users.noreply.github.com> | 2017-11-21 17:03:25 +0200 |
commit | de5c9a394a5e3852fb2e9cf00803e84559cf4c75 (patch) | |
tree | 7d669bc4a29b7eb8f0ce266498d1229c5b409a26 | |
parent | f805482c6013cebdb401341da37614fd664f85c7 (diff) | |
download | vaadin-framework-de5c9a394a5e3852fb2e9cf00803e84559cf4c75.tar.gz vaadin-framework-de5c9a394a5e3852fb2e9cf00803e84559cf4c75.zip |
Create DescriptionGenerator in package com.vaadin.ui (#10346)
Deprecate com.vaadin.ui.components.grid.DescriptionGenerator
and subclass it from the new DescriptionGenerator.
9 files changed, 39 insertions, 10 deletions
diff --git a/server/src/main/java/com/vaadin/ui/CheckBoxGroup.java b/server/src/main/java/com/vaadin/ui/CheckBoxGroup.java index 0c7eb3f516..991f491084 100644 --- a/server/src/main/java/com/vaadin/ui/CheckBoxGroup.java +++ b/server/src/main/java/com/vaadin/ui/CheckBoxGroup.java @@ -35,7 +35,6 @@ import com.vaadin.server.SerializablePredicate; import com.vaadin.shared.Registration; import com.vaadin.shared.ui.ListingJsonConstants; import com.vaadin.shared.ui.optiongroup.CheckBoxGroupState; -import com.vaadin.ui.components.grid.DescriptionGenerator; import com.vaadin.ui.declarative.DesignContext; import com.vaadin.ui.declarative.DesignFormatter; diff --git a/server/src/main/java/com/vaadin/ui/DescriptionGenerator.java b/server/src/main/java/com/vaadin/ui/DescriptionGenerator.java new file mode 100644 index 0000000000..799b3a06ea --- /dev/null +++ b/server/src/main/java/com/vaadin/ui/DescriptionGenerator.java @@ -0,0 +1,32 @@ +/* + * 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.ui; + +import com.vaadin.server.SerializableFunction; + +/** + * A callback interface for generating description texts for an item. + * + * @author Vaadin Ltd + * @since 8.2 + * + * @param <T> + * the item type + */ +@FunctionalInterface +public interface DescriptionGenerator<T> + extends SerializableFunction<T, String> { +} diff --git a/server/src/main/java/com/vaadin/ui/Grid.java b/server/src/main/java/com/vaadin/ui/Grid.java index 8074c35f0d..e39c0f809f 100644 --- a/server/src/main/java/com/vaadin/ui/Grid.java +++ b/server/src/main/java/com/vaadin/ui/Grid.java @@ -97,7 +97,6 @@ import com.vaadin.shared.ui.grid.SectionState; import com.vaadin.ui.components.grid.ColumnReorderListener; import com.vaadin.ui.components.grid.ColumnResizeListener; import com.vaadin.ui.components.grid.ColumnVisibilityChangeListener; -import com.vaadin.ui.components.grid.DescriptionGenerator; import com.vaadin.ui.components.grid.DetailsGenerator; import com.vaadin.ui.components.grid.Editor; import com.vaadin.ui.components.grid.EditorImpl; diff --git a/server/src/main/java/com/vaadin/ui/RadioButtonGroup.java b/server/src/main/java/com/vaadin/ui/RadioButtonGroup.java index f8f2bd3991..4eebf13f50 100644 --- a/server/src/main/java/com/vaadin/ui/RadioButtonGroup.java +++ b/server/src/main/java/com/vaadin/ui/RadioButtonGroup.java @@ -38,7 +38,6 @@ import com.vaadin.server.SerializablePredicate; import com.vaadin.shared.Registration; import com.vaadin.shared.ui.ListingJsonConstants; import com.vaadin.shared.ui.optiongroup.RadioButtonGroupState; -import com.vaadin.ui.components.grid.DescriptionGenerator; import com.vaadin.ui.declarative.DesignContext; import com.vaadin.ui.declarative.DesignFormatter; diff --git a/server/src/main/java/com/vaadin/ui/Tree.java b/server/src/main/java/com/vaadin/ui/Tree.java index fec9e53b1f..5e642caacc 100644 --- a/server/src/main/java/com/vaadin/ui/Tree.java +++ b/server/src/main/java/com/vaadin/ui/Tree.java @@ -59,7 +59,6 @@ import com.vaadin.shared.ui.grid.ScrollDestination; import com.vaadin.shared.ui.tree.TreeMultiSelectionModelState; import com.vaadin.shared.ui.tree.TreeRendererState; import com.vaadin.ui.Grid.SelectionMode; -import com.vaadin.ui.components.grid.DescriptionGenerator; import com.vaadin.ui.components.grid.MultiSelectionModelImpl; import com.vaadin.ui.components.grid.NoSelectionModel; import com.vaadin.ui.components.grid.SingleSelectionModelImpl; diff --git a/server/src/main/java/com/vaadin/ui/components/grid/DescriptionGenerator.java b/server/src/main/java/com/vaadin/ui/components/grid/DescriptionGenerator.java index 4ec3d72482..6389500345 100644 --- a/server/src/main/java/com/vaadin/ui/components/grid/DescriptionGenerator.java +++ b/server/src/main/java/com/vaadin/ui/components/grid/DescriptionGenerator.java @@ -15,8 +15,6 @@ */ package com.vaadin.ui.components.grid; -import com.vaadin.server.SerializableFunction; - /** * A callback interface for generating description texts for an item. * @@ -25,8 +23,11 @@ import com.vaadin.server.SerializableFunction; * * @param <T> * the grid bean type + * @deprecated as of 8.2, use the DescriptionGenerator found in package + * com.vaadin.ui instead. */ @FunctionalInterface +@Deprecated public interface DescriptionGenerator<T> - extends SerializableFunction<T, String> { + extends com.vaadin.ui.DescriptionGenerator<T> { } diff --git a/uitest/src/main/java/com/vaadin/tests/components/checkbox/CheckBoxGroupTestUI.java b/uitest/src/main/java/com/vaadin/tests/components/checkbox/CheckBoxGroupTestUI.java index f69bf26a3d..e7ee89f662 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/checkbox/CheckBoxGroupTestUI.java +++ b/uitest/src/main/java/com/vaadin/tests/components/checkbox/CheckBoxGroupTestUI.java @@ -20,8 +20,8 @@ import java.util.LinkedHashMap; import com.vaadin.icons.VaadinIcons; import com.vaadin.tests.components.abstractlisting.AbstractMultiSelectTestUI; import com.vaadin.ui.CheckBoxGroup; +import com.vaadin.ui.DescriptionGenerator; import com.vaadin.ui.IconGenerator; -import com.vaadin.ui.components.grid.DescriptionGenerator; /** * Test UI for CheckBoxGroup component diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/basics/GridBasics.java b/uitest/src/main/java/com/vaadin/tests/components/grid/basics/GridBasics.java index ef7533d082..be05ed7d87 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/grid/basics/GridBasics.java +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/basics/GridBasics.java @@ -29,6 +29,7 @@ import com.vaadin.shared.ui.grid.HeightMode; import com.vaadin.tests.components.AbstractTestUIWithLog; import com.vaadin.ui.Button; import com.vaadin.ui.Component; +import com.vaadin.ui.DescriptionGenerator; import com.vaadin.ui.Grid; import com.vaadin.ui.Grid.Column; import com.vaadin.ui.Grid.SelectionMode; @@ -43,7 +44,6 @@ import com.vaadin.ui.SingleSelect; import com.vaadin.ui.StyleGenerator; import com.vaadin.ui.TextField; import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.components.grid.DescriptionGenerator; import com.vaadin.ui.components.grid.DetailsGenerator; import com.vaadin.ui.components.grid.FooterCell; import com.vaadin.ui.components.grid.FooterRow; diff --git a/uitest/src/main/java/com/vaadin/tests/components/radiobutton/RadioButtonGroupTestUI.java b/uitest/src/main/java/com/vaadin/tests/components/radiobutton/RadioButtonGroupTestUI.java index 3403fa22b8..87f265cf99 100644 --- a/uitest/src/main/java/com/vaadin/tests/components/radiobutton/RadioButtonGroupTestUI.java +++ b/uitest/src/main/java/com/vaadin/tests/components/radiobutton/RadioButtonGroupTestUI.java @@ -20,9 +20,9 @@ import java.util.stream.IntStream; import com.vaadin.icons.VaadinIcons; import com.vaadin.tests.components.abstractlisting.AbstractListingTestUI; +import com.vaadin.ui.DescriptionGenerator; import com.vaadin.ui.ItemCaptionGenerator; import com.vaadin.ui.RadioButtonGroup; -import com.vaadin.ui.components.grid.DescriptionGenerator; /** * Test UI for RadioButtonGroup component |