New server side tooltip behavior added.
[utils] / wicket / components / src / main / java / org / wamblee / wicket / behavior / AbstractTooltipBehavior.java
1 /*
2  * Copyright 2005-2010 the original author or authors.
3  * 
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  * 
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  * 
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 package org.wamblee.wicket.behavior;
17
18 import org.apache.wicket.behavior.IBehavior;
19 import org.wamblee.wicket.jquery.AbstractJQueryBehavior;
20
21 /**
22  * Abstract tooltip behavior providing common options for tooltips.
23  * 
24  * @author Erik Brakkee
25  */
26 public class AbstractTooltipBehavior extends AbstractJQueryBehavior {
27
28     private String border;
29     private String padding;
30     private String background;
31
32     public AbstractTooltipBehavior(String aFunction, IBehavior... aBehaviors) {
33         super(aFunction, aBehaviors);
34     }
35
36     public AbstractTooltipBehavior border(String aValue) { 
37         border = aValue;
38         return this; 
39     }
40
41     public AbstractTooltipBehavior padding(String aValue) { 
42         padding = aValue; 
43         return this; 
44     }
45
46     public AbstractTooltipBehavior background(String aValue) { 
47         background = aValue; 
48         return this; 
49     }
50
51     @Override
52     protected Object getConfigurationObject() {
53         return this; 
54     }
55
56     public String getBorder() {
57         return border;
58     }
59
60     public String getPadding() {
61         return padding;
62     }
63
64     public String getBackground() {
65         return background;
66     }
67
68 }