@@ -0,0 +1,2270 @@
+/*%0A * Copyright (c) 2006-2010 Chris Smith, Shane Mc Cormack, Gregory Holmes%0A *%0A * Permission is hereby granted, free of charge, to any person obtaining a copy%0A * of this software and associated documentation files (the %22Software%22), to deal%0A * in the Software without restriction, including without limitation the rights%0A * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell%0A * copies of the Software, and to permit persons to whom the Software is%0A * furnished to do so, subject to the following conditions:%0A *%0A * The above copyright notice and this permission notice shall be included in%0A * all copies or substantial portions of the Software.%0A *%0A * THE SOFTWARE IS PROVIDED %22AS IS%22, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR%0A * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,%0A * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE%0A * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER%0A * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,%0A * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE%0A * SOFTWARE.%0A */%0A%0Apackage com.dmdirc.addons.ui_swing.components;%0A%0Aimport javax.swing.ComboBoxModel;%0A%0A/**%0A * Generic combo box model, extends generic list model.%0A *%0A * @param %3CT%3E Model holds this type of object%0A */%0Apublic class GenericComboBoxModel%3CT%3E extends GenericListModel%3CT%3E implements%0A        ComboBoxModel %7B%0A%0A    /**%0A     * A version number for this class. It should be changed whenever the class%0A     * structure is changed (or anything else that would prevent serialized%0A     * objects being unserialized with the new class).%0A     */%0A    private static final long serialVersionUID = 2;%0A    /** Selected Object. */%0A    private T selectedObject;%0A%0A    /** %7B@inheritDoc%7D */%0A    @Override%0A    @SuppressWarnings(%22unchecked%22)%0A    public void setSelectedItem(final Object anItem) %7B%0A        if ((selectedObject != null && !selectedObject.equals(anItem)) %7C%7C selectedObject%0A                == null && anItem != null) %7B%0A            selectedObject = (T) anItem;%0A            fireContentsChanged(this, -1, -1);%0A        %7D%0A    %7D%0A%0A    /** %7B@inheritDoc%7D */%0A    @Override%0A    public T getSelectedItem() %7B%0A        return selectedObject;%0A    %7D%0A%7D%0A

Add generic combo box model.