|
|||||||||||||||||||
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover | |||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
LinkEventType.java | - | 100% | 100% | 100% |
|
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.commons.lang.enum.Enum;
|
|
18 |
|
|
19 |
/**
|
|
20 |
* Different types of JavaScript events that an {@link ILinkComponent}
|
|
21 |
* can provide handlers for.
|
|
22 |
*
|
|
23 |
* @author Howard Lewis Ship
|
|
24 |
* @since 0.2.9
|
|
25 |
*
|
|
26 |
**/
|
|
27 |
|
|
28 |
public class LinkEventType extends Enum |
|
29 |
{ |
|
30 |
private String _attributeName;
|
|
31 |
|
|
32 |
/**
|
|
33 |
* Type for <code>onMouseOver</code>. This may also be called "focus".
|
|
34 |
*
|
|
35 |
**/
|
|
36 |
|
|
37 |
public static final LinkEventType MOUSE_OVER = new LinkEventType("MOUSE_OVER", "onMouseOver"); |
|
38 |
|
|
39 |
/**
|
|
40 |
* Type for <code>onMouseOut</code>. This may also be called "blur".
|
|
41 |
*
|
|
42 |
**/
|
|
43 |
|
|
44 |
public static final LinkEventType MOUSE_OUT = new LinkEventType("MOUSE_OUT", "onMouseOut"); |
|
45 |
|
|
46 |
/**
|
|
47 |
* Type for <code>onClick</code>.
|
|
48 |
*
|
|
49 |
* @since 1.0.1
|
|
50 |
*
|
|
51 |
**/
|
|
52 |
|
|
53 |
public static final LinkEventType CLICK = new LinkEventType("CLICK", "onClick"); |
|
54 |
|
|
55 |
/**
|
|
56 |
* Type for <code>onDblClick</code>.
|
|
57 |
*
|
|
58 |
* @since 1.0.1
|
|
59 |
*
|
|
60 |
**/
|
|
61 |
|
|
62 |
public static final LinkEventType DOUBLE_CLICK = |
|
63 |
new LinkEventType("DOUBLE_CLICK", "onDblClick"); |
|
64 |
|
|
65 |
/**
|
|
66 |
* Type for <code>onMouseDown</code>.
|
|
67 |
*
|
|
68 |
* @since 1.0.1.
|
|
69 |
*
|
|
70 |
**/
|
|
71 |
|
|
72 |
public static final LinkEventType MOUSE_DOWN = new LinkEventType("MOUSE_DOWN", "onMouseDown"); |
|
73 |
|
|
74 |
/**
|
|
75 |
* Type for <code>onMouseUp</code>.
|
|
76 |
*
|
|
77 |
* @since 1.0.1
|
|
78 |
*
|
|
79 |
**/
|
|
80 |
|
|
81 |
public static final LinkEventType MOUSE_UP = new LinkEventType("MOUSE_UP", "onMouseUp"); |
|
82 |
|
|
83 |
/**
|
|
84 |
* Constructs a new type of event. The name should match the
|
|
85 |
* static final variable (i.e., MOUSE_OVER) and the attributeName
|
|
86 |
* is the name of the HTML attribute to be managed (i.e., "onMouseOver").
|
|
87 |
*
|
|
88 |
* <p>This method is protected so that subclasses can be created
|
|
89 |
* to provide additional managed event types.
|
|
90 |
**/
|
|
91 |
|
|
92 | 6 |
protected LinkEventType(String name, String attributeName)
|
93 |
{ |
|
94 | 6 |
super(name);
|
95 |
|
|
96 | 6 |
_attributeName = attributeName; |
97 |
} |
|
98 |
|
|
99 |
/**
|
|
100 |
* Returns the name of the HTML attribute corresponding to this
|
|
101 |
* type.
|
|
102 |
*
|
|
103 |
**/
|
|
104 |
|
|
105 | 1 |
public String getAttributeName()
|
106 |
{ |
|
107 | 1 |
return _attributeName;
|
108 |
} |
|
109 |
} |
|