001    /*
002     * Created on Oct 21, 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.driver;
016    
017    import java.awt.Component;
018    
019    import org.fest.swing.annotation.RunsInCurrentThread;
020    
021    /**
022     * Understands reading the value of a <code>{@link Component}</code> that used as a cell renderer.
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 CellRendererReader {
032    
033      /**
034       * Reads the value in the given cell renderer component, or returns <code>null</code> if the component is not
035       * recognized by this reader.
036       * <p>
037       * <b>Note:</b> Implementations of this method <b>may not</b> guaranteed to be executed in the event dispatch thread
038       * (EDT.) Clients are responsible for invoking this method in the EDT.
039       * </p>
040       * @param c the given cell renderer component.
041       * @return the value of the given <code>Component</code>, or <code>null</code> if the renderer belongs to an unknown
042       * component type.
043       */
044      String valueFrom(Component c);
045    }