001/*
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements.  See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License.  You may obtain a copy of the License at
008 *
009 *      http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package org.apache.wicket.extensions.breadcrumb;
018
019import java.util.EventListener;
020
021import org.apache.wicket.util.io.IClusterable;
022
023/**
024 * Bread crumb model listeners get notified by {@link IBreadCrumbModel bread crumb models} of
025 * {@link #breadCrumbActivated(IBreadCrumbParticipant, IBreadCrumbParticipant) activation},
026 * {@link #breadCrumbAdded(IBreadCrumbParticipant) addition} and
027 * {@link #breadCrumbRemoved(IBreadCrumbParticipant) removal} events.
028 * 
029 * @author Eelco Hillenius
030 */
031public interface IBreadCrumbModelListener extends EventListener, IClusterable
032{
033        /**
034         * Called when a bread crumb was activated.
035         * 
036         * @param previousParticipant
037         *            The previously active participant
038         * 
039         * @param breadCrumbParticipant
040         *            The bread crumb that was activated.
041         */
042        default void breadCrumbActivated(IBreadCrumbParticipant previousParticipant,
043                IBreadCrumbParticipant breadCrumbParticipant)
044        {}
045
046        /**
047         * Called when a bread crumb was added to the model.
048         * 
049         * @param breadCrumbParticipant
050         *            The new bread crumb
051         */
052        default void breadCrumbAdded(IBreadCrumbParticipant breadCrumbParticipant)
053        {}
054
055        /**
056         * Called when a bread crumb was removed from the model.
057         * 
058         * @param breadCrumbParticipant
059         *            The bread crumb that was removed
060         */
061        default void breadCrumbRemoved(IBreadCrumbParticipant breadCrumbParticipant)
062        {}
063}