View Javadoc

1   /*
2    * Copyright (c) 2007 Creative Sphere Limited.
3    * All rights reserved. This program and the accompanying materials
4    * are made available under the terms of the Eclipse Public License v1.0
5    * which accompanies this distribution, and is available at
6    * http://www.eclipse.org/legal/epl-v10.html
7    *
8    * Contributors:
9    *
10   *   Creative Sphere - initial API and implementation
11   *
12   */
13  package org.abstracthorizon.aequo;
14  
15  import javax.swing.ListModel;
16  import javax.swing.ListSelectionModel;
17  
18  /**
19   * <p>This is model that is in use for compare panels (list, tree, etc...).</p>
20   * 
21   * <p>Essentially it is a list implementation of CompareEntry and a ListModel. List
22   * implementation gives list methods while ListModel gives access to events</p>
23   * 
24   * @param <CompareEntryType> compare entry type
25   * 
26   * @author Daniel Sendula
27   */
28  public interface CompareModel<T, CompareEntryType extends CompareEntry<T>> extends /*List<T>,*/ ListModel {
29  
30      /**
31       * Retruns {@link ListSelectionModel}
32       * @return {@link ListSelectionModel}
33       */
34      ListSelectionModel getSelectionModel();
35      
36      /**
37       * Returns entry for given index
38       * @param index index
39       * @return entry
40       */
41      CompareEntryType get(int index);
42  }