2 * jSite-next - InsertListenerSupport.java -
3 * Copyright © 2008 David Roden
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 package net.pterodactylus.jsite.core;
22 import net.pterodactylus.util.event.ListenerSupport;
25 * Helper class that fires {@link InsertListener} events.
27 * @author David ‘Bombe’ Roden <bombe@freenetproject.org>
29 public class InsertListenerSupport extends ListenerSupport<InsertListener> {
32 * Notifies all listeners that the insert was added.
34 * @see InsertListener#insertAdded(Insert)
36 * The insert that was added
38 public void fireInsertAdded(Insert insert) {
39 for (InsertListener insertListener : getListeners()) {
40 insertListener.insertAdded(insert);
45 * Notifies all listeners that the insert was removed.
47 * @see InsertListener#insertRemoved(Insert)
49 * The insert that was removed
51 public void fireInsertRemoved(Insert insert) {
52 for (InsertListener insertListener : getListeners()) {
53 insertListener.insertRemoved(insert);
58 * Notifies all listeners that the insert was started.
60 * @see InsertListener#insertStarted(Insert)
62 * The insert that was started
64 public void fireInsertStarted(Insert insert) {
65 for (InsertListener insertListener : getListeners()) {
66 insertListener.insertStarted(insert);
71 * Notifies all listeners that the insert made progress.
73 * @see InsertListener#insertProgressed(Insert)
75 * The insert that made progress
77 public void fireInsertProgressed(Insert insert) {
78 for (InsertListener insertListener : getListeners()) {
79 insertListener.insertProgressed(insert);
84 * Notifies all listeners that the insert generated a URI.
86 * @see InsertListener#insertGeneratedURI(Insert, String)
88 * The insert that generated a URI
90 * The URI that was generated
92 public void fireInsertGeneratedURI(Insert insert, String generatedUri) {
93 for (InsertListener insertListener : getListeners()) {
94 insertListener.insertGeneratedURI(insert, generatedUri);
99 * Notifies all listeners that the insert has finished.
101 * @see InsertListener#insertFinished(Insert)
103 * The insert that was finished
105 public void fireInsertFinished(Insert insert) {
106 for (InsertListener insertListener : getListeners()) {
107 insertListener.insertFinished(insert);