KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > wings > SAbstractClickable


1 /*
2  * $Id: SAbstractClickable.java,v 1.6 2005/05/26 13:18:08 neurolabs Exp $
3  * Copyright 2000,2005 wingS development team.
4  *
5  * This file is part of wingS (http://www.j-wings.org).
6  *
7  * wingS is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU Lesser General Public License
9  * as published by the Free Software Foundation; either version 2.1
10  * of the License, or (at your option) any later version.
11  *
12  * Please see COPYING for the complete licence.
13  */

14 package org.wings;
15
16 import org.wings.plaf.ClickableCG;
17
18 /**
19  * @author armin
20  * created at 24.02.2004 13:07:02
21  */

22 public abstract class SAbstractClickable
23         extends SAbstractIconTextCompound {
24
25     /**
26      * Creates a new <code>SClickable</code> instance with the specified text
27      * (left alligned) and no icon.
28      *
29      * @param text The text to be displayed by the label.
30      */

31     public SAbstractClickable(String JavaDoc text) {
32         this(text, null, SConstants.LEFT);
33     }
34
35     /**
36      * Creates a new <code>SClickable</code> instance with no text and no icon.
37      */

38     public SAbstractClickable() {
39         this((String JavaDoc) null);
40     }
41
42     /**
43      * Creates a new <code>SClickable</code> instance with the specified icon
44      * (left alligned) and no text.
45      *
46      * @param icon The image to be displayed by the label.
47      */

48     public SAbstractClickable(SIcon icon) {
49         this(icon, SConstants.LEFT);
50     }
51
52     /**
53      * Creates a new <code>SClickable</code> instance with the specified icon
54      * (alligned as specified) and no text.
55      *
56      * @param icon The image to be displayed by the clickable.
57      * @param horizontalAlignment One of the following constants defined in
58      * <code>SConstants</code>:
59      * <code>LEFT</code>, <code>CENTER</code>, <code>RIGHT</code>.
60      * @see SConstants
61      */

62     public SAbstractClickable(SIcon icon, int horizontalAlignment) {
63         this(null, icon, horizontalAlignment);
64     }
65
66     /**
67      * Creates a new <code>SClickable</code> instance with the specified icon
68      * and the specified text (left alligned).
69      *
70      * @param text The text to be displayed by the SClickable.
71      * @param icon The image to be displayed by the SClickable.
72      */

73     public SAbstractClickable(String JavaDoc text, SIcon icon) {
74         setText(text);
75         setIcon(icon);
76         setHorizontalAlignment(SConstants.LEFT);
77     }
78
79     /**
80      * Creates a new <code>SClickable</code> instance with the specified icon
81      * and the specified text (alligned as specified).
82      *
83      * @param text The text to be displayed by the SClickable.
84      * @param icon The image to be displayed by the SClickable.
85      * @param horizontalAlignment One of the following constants defined in
86      * <code>SConstants</code>:
87      * <code>LEFT</code>, <code>CENTER</code>, <code>RIGHT</code>.
88      * @see SConstants
89      */

90     public SAbstractClickable(String JavaDoc text, SIcon icon, int horizontalAlignment) {
91         setText(text);
92         setIcon(icon);
93         setHorizontalAlignment(horizontalAlignment);
94     }
95
96     /**
97      * Creates a new <code>SClickable</code> instance with the specified text
98      * (alligned as specified) and no icon.
99      *
100      * @param text The text to be displayed by the SClickable.
101      * @param horizontalAlignment One of the following constants defined in
102      * <code>SConstants</code>:
103      * <code>LEFT</code>, <code>CENTER</code>, <code>RIGHT</code>.
104      * @see SConstants
105      */

106     public SAbstractClickable(String JavaDoc text, int horizontalAlignment) {
107         this(text, null, horizontalAlignment);
108     }
109
110     public abstract boolean isEpochCheckEnabled();
111
112     public abstract SimpleURL getURL();
113
114     public void setCG(ClickableCG cg) {
115         super.setCG(cg);
116     }
117 }
118
Popular Tags