|
|||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
ILinkComponent.java | - | - | - | - |
|
1 | // Copyright 2004, 2005 The Apache Software Foundation | |
2 | // | |
3 | // Licensed under the Apache License, Version 2.0 (the "License"); | |
4 | // you may not use this file except in compliance with the License. | |
5 | // You may obtain a copy of the License at | |
6 | // | |
7 | // http://www.apache.org/licenses/LICENSE-2.0 | |
8 | // | |
9 | // Unless required by applicable law or agreed to in writing, software | |
10 | // distributed under the License is distributed on an "AS IS" BASIS, | |
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
12 | // See the License for the specific language governing permissions and | |
13 | // limitations under the License. | |
14 | ||
15 | package org.apache.tapestry.components; | |
16 | ||
17 | import org.apache.tapestry.IComponent; | |
18 | import org.apache.tapestry.IMarkupWriter; | |
19 | import org.apache.tapestry.IRequestCycle; | |
20 | import org.apache.tapestry.engine.ILink; | |
21 | ||
22 | /** | |
23 | * A component that renders an HTML <a> element. It exposes some properties to the components | |
24 | * it wraps. This is basically to facilitate the {@link org.apache.tapestry.html.Rollover} | |
25 | * component. | |
26 | * | |
27 | * @author Howard Lewis Ship | |
28 | */ | |
29 | ||
30 | public interface ILinkComponent extends IComponent | |
31 | { | |
32 | ||
33 | /** | |
34 | * Returns the desired scheme (i.e., "http" or "https") for the link, or null to not output a | |
35 | * specific scheme (in which case the URL will fall under the incoming request's scheme). | |
36 | * | |
37 | * @since 4.0 | |
38 | */ | |
39 | ||
40 | public String getScheme(); | |
41 | ||
42 | /** | |
43 | * Returns whether this service link component is enabled or disabled. | |
44 | * | |
45 | * @since 0.2.9 | |
46 | */ | |
47 | ||
48 | public boolean isDisabled(); | |
49 | ||
50 | /** | |
51 | * Returns the anchor defined for this link, or null for no anchor. | |
52 | * | |
53 | * @since 3.0 | |
54 | */ | |
55 | ||
56 | public String getAnchor(); | |
57 | ||
58 | /** | |
59 | * Returns the name of the target window or frame for this link, or null if current window or | |
60 | * frame is to be used. | |
61 | * | |
62 | * @since 4.0 | |
63 | */ | |
64 | public String getTarget(); | |
65 | ||
66 | /** | |
67 | * Adds a new event handler. When the event occurs, the JavaScript function specified is | |
68 | * executed. Multiple functions can be specified, in which case all of them are executed. | |
69 | * <p> | |
70 | * This was created for use by {@link org.apache.tapestry.html.Rollover} to set mouse over and | |
71 | * mouse out handlers on the {@link ILinkComponent} that wraps it, but can be used for many | |
72 | * other things as well. | |
73 | * | |
74 | * @since 0.2.9 | |
75 | */ | |
76 | ||
77 | public void addEventHandler(LinkEventType type, String functionName); | |
78 | ||
79 | /** | |
80 | * Invoked by the {@link org.apache.tapestry.link.ILinkRenderer} (if the link is not disabled) | |
81 | * to provide a {@link org.apache.tapestry.engine.EngineServiceLink} that the renderer can | |
82 | * convert into a URL. | |
83 | */ | |
84 | ||
85 | public ILink getLink(IRequestCycle cycle); | |
86 | ||
87 | /** | |
88 | * Invoked (by the {@link org.apache.tapestry.link.ILinkRenderer}) to make the link render any | |
89 | * additional attributes. These are informal parameters, plus any attributes related to events. | |
90 | * This is only invoked for non-disabled links. | |
91 | * | |
92 | * @since 3.0 | |
93 | */ | |
94 | ||
95 | public void renderAdditionalAttributes(IMarkupWriter writer, IRequestCycle cycle); | |
96 | } |
|