1 |
/******************************************************************************* |
= |
1 |
/******************************************************************************* |
2 |
* Copyright (c) 2000, 2005 IBM Corporation and others. |
|
2 |
* Copyright (c) 2000, 2005 IBM Corporation and others. |
3 |
* All rights reserved. This program and the accompanying materials |
|
3 |
* All rights reserved. This program and the accompanying materials |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
|
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
5 |
* which accompanies this distribution, and is available at |
|
5 |
* which accompanies this distribution, and is available at |
6 |
* http://www.eclipse.org/legal/epl-v10.html |
|
6 |
* http://www.eclipse.org/legal/epl-v10.html |
7 |
* |
|
7 |
* |
8 |
* Contributors: |
|
8 |
* Contributors: |
9 |
* IBM Corporation - initial API and implementation |
|
9 |
* IBM Corporation - initial API and implementation |
10 |
*******************************************************************************/ |
|
10 |
*******************************************************************************/ |
|
|
|
11 |
/******************************************************************************* |
|
|
|
12 |
* Additions/modifications to this source file by Oracle America, Inc. 2011 |
|
|
|
13 |
*******************************************************************************/ |
11 |
package org.eclipse.ercp.swt.mobile; |
|
14 |
package org.eclipse.ercp.swt.mobile; |
12 |
|
|
15 |
|
13 |
import java.util.Locale; |
|
16 |
import java.util.Locale; |
14 |
|
|
17 |
|
15 |
import org.eclipse.swt.SWT; |
|
18 |
import org.eclipse.swt.SWT; |
16 |
import org.eclipse.swt.events.FocusEvent; |
|
19 |
import org.eclipse.swt.events.FocusEvent; |
17 |
import org.eclipse.swt.events.FocusListener; |
|
20 |
import org.eclipse.swt.events.FocusListener; |
18 |
import org.eclipse.swt.events.KeyEvent; |
|
21 |
import org.eclipse.swt.events.KeyEvent; |
19 |
import org.eclipse.swt.events.KeyListener; |
|
22 |
import org.eclipse.swt.events.KeyListener; |
20 |
import org.eclipse.swt.graphics.Color; |
|
23 |
import org.eclipse.swt.graphics.Color; |
21 |
import org.eclipse.swt.graphics.Font; |
|
24 |
import org.eclipse.swt.graphics.Font; |
22 |
import org.eclipse.swt.widgets.Composite; |
|
25 |
import org.eclipse.swt.widgets.Composite; |
23 |
import org.eclipse.swt.widgets.Event; |
|
26 |
import org.eclipse.swt.widgets.Event; |
24 |
import org.eclipse.swt.widgets.Label; |
|
27 |
import org.eclipse.swt.widgets.Label; |
25 |
import org.eclipse.swt.widgets.Listener; |
|
28 |
import org.eclipse.swt.widgets.Listener; |
26 |
|
|
29 |
|
|
|
|
30 |
|
27 |
/** |
|
31 |
/** |
28 |
* |
|
32 |
* |
29 |
* Instances of this class represent a selectable user interface object that |
|
33 |
* Instances of this class represent a selectable user interface object that |
30 |
* launchs other applications when activated by the end-user. |
|
34 |
* launchs other applications when activated by the end-user. |
31 |
* |
|
35 |
* |
32 |
* <p> |
|
36 |
* <p> |
33 |
* This class represents several types of hyperlinks associated with certain |
|
37 |
* This class represents several types of hyperlinks associated with certain |
34 |
* functionalities. The end-user can activate the associated program determined |
|
38 |
* functionalities. The end-user can activate the associated program determined |
35 |
* by the style. The concrete visual effect and activation behavior vary from |
|
39 |
* by the style. The concrete visual effect and activation behavior vary from |
36 |
* platform to platform. |
|
40 |
* platform to platform. |
37 |
* </p> |
|
41 |
* </p> |
38 |
* <p> |
|
42 |
* <p> |
39 |
* A HyperLink instance accepts general characters as other controls do, but the |
|
43 |
* A HyperLink instance accepts general characters as other controls do, but the |
40 |
* appearance is implementation and locale dependent, for example, a HyperLink |
|
44 |
* appearance is implementation and locale dependent, for example, a HyperLink |
41 |
* object with the PHONE style might display as follows: <br> |
|
45 |
* object with the PHONE style might display as follows: <br> |
42 |
* (416) 123-4567 <br> |
|
46 |
* (416) 123-4567 <br> |
43 |
* but the actual contents of the object visible to the application through the |
|
47 |
* but the actual contents of the object visible to the application through the |
44 |
* APIs, e.g. <code>getText()</code>, can be the string "4161234567". |
|
48 |
* APIs, e.g. <code>getText()</code>, can be the string "4161234567". |
45 |
* </p> |
|
49 |
* </p> |
46 |
* <p> |
|
50 |
* <p> |
47 |
* <b>Example </b> |
|
51 |
* <b>Example </b> |
48 |
* |
|
52 |
* |
49 |
* <pre> |
|
53 |
* <pre> |
50 |
* HyperLink email = new HyperLink(composite, SWT.NONE, HyperLink.EMAIL); |
|
54 |
* HyperLink email = new HyperLink(composite, SWT.NONE, HyperLink.EMAIL); |
51 |
* email.setText("firstname.lastname@foo.com"); |
|
55 |
* email.setText("firstname.lastname@foo.com"); |
52 |
* HyperLink dialer = new HyperLink(composite, SWT.BORDER | SWT.LEFT, |
|
56 |
* HyperLink dialer = new HyperLink(composite, SWT.BORDER | SWT.LEFT, |
53 |
* HyperLink.PHONE); |
|
57 |
* HyperLink.PHONE); |
54 |
* dialer.setText("3581234567"); |
|
58 |
* dialer.setText("3581234567"); |
55 |
* </pre> |
|
59 |
* </pre> |
56 |
* |
|
60 |
* |
57 |
* </p> |
|
61 |
* </p> |
58 |
* <dl> |
|
62 |
* <dl> |
59 |
* <dt><b>Styles: </b></dt> |
|
63 |
* <dt><b>Styles: </b></dt> |
60 |
* <dd>BORDER, CENTER, LEFT, RIGHT</dd> |
|
64 |
* <dd>BORDER, CENTER, LEFT, RIGHT</dd> |
61 |
* <dt><b>Format Styles: </b></dt> |
|
65 |
* <dt><b>Format Styles: </b></dt> |
62 |
* <dd>URL: launches a platform specific web browser when activated</dd> |
|
66 |
* <dd>URL: launches a platform specific web browser when activated</dd> |
63 |
* <dd>EMAIL: opens the platform specific e-mail client when activated</dd> |
|
67 |
* <dd>EMAIL: opens the platform specific e-mail client when activated</dd> |
64 |
* <dd>PHONE: shows a platform specific dialer interface when activated</dt> |
|
68 |
* <dd>PHONE: shows a platform specific dialer interface when activated</dt> |
|
|
|
69 |
* <dd>PAGENAV: forwards mouse/key event to listeners but no native action when activated</dt> |
65 |
* <dt><b>Events: </b></dt> |
|
70 |
* <dt><b>Events: </b></dt> |
66 |
* <dd>(none)</dd> |
|
71 |
* <dd>(none)</dd> |
67 |
* </dl> |
|
72 |
* </dl> |
68 |
* <p> |
|
73 |
* <p> |
69 |
* Note: Since the style provides hint for the implementation, there is no event |
|
74 |
* Note: Since the style provides hint for the implementation, there is no event |
70 |
* that applications need to listen to. |
|
75 |
* that applications need to listen to. |
71 |
* </p> |
|
76 |
* </p> |
72 |
* <p> |
|
77 |
* <p> |
73 |
* IMPORTANT: This class is <em>not</em> intended to be subclassed. |
|
78 |
* IMPORTANT: This class is <em>not</em> intended to be subclassed. |
74 |
* </p> |
|
79 |
* </p> |
75 |
*/ |
|
80 |
*/ |
|
|
<> |
81 |
public class HyperLink |
76 |
public class HyperLink extends org.eclipse.swt.widgets.Control { |
|
82 |
extends org.eclipse.swt.widgets.Control |
|
|
|
83 |
{ |
77 |
|
= |
84 |
|
78 |
|
|
85 |
|
79 |
/** |
|
86 |
/** |
80 |
* launches a implementation-dependent web browser when activated. |
|
87 |
* launches a implementation-dependent web browser when activated. |
81 |
*/ |
|
88 |
*/ |
82 |
public static final int URL = 0x01; |
|
89 |
public static final int URL = 0x01; |
83 |
|
|
90 |
|
84 |
/** |
|
91 |
/** |
85 |
* opens the implementation-dependent e-mail client when activated. |
|
92 |
* opens the implementation-dependent e-mail client when activated. |
86 |
*/ |
|
93 |
*/ |
87 |
public static final int EMAIL = 0x01 << 1; |
|
94 |
public static final int EMAIL = 0x01 << 1; |
88 |
|
|
95 |
|
89 |
/** |
|
96 |
/** |
90 |
* shows the implementation-dependent dialer interface when activated. |
|
97 |
* shows the implementation-dependent dialer interface when activated. |
91 |
*/ |
|
98 |
*/ |
92 |
public static final int PHONE = 0x01 << 2; |
|
99 |
public static final int PHONE = 0x01 << 2; |
93 |
|
|
100 |
|
|
|
|
101 |
/** |
|
|
|
102 |
* used for intra-app navigation within Oracle ADF NMC client |
|
|
|
103 |
*/ |
|
|
-+ |
104 |
public static final int PAGENAV = 0x01 << 3; |
|
|
= |
105 |
|
94 |
private Label label; |
|
106 |
private Label label; |
95 |
private static Composite hackComposite; |
|
107 |
private static Composite hackComposite; |
96 |
private static int hackStyle; |
|
108 |
private static int hackStyle; |
97 |
private Color normalForeground, activeForeground; //foreground color |
|
109 |
private Color normalForeground, activeForeground; //foreground color |
98 |
private String argument; |
|
110 |
private String argument; |
99 |
private int Global_Format; |
|
111 |
private int Global_Format; |
100 |
private boolean isActive; |
|
112 |
private boolean isActive; |
101 |
private Locale locale; |
|
113 |
private Locale locale; |
|
|
-+ |
114 |
private MouseUpListener mouseUpListener; |
|
|
|
115 |
private CrKeyListener crKeyListener; |
|
|
= |
116 |
|
102 |
/** |
|
117 |
/** |
103 |
* Constructs a new instance of this class given its parent, a style value |
|
118 |
* Constructs a new instance of this class given its parent, a style value |
104 |
* and a format value describing its behavior and appearance. |
|
119 |
* and a format value describing its behavior and appearance. |
105 |
* <p> |
|
120 |
* <p> |
106 |
* The style value is either one of the style constants defined in class |
|
121 |
* The style value is either one of the style constants defined in class |
107 |
* <code>SWT</code> which is applicable to instances of this class, or |
|
122 |
* <code>SWT</code> which is applicable to instances of this class, or |
108 |
* must be built by <em>bitwise OR</em> 'ing together (that is, using the |
|
123 |
* must be built by <em>bitwise OR</em> 'ing together (that is, using the |
109 |
* <code>int</code> "|" operator) two or more of those <code>SWT</code> |
|
124 |
* <code>int</code> "|" operator) two or more of those <code>SWT</code> |
110 |
* style constants. The class description lists the style constants that are |
|
125 |
* style constants. The class description lists the style constants that are |
111 |
* applicable to the class. Style bits are also inherited from superclasses. |
|
126 |
* applicable to the class. Style bits are also inherited from superclasses. |
112 |
* </p> |
|
127 |
* </p> |
113 |
* <p> |
|
128 |
* <p> |
114 |
* The format value must be one of URL, EMAIL and PHONE. |
|
129 |
* The format value must be one of URL, EMAIL, PHONE and PAGENAV. |
115 |
* </p> |
|
130 |
* </p> |
116 |
* |
|
131 |
* |
117 |
* @param parent |
|
132 |
* @param parent |
118 |
* a composite control which will be the parent of the new |
|
133 |
* a composite control which will be the parent of the new |
119 |
* instance (cannot be null) |
|
134 |
* instance (cannot be null) |
120 |
* @param style |
|
135 |
* @param style |
121 |
* the style of control to construct |
|
136 |
* the style of control to construct |
122 |
* @param format |
|
137 |
* @param format |
123 |
* the format value. |
|
138 |
* the format value. |
124 |
* |
|
139 |
* |
125 |
* @exception IllegalArgumentException |
|
140 |
* @exception IllegalArgumentException |
126 |
* <ul> |
|
141 |
* <ul> |
127 |
* <li>ERROR_NULL_ARGUMENT - if the parent is null</li> |
|
142 |
* <li>ERROR_NULL_ARGUMENT - if the parent is null</li> |
128 |
* <li>ERROR_INVALID_ARGUMENT - if the format is invalid |
|
143 |
* <li>ERROR_INVALID_ARGUMENT - if the format is invalid |
129 |
* </li> |
|
144 |
* </li> |
130 |
* </ul> |
|
145 |
* </ul> |
131 |
* @exception SWTException |
|
146 |
* @exception SWTException |
132 |
* <ul> |
|
147 |
* <ul> |
133 |
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the |
|
148 |
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the |
134 |
* thread that created the parent</li> |
|
149 |
* thread that created the parent</li> |
135 |
* <li>ERROR_INVALID_SUBCLASS - if this class is not an |
|
150 |
* <li>ERROR_INVALID_SUBCLASS - if this class is not an |
136 |
* allowed subclass</li> |
|
151 |
* allowed subclass</li> |
137 |
* </ul> |
|
152 |
* </ul> |
138 |
* |
|
153 |
* |
139 |
* @see SWT#BORDER |
|
154 |
* @see SWT#BORDER |
140 |
* @see SWT#CENTER |
|
155 |
* @see SWT#CENTER |
141 |
* @see SWT#LEFT |
|
156 |
* @see SWT#LEFT |
142 |
* @see SWT#RIGHT |
|
157 |
* @see SWT#RIGHT |
143 |
* @see #URL |
|
158 |
* @see #URL |
144 |
* @see #EMAIL |
|
159 |
* @see #EMAIL |
145 |
* @see #PHONE |
|
160 |
* @see #PHONE |
146 |
*/ |
|
161 |
*/ |
147 |
public HyperLink(Composite parent, int style, int format) { |
<> |
162 |
public HyperLink(Composite parent, int style, int format) |
|
|
|
163 |
{ |
148 |
super(SaveStyle(parent, checkStyle(style)),checkStyle(style)); |
= |
164 |
super(SaveStyle(parent, checkStyle(style)), checkStyle(style)); |
149 |
locale = Locale.getDefault(); |
|
165 |
locale = Locale.getDefault(); |
150 |
|
|
166 |
|
151 |
//throw new RuntimeException("spec implementation"); |
|
167 |
//throw new RuntimeException("spec implementation"); |
152 |
normalForeground = getDisplay().getSystemColor(SWT.COLOR_BLUE); //Set word color |
|
168 |
normalForeground = getDisplay().getSystemColor(SWT.COLOR_BLUE); //Set word color |
153 |
activeForeground = getDisplay().getSystemColor(SWT.COLOR_DARK_MAGENTA); |
|
169 |
activeForeground = getDisplay().getSystemColor(SWT.COLOR_DARK_MAGENTA); |
154 |
this.setForeground(normalForeground); |
|
170 |
this.setForeground(normalForeground); |
155 |
checkFormat(format); |
|
171 |
checkFormat(format); |
156 |
|
|
172 |
|
157 |
isActive = false; |
|
173 |
isActive = false; |
|
|
-+ |
174 |
this.addFocusListener(new FocusListener() |
|
|
|
175 |
{ |
|
|
= |
176 |
|
|
|
-+ |
177 |
public void focusGained(FocusEvent e) |
|
|
|
178 |
{ |
|
|
|
179 |
OS.HyperLink_SetItalic(label.internal_handle, true); |
|
|
|
180 |
} |
|
|
= |
181 |
|
|
|
-+ |
182 |
public void focusLost(FocusEvent e) |
|
|
|
183 |
{ |
|
|
|
184 |
OS.HyperLink_SetItalic(label.internal_handle, false); |
|
|
|
185 |
} |
|
|
= |
186 |
|
|
|
-+ |
187 |
}); |
|
|
= |
188 |
|
|
|
|
189 |
|
|
|
|
190 |
// MDO - The mouse and key listeners added here may have to be removed if |
|
|
|
191 |
// control is used for intra-app navigation. Hence we need to keep a reference |
|
|
|
192 |
// to the listeners. The functionality has been moved to the inner classes |
|
|
|
193 |
// MouseUpListener and CrKeyListener. |
|
|
<> |
194 |
mouseUpListener = new MouseUpListener(); |
158 |
this.addListener(SWT.MouseUp, new Listener() { |
|
195 |
this.addListener(SWT.MouseUp, mouseUpListener); |
|
|
= |
196 |
// this.addListener(SWT.MouseUp, new Listener() { |
|
|
|
197 |
// public void handleEvent(Event event) { |
|
|
|
198 |
// if (!isActive) { |
|
|
|
199 |
// return; |
|
|
|
200 |
// } |
|
|
|
201 |
// label.setForeground(activeForeground); |
|
|
|
202 |
// //launch a platform specified relative program |
|
|
|
203 |
// OS.HyperLink_Launch(label.internal_handle, Global_Format, argument); |
|
|
|
204 |
// } |
|
|
|
205 |
// }); |
|
|
|
206 |
|
|
|
|
207 |
// MDO - see comment above |
|
|
-+ |
208 |
crKeyListener = new CrKeyListener(); |
|
|
|
209 |
this.addKeyListener(crKeyListener); |
|
|
= |
210 |
// this.addKeyListener(new KeyListener() { |
|
|
|
211 |
// public void keyPressed(KeyEvent e) { |
|
|
|
212 |
// if (e.character == SWT.CR) { |
|
|
|
213 |
// if (!isActive) { |
|
|
|
214 |
// return; |
|
|
|
215 |
// } |
|
|
|
216 |
// label.setForeground(activeForeground); |
|
|
|
217 |
// //launch a platform specified relative program |
|
|
|
218 |
// OS.HyperLink_Launch(label.internal_handle, Global_Format, argument); |
|
|
|
219 |
// } |
|
|
|
220 |
// } |
|
|
|
221 |
// |
|
|
|
222 |
// public void keyReleased(KeyEvent e) { |
|
|
|
223 |
// } |
|
|
|
224 |
// }); |
|
|
|
225 |
|
|
|
-+ |
226 |
} |
|
|
= |
227 |
|
|
|
|
228 |
/* |
|
|
|
229 |
* MDO - duplicates functionality of listener formerly implemented in the constructor |
|
|
|
230 |
*/ |
|
|
|
231 |
|
|
|
<> |
232 |
private class MouseUpListener |
|
|
|
233 |
implements Listener |
|
|
|
234 |
{ |
159 |
public void handleEvent(Event event) { |
|
235 |
public void handleEvent(Event event) |
|
|
|
236 |
{ |
160 |
if (!isActive) { |
|
237 |
if (!isActive) |
|
|
|
238 |
{ |
161 |
return; |
= |
239 |
return; |
162 |
} |
|
240 |
} |
163 |
label.setForeground(activeForeground); |
|
241 |
label.setForeground(activeForeground); |
164 |
//launch a platform specified relative program |
|
242 |
// launch a platform specified relative program |
165 |
OS.HyperLink_Launch(label.internal_handle, Global_Format, argument); |
|
243 |
OS.HyperLink_Launch(label.internal_handle, Global_Format, argument); |
166 |
} |
|
244 |
} |
167 |
}); |
+- |
|
|
168 |
|
= |
|
|
169 |
this.addFocusListener(new FocusListener() { |
+- |
|
|
170 |
|
= |
|
|
171 |
public void focusGained(FocusEvent e) { |
+- |
|
|
172 |
OS.HyperLink_SetItalic(label.internal_handle, true); |
|
|
|
173 |
} |
= |
245 |
} |
174 |
|
|
246 |
|
175 |
public void focusLost(FocusEvent e) { |
<> |
|
|
176 |
OS.HyperLink_SetItalic(label.internal_handle, false); |
|
|
|
177 |
} |
|
247 |
/* |
|
|
= |
248 |
* MDO - duplicates functionality of listener formerly implemented in the constructor |
178 |
|
|
249 |
*/ |
179 |
}); |
<> |
250 |
|
|
|
|
251 |
private class CrKeyListener |
|
|
|
252 |
implements KeyListener |
180 |
|
|
253 |
{ |
181 |
this.addKeyListener(new KeyListener() { |
|
|
|
182 |
public void keyPressed(KeyEvent e) { |
|
254 |
public void keyPressed(KeyEvent e) |
|
|
|
255 |
{ |
183 |
if (e.character == SWT.CR) { |
|
256 |
if (e.character == SWT.CR) |
|
|
|
257 |
{ |
184 |
if (!isActive) { |
|
258 |
if (!isActive) |
|
|
|
259 |
{ |
185 |
return; |
= |
260 |
return; |
186 |
} |
|
261 |
} |
187 |
label.setForeground(activeForeground); |
|
262 |
label.setForeground(activeForeground); |
188 |
//launch a platform specified relative program |
|
263 |
//launch a platform specified relative program |
189 |
OS.HyperLink_Launch(label.internal_handle, Global_Format, argument); |
|
264 |
OS.HyperLink_Launch(label.internal_handle, Global_Format, argument); |
190 |
} |
|
265 |
} |
191 |
} |
|
266 |
} |
192 |
|
|
267 |
|
193 |
public void keyReleased(KeyEvent e) { |
<> |
268 |
public void keyReleased(KeyEvent e) |
|
|
|
269 |
{ |
194 |
} |
= |
270 |
} |
195 |
}); |
+- |
|
|
196 |
|
= |
|
|
197 |
} |
|
271 |
} |
198 |
|
|
272 |
|
199 |
//Save style argument as global argument |
|
273 |
//Save style argument as global argument |
|
|
|
274 |
|
200 |
private static Composite SaveStyle(Composite parent, int style) { |
<> |
275 |
private static Composite SaveStyle(Composite parent, int style) |
|
|
|
276 |
{ |
201 |
hackStyle = style; |
= |
277 |
hackStyle = style; |
202 |
hackComposite = parent; |
|
278 |
hackComposite = parent; |
203 |
return parent; |
|
279 |
return parent; |
204 |
} |
|
280 |
} |
205 |
|
|
281 |
|
206 |
private static int checkStyle(int style) |
|
282 |
private static int checkStyle(int style) |
207 |
{ |
|
283 |
{ |
|
|
<> |
284 |
if ((style & |
208 |
if ((style & (SWT.SEPARATOR | SWT.HORIZONTAL | SWT.VERTICAL | SWT.WRAP | SWT.SHADOW_IN | SWT.SHADOW_OUT | SWT.SHADOW_NONE)) != 0 ) |
|
285 |
(SWT.SEPARATOR | SWT.HORIZONTAL | SWT.VERTICAL | SWT.WRAP | SWT.SHADOW_IN | SWT.SHADOW_OUT | SWT.SHADOW_NONE)) != |
|
|
|
286 |
0) |
|
|
|
287 |
style &= |
209 |
style &= ~(SWT.SEPARATOR | SWT.HORIZONTAL | SWT.VERTICAL | SWT.WRAP | SWT.SHADOW_IN | SWT.SHADOW_OUT | SWT.SHADOW_NONE); |
|
288 |
~(SWT.SEPARATOR | SWT.HORIZONTAL | SWT.VERTICAL | SWT.WRAP | SWT.SHADOW_IN | SWT.SHADOW_OUT | SWT.SHADOW_NONE); |
210 |
return style; |
= |
289 |
return style; |
211 |
} |
|
290 |
} |
212 |
|
|
291 |
|
213 |
|
|
292 |
|
214 |
//Check format parameter of URL, EMAIL, or PHONE |
|
293 |
//Check format parameter of URL, EMAIL, or PHONE |
|
|
|
294 |
|
215 |
private void checkFormat(int format) |
|
295 |
private void checkFormat(int format) |
216 |
{ |
|
296 |
{ |
217 |
Global_Format = format; |
|
297 |
Global_Format = format; |
218 |
|
|
298 |
|
219 |
if ((format & ~(URL | EMAIL| PHONE)) != 0) |
<> |
299 |
if ((format & ~(URL | EMAIL | PHONE | PAGENAV)) != 0) |
220 |
SWT.error(SWT.ERROR_INVALID_ARGUMENT); |
= |
300 |
SWT.error(SWT.ERROR_INVALID_ARGUMENT); |
221 |
|
|
301 |
|
222 |
if ((format & URL) == URL && ((format | URL) != URL)) |
|
302 |
if ((format & URL) == URL && ((format | URL) != URL)) |
223 |
SWT.error(SWT.ERROR_INVALID_ARGUMENT); |
|
303 |
SWT.error(SWT.ERROR_INVALID_ARGUMENT); |
224 |
if ((format & EMAIL) == EMAIL && ((format | EMAIL) != EMAIL)) |
|
304 |
if ((format & EMAIL) == EMAIL && ((format | EMAIL) != EMAIL)) |
225 |
SWT.error(SWT.ERROR_INVALID_ARGUMENT); |
|
305 |
SWT.error(SWT.ERROR_INVALID_ARGUMENT); |
226 |
if ((format & PHONE) == PHONE && ((format | PHONE) != PHONE)) |
|
306 |
if ((format & PHONE) == PHONE && ((format | PHONE) != PHONE)) |
227 |
SWT.error(SWT.ERROR_INVALID_ARGUMENT); |
|
307 |
SWT.error(SWT.ERROR_INVALID_ARGUMENT); |
|
|
|
308 |
|
|
|
|
309 |
// MDO - checks for PAGENAV style |
|
|
-+ |
310 |
if ((format & PAGENAV) == PAGENAV && ((format | PAGENAV) != PAGENAV)) |
|
|
|
311 |
SWT.error(SWT.ERROR_INVALID_ARGUMENT); |
228 |
} |
= |
312 |
} |
229 |
|
|
313 |
|
230 |
|
|
314 |
|
231 |
|
|
|
|
232 |
//Overwrite the setFont function of control |
|
315 |
//Overwrite the setFont function of control |
|
|
|
316 |
|
233 |
public void setFont(Font font) { |
<> |
317 |
public void setFont(Font font) |
|
|
|
318 |
{ |
234 |
checkWidget(); |
= |
319 |
checkWidget(); |
235 |
super.setFont(font); |
|
320 |
super.setFont(font); |
236 |
OS.HyperLink_SetUnderLine(internal_handle); //Set Underline to string |
|
321 |
OS.HyperLink_SetUnderLine(internal_handle); //Set Underline to string |
237 |
} |
|
322 |
} |
238 |
|
|
323 |
|
239 |
|
|
324 |
|
240 |
|
|
|
|
241 |
/** |
|
325 |
/** |
242 |
* Returns the receiver's text, which will be an empty string if it has |
|
326 |
* Returns the receiver's text, which will be an empty string if it has |
243 |
* never been set. |
|
327 |
* never been set. |
244 |
* |
|
328 |
* |
245 |
* @return the receiver's text |
|
329 |
* @return the receiver's text |
246 |
* |
|
330 |
* |
247 |
* @exception SWTException |
|
331 |
* @exception SWTException |
248 |
* <ul> |
|
332 |
* <ul> |
249 |
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been |
|
333 |
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been |
250 |
* disposed</li> |
|
334 |
* disposed</li> |
251 |
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the |
|
335 |
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the |
252 |
* thread that created the receiver</li> |
|
336 |
* thread that created the receiver</li> |
253 |
* </ul> |
|
337 |
* </ul> |
254 |
* @see #setText(String) |
|
338 |
* @see #setText(String) |
255 |
*/ |
|
339 |
*/ |
256 |
//Get the string from setText function |
|
340 |
//Get the string from setText function |
257 |
public String getText() { |
<> |
341 |
public String getText() |
|
|
|
342 |
{ |
258 |
//throw new RuntimeException("spec implementation"); |
= |
343 |
//throw new RuntimeException("spec implementation"); |
259 |
checkWidget(); |
|
344 |
checkWidget(); |
260 |
String return_argument = argument; |
|
345 |
String return_argument = argument; |
261 |
if (argument == null) |
|
346 |
if (argument == null) |
262 |
return_argument = ""; |
|
347 |
return_argument = ""; |
263 |
if (Global_Format == EMAIL && return_argument.length() >= 7){ |
<> |
348 |
if (Global_Format == EMAIL && return_argument.length() >= 7) |
|
|
|
349 |
{ |
264 |
return_argument = return_argument.substring(7, return_argument.length()); |
= |
350 |
return_argument = return_argument.substring(7, return_argument.length()); |
265 |
} |
|
351 |
} |
266 |
else if (Global_Format == PHONE && return_argument.length() >= 9) { |
<> |
352 |
else if (Global_Format == PHONE && return_argument.length() >= 9) |
|
|
|
353 |
{ |
267 |
return_argument = return_argument.substring(9, return_argument.length()); |
= |
354 |
return_argument = return_argument.substring(9, return_argument.length()); |
268 |
} |
|
355 |
} |
269 |
return return_argument; |
|
356 |
return return_argument; |
270 |
} |
|
357 |
} |
271 |
|
|
358 |
|
272 |
/** |
|
359 |
/** |
273 |
* Sets the receiver's text. |
|
360 |
* Sets the receiver's text. |
274 |
* <p> |
|
361 |
* <p> |
275 |
* This method sets the link text. |
|
362 |
* This method sets the link text. |
276 |
* </p> |
|
363 |
* </p> |
277 |
* |
|
364 |
* |
278 |
* @param string |
|
365 |
* @param string |
279 |
* the new text |
|
366 |
* the new text |
280 |
* |
|
367 |
* |
281 |
* @exception IllegalArgumentException |
|
368 |
* @exception IllegalArgumentException |
282 |
* <ul> |
|
369 |
* <ul> |
283 |
* <li>ERROR_NULL_ARGUMENT - if the text is null</li> |
|
370 |
* <li>ERROR_NULL_ARGUMENT - if the text is null</li> |
284 |
* </ul> |
|
371 |
* </ul> |
285 |
* @exception SWTException |
|
372 |
* @exception SWTException |
286 |
* <ul> |
|
373 |
* <ul> |
287 |
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been |
|
374 |
* <li>ERROR_WIDGET_DISPOSED - if the receiver has been |
288 |
* disposed</li> |
|
375 |
* disposed</li> |
289 |
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the |
|
376 |
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the |
290 |
* thread that created the receiver</li> |
|
377 |
* thread that created the receiver</li> |
291 |
* </ul> |
|
378 |
* </ul> |
292 |
* @see #getText() |
|
379 |
* @see #getText() |
293 |
*/ |
|
380 |
*/ |
294 |
//Set the URL, Email, or phonenumber to executive relatively |
|
381 |
//Set the URL, Email, or phonenumber to executive relatively |
295 |
public void setText(String string) { |
<> |
382 |
public void setText(String string) |
|
|
|
383 |
{ |
296 |
//throw new RuntimeException("spec implementation"); |
= |
384 |
//throw new RuntimeException("spec implementation"); |
297 |
checkWidget(); |
|
385 |
checkWidget(); |
298 |
String show_string = null; |
|
386 |
String show_string = null; |
299 |
|
|
387 |
|
|
|
<> |
388 |
if (string == null) |
300 |
if (string == null) SWT.error(SWT.ERROR_NULL_ARGUMENT); |
|
389 |
SWT.error(SWT.ERROR_NULL_ARGUMENT); |
301 |
if(Global_Format == URL) //URL |
= |
390 |
if (Global_Format == URL) //URL |
302 |
{ |
|
391 |
{ |
303 |
argument = string; |
|
392 |
argument = string; |
304 |
show_string = string; |
|
393 |
show_string = string; |
305 |
} |
|
394 |
} |
306 |
else if (Global_Format == EMAIL) //EMAIL |
|
395 |
else if (Global_Format == EMAIL) //EMAIL |
307 |
{ |
|
396 |
{ |
308 |
argument =new String("mailto:"); |
|
397 |
argument = new String("mailto:"); |
309 |
argument= argument.concat(string); |
|
398 |
argument = argument.concat(string); |
310 |
show_string = string; |
|
399 |
show_string = string; |
311 |
} |
|
400 |
} |
312 |
else if (Global_Format == PHONE) //PHONENUMBER |
|
401 |
else if (Global_Format == PHONE) //PHONENUMBER |
313 |
{ |
|
402 |
{ |
314 |
//Eric, Fill in phone numer to dialer. |
|
403 |
//Eric, Fill in phone numer to dialer. |
315 |
argument = "-url tel:" + string; |
|
404 |
argument = "-url tel:" + string; |
316 |
// if (new String("ja_JP").equals(locale.toString())) |
|
405 |
// if (new String("ja_JP").equals(locale.toString())) |
317 |
if(Locale.JAPAN.toString().equals(locale.toString())) |
|
406 |
if (Locale.JAPAN.toString().equals(locale.toString())) |
318 |
show_string = JPPhoneLocale(string); |
|
407 |
show_string = JPPhoneLocale(string); |
319 |
else if (Locale.FRANCE.toString().equals(locale.toString())) |
|
408 |
else if (Locale.FRANCE.toString().equals(locale.toString())) |
320 |
show_string = FrancePhoneLocale(string); |
|
409 |
show_string = FrancePhoneLocale(string); |
321 |
else if (Locale.CHINA.toString().equals(locale.toString())) |
|
410 |
else if (Locale.CHINA.toString().equals(locale.toString())) |
322 |
show_string = ChinaPhoneLocale(string); |
|
411 |
show_string = ChinaPhoneLocale(string); |
323 |
else if (new String("pl_PL").equals(locale.toString())) |
|
412 |
else if (new String("pl_PL").equals(locale.toString())) |
324 |
show_string = PolandPhoneLocale(string); |
|
413 |
show_string = PolandPhoneLocale(string); |
325 |
else |
|
414 |
else |
326 |
show_string = DefaultPhoneLocale(string); |
|
415 |
show_string = DefaultPhoneLocale(string); |
327 |
} |
|
416 |
} |
328 |
//System.out.println(Global_Format + " "+ Executive_file + " "+ argument); |
|
417 |
// MDO - not much to do for PAGENAV |
|
|
-+ |
418 |
else if (Global_Format == PAGENAV) |
|
|
|
419 |
{ |
|
|
|
420 |
argument = string; |
|
|
|
421 |
show_string = string; |
|
|
|
422 |
} |
329 |
OS.HyperLink_SetUnderLine(internal_handle); |
= |
423 |
OS.HyperLink_SetUnderLine(internal_handle); |
330 |
OS.HyperLink_SetText(internal_handle,show_string); |
|
424 |
OS.HyperLink_SetText(internal_handle, show_string); |
331 |
|
|
425 |
|
332 |
isActive = true; |
|
426 |
isActive = true; |
333 |
} |
|
427 |
} |
334 |
//Japen phone format |
|
428 |
//Japen phone format |
|
|
|
429 |
|
335 |
private String JPPhoneLocale (String string) |
|
430 |
private String JPPhoneLocale(String string) |
336 |
{ |
|
431 |
{ |
337 |
String TempString = null; |
|
432 |
String TempString = null; |
338 |
if(string.length() < 5) |
|
433 |
if (string.length() < 5) |
339 |
return string; |
|
434 |
return string; |
340 |
else if (string.length() < 7) |
|
435 |
else if (string.length() < 7) |
341 |
{ |
|
436 |
{ |
342 |
TempString = string.substring(0,4); |
|
437 |
TempString = string.substring(0, 4); |
343 |
TempString = TempString.concat("-"); |
|
438 |
TempString = TempString.concat("-"); |
344 |
TempString = TempString.concat(string.substring(4,string.length())); |
|
439 |
TempString = TempString.concat(string.substring(4, string.length())); |
345 |
return TempString; |
|
440 |
return TempString; |
346 |
} |
|
441 |
} |
347 |
else |
|
442 |
else |
348 |
{ |
|
443 |
{ |
349 |
TempString = string.substring(0,4); |
|
444 |
TempString = string.substring(0, 4); |
350 |
TempString = TempString.concat("-"); |
|
445 |
TempString = TempString.concat("-"); |
351 |
TempString = TempString.concat(string.substring(4,6)); |
|
446 |
TempString = TempString.concat(string.substring(4, 6)); |
352 |
TempString = TempString.concat("-"); |
|
447 |
TempString = TempString.concat("-"); |
353 |
TempString = TempString.concat(string.substring(6,string.length())); |
|
448 |
TempString = TempString.concat(string.substring(6, string.length())); |
354 |
} |
|
449 |
} |
355 |
return TempString; |
|
450 |
return TempString; |
356 |
} |
|
451 |
} |
357 |
//China phone format |
|
452 |
//China phone format |
|
|
|
453 |
|
358 |
private String ChinaPhoneLocale (String string) { |
<> |
454 |
private String ChinaPhoneLocale(String string) |
|
|
|
455 |
{ |
359 |
String TempString= null; |
= |
456 |
String TempString = null; |
360 |
if(string.length() < 2) { |
<> |
457 |
if (string.length() < 2) |
|
|
|
458 |
{ |
361 |
TempString = "+"; |
= |
459 |
TempString = "+"; |
362 |
TempString = TempString.concat(string); |
|
460 |
TempString = TempString.concat(string); |
363 |
return TempString; |
|
461 |
return TempString; |
364 |
} |
|
462 |
} |
365 |
else if(string.length() < 5) { |
<> |
463 |
else if (string.length() < 5) |
|
|
|
464 |
{ |
366 |
TempString = "+"; |
= |
465 |
TempString = "+"; |
367 |
TempString = TempString.concat(string.substring(0,1)); |
|
466 |
TempString = TempString.concat(string.substring(0, 1)); |
368 |
TempString = TempString.concat("-"); |
|
467 |
TempString = TempString.concat("-"); |
369 |
TempString = TempString.concat(string.substring(1,string.length())); |
|
468 |
TempString = TempString.concat(string.substring(1, string.length())); |
370 |
return TempString; |
|
469 |
return TempString; |
371 |
} |
|
470 |
} |
372 |
else |
|
471 |
else |
373 |
{ |
|
472 |
{ |
374 |
TempString = "+"; |
|
473 |
TempString = "+"; |
375 |
TempString = TempString.concat(string.substring(0,1)); |
|
474 |
TempString = TempString.concat(string.substring(0, 1)); |
376 |
TempString = TempString.concat("-"); |
|
475 |
TempString = TempString.concat("-"); |
377 |
TempString = TempString.concat(string.substring(1,4)); |
|
476 |
TempString = TempString.concat(string.substring(1, 4)); |
378 |
TempString = TempString.concat("-"); |
|
477 |
TempString = TempString.concat("-"); |
379 |
TempString = TempString.concat(string.substring(4,string.length())); |
|
478 |
TempString = TempString.concat(string.substring(4, string.length())); |
380 |
} |
|
479 |
} |
381 |
return TempString; |
|
480 |
return TempString; |
382 |
} |
|
481 |
} |
383 |
|
|
482 |
|
384 |
//France phone format |
|
483 |
//France phone format |
|
|
|
484 |
|
385 |
private String FrancePhoneLocale (String string) { |
<> |
485 |
private String FrancePhoneLocale(String string) |
|
|
|
486 |
{ |
386 |
String TempString= null; |
= |
487 |
String TempString = null; |
387 |
if(string.length() < 3) { |
<> |
488 |
if (string.length() < 3) |
|
|
|
489 |
{ |
388 |
return string; |
= |
490 |
return string; |
389 |
} |
|
491 |
} |
390 |
else if(string.length() < 5) { |
<> |
492 |
else if (string.length() < 5) |
|
|
|
493 |
{ |
391 |
TempString = string.substring(0,2); |
= |
494 |
TempString = string.substring(0, 2); |
392 |
TempString = TempString.concat(" "); |
|
495 |
TempString = TempString.concat(" "); |
393 |
TempString = TempString.concat(string.substring(2,string.length())); |
|
496 |
TempString = TempString.concat(string.substring(2, string.length())); |
394 |
return TempString; |
|
497 |
return TempString; |
395 |
} |
|
498 |
} |
396 |
else if(string.length() < 7) { |
<> |
499 |
else if (string.length() < 7) |
|
|
|
500 |
{ |
397 |
TempString = string.substring(0,2); |
= |
501 |
TempString = string.substring(0, 2); |
398 |
TempString = TempString.concat(" "); |
|
502 |
TempString = TempString.concat(" "); |
399 |
TempString = TempString.concat(string.substring(2,4)); |
|
503 |
TempString = TempString.concat(string.substring(2, 4)); |
400 |
TempString = TempString.concat(" "); |
|
504 |
TempString = TempString.concat(" "); |
401 |
TempString = TempString.concat(string.substring(4,string.length())); |
|
505 |
TempString = TempString.concat(string.substring(4, string.length())); |
402 |
return TempString; |
|
506 |
return TempString; |
403 |
} |
|
507 |
} |
404 |
else if(string.length() < 9) { |
<> |
508 |
else if (string.length() < 9) |
|
|
|
509 |
{ |
405 |
TempString = string.substring(0,2); |
= |
510 |
TempString = string.substring(0, 2); |
406 |
TempString = TempString.concat(" "); |
|
511 |
TempString = TempString.concat(" "); |
407 |
TempString = TempString.concat(string.substring(2,4)); |
|
512 |
TempString = TempString.concat(string.substring(2, 4)); |
408 |
TempString = TempString.concat(" "); |
|
513 |
TempString = TempString.concat(" "); |
409 |
TempString = TempString.concat(string.substring(4,6)); |
|
514 |
TempString = TempString.concat(string.substring(4, 6)); |
410 |
TempString = TempString.concat(" "); |
|
515 |
TempString = TempString.concat(" "); |
411 |
TempString = TempString.concat(string.substring(6,string.length())); |
|
516 |
TempString = TempString.concat(string.substring(6, string.length())); |
412 |
return TempString; |
|
517 |
return TempString; |
413 |
} |
|
518 |
} |
414 |
else |
|
519 |
else |
415 |
{ |
|
520 |
{ |
416 |
TempString = string.substring(0,2); |
|
521 |
TempString = string.substring(0, 2); |
417 |
TempString = TempString.concat(" "); |
|
522 |
TempString = TempString.concat(" "); |
418 |
TempString = TempString.concat(string.substring(2,4)); |
|
523 |
TempString = TempString.concat(string.substring(2, 4)); |
419 |
TempString = TempString.concat(" "); |
|
524 |
TempString = TempString.concat(" "); |
420 |
TempString = TempString.concat(string.substring(4,6)); |
|
525 |
TempString = TempString.concat(string.substring(4, 6)); |
421 |
TempString = TempString.concat(" "); |
|
526 |
TempString = TempString.concat(" "); |
422 |
TempString = TempString.concat(string.substring(6,8)); |
|
527 |
TempString = TempString.concat(string.substring(6, 8)); |
423 |
TempString = TempString.concat(" "); |
|
528 |
TempString = TempString.concat(" "); |
424 |
TempString = TempString.concat(string.substring(8,string.length())); |
|
529 |
TempString = TempString.concat(string.substring(8, string.length())); |
425 |
} |
|
530 |
} |
426 |
return TempString; |
|
531 |
return TempString; |
427 |
} |
|
532 |
} |
428 |
|
|
533 |
|
429 |
//Poland phone format |
|
534 |
//Poland phone format |
|
|
|
535 |
|
430 |
private String PolandPhoneLocale (String string) { |
<> |
536 |
private String PolandPhoneLocale(String string) |
|
|
|
537 |
{ |
431 |
String TempString= null; |
= |
538 |
String TempString = null; |
432 |
if(string.length() < 9) |
|
539 |
if (string.length() < 9) |
433 |
return string; |
|
540 |
return string; |
434 |
else |
|
541 |
else |
435 |
{ |
|
542 |
{ |
436 |
TempString = "("; |
|
543 |
TempString = "("; |
437 |
TempString = TempString.concat(string.substring(0,2)); |
|
544 |
TempString = TempString.concat(string.substring(0, 2)); |
438 |
TempString = TempString.concat(") "); |
|
545 |
TempString = TempString.concat(") "); |
439 |
TempString = TempString.concat(string.substring(2,5)); |
|
546 |
TempString = TempString.concat(string.substring(2, 5)); |
440 |
TempString = TempString.concat("."); |
|
547 |
TempString = TempString.concat("."); |
441 |
TempString = TempString.concat(string.substring(5,7)); |
|
548 |
TempString = TempString.concat(string.substring(5, 7)); |
442 |
TempString = TempString.concat("."); |
|
549 |
TempString = TempString.concat("."); |
443 |
TempString = TempString.concat(string.substring(7,string.length())); |
|
550 |
TempString = TempString.concat(string.substring(7, string.length())); |
444 |
} |
|
551 |
} |
445 |
return TempString; |
|
552 |
return TempString; |
446 |
} |
|
553 |
} |
447 |
|
|
554 |
|
448 |
private String DefaultPhoneLocale (String string) { |
<> |
555 |
private String DefaultPhoneLocale(String string) |
|
|
|
556 |
{ |
449 |
String TempString= null; |
= |
557 |
String TempString = null; |
450 |
if(string.length() < 3) |
|
558 |
if (string.length() < 3) |
451 |
return string; |
|
559 |
return string; |
452 |
else if (string.length() < 7) |
|
560 |
else if (string.length() < 7) |
453 |
{ |
|
561 |
{ |
454 |
TempString = "("; |
|
562 |
TempString = "("; |
455 |
TempString = TempString.concat(string.substring(0,3)); |
|
563 |
TempString = TempString.concat(string.substring(0, 3)); |
456 |
TempString = TempString.concat(")"); |
|
564 |
TempString = TempString.concat(")"); |
457 |
TempString = TempString.concat(string.substring(3,string.length())); |
|
565 |
TempString = TempString.concat(string.substring(3, string.length())); |
458 |
return TempString; |
|
566 |
return TempString; |
459 |
} |
|
567 |
} |
460 |
else |
|
568 |
else |
461 |
{ |
|
569 |
{ |
462 |
TempString = "("; |
|
570 |
TempString = "("; |
463 |
TempString = TempString.concat(string.substring(0,3)); |
|
571 |
TempString = TempString.concat(string.substring(0, 3)); |
464 |
TempString = TempString.concat(")"); |
|
572 |
TempString = TempString.concat(")"); |
465 |
TempString = TempString.concat(string.substring(3,6)); |
|
573 |
TempString = TempString.concat(string.substring(3, 6)); |
466 |
TempString = TempString.concat("-"); |
|
574 |
TempString = TempString.concat("-"); |
467 |
TempString = TempString.concat(string.substring(6,string.length())); |
|
575 |
TempString = TempString.concat(string.substring(6, string.length())); |
468 |
} |
|
576 |
} |
469 |
return TempString; |
|
577 |
return TempString; |
470 |
} |
|
578 |
} |
471 |
|
|
579 |
|
472 |
int i=0; |
|
580 |
int i = 0; |
|
|
|
581 |
|
473 |
public void internal_createHandle(int index) { |
<> |
582 |
public void internal_createHandle(int index) |
|
|
|
583 |
{ |
474 |
label = new Label(hackComposite, checkStyle(hackStyle)); |
= |
584 |
label = new Label(hackComposite, checkStyle(hackStyle)); |
475 |
internal_handle = label.internal_handle; |
|
585 |
internal_handle = label.internal_handle; |
476 |
hackComposite.internal_removeChild(label); |
|
586 |
hackComposite.internal_removeChild(label); |
477 |
} |
|
587 |
} |
478 |
|
|
588 |
|
479 |
public boolean allowTraverseByArrowKey(Event event) { |
<> |
589 |
public boolean allowTraverseByArrowKey(Event event) |
|
|
|
590 |
{ |
480 |
switch (event.keyCode) { |
|
591 |
switch (event.keyCode) |
|
|
|
592 |
{ |
481 |
case SWT.ARROW_UP : |
= |
593 |
case SWT.ARROW_UP: |
482 |
case SWT.ARROW_LEFT : |
|
594 |
case SWT.ARROW_LEFT: |
483 |
case SWT.ARROW_DOWN : |
|
595 |
case SWT.ARROW_DOWN: |
484 |
case SWT.ARROW_RIGHT : |
|
596 |
case SWT.ARROW_RIGHT: |
485 |
return true; |
|
597 |
return true; |
486 |
} |
|
598 |
} |
487 |
return false; |
|
599 |
return false; |
488 |
} |
|
600 |
} |
489 |
|
|
601 |
|
490 |
protected boolean traverse(Event event) { |
<> |
602 |
protected boolean traverse(Event event) |
|
|
|
603 |
{ |
491 |
if (isDisposed()) return false; |
|
604 |
if (isDisposed()) |
|
|
|
605 |
return false; |
492 |
if(allowTraverseByArrowKey(event)) { |
|
606 |
if (allowTraverseByArrowKey(event)) |
|
|
|
607 |
{ |
493 |
return traverseByArrowKey(event); |
= |
608 |
return traverseByArrowKey(event); |
494 |
} |
|
609 |
} |
495 |
return super.traverse(event); |
|
610 |
return super.traverse(event); |
496 |
} |
|
611 |
} |
497 |
|
|
612 |
|
|
|
|
613 |
// MDO - These methods are used by the ADF NMC control to remove the default |
|
|
|
614 |
// listeners and add its custom listeners. |
|
|
|
615 |
|
|
|
|
616 |
/** |
|
|
|
617 |
* Returns default MouseListener |
|
|
|
618 |
*/ |
|
|
-+ |
619 |
public Listener getMouseListener() |
|
|
|
620 |
{ |
|
|
|
621 |
return mouseUpListener; |
|
|
|
622 |
} |
|
|
= |
623 |
|
|
|
|
624 |
/** |
|
|
|
625 |
* Returns default MouseListener's event type |
|
|
|
626 |
*/ |
|
|
-+ |
627 |
public int getMouseListenerEventType() |
|
|
|
628 |
{ |
|
|
|
629 |
return SWT.MouseUp; |
|
|
|
630 |
} |
|
|
= |
631 |
|
|
|
|
632 |
/** |
|
|
|
633 |
* Return default KeyListener |
|
|
|
634 |
*/ |
|
|
-+ |
635 |
public KeyListener getKeyListener() |
|
|
|
636 |
{ |
|
|
|
637 |
return crKeyListener; |
|
|
|
638 |
} |
498 |
} |
= |
639 |
} |