diff --git a/wicket-select2-examples/src/main/java/com/vaynberg/wicket/select2/Country.java b/wicket-select2-examples/src/main/java/com/vaynberg/wicket/select2/Country.java old mode 100755 new mode 100644 diff --git a/wicket-select2-examples/src/main/java/com/vaynberg/wicket/select2/HomePage.html b/wicket-select2-examples/src/main/java/com/vaynberg/wicket/select2/HomePage.html index 01213ac..e48908d 100755 --- a/wicket-select2-examples/src/main/java/com/vaynberg/wicket/select2/HomePage.html +++ b/wicket-select2-examples/src/main/java/com/vaynberg/wicket/select2/HomePage.html @@ -68,6 +68,28 @@

Multi-Select Ajax result loading. Paging with infinite scrolling. Min + +
+ +
+
+

+ Countries currently selected: +

+
+ +
+ +
+
+
+
+
+ diff --git a/wicket-select2-examples/src/main/java/com/vaynberg/wicket/select2/HomePage.java b/wicket-select2-examples/src/main/java/com/vaynberg/wicket/select2/HomePage.java index 9bf34e8..745696e 100755 --- a/wicket-select2-examples/src/main/java/com/vaynberg/wicket/select2/HomePage.java +++ b/wicket-select2-examples/src/main/java/com/vaynberg/wicket/select2/HomePage.java @@ -21,7 +21,6 @@ import org.apache.wicket.markup.html.basic.Label; import org.apache.wicket.markup.html.form.Form; import org.apache.wicket.model.PropertyModel; -import org.apache.wicket.request.mapper.parameter.PageParameters; /** * Example page. @@ -35,6 +34,9 @@ public class HomePage extends WebPage { private Country country = Country.US; private List countries = new ArrayList(Arrays.asList(new Country[] { Country.US, Country.CA })); + + private List countriesStateless = new ArrayList(Arrays.asList(new Country[] { Country.US, Country.CA })); + public HomePage() { @@ -60,9 +62,21 @@ public HomePage() { Select2MultiChoice countries = new Select2MultiChoice("countries", new PropertyModel>(this, "countries"), new CountriesProvider()); countries.getSettings().setMinimumInputLength(1); - countries.add(new DragAndDropBehavior()); + countries.add(new DragAndDropBehavior()); multi.add(countries); + + add(new Label("countriesStateless", new PropertyModel(this, "countriesStateless"))); + + Form multiStateless = new Form("multiStateless"); + add(multiStateless); + + Select2MultiChoice countriesStateless = new Select2MultiChoice("countriesStateless", + new PropertyModel>(this, "countriesStateless"), new CountriesProvider()); + countriesStateless.getSettings().setMinimumInputLength(1); + countriesStateless.getSettings().setStateless(true); + countriesStateless.getSettings().setMountPath(WicketApplication.COUNTRIES_MOUNT_PATH); + multiStateless.add(countriesStateless); } /** @@ -108,7 +122,7 @@ private static List queryMatches(String term, int page, int pageSize) { * @author igor * */ - public class CountriesProvider extends TextChoiceProvider { + public static class CountriesProvider extends TextChoiceProvider { @Override protected String getDisplayText(Country choice) { @@ -137,4 +151,12 @@ public Collection toChoices(Collection ids) { } } + + public List getCountriesStateless() { + return countriesStateless; + } + + public void setCountriesStateless(List countriesStateless) { + this.countriesStateless = countriesStateless; + } } diff --git a/wicket-select2-examples/src/main/java/com/vaynberg/wicket/select2/WicketApplication.java b/wicket-select2-examples/src/main/java/com/vaynberg/wicket/select2/WicketApplication.java index 3de5d0b..c569590 100755 --- a/wicket-select2-examples/src/main/java/com/vaynberg/wicket/select2/WicketApplication.java +++ b/wicket-select2-examples/src/main/java/com/vaynberg/wicket/select2/WicketApplication.java @@ -18,8 +18,26 @@ * Application object */ public class WicketApplication extends WebApplication { + + public static final String COUNTRIES_MOUNT_PATH = "/countries/"; + @Override public Class getHomePage() { return HomePage.class; } + + @Override + protected void init() { + super.init(); + + mountResource(COUNTRIES_MOUNT_PATH, new JsonResourceReference() { + + private static final long serialVersionUID = 1L; + + @Override + protected ChoiceProvider getChoiceProvider() { + return new HomePage.CountriesProvider(); + } + }); + } } diff --git a/wicket-select2-examples/src/test/java/com/vaynberg/wicket/select2/BogusTest.java b/wicket-select2-examples/src/test/java/com/vaynberg/wicket/select2/BogusTest.java deleted file mode 100755 index 18c917f..0000000 --- a/wicket-select2-examples/src/test/java/com/vaynberg/wicket/select2/BogusTest.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.vaynberg.wicket.select2; - -import org.junit.Test; - -/** - * A bogus test to keep bamboo happy since its looking for test output - * - * @author igor - * - */ -public class BogusTest { - @Test - public void bogus() { - } -} diff --git a/wicket-select2-examples/src/test/java/com/vaynberg/wicket/select2/SelectTest.java b/wicket-select2-examples/src/test/java/com/vaynberg/wicket/select2/SelectTest.java new file mode 100755 index 0000000..30918a1 --- /dev/null +++ b/wicket-select2-examples/src/test/java/com/vaynberg/wicket/select2/SelectTest.java @@ -0,0 +1,35 @@ +package com.vaynberg.wicket.select2; + +import junit.framework.Assert; + +import org.apache.wicket.util.tester.WicketTester; +import org.junit.Before; +import org.junit.Test; + +/** + * A bogus test to keep bamboo happy since its looking for test output + * + * @author igor + * + */ +public class SelectTest { + + private WicketTester tester; + + @Before + public void bogus() { + tester = new WicketTester(); + } + + @Test + public void testMultiSelect() { + TestMultiSelectPage testPage =tester.startPage(TestMultiSelectPage.class); + tester.assertRenderedPage(TestMultiSelectPage.class); + tester.getRequest().setParameter("countries", Country.CU.name()+","+Country.CA.name()); + tester.submitForm(testPage.getForm()); + Assert.assertTrue(testPage.getCountries().contains(Country.CU)); + Assert.assertTrue(testPage.getCountries().contains(Country.CA)); + Assert.assertTrue(!testPage.getCountries().contains(Country.US)); + + } +} diff --git a/wicket-select2-examples/src/test/java/com/vaynberg/wicket/select2/TestMultiSelectPage.html b/wicket-select2-examples/src/test/java/com/vaynberg/wicket/select2/TestMultiSelectPage.html new file mode 100755 index 0000000..a258801 --- /dev/null +++ b/wicket-select2-examples/src/test/java/com/vaynberg/wicket/select2/TestMultiSelectPage.html @@ -0,0 +1,36 @@ + + + + +Apache Wicket Select2 Examples + + + + + + + + + Fork me on GitHub +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+ + diff --git a/wicket-select2-examples/src/test/java/com/vaynberg/wicket/select2/TestMultiSelectPage.java b/wicket-select2-examples/src/test/java/com/vaynberg/wicket/select2/TestMultiSelectPage.java new file mode 100755 index 0000000..e819e8d --- /dev/null +++ b/wicket-select2-examples/src/test/java/com/vaynberg/wicket/select2/TestMultiSelectPage.java @@ -0,0 +1,166 @@ +/* + * Copyright 2012 Igor Vaynberg + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with + * the License. You may obtain a copy of the License in the LICENSE file, or 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.vaynberg.wicket.select2; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; + +import org.apache.wicket.markup.html.WebPage; +import org.apache.wicket.markup.html.basic.Label; +import org.apache.wicket.markup.html.form.Form; +import org.apache.wicket.model.PropertyModel; + +/** + * Example page. + * + * @author igor + * + */ +@SuppressWarnings("unused") +public class TestMultiSelectPage extends WebPage { + + private static final long serialVersionUID = 1L; + + private static final int PAGE_SIZE = 20; + + private Country country = Country.US; + private List countries = new ArrayList(Arrays.asList(new Country[] { Country.US, Country.CA })); + + private Form form; + + private Select2MultiChoice countriesChoice; + + public TestMultiSelectPage() { + + // single-select example + + + form = new Form("multi"); + add(form); + + countriesChoice = new Select2MultiChoice("countries", + new PropertyModel>(this, "countries"), new CountriesProvider()); + countriesChoice.getSettings().setMinimumInputLength(1); + countriesChoice.add(new DragAndDropBehavior()); + form.add(countriesChoice); + + } + + /** + * Queries {@code pageSize} worth of countries from the {@link Country} enum, starting with {@code page * pageSize} + * offset. Countries are matched on their {@code displayName} containing {@code term} + * + * @param term + * search term + * @param page + * starting page + * @param pageSize + * items per page + * @return list of matches + */ + private static List queryMatches(String term, int page, int pageSize) { + + List result = new ArrayList(); + + term = term.toUpperCase(); + + final int offset = page * pageSize; + + int matched = 0; + for (Country country : Country.values()) { + if (result.size() == pageSize) { + break; + } + + if (country.getDisplayName().toUpperCase().contains(term)) { + matched++; + if (matched > offset) { + result.add(country); + } + } + } + return result; + } + + /** + * {@link Country} based choice provider for Select2 components. Demonstrates integration between Select2 components + * and a domain object (in this case an enum). + * + * @author igor + * + */ + public static class CountriesProvider extends TextChoiceProvider { + + @Override + protected String getDisplayText(Country choice) { + return choice.getDisplayName(); + } + + @Override + protected Object getId(Country choice) { + return choice.name(); + } + + @Override + public void query(String term, int page, Response response) { + response.addAll(queryMatches(term, page, 10)); + response.setHasMore(response.size() == 10); + + } + + @Override + public Collection toChoices(Collection ids) { + ArrayList countries = new ArrayList(); + for (String id : ids) { + countries.add(Country.valueOf(id)); + } + return countries; + } + + } + + public Country getCountry() { + return country; + } + + public void setCountry(Country country) { + this.country = country; + } + + public List getCountries() { + return countries; + } + + public void setCountries(List countries) { + this.countries = countries; + } + + public Form getForm() { + return form; + } + + public void setForm(Form form) { + this.form = form; + } + + public Select2MultiChoice getCountriesChoice() { + return countriesChoice; + } + + public void setCountriesChoice(Select2MultiChoice countriesChoice) { + this.countriesChoice = countriesChoice; + } + +} diff --git a/wicket-select2/src/main/java/com/vaynberg/wicket/select2/AbstractSelect2Choice.java b/wicket-select2/src/main/java/com/vaynberg/wicket/select2/AbstractSelect2Choice.java index 2bc0456..08a7ef6 100755 --- a/wicket-select2/src/main/java/com/vaynberg/wicket/select2/AbstractSelect2Choice.java +++ b/wicket-select2/src/main/java/com/vaynberg/wicket/select2/AbstractSelect2Choice.java @@ -13,6 +13,7 @@ package com.vaynberg.wicket.select2; import java.io.IOException; +import java.io.OutputStream; import java.io.OutputStreamWriter; import org.apache.wicket.IResourceListener; @@ -24,8 +25,10 @@ import org.apache.wicket.model.IModel; import org.apache.wicket.request.IRequestParameters; import org.apache.wicket.request.Request; +import org.apache.wicket.request.cycle.RequestCycle; import org.apache.wicket.request.http.WebRequest; import org.apache.wicket.request.http.WebResponse; +import org.apache.wicket.util.string.Strings; import org.json.JSONException; import org.json.JSONWriter; @@ -39,6 +42,7 @@ * @param * type of model object */ +@SuppressWarnings("serial") abstract class AbstractSelect2Choice extends HiddenField implements IResourceListener { private final Settings settings = new Settings(); @@ -147,6 +151,11 @@ public void renderHead(IHeaderResponse response) { renderInitializationScript(response); } + + @Override + protected boolean getStatelessHint() { + return settings.isStateless(); + } /** * Renders script used to initialize the value of Select2 after it is created so it matches the current model @@ -182,8 +191,14 @@ protected void onInitialize() { @Override protected void onConfigure() { super.onConfigure(); - - getSettings().getAjax().setUrl(urlFor(IResourceListener.INTERFACE, null)); + if(getSettings().isStateless()) { + if(Strings.isEmpty(getSettings().getMountPath())) { + throw new IllegalStateException("Select2 in stateless mode should specify a mountPath"); + } + getSettings().getAjax().setUrl(getSettings().getMountPath()); + } else { + getSettings().getAjax().setUrl(urlFor(IResourceListener.INTERFACE, null)); + } } @Override @@ -205,11 +220,22 @@ public void onEvent(IEvent event) { } @Override - public void onResourceRequested() { - + public void onResourceRequested() { + WebResponse webResponse = (WebResponse) getRequestCycle().getResponse(); + webResponse.setContentType("application/json"); + generateJSON(provider, webResponse.getOutputStream()); + } + + /** + * Utility method to generate JSON response. + * + * @param provider + * @param outputStream + */ + public static void generateJSON(ChoiceProvider provider, OutputStream outputStream) { // this is the callback that retrieves matching choices used to populate the dropdown - Request request = getRequestCycle().getRequest(); + Request request = RequestCycle.get().getRequest(); IRequestParameters params = request.getRequestParameters(); // retrieve choices matching the search term @@ -226,10 +252,7 @@ public void onResourceRequested() { // jsonize and write out the choices to the response - WebResponse webResponse = (WebResponse) getRequestCycle().getResponse(); - webResponse.setContentType("application/json"); - - OutputStreamWriter out = new OutputStreamWriter(webResponse.getOutputStream(), getRequest().getCharset()); + OutputStreamWriter out = new OutputStreamWriter(outputStream, request.getCharset()); JSONWriter json = new JSONWriter(out); try { diff --git a/wicket-select2/src/main/java/com/vaynberg/wicket/select2/AjaxSettings.java b/wicket-select2/src/main/java/com/vaynberg/wicket/select2/AjaxSettings.java index a6c017e..0637f09 100755 --- a/wicket-select2/src/main/java/com/vaynberg/wicket/select2/AjaxSettings.java +++ b/wicket-select2/src/main/java/com/vaynberg/wicket/select2/AjaxSettings.java @@ -24,6 +24,7 @@ * * @author igor */ +@SuppressWarnings("serial") public final class AjaxSettings implements Serializable { private CharSequence url; private String dataType = "json"; diff --git a/wicket-select2/src/main/java/com/vaynberg/wicket/select2/ApplicationSettings.java b/wicket-select2/src/main/java/com/vaynberg/wicket/select2/ApplicationSettings.java index 9497b94..1a12d19 100755 --- a/wicket-select2/src/main/java/com/vaynberg/wicket/select2/ApplicationSettings.java +++ b/wicket-select2/src/main/java/com/vaynberg/wicket/select2/ApplicationSettings.java @@ -28,7 +28,8 @@ */ public class ApplicationSettings { - private static final MetaDataKey KEY = new MetaDataKey() { + @SuppressWarnings("serial") + private static final MetaDataKey KEY = new MetaDataKey() { }; private ResourceReference javaScriptReference = new PackageResourceReference(ApplicationSettings.class, diff --git a/wicket-select2/src/main/java/com/vaynberg/wicket/select2/ChoiceProvider.java b/wicket-select2/src/main/java/com/vaynberg/wicket/select2/ChoiceProvider.java old mode 100755 new mode 100644 index 066db0d..4ec6a07 --- a/wicket-select2/src/main/java/com/vaynberg/wicket/select2/ChoiceProvider.java +++ b/wicket-select2/src/main/java/com/vaynberg/wicket/select2/ChoiceProvider.java @@ -39,6 +39,7 @@ * @param * type of choice object */ +@SuppressWarnings("serial") public abstract class ChoiceProvider implements IDetachable { /** * Queries application for choices that match the search {@code term} and adds them to the {@code response} diff --git a/wicket-select2/src/main/java/com/vaynberg/wicket/select2/DragAndDropBehavior.java b/wicket-select2/src/main/java/com/vaynberg/wicket/select2/DragAndDropBehavior.java index 02be5fe..67f9b92 100644 --- a/wicket-select2/src/main/java/com/vaynberg/wicket/select2/DragAndDropBehavior.java +++ b/wicket-select2/src/main/java/com/vaynberg/wicket/select2/DragAndDropBehavior.java @@ -12,6 +12,7 @@ * * @author Tom Götz (tom@decoded.de) */ +@SuppressWarnings("serial") public class DragAndDropBehavior extends Behavior { @Override diff --git a/wicket-select2/src/main/java/com/vaynberg/wicket/select2/JQuery.java b/wicket-select2/src/main/java/com/vaynberg/wicket/select2/JQuery.java old mode 100755 new mode 100644 diff --git a/wicket-select2/src/main/java/com/vaynberg/wicket/select2/JsonResourceReference.java b/wicket-select2/src/main/java/com/vaynberg/wicket/select2/JsonResourceReference.java new file mode 100644 index 0000000..a3f1123 --- /dev/null +++ b/wicket-select2/src/main/java/com/vaynberg/wicket/select2/JsonResourceReference.java @@ -0,0 +1,63 @@ +package com.vaynberg.wicket.select2; + +import java.io.ByteArrayOutputStream; + +import org.apache.wicket.request.resource.IResource; +import org.apache.wicket.request.resource.ResourceReference; +import org.apache.wicket.request.resource.ResourceStreamResource; +import org.apache.wicket.util.resource.StringResourceStream; + + + +/** + * A resource that serves JSON for stateless . You have to mount at application init like. E.g. + * + *

+ *

+ * 	mountResource(CATEGORIES_JSON, new JsonResourceReference() {
+ * 			
+ * 			private static final long serialVersionUID = 1L;
+ * 	
+ * 			protected ChoiceProvider getChoiceProvider() {
+ * 				return CategoriesTextChoiceProvider.getInstance();
+ * 			}
+ * 		});
+ * 		
+ * 
+ *

+ * + * and then on component you add + * + *

+ *

+ *  	Select2MultiChoice c = new Select2MultiChoice("categories", new PropertyModel>(searchBean, "translations"), CategoriesTextChoiceProvider.getInstance());
+ *  	c.getSettings().setStateless(true);
+ *  	c.getSettings().setMountPath(Application.CATEGORIES_JSON);
+ *  
+ *

+ * + * @author Ernesto Reinaldo Barreiro (reiern70@mail.com). + */ +public abstract class JsonResourceReference extends ResourceReference { + private static final long serialVersionUID = 1L; + + public JsonResourceReference() { + super(JsonResourceReference.class, "images"); + } + + @Override + public IResource getResource() { + ByteArrayOutputStream webResponse = new ByteArrayOutputStream(); + AbstractSelect2Choice.generateJSON(getChoiceProvider(), webResponse); + StringResourceStream resourceStream = new StringResourceStream(webResponse.toString(), "application/json"); + return new ResourceStreamResource(resourceStream); + } + + /** + * The choice provider. + * + * @return + */ + protected abstract ChoiceProvider getChoiceProvider(); + +} diff --git a/wicket-select2/src/main/java/com/vaynberg/wicket/select2/Response.java b/wicket-select2/src/main/java/com/vaynberg/wicket/select2/Response.java old mode 100755 new mode 100644 diff --git a/wicket-select2/src/main/java/com/vaynberg/wicket/select2/Select2Choice.java b/wicket-select2/src/main/java/com/vaynberg/wicket/select2/Select2Choice.java index 1642abc..bcb3601 100755 --- a/wicket-select2/src/main/java/com/vaynberg/wicket/select2/Select2Choice.java +++ b/wicket-select2/src/main/java/com/vaynberg/wicket/select2/Select2Choice.java @@ -32,7 +32,9 @@ */ public class Select2Choice extends AbstractSelect2Choice { - public Select2Choice(String id, IModel model, ChoiceProvider provider) { + private static final long serialVersionUID = 1L; + + public Select2Choice(String id, IModel model, ChoiceProvider provider) { super(id, model, provider); } diff --git a/wicket-select2/src/main/java/com/vaynberg/wicket/select2/Select2MultiChoice.java b/wicket-select2/src/main/java/com/vaynberg/wicket/select2/Select2MultiChoice.java index 0b7d0c4..a98cbeb 100755 --- a/wicket-select2/src/main/java/com/vaynberg/wicket/select2/Select2MultiChoice.java +++ b/wicket-select2/src/main/java/com/vaynberg/wicket/select2/Select2MultiChoice.java @@ -32,18 +32,35 @@ * @param * type of choice object */ +@SuppressWarnings("serial") public class Select2MultiChoice extends AbstractSelect2Choice> { + /** + * Construct. + * @param id + * @param model + * @param provider + */ public Select2MultiChoice(String id, IModel> model, ChoiceProvider provider) { - super(id, model, provider); + super(id, model, provider); } + /** + * Construct. + * @param id + * @param model + */ public Select2MultiChoice(String id, IModel> model) { - super(id, model); + super(id, model); } + /** + * Construct. + * + * @param id + */ public Select2MultiChoice(String id) { - super(id); + super(id); } @Override diff --git a/wicket-select2/src/main/java/com/vaynberg/wicket/select2/Select2ResourcesBehavior.java b/wicket-select2/src/main/java/com/vaynberg/wicket/select2/Select2ResourcesBehavior.java index dd66e7b..9e22fba 100755 --- a/wicket-select2/src/main/java/com/vaynberg/wicket/select2/Select2ResourcesBehavior.java +++ b/wicket-select2/src/main/java/com/vaynberg/wicket/select2/Select2ResourcesBehavior.java @@ -27,6 +27,7 @@ * @author igor * */ +@SuppressWarnings("serial") public class Select2ResourcesBehavior extends Behavior { @Override diff --git a/wicket-select2/src/main/java/com/vaynberg/wicket/select2/Settings.java b/wicket-select2/src/main/java/com/vaynberg/wicket/select2/Settings.java index 954c8dc..3c6b1f0 100755 --- a/wicket-select2/src/main/java/com/vaynberg/wicket/select2/Settings.java +++ b/wicket-select2/src/main/java/com/vaynberg/wicket/select2/Settings.java @@ -24,6 +24,7 @@ * * @author igor */ +@SuppressWarnings("serial") public final class Settings implements Serializable { /** @@ -57,6 +58,17 @@ public static class Widths { private String tags; private String separator; private String[] tokenSeparators; + + /** + * If stateless is set to true then component will not be used as context + * for serving JSON. + */ + private boolean stateless = false; + + /** + * Path to which JSON producing resource will be attached. + */ + private String mountPath; public CharSequence toJson() { try { @@ -221,7 +233,7 @@ public AjaxSettings getAjax() { } public AjaxSettings getAjax(boolean createIfNotSet) { - if (createIfNotSet && ajax == null) { + if (createIfNotSet) { ajax = new AjaxSettings(); } return ajax; @@ -367,4 +379,20 @@ public void setTokenSeparators(String[] tokenSeparators) { this.tokenSeparators = tokenSeparators; } + public boolean isStateless() { + return stateless; + } + + public void setStateless(boolean stateless) { + this.stateless = stateless; + } + + public String getMountPath() { + return mountPath; + } + + public void setMountPath(String mountPath) { + this.mountPath = mountPath; + } + } diff --git a/wicket-select2/src/main/java/com/vaynberg/wicket/select2/StringTextChoiceProvider.java b/wicket-select2/src/main/java/com/vaynberg/wicket/select2/StringTextChoiceProvider.java index 2344bd4..9cf43af 100644 --- a/wicket-select2/src/main/java/com/vaynberg/wicket/select2/StringTextChoiceProvider.java +++ b/wicket-select2/src/main/java/com/vaynberg/wicket/select2/StringTextChoiceProvider.java @@ -7,6 +7,7 @@ * * @author Tom Götz (tom@decoded.de) */ +@SuppressWarnings("serial") public abstract class StringTextChoiceProvider extends TextChoiceProvider { @Override diff --git a/wicket-select2/src/main/java/com/vaynberg/wicket/select2/TextChoiceProvider.java b/wicket-select2/src/main/java/com/vaynberg/wicket/select2/TextChoiceProvider.java old mode 100755 new mode 100644 index 3f5a01c..842e9c2 --- a/wicket-select2/src/main/java/com/vaynberg/wicket/select2/TextChoiceProvider.java +++ b/wicket-select2/src/main/java/com/vaynberg/wicket/select2/TextChoiceProvider.java @@ -22,6 +22,7 @@ * * @param type of choice object */ +@SuppressWarnings("serial") public abstract class TextChoiceProvider extends ChoiceProvider { protected abstract String getDisplayText(T choice);