All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.vaadin.v7.data.Item Maven / Gradle / Ivy

The newest version!
/*
 * Copyright (C) 2000-2024 Vaadin Ltd
 *
 * This program is available under Vaadin Commercial License and Service Terms.
 *
 * See  for the full
 * license.
 */

package com.vaadin.v7.data;

import java.io.Serializable;
import java.util.Collection;

import com.vaadin.data.Binder;
import com.vaadin.data.provider.DataProvider;

/**
 * 

* Provides a mechanism for handling a set of Properties, each associated to a * locally unique non-null identifier. The interface is split into subinterfaces * to enable a class to implement only the functionalities it needs. *

* * @author Vaadin Ltd * @since 3.0 * @deprecated As of 8.0, no direct replacement available, see {@link Binder}, {@link DataProvider} */ @Deprecated public interface Item extends Serializable { /** * Gets the Property corresponding to the given Property ID stored in the * Item. If the Item does not contain the Property, null is * returned. * * @param id * identifier of the Property to get * @return the Property with the given ID or null */ public Property getItemProperty(Object id); /** * Gets the collection of IDs of all Properties stored in the Item. * * @return unmodifiable collection containing IDs of the Properties stored * the Item */ public Collection getItemPropertyIds(); /** * Tries to add a new Property into the Item. * *

* This functionality is optional. *

* * @param id * ID of the new Property * @param property * the Property to be added and associated with the id * @return true if the operation succeeded, false * if not * @throws UnsupportedOperationException * if the operation is not supported. */ public boolean addItemProperty(Object id, Property property) throws UnsupportedOperationException; /** * Removes the Property identified by ID from the Item. * *

* This functionality is optional. *

* * @param id * ID of the Property to be removed * @return true if the operation succeeded * @throws UnsupportedOperationException * if the operation is not supported. false if not */ public boolean removeItemProperty(Object id) throws UnsupportedOperationException; /** * Interface implemented by viewer classes capable of using an Item as a * data source. */ @Deprecated public interface Viewer extends Serializable { /** * Sets the Item that serves as the data source of the viewer. * * @param newDataSource * The new data source Item */ public void setItemDataSource(Item newDataSource); /** * Gets the Item serving as the data source of the viewer. * * @return data source Item */ public Item getItemDataSource(); } /** * Interface implemented by the Editor classes capable of * editing the Item. Implementing this interface means that the Item serving * as the data source of the editor can be modified through it. *

* Note : Not implementing the Item.Editor interface does not * restrict the class from editing the contents of an internally. *

*/ @Deprecated public interface Editor extends Item.Viewer { } /* Property set change event */ /** * An Event object specifying the Item whose contents has been * changed through the Property interface. *

* Note: The values stored in the Properties may change without triggering * this event. *

*/ @Deprecated public interface PropertySetChangeEvent extends Serializable { /** * Retrieves the Item whose contents has been modified. * * @return source Item of the event */ public Item getItem(); } /** * The listener interface for receiving PropertySetChangeEvent * objects. */ @Deprecated public interface PropertySetChangeListener extends Serializable { /** * Notifies this listener that the Item's property set has changed. * * @param event * Property set change event object */ public void itemPropertySetChange(Item.PropertySetChangeEvent event); } /** * The interface for adding and removing PropertySetChangeEvent * listeners. By implementing this interface a class explicitly announces * that it will generate a PropertySetChangeEvent when its * Property set is modified. *

* Note : The general Java convention is not to explicitly declare that a * class generates events, but to directly define the * addListener and removeListener methods. That * way the caller of these methods has no real way of finding out if the * class really will send the events, or if it just defines the methods to * be able to implement an interface. *

*/ @Deprecated public interface PropertySetChangeNotifier extends Serializable { /** * Registers a new property set change listener for this Item. * * @param listener * The new Listener to be registered. */ public void addPropertySetChangeListener( Item.PropertySetChangeListener listener); /** * @deprecated As of 7.0, replaced by * {@link #addPropertySetChangeListener(PropertySetChangeListener)} */ @Deprecated public void addListener(Item.PropertySetChangeListener listener); /** * Removes a previously registered property set change listener. * * @param listener * Listener to be removed. */ public void removePropertySetChangeListener( Item.PropertySetChangeListener listener); /** * @deprecated As of 7.0, replaced by * {@link #removePropertySetChangeListener(PropertySetChangeListener)} */ @Deprecated public void removeListener(Item.PropertySetChangeListener listener); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy