Author: tchemit Date: 2010-03-10 11:09:23 +0100 (Wed, 10 Mar 2010) New Revision: 1793 Log: Evolution #368: Remove org.nuiton.util.EnumEditor Removed: trunk/src/main/java/org/nuiton/util/EnumEditor.java Deleted: trunk/src/main/java/org/nuiton/util/EnumEditor.java =================================================================== --- trunk/src/main/java/org/nuiton/util/EnumEditor.java 2010-03-09 23:13:37 UTC (rev 1792) +++ trunk/src/main/java/org/nuiton/util/EnumEditor.java 2010-03-10 10:09:23 UTC (rev 1793) @@ -1,53 +0,0 @@ -/* -* *##% Nuiton utilities library - * Copyright (C) 2004 - 2009 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 - * 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 - * License along with this program. If not, see - * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%* */ -package org.nuiton.util; - - -import javax.swing.JComboBox; -import java.util.EnumSet; - -/** - * Une éditeur d'enum. - * - * @author chemit - * - * @deprecated since 1.1.0, will be moved in jaxx-runtime-swing - */ -@Deprecated -public class EnumEditor extends JComboBox { - - /** serialVersionUID */ - private static final long serialVersionUID = 2693771553067104538L; - - protected Class<? extends Enum<?>> type; - - public static EnumEditor newEditor(Class<?> type) { - return new EnumEditor(type); - } - - public EnumEditor(Class<?> type) { - super(buildModel(type)); - } - - protected static Object[] buildModel(Class<?> type) { - Class<Enum> enumClass = ReflectUtil.getEnumClass(type); - EnumSet result = EnumSet.allOf(enumClass); - return result.toArray(new Object[result.size()]); - } - -}