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