/**
 * Copyright © CENRA (2016)
 *
 * remi.clement@espaces-naturels.fr
 * 
 * This software is a multi-platform and portable application based on 
 * the scientifical toolbox to monitor wetlands. With this toolbox it’s 
 * possible to calculate indicators «RhoMéO» to monitor quality, 
 * fonctionalities and urban and agricultural pressures of wetlands. 
 * Indicators are calculated using naturalist data entered and/or imported,
 * and geographic data downloaded from a geographic server.
 * 
 * This software is governed by the CeCILL license under French law and
 * abiding by the rules of distribution of free software.  You can  use, 
 * modify and/ or redistribute the software under the terms of the CeCILL
 * license as circulated by CEA, CNRS and INRIA at the following URL
 * "http://www.cecill.info". 
 * 
 * As a counterpart to the access to the source code and  rights to copy,
 * modify and redistribute granted by the license, users are provided only
 * with a limited warranty  and the software's author,  the holder of the
 * economic rights,  and the successive licensors  have only  limited
 * liability. 
 * 
 * In this respect, the user's attention is drawn to the risks associated
 * with loading,  using,  modifying and/or developing or reproducing the
 * software by the user in light of its specific status of free software,
 * that may mean  that it is complicated to manipulate,  and  that  also
 * therefore means  that it is reserved for developers  and  experienced
 * professionals having in-depth computer knowledge. Users are therefore
 * encouraged to load and test the software's suitability as regards their
 * requirements in conditions enabling the security of their systems and/or 
 * data to be ensured and,  more generally, to use and operate it in the 
 * same conditions as regards security. 
 * 
 * The fact that you are presently reading this means that you have had
 * knowledge of the CeCILL license and that you accept its terms.
*/
package fr.cenra.rhomeo.api.ui;

import fr.cenra.rhomeo.api.data.Statement;
import javafx.beans.property.ObjectProperty;
import javafx.collections.ObservableList;

/**
 * An editor created from {@link StatementEditorSpi#createEditor() }.
 * @author Alexis Manin (Geomatys)
 * @param <T> Manageable data type.
 */
public interface StatementEditor<T extends Statement> {

    /**
     *
     * @return Data type manageable by current editor.
     */
    Class<T> getDataType();

    /**
     * Asks the editor to focus on a particular item. Optionally, user can also
     * give a property name to focus on into input object.
     *
     * @param item The item to focus on in the editor.
     * @param propertyName If not null, this represents a property of the given
     * item to focus on.
     */
    void focusOn(final T item, final String propertyName);

    /**
     *
     * @return List of items contained (to edit) in this component.
     */
    ObservableList<T> getItems();

    /**
     *
     * @param items Configure this component to work with given set of items.
     */
    void setItems(ObservableList<T> items);

    ObjectProperty<ObservableList<T>> itemsProperty();
}
