01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package org.apache.wicket.extensions.breadcrumb;
18:
19: import org.apache.wicket.Component;
20: import org.apache.wicket.IClusterable;
21: import org.apache.wicket.extensions.breadcrumb.panel.BreadCrumbPanel;
22:
23: /**
24: * Bread crumb participants function as proxies for components that are part of
25: * a bread crumb hierarchy. An example of a bread crumb is:
26: *
27: * <pre>
28: * Home > Products & Solutions > Hardware > Desktop Systems
29: * </pre>
30: *
31: * In a {@link BreadCrumbPanel panel based implementation}, <tt>Home</tt>,
32: * <tt>Products & Solutions</tt> etc would be seperate panels that all are
33: * bread crumb participants: for instance the <tt>Home</tt> participant's
34: * {@link #getTitle() title} would return 'Home', and
35: * {@link #getComponent() the component} would be the corresponding panel.
36: *
37: * @author Eelco Hillenius
38: */
39: public interface IBreadCrumbParticipant extends IClusterable {
40: /**
41: * Gets the participating component. Typically, this is a panel.
42: *
43: * @return The participating component, must return a non-null value
44: */
45: Component getComponent();
46:
47: /**
48: * Gets the title of the bread crumb, which will be used for displaying it.
49: *
50: * @return The title of the bread crumb
51: */
52: String getTitle();
53:
54: /**
55: * Called when the corresponding bread crumb is activated.
56: *
57: * @param previous
58: * The previously active bread crumb participant, possibly null
59: */
60: void onActivate(IBreadCrumbParticipant previous);
61: }
|