001    /*
002     * Created on Apr 12, 2008
003     *
004     * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
005     * the License. You may obtain a copy of the License at
006     *
007     * http://www.apache.org/licenses/LICENSE-2.0
008     *
009     * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
010     * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
011     * specific language governing permissions and limitations under the License.
012     *
013     * Copyright @2008-2010 the original author or authors.
014     */
015    package org.fest.swing.cell;
016    
017    import javax.swing.JList;
018    
019    import org.fest.swing.annotation.RunsInCurrentThread;
020    
021    /**
022     * Understands reading the internal value of a cell in a <code>{@link JList}</code> as expected in a test.
023     * <p>
024     * <b>Note:</b> methods in this interface are <b>not</b> guaranteed to be executed in the event dispatch thread (EDT.)
025     * Clients are responsible for invoking them in the EDT.
026     * </p>
027     *
028     * @author Alex Ruiz
029     */
030    @RunsInCurrentThread
031    public interface JListCellReader {
032    
033      /**
034       * Returns the internal value of a cell in a <code>{@link JList}</code> as expected in a test.
035       * <p>
036       * <b>Note:</b> Implementations of this method <b>may not</b> guaranteed to be executed in the event dispatch thread
037       * (EDT.) Clients are responsible for invoking this method in the EDT.
038       * </p>
039       * @param list the given <code>JList</code>.
040       * @param index the index of the cell.
041       * @return the internal value of a cell in a <code>JList</code> as expected in a test.
042       */
043      String valueAt(JList list, int index);
044    }