r2592 - trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/model
Author: kmorin Date: 2013-03-07 11:23:58 +0100 (Thu, 07 Mar 2013) New Revision: 2592 Url: http://nuiton.org/projects/jaxx/repository/revisions/2592 Log: add public method to refilter the elements Modified: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/model/JaxxFilterableListModel.java Modified: trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/model/JaxxFilterableListModel.java =================================================================== --- trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/model/JaxxFilterableListModel.java 2013-03-05 11:14:39 UTC (rev 2591) +++ trunk/jaxx-runtime/src/main/java/jaxx/runtime/swing/model/JaxxFilterableListModel.java 2013-03-07 10:23:58 UTC (rev 2592) @@ -9,16 +9,16 @@ * Copyright (C) 2008 - 2013 CodeLutin * %% * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation, either version 3 of the + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Lesser Public License for more details. - * - * You should have received a copy of the GNU General Lesser Public + * + * You should have received a copy of the GNU General Lesser Public * License along with this program. If not, see * <http://www.gnu.org/licenses/lgpl-3.0.html>. * #L% @@ -31,7 +31,6 @@ import java.util.List; import java.util.regex.Pattern; import org.apache.commons.lang3.StringUtils; -import org.apache.commons.logging.LogFactory; import org.nuiton.util.decorator.JXPathDecorator; /** @@ -55,11 +54,14 @@ @Override public E getElementAt(int index) { - if (index < filteredItems.size()) { - return filteredItems.get(index); + E result; + + if (index >= 0 && index < filteredItems.size()) { + result = filteredItems.get(index); } else { - return null; + result = null; } + return result; } @Override @@ -208,6 +210,10 @@ refilter(); } + public void refreshFilteredElements() { + refilter(); + } + protected void refilter() { filteredItems.clear();
participants (1)
-
kmorin@users.nuiton.org