author | John Kern <johnk@symbian.org> |
Mon, 29 Mar 2010 13:59:08 -0700 | |
changeset 287 | acfa94f7e231 |
parent 273 | b1f63c2c240c |
permissions | -rw-r--r-- |
210
0f7abfd6ae62
Fixed bug 2072: update .js files with EPL
tasneems@symbian.org
parents:
102
diff
changeset
|
1 |
/** |
0f7abfd6ae62
Fixed bug 2072: update .js files with EPL
tasneems@symbian.org
parents:
102
diff
changeset
|
2 |
* Copyright (c) 2009-2010 Symbian Foundation and/or its subsidiary(-ies). |
0f7abfd6ae62
Fixed bug 2072: update .js files with EPL
tasneems@symbian.org
parents:
102
diff
changeset
|
3 |
* All rights reserved. |
0f7abfd6ae62
Fixed bug 2072: update .js files with EPL
tasneems@symbian.org
parents:
102
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
0f7abfd6ae62
Fixed bug 2072: update .js files with EPL
tasneems@symbian.org
parents:
102
diff
changeset
|
5 |
* under the terms of the License "Eclipse Public License v1.0" |
0f7abfd6ae62
Fixed bug 2072: update .js files with EPL
tasneems@symbian.org
parents:
102
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
0f7abfd6ae62
Fixed bug 2072: update .js files with EPL
tasneems@symbian.org
parents:
102
diff
changeset
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
0f7abfd6ae62
Fixed bug 2072: update .js files with EPL
tasneems@symbian.org
parents:
102
diff
changeset
|
8 |
* |
0f7abfd6ae62
Fixed bug 2072: update .js files with EPL
tasneems@symbian.org
parents:
102
diff
changeset
|
9 |
* Initial Contributors: |
273
b1f63c2c240c
Bug 2072 - Update .js files with EPL
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
211
diff
changeset
|
10 |
* Nokia Corporation - initial contribution. |
b1f63c2c240c
Bug 2072 - Update .js files with EPL
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
211
diff
changeset
|
11 |
* |
210
0f7abfd6ae62
Fixed bug 2072: update .js files with EPL
tasneems@symbian.org
parents:
102
diff
changeset
|
12 |
* Contributors: |
273
b1f63c2c240c
Bug 2072 - Update .js files with EPL
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
211
diff
changeset
|
13 |
* |
b1f63c2c240c
Bug 2072 - Update .js files with EPL
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
211
diff
changeset
|
14 |
* Description: |
b1f63c2c240c
Bug 2072 - Update .js files with EPL
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
211
diff
changeset
|
15 |
* |
210
0f7abfd6ae62
Fixed bug 2072: update .js files with EPL
tasneems@symbian.org
parents:
102
diff
changeset
|
16 |
*/ |
73 | 17 |
|
18 |
/////////////////////////////////////////////////////////////////////////////// |
|
19 |
// The View class is an abstract base class for views in the UI toolkit. |
|
20 |
// Don't use the View directly - instead use a concrete subclass like ListView. |
|
21 |
||
22 |
// Constructor. |
|
23 |
function View(id) { |
|
24 |
if (id != UI_NO_INIT_ID) { |
|
25 |
this.init(id); |
|
26 |
} |
|
27 |
} |
|
28 |
||
29 |
// View inherits from UIElement. |
|
30 |
View.prototype = new UIElement(UI_NO_INIT_ID); |
|
31 |
||
32 |
// Currently focused control. |
|
33 |
View.prototype.focusedControl = null; |
|
34 |
||
35 |
// Initializer - called from constructor. |
|
36 |
View.prototype.init = function(id) { |
|
37 |
uiLogger.debug("View.init(" + id + ")"); |
|
38 |
||
39 |
// call superclass initializer |
|
40 |
UIElement.prototype.init.call(this, id); |
|
102
30e0796f3ebb
Warnings in new projects were fixed
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
73
diff
changeset
|
41 |
}; |
73 | 42 |
|
43 |
// Returns the currently focused control; null if none. |
|
44 |
View.prototype.getFocusedControl = function() { |
|
45 |
return this.focusedControl; |
|
102
30e0796f3ebb
Warnings in new projects were fixed
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
73
diff
changeset
|
46 |
}; |
73 | 47 |
|
48 |
// Used to notify the view that the focused control has changed. |
|
49 |
View.prototype.focusedControlChanged = function(control) { |
|
50 |
uiLogger.debug("View.focusedControlChanged(" + control + ")"); |
|
51 |
this.focusedControl = control; |
|
52 |
// notify event listeners |
|
53 |
this.fireEvent(this.createEvent("FocusedControlChanged", this.focusedControl)); |
|
102
30e0796f3ebb
Warnings in new projects were fixed
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
73
diff
changeset
|
54 |
}; |
73 | 55 |
|
56 |
// Attempts to focus the first focusable control. |
|
57 |
// Override in subclasses as required. |
|
58 |
View.prototype.focusFirstControl = function() { |
|
59 |
uiLogger.debug("View.focusFirstControl()"); |
|
102
30e0796f3ebb
Warnings in new projects were fixed
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
73
diff
changeset
|
60 |
}; |
73 | 61 |
|
62 |
// Attempts to reset all control focus states. |
|
63 |
// Override in subclasses as required. |
|
64 |
View.prototype.resetControlFocusStates = function() { |
|
65 |
uiLogger.debug("View.resetControlFocusStates()"); |
|
102
30e0796f3ebb
Warnings in new projects were fixed
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
73
diff
changeset
|
66 |
}; |