|
|||||||||||||||||||
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 the desired port (i.e., "80" or "443") for the link, or null to not output a | |
44 | * specific port (in which case the URL will fall under the incoming request's port). | |
45 | * | |
46 | * @since 4.1 | |
47 | */ | |
48 | ||
49 | public Integer getPort(); | |
50 | ||
51 | /** | |
52 | * Returns whether this service link component is enabled or disabled. | |
53 | * | |
54 | * @since 0.2.9 | |
55 | */ | |
56 | ||
57 | public boolean isDisabled(); | |
58 | ||
59 | /** | |
60 | * Returns the anchor defined for this link, or null for no anchor. | |
61 | * | |
62 | * @since 3.0 | |
63 | */ | |
64 | ||
65 | public String getAnchor(); | |
66 | ||
67 | /** | |
68 | * Returns the name of the target window or frame for this link, or null if current window or | |
69 | * frame is to be used. | |
70 | * | |
71 | * @since 4.0 | |
72 | */ | |
73 | public String getTarget(); | |
74 | ||
75 | /** | |
76 | * Adds a new event handler. When the event occurs, the JavaScript function specified is | |
77 | * executed. Multiple functions can be specified, in which case all of them are executed. | |
78 | * <p> | |
79 | * This was created for use by {@link org.apache.tapestry.html.Rollover} to set mouse over and | |
80 | * mouse out handlers on the {@link ILinkComponent} that wraps it, but can be used for many | |
81 | * other things as well. | |
82 | * | |
83 | * @since 0.2.9 | |
84 | */ | |
85 | ||
86 | public void addEventHandler(LinkEventType type, String functionName); | |
87 | ||
88 | /** | |
89 | * Invoked by the {@link org.apache.tapestry.link.ILinkRenderer} (if the link is not disabled) | |
90 | * to provide a {@link org.apache.tapestry.engine.EngineServiceLink} that the renderer can | |
91 | * convert into a URL. | |
92 | */ | |
93 | ||
94 | public ILink getLink(IRequestCycle cycle); | |
95 | ||
96 | /** | |
97 | * Invoked (by the {@link org.apache.tapestry.link.ILinkRenderer}) to make the link render any | |
98 | * additional attributes. These are informal parameters, plus any attributes related to events. | |
99 | * This is only invoked for non-disabled links. | |
100 | * | |
101 | * @since 3.0 | |
102 | */ | |
103 | ||
104 | public void renderAdditionalAttributes(IMarkupWriter writer, IRequestCycle cycle); | |
105 | } |
|