001    package data.events;
002    
003    import java.util.*;
004    
005    /**
006     * Listener listening for StockChangeEvents.
007     *
008     * @author Steffen Zschaler
009     * @version 2.0 19/08/1999
010     * @since v2.0
011     */
012    public interface StockChangeListener extends EventListener {
013    
014        /**
015         * Called whenever StockItems were added to the Stock.
016         *
017         * @override Always
018         *
019         * @param e an event object describing the event.
020         */
021        public void addedStockItems(StockChangeEvent e);
022    
023        /**
024         * Called whenever the adding of StockItems was commited.
025         *
026         * @override Always
027         *
028         * @param e an event object describing the event.
029         */
030        public void commitAddStockItems(StockChangeEvent e);
031    
032        /**
033         * Called whenever the adding of StockItems was rolled back.
034         *
035         * @override Always
036         *
037         * @param e an event object describing the event.
038         */
039        public void rollbackAddStockItems(StockChangeEvent e);
040    
041        /**
042         * Called to ask whether certain StockItems may be removed. If one of the listeners vetos the removal, all
043         * listeners that had already been asked will receive a {@link #noRemoveStockItems noRemoveStockItems}
044         * event.
045         *
046         * @override Always
047         *
048         * @param e an event object describing the event.
049         *
050         * @exception VetoException if the listener wants to veto the removal.
051         */
052        public void canRemoveStockItems(StockChangeEvent e) throws VetoException;
053    
054        /**
055         * Called for each listener that already agreed with a removal that was then rejected by another listener.
056         *
057         * @override Always
058         *
059         * @param e an event object describing the event.
060         */
061        public void noRemoveStockItems(StockChangeEvent e);
062    
063        /**
064         * Called whenever StockItems were removed from the Stock.
065         *
066         * @override Always
067         *
068         * @param e an event object describing the event.
069         */
070        public void removedStockItems(StockChangeEvent e);
071    
072        /**
073         * Called whenever the removal of StockItems was commited.
074         *
075         * @override Always
076         *
077         * @param e an event object describing the event.
078         */
079        public void commitRemoveStockItems(StockChangeEvent e);
080    
081        /**
082         * Called whenever the removal of StockItems was rolled back.
083         *
084         * @override Always
085         *
086         * @param e an event object describing the event.
087         */
088        public void rollbackRemoveStockItems(StockChangeEvent e);
089    
090        /**
091         * Called to ask whether certain StockItems may be edited. If one of the listeners vetos the editing, all
092         * listeners that had already been asked will receive a {@link #noEditStockItems noEditStockItems}
093         * event.
094         *
095         * @override Always
096         *
097         * @param e an event object describing the event.
098         *
099         * @exception VetoException if the listener wants to veto the editing.
100         */
101        public void canEditStockItems(StockChangeEvent e) throws VetoException;
102    
103        /**
104         * Called for each listener that already agreed with an editing that was then rejected by another listener.
105         *
106         * @override Always
107         *
108         * @param e an event object describing the event.
109         */
110        public void noEditStockItems(StockChangeEvent e);
111    
112        /**
113         * Called whenever the Stock began editing StockItems. This event may be accompanied by a
114         * <code>removedStockItems</code> and a <code>addedStockItems</code> event, but this is implementation
115         * specific.
116         *
117         * @override Always
118         *
119         * @param e an event object describing the event.
120         */
121        public void editingStockItems(StockChangeEvent e);
122    
123        /**
124         * Called whenever the editing of StockItems was commited.
125         *
126         * @override Always
127         *
128         * @param e an event object describing the event.
129         */
130        public void commitEditStockItems(StockChangeEvent e);
131    
132        /**
133         * Called whenever the editing of StockItems was rolled back.
134         *
135         * @override Always
136         *
137         * @param e an event object describing the event.
138         */
139        public void rollbackEditStockItems(StockChangeEvent e);
140    }