001    /*
002     * Created on Dec 23, 2009
003     *
004     * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
005     * in compliance with 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
010     * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
011     * or implied. See the License for the specific language governing permissions and limitations under
012     * the License.
013     *
014     * Copyright @2009-2010 the original author or authors.
015     */
016    package org.fest.swing.data;
017    
018    import javax.swing.JTable;
019    
020    import org.fest.swing.annotation.RunsInEDT;
021    import org.fest.swing.cell.JTableCellReader;
022    import org.fest.swing.exception.ActionFailedException;
023    
024    /**
025     * Understands finding a cell in a <code>{@link JTable}</code>.
026     *
027     * @author Alex Ruiz
028     */
029    public interface TableCellFinder {
030    
031      /**
032       * Finds a cell in the given <code>{@link JTable}</code> based on some search criteria specified by this finder.
033       * Implementations of this method <strong>should</strong> access the given <code>JTable</code> in the event dispatch
034       * thread.
035       * @param table the target <code>JTable</code>.
036       * @param cellReader knows how to read the contents of a cell in a <code>JTable</code>.
037       * @return the cell found, if any.
038       * @throws ActionFailedException if a matching cell could not be found.
039       */
040      @RunsInEDT
041      TableCell findCell(JTable table, JTableCellReader cellReader);
042    }