carbidesdk/com.nokia.carbide.cpp.sdk.doc.user/html/reference/CustomComponents/cc_implementations.htm
author fturovic <frank.turovich@nokia.com>
Tue, 27 Jul 2010 15:28:19 -0500
changeset 1704 24ac5a5cf80c
parent 0 fb279309251b
permissions -rw-r--r--
updated copyright dates and fixed some css issues
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1704
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
     1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
     2
<html>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
     3
<head>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
     4
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
     5
<meta http-equiv="Content-Style-Type" content="text/css" />
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
     6
<title>Implementations Element</title>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
     7
<link rel="StyleSheet" href="../../../book.css" type="text/css"/>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
     8
</head>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
     9
<body bgcolor="#FFFFFF">
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    10
<h2>Implementations</h2>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    11
<p> The preceding sections described  characteristics of components which could be represented statically in XML.  Implementations allow for script or code to dynamically extend a component's behavior in the UI Designer.  Implementation also allows automatic layout, dynamic containment rules, direct label editing, component properties validation and more.</p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    12
<p>A component uses the &lt;implementations&gt; XML element to define implementations.  This element contains zero or more &lt;implementation&gt; elements.  A single implementation element contains one or more &lt;interface&gt; elements, telling which interfaces are implemented, and either a &lt;script&gt; or a &lt;class&gt; element which implements those interfaces.  It's up to you how many interfaces to implement with one class or script.   Implementations may be provided in JavaScript or Java code.  For Java implementations, merely implement the interface and ensure its containing package is exported from the plugin.  This document doesn't discuss Java implementations further, since a JavaScript implementation is easier to use in many respects.</p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    13
<p>Example implementations declaration:</p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    14
<pre class="listing">&lt;implementations&gt;
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    15
 &nbsp;&nbsp; &lt;implementation&gt;
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    16
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;interface  id=&quot;com.nokia.sdt.datamodel.adapter.IVisualAppearance&quot;/&gt;
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    17
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;interface  id=&quot;com.nokia.sdt.datamodel.adapter.IDirectLabelEdit&quot;/&gt;
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    18
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;script  file=&quot;MyComponent.js&quot; prototype=&quot;MyPrototype&quot;/&gt;
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    19
 &nbsp;&nbsp; &lt;/implementation&gt;
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    20
&lt;/implementations&gt;</pre>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    21
<p>Some of the most common interfaces are:</p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    22
<ul>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    23
  <li>com.nokia.sdt.datamodel.adapter.IVisualAppearance </li>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    24
  <li>com.nokia.sdt.datamodel.adapter.ILayout</li>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    25
  <li>com.nokia.sdt.datamodel.adapter.IQueryContainment</li>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    26
  <li>com.nokia.sdt.datamodel.adapter.IDirectLabelEdit</li>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    27
  <li>com.nokia.sdt.datamodel.adapter.IComponentInstancePropertyListener </li>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    28
</ul>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    29
<h3><a name="javascript"></a>JavaScript</h3>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    30
<p>The UI Designer allows the use of JavaScript to customize  components. This allows component development without the need of a JDK and more dynamic  updating of component implementations while the UI Designer is running. The Mozilla Project&rsquo;s Rhino engine is used for  JavaScript interpretation (<a href="http://www.mozilla.org/rhino">http://www.mozilla.org/rhino</a>). This engine allows for JavaScript to call  Java routines, and Java routines to call JavaScript. Other sources of JavaScript information include <a href="http://javascript-reference.info/">http://javascript-reference.info/</a> and <a href="http://www.mozilla.org/js/language/">http://www.mozilla.org/js/language/</a>.</p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    31
<h4>Connecting JavaScript to Implementations</h4>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    32
<p>For component implementations, the &lt;implementation&gt; element can contain a &lt;script&gt; statement that specifies a JavaScript file and prototype that implements an interface. UI Designer instantiates the prototype into an object that is used throughout the lifetime of a component instance. Prototypes can be named and referenced across components.</p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    33
<p>Script declaration example:</p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    34
<pre class="listing">&lt;implementations&gt;
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    35
  &lt;implementation&gt;
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    36
    &lt;interface id=&quot;com.nokia.sdt.datamodel.adapter.IVisualAppearance&quot;/&gt;
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    37
    &lt;script file=&rdquo;MyComponent_render.js&rdquo; prototype=&rdquo;Render&rdquo; /&gt;
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    38
  &lt;/implementation&gt;
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    39
 &hellip;
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    40
&lt;/implementations&gt; </pre>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    41
<p>The file MyComponent_render.js should be located relative to the component definition (.component) file, and define a prototype named Render. Most implementations have two variants of the interface.  One is for Java use, and another is for JavaScript.  For example, IVisualAppearance and IScriptVisualAppearance.  The &lt;interface&gt; statement references the non-script interface but the implementation in the script uses the &ldquo;script&rdquo; variant.  Usually the only difference is the addition of a WrappedInstance argument.</p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    42
<p>Usually, a set of related implementations  share the same JavaScript prototype, such as rendering, layout, and direct  label editing. The method names used in  interfaces are intended to be specific enough so they won&rsquo;t clash.</p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    43
<p>MyComponent_render.js example:</p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    44
<pre class="listing">function Render() {
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    45
 }<br /><br />Render.prototype.draw = function(instance, laf, graphics) {
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    46
   var bounds = instance.getRenderingBounds();
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    47
   graphics.drawLine(bounds.x, bounds.y, bounds.w, bounds.h);
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    48
}<br /><br />Render.prototype.getPreferredSize = function(instance, laf, wHint, hHint) {
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    49
   if (wHint &lt; 0) wHint = 32;
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    50
   if (hHint &lt; 0) hHint = 24;
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    51
   return new Point(wHint, hHint);
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    52
}</pre>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    53
<h4><a name="wrapped"></a>Wrapped Types</h4>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    54
<p>JavaScript hosted in the UI Designer has access to component instances, properties, and attributes through a script-friendly interface.</p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    55
<ul>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    56
  <li><strong>WrappedInstance</strong> &mdash; This class wraps IComponentInstance.  A variable of this type called &ldquo;instance&rdquo; is usually the first argument to implementation methods, and is the primary point of entry to the other types.</li>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    57
</ul>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    58
<table width="645" border="1" align="center">
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    59
<caption>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    60
    WrappedInstance
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    61
  </caption>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    62
  <tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    63
    <th width="220" scope="col">Properties</th>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    64
    <th width="409" scope="col">Description</th>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    65
  </tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    66
  <tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    67
    <td>name</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    68
    <td>The instance name.</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    69
  </tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    70
  <tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    71
    <td>memberName</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    72
    <td>Name of the member (&ldquo;i&rdquo; + titlecased name)</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    73
  </tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    74
  <tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    75
    <td>className</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    76
    <td>Name of this instance&rsquo;s className property, or null.</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    77
  </tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    78
  <tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    79
    <td>properties</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    80
    <td>Reference to WrappedProperties, where given properties are accessible as members or by dictionary lookup. For example, instance.properties[<em>name</em>] or instance.properties.<em>name</em>.</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    81
  </tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    82
  <tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    83
    <td>attributes</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    84
    <td>Reference to WrappedAttributes, where given attribute values are accessible as members or by dictionary lookup.  Most attributes use dashes in names, so the dictionary lookup is probably mandatory. For example, <span class="code">instance.attributes[is-layout-object]</span>.</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    85
  </tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    86
  <tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    87
    <td>componentId</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    88
    <td>Qualified name of component</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    89
  </tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    90
  <tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    91
    <td>component</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    92
    <td>Reference to WrappedComponent</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    93
  </tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    94
  <tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    95
    <td>events</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    96
    <td>Array of WrappedEventBinding</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    97
  </tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    98
  <tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
    99
    <td>children</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   100
    <td>Return array of children as WrappedInstances (0-element array if no children)</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   101
  </tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   102
  <tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   103
    <td>parent</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   104
    <td>Return parent WrappedInstance or null</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   105
  </tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   106
  <tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   107
    <th width="220" scope="col">Function</th>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   108
    <th width="409" scope="col">Description</th>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   109
  </tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   110
  <tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   111
    <td>toString()</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   112
    <td>Converts an object to a string and returns the result.</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   113
  </tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   114
  <tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   115
    <td>findChildrenOfType(componentId)</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   116
    <td>Return array of WrappedInstance of children derived from the given component id.  Returns 0-element array if none match.</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   117
  </tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   118
  <tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   119
    <td>findChildOfType(componentId)</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   120
    <td>Like findChildrenOfType but returns single instance</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   121
  </tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   122
  <tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   123
    <td>forceLayout()</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   124
    <td>Forces ILayout#layout() on self and children</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   125
  </tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   126
  <tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   127
    <td>forceRedraw()</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   128
    <td>Forces redraw of self and children</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   129
  </tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   130
  <tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   131
    <td>isInstanceOf(componentId)</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   132
    <td>Returns true if component is instance of given component id or derived component id.</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   133
  </tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   134
  <tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   135
    <td>void updatePropertySource()</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   136
    <td>Force rebuild of property list for extension properties.</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   137
  </tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   138
  <tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   139
    <td>Rectangle getRenderingBounds()</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   140
    <td>Get the bounds for rendering, with x=y=0</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   141
  </tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   142
  <tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   143
    <td>Rectangle getLayoutBounds()</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   144
    <td>Get the layout bounds</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   145
  </tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   146
  <tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   147
    <td>setLayoutBounds(Rectangle)</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   148
    <td>Set the layout bounds</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   149
  </tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   150
  <tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   151
    <td>getPreferredSize()</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   152
    <td>get the preferred size from ILayout or IVisualAppearance</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   153
  </tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   154
</table>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   155
<p>&nbsp;</p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   156
<ul>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   157
  <li><strong>WrappedComponent</strong> &mdash; This class wraps IComponent.</li>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   158
</ul>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   159
<table width="645" border="1" align="center">
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   160
  <caption>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   161
    WrappedComponent
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   162
  </caption>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   163
  <tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   164
    <th width="220" scope="col">Properties</th>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   165
    <th width="409" scope="col">Description</th>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   166
  </tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   167
  <tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   168
    <td>id</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   169
    <td>The qualified component id. For example, com.nokia.sdt.series60.CAknView.</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   170
  </tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   171
  <tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   172
    <td>friendlyName</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   173
    <td>Localized component name, for example &ldquo;Vertical Label&rdquo;.</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   174
  </tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   175
  <tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   176
    <td>attributes</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   177
    <td>The WrappedAttributes for the component.</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   178
  </tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   179
  <tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   180
    <td>minSDKVersion</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   181
    <td>A org.osgi.framework.Version instance reflecting the minimum SDK version from the &lt;symbian&gt; element.</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   182
  </tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   183
  <tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   184
    <td>maxSDKVersion</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   185
    <td>A org.osgi.framework.Version instance reflecting the maximum SDK version from the &lt;symbian&gt; element.</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   186
  </tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   187
  <tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   188
    <th width="220" scope="col">Function</th>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   189
    <th width="409" scope="col">Description</th>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   190
  </tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   191
  <tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   192
    <td>toString()</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   193
    <td>Converts an object to a string and returns the result.</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   194
  </tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   195
  <tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   196
    <td>isOfType(componentId)</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   197
    <td>Return true if component matches or is derived from given component id.</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   198
  </tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   199
</table>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   200
<p>&nbsp;</p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   201
<ul>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   202
  <li><strong>WrappedProperties</strong> &mdash; This is an object with property names as members.  It can also be accessed as a dictionary.  For example, if a component defines a property <span class="code">name</span>, then <span class="code">properties.name</span> or <span class="code">properties[&quot;name&quot;]</span> can be used to access the property.  If no such property exists, the reference is undefined.</li>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   203
</ul>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   204
<blockquote>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   205
  <p>For defined properties, access of a property returns a JavaScript-friendly type.</p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   206
  <ul>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   207
    <li>Booleans, strings, integers act naturally. &nbsp;Localized string properties map to the string entry for the current language.</li>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   208
    <li>Component references return strings that can be looked up with <span class="code">lookupInstanceByName()</span>.&nbsp; </li>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   209
    <li>Compound properties are themselves WrappedProperties  (e.g. <span class="code">instance.properties.size.width</span>).  The &ldquo;editableValue&rdquo; property of compound properties resolves to the  value edited in cell editors (through <span class="code">ICompoundPropertyValueConverter#getEditableValue() </span>), or returned by <span class="code">IReconcileProperty#createDisplayValue()</span>. For the com.nokia.sdt.series60.CBA component,  &ldquo;instance.properties.cba&rdquo; is a compound property and a WrappedProperties  reference, but &ldquo;instance.properties.cba.editableValue&rdquo; is a string returned by  reconciling the contained properties to a single string (e.g. <span class="code">OPTIONS_BACK</span> or  <span class="code">&hellip;CUSTOM</span>).</li>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   210
    <li>Array  properties are modifiable JavaScript arrays.&nbsp;  The length property returns the size of the array. Elements are accessed as in  <span class="code">instance.properties.arrayProperty[0]</span>.</li>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   211
  </ul>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   212
</blockquote>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   213
<ul>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   214
  <li><strong>WrappedAttributes</strong> &mdash; This is an object of the component attributes for the instance&rsquo;s component, accessible as members or a dictionary.  Since most attributes use dashes, they are illegal as JavaScript members and should be accessed through the dictionary.  An attribute&rsquo;s value is the string placed in the component definition.  Attributes are strings.</li>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   215
</ul>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   216
<ul>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   217
  <li><strong>WrappedEventBindings</strong> &mdash; The <span class="code">instance.events</span> array is a reference to this class, which is a dictionary of events bound to the current instance.  Each entry is a WrappedEventBinding.   For example, <span class="code">instance.events[&ldquo;selected&rdquo;]</span> returns a WrappedEventBinding or null.</li>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   218
</ul>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   219
<blockquote>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   220
  <p class="note"><strong>NOTE</strong> This is not for accessing all possible events supported by a component, which is not supported.  If supported, this would appear on WrappedComponent.</p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   221
</blockquote>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   222
<ul>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   223
  <li><strong>WrappedEventBinding</strong> &mdash; This wraps IEventBinding.  The names used as properties match the names given to sourcegen globals that can be used to conditionally generate locations and templates based on whether a given event is bound to the current instance.</li>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   224
</ul>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   225
<table width="645" border="1" align="center">
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   226
<caption>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   227
    WrappedEventBinding
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   228
  </caption>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   229
  <tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   230
    <th width="220" scope="col">Properties</th>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   231
    <th width="409" scope="col">Description</th>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   232
  </tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   233
  <tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   234
    <td>eventId</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   235
    <td>Name of event (e.g. &ldquo;selected&rdquo;)</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   236
  </tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   237
  <tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   238
    <td>eventName</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   239
    <td>Friendly name of event (e.g. &ldquo;Focus lost&rdquo;)</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   240
  </tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   241
  <tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   242
    <td>handlerName</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   243
    <td>Base name of function handling the event (e.g. &ldquo;HandleSelectedEvent&rdquo;)</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   244
  </tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   245
  <tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   246
    <td>handlerSymbol</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   247
    <td>Encoded information describing the location of the event in source code.  Not generally useful in script.  The name starts with the domain name and contains domain-specific information to look up the symbol.  In the cpp domain the location path is used. For example &ldquo;cpp@src//MyFile.cpp/function(CContainer::HandleSelectedEvent(CCoeControl*))&quot;.</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   248
  </tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   249
</table>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   250
<h4><a name="globals"></a>JavaScript Globals</h4>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   251
<p>Scripts have access to several sets of global routines for use in implementations.  These are the commonly accessible routines.</p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   252
<h5>Generic Routines</h5>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   253
<p>These routines do not depend on the current instance or data model.</p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   254
<blockquote>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   255
  <p><strong>getLocalizedStrings(filebase)</strong> &mdash; Returns a reference to the com.nokia.sdt.component.symbian.ILocalizedStrings  interface for the given base filename.&nbsp;  This is usually used when a library script has *.properties files and is  used as in:</p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   256
  <ul>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   257
    <li>strings = getLocalizedStrings(&ldquo;utils&rdquo;)&nbsp; // look in utils.properties, etc.</li>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   258
    <li>localized = strings.getString(&ldquo;key&rdquo;)</li>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   259
  </ul>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   260
  <p><strong>print(string)  &mdash; </strong>Print  out the string to the console without a newline.</p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   261
  <p><strong>println(string)  &mdash; </strong>Print out the string to the console with a newline</p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   262
  <p><strong>titleCase(string)  &mdash; </strong>Return the string with all words titlecased (&ldquo;Like This&rdquo;).</p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   263
  <p><strong>getPluginClass(pluginId,  className)  &mdash; </strong>Return a JavaScript reference (NativeJavaClass) of the given  class loaded from the given plugin. This  is primarily used to access static functions.</p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   264
  <p><strong>formatString(format,  &hellip;)  &mdash; I</strong>nvoke MessageFormat.format() on the given format string and its  arguments.</p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   265
  <p><strong>makeValidIdentifier(name)  &mdash; </strong>Return the given name converted to a valid identifier by replacing invalid  characters with &lsquo;_&rsquo; and adding an initial &lsquo;_&rsquo; if necessary.</p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   266
  <p><strong>newStatusBuilder()  &mdash; </strong>Return a new com.nokia.sdt.utils.StatusBuilder class.
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   267
  </p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   268
</blockquote>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   269
<h5>Component-specific Routines</h5>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   270
<p>These routines rely on the current instance and data model to influence their behavior.  As such, they do not take instance arguments.</p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   271
<blockquote>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   272
  <p><strong>include(filename) &mdash; </strong>Include contents of the named file (relative to the current file)  into the current script. This is not  textual inclusion but semantic inclusion. The included file is compiled  separately and reused if the same include() appears in other scripts. Thus, a file can include file1.js which can  include utils.js, and then include file2.js which includes utils.js, and  overall, only one copy of utils.js will exist.</p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   273
  <p><strong>lookupString(key) &mdash; </strong>Return the localized entry for &lsquo;key&rsquo; in  the component&rsquo;s *.properties file.</p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   274
  <p><strong>lookupInstanceByName(name) &mdash; </strong>Return the WrappedInstance for  the given instance name property in the current data model.</p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   275
  <p><strong>getComponentVersions() &mdash; </strong>Return the  org.osgi.framework.Version for the data model&rsquo;s components (e.g. 2.6, 2.8, 3.0).</p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   276
  <p><strong>logStatus(IStatus) &mdash; </strong>Log an IStatus to the Error Log (get an  IStatus from StatusBuilder#createStatus).</p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   277
  <p><strong>log(string) &mdash; </strong>Log an info message to the Problems view in Carbide.c++;  associated with the *.uidesign file.</p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   278
  <p><strong>error(string) &mdash; </strong>Log an error message to the Problems view;  associated with the *.uidesign file.</p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   279
  <p><strong>warning(string) &mdash; </strong>Log a warning message to the Problems  view; associated with the *.uidesign file.</p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   280
  <p><strong>isInRootModel() &mdash; </strong>Tell whether the current instance is in  the root (application.uidesign) model.</p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   281
  <p><strong>getProjectName() &mdash; </strong>Return the name of the current  project.</p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   282
  <p><strong>getRootModelInstanceOfType(componentId) &mdash; </strong>Return a WrappedInstance for the first root model instance with the given  component id. </p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   283
</blockquote>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   284
<h4><a name="libraries"></a>JavaScript Libraries</h4>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   285
<p>The <span class="code">include(<em>filename</em>)</span> function opens the door for using libraries.   The S60 component library plugin uses these to accelerate common tasks.  Unfortunately our libraries are not easily accessible from custom component projects, since you would need to hardcode a path out of your workspace into our plugin.</p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   286
<p>You can copy code from the libraries for your own use, but do not directly reference the files since the contents are subject to change from release to release. Most useful are the implLibrary.js and renderLibrary.js files.  The implLibrary.js file makes handy use of JavaScript to dynamically implement interfaces by adding members to a prototype.  Helpers for hooking up common direct label and image editing implementations are provided.   The renderLibrary.js file contains useful routines for finding out the appropriate background color (when rendering text) and rendering images.   The formLibrary.js file helps automate support for hosting a control either in a container or in a form.</p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   287
<p>The srcgenLibrary.js file provides helpers for emitting property setting code in C++ for loading bitmap or SVG images, and for generating contributions. If appropriate resources exist, use source mapping instead.</p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   288
<h4><a name="rendering"></a>Rendering</h4>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   289
<p>When implementing IVisualAppearance to render components in the editor, the UI Designer provides easy access to the SWT graphics library.  The org.eclipse.swt.graphics.GC class is wrapped for scripting.  An instance of this class is instantiated to draw onto a bitmap with a size corresponding to the current layout size.  The bitmap supports a transparent pixel model (rather than alpha blending) and is initially fully transparent.</p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   290
<h5>Wrapped org.eclipse.swt.graphics.GC Class</h5>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   291
<p>The SWT GC class is wrapped and extended.  The GC is enhanced with the ability to modify colors that will conflict with the transparent pixel value (which may be retrieved via getTransparentColor() ).</p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   292
<p>Scripting Example:</p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   293
<p><span class="code">Device getDevice() </span>Returns the Device the GC was created on.</p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   294
<p>Draw a string which takes formatting flags.</p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   295
<p>string <strong>&mdash; </strong>The string to draw<br />
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   296
bounds <strong>&mdash; </strong>The rectangle in which to draw<br />
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   297
flags <strong>&mdash; </strong>Mask of IFont.xxx flags<br />
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   298
lineGap <strong>&mdash; </strong>Extra pixel gap between  lines </p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   299
<pre>public void drawFormattedString(String string, Rectangle bounds, int flags, int lineGap)
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   300
public Device getDevice()          // Get the device the GC was created with.
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   301
public int getOffX()               // Get the X offset all drawing is translated by.
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   302
public void setOffX(int offX)      // Set the X offset. This is separate from gc.setTransform.
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   303
public int getOffY()               // Get the Y offset.
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   304
public void setOffY(int offY)      // Set the Y offset all drawing is translated by. This is separate from gc.setTransform.
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   305
public Color getTransparentColor() // Get the color allocated for the transparent pixel.
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   306
public Color getSubstituteColor()  // Get the color used when drawing operations try to use the transparent pixel.</pre>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   307
<h5>Font Support</h5>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   308
<p>In the UI Designer, fonts are expected to be referenced through the ILookAndFeel instance passed to rendering and layout functions (usually called &quot;laf&quot;).  This provides IFont instances that are rendered specially for the UI Designer.   Host fonts may be referenced with the appropriate SWT methods, but if you want to use custom fonts, we recommend making them available to the look and feel system.  For S60, see com.nokia.sdt.component.symbian under /data/s60/fonts/ for the typical font installation directory.  In the same plugin, see  /data/laf/qvga_fonts.inc for an example of how font and sizes are mapped to LAF keys for a QVGA layout.</p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   309
<h5>IFontConstants bitmask constants</h5>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   310
<p>IFontConstants provides constants which are combined with the logical OR operator to control the GC#drawFormattedString() and GC#getFormattedStringTexts() family of methods.</p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   311
<pre>/** Ignore overflow (text is clipped) */
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   312
 &nbsp;&nbsp; public static final  int OVERFLOW_IGNORE = (0 &lt;&lt; 0);
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   313
<br />/** Truncate text  before overflow */
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   314
 &nbsp;&nbsp; public static  final int OVERFLOW_TRUNCATE = (1 &lt;&lt; 0);
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   315
<br />/** Use an  ellipsis to indicate truncation */ 
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   316
&nbsp;&nbsp;&nbsp; public static  final int OVERFLOW_ELLIPSIS = (2 &lt;&lt; 0);
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   317
&nbsp;&nbsp;&nbsp; public static  final int OVERFLOW_MASK = (3 &lt;&lt; 0);</pre>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   318
<pre>&nbsp;&nbsp;&nbsp; public static  final int DIRECTION_LEFT_TO_RIGHT = (0 &lt;&lt; 2); 
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   319
  &nbsp; public static  final int DIRECTION_RIGHT_TO_LEFT = (1 &lt;&lt; 2);
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   320
  &nbsp; public static  final int DIRECTION_DEFAULT_LEFT_TO_RIGHT = (2 &lt;&lt; 2);
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   321
  &nbsp; public static  final int DIRECTION_DEFAULT_RIGHT_TO_LEFT = (3 &lt;&lt; 2);
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   322
  &nbsp; public static  final int DIRECTION_MASK = (3 &lt;&lt; 2); </pre>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   323
<pre>&nbsp;&nbsp;&nbsp; public static  final int DRAW_TRANSPARENT = (0 &lt;&lt; 4);
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   324
  &nbsp; public static  final int DRAW_OPAQUE = (1 &lt;&lt; 4);
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   325
  &nbsp; public static  final int DRAW_MASK = (3 &lt;&lt; 4);
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   326
   &nbsp;&nbsp;&nbsp; 
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   327
  &nbsp; public static  final int ALIGN_LEFT = (0 &lt;&lt; 6);
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   328
  &nbsp; public static  final int ALIGN_RIGHT = (1 &lt;&lt; 6);
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   329
  &nbsp; public static  final int ALIGN_CENTER = (2 &lt;&lt; 6);
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   330
  &nbsp; public static  final int ALIGN_MASK = (3 &lt;&lt; 6);
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   331
   &nbsp;&nbsp;&nbsp; 
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   332
  &nbsp; public static final  int WRAPPING_NONE = (0 &lt;&lt; 8);
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   333
  &nbsp; public static  final int WRAPPING_ENABLED = (1 &lt;&lt; 8);
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   334
  &nbsp; public static  final int WRAPPING_MASK = (1 &lt;&lt; 8);
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   335
   &nbsp;&nbsp;&nbsp; 
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   336
  &nbsp; public static  final int OPTIONS_NONE = (0 &lt;&lt; 11);
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   337
  &nbsp; public static  final int OPTIONS_UNDERLINE = (1 &lt;&lt; 11);
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   338
  &nbsp; public static  final int OPTIONS_STRIKETHROUGH = (2 &lt;&lt; 11);
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   339
  &nbsp; public static  final int OPTIONS_BOLD = (4 &lt;&lt; 11);
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   340
  &nbsp; public static  final int OPTIONS_EXTRABOLD = (12 &lt;&lt; 11);
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   341
  &nbsp; // next: 16
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   342
  &nbsp; public static  final int OPTIONS_MASK = (15 &lt;&lt; 11);
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   343
   &nbsp;&nbsp;&nbsp; 
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   344
  &nbsp; // note: on by  default
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   345
  &nbsp; public static  final int ANTIALIAS_ON = (0 &lt;&lt; 15);
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   346
  &nbsp; public static  final int ANTIALIAS_OFF = (1 &lt;&lt; 15);
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   347
    public static final int ANTIALIAS_MASK = (1  &lt;&lt; 15);<br /><br />    /** default */<br />    public static final int VERTICAL_ALIGN_TOP = (0 &lt;&lt; 16);<br />    public static final int VERTICAL_ALIGN_BOTTOM =(1 &lt;&lt; 16);<br />    public static final int VERTICAL_ALIGN_CENTER = (2 &lt;&lt; 16);<br />    public static final int VERTICAL_ALIGN_MASK = (3 &lt;&lt; 16);</pre>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   348
    
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   349
<h5>Rendering Globals</h5>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   350
<p>Use of the look and feel object (type ILookAndFeel) is recommended for looking up colors, fonts, and images that can vary based on the current layout, but globals are available for other uses as needed.</p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   351
<p>Example of Colors object:</p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   352
<blockquote>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   353
  <pre>getColor(int red, int green, int blue)</pre>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   354
  <p>Returns an SWT Color initialized with the given RGB value.  The color is cached and automatically disposed.  For example, <span class="code">Colors.getColor(128, 128, 255)</span>.</p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   355
</blockquote>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   356
<p>Example of Fonts object:</p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   357
<blockquote>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   358
  <pre>getLocalFont(filename, size)</pre>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   359
  <p>Returns an IFont instance, which is passed to GC routines ordinarily taking SWT Font.  The filename is a Truetype font file relative to the current script&rsquo;s directory.  The font is cached and automatically disposed.</p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   360
  <pre>getGlobalFont(filename, size)</pre>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   361
  <p>Same as getLocalFont, but finds the file relative to the com.nokia.sdt.component.symbian plugin's /data directory.</p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   362
</blockquote>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   363
<p>Example of Image objects:</p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   364
<table width="705" border="1" align="center">
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   365
<caption>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   366
    Image Objects
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   367
  </caption>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   368
  <tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   369
    <td width="255" class="code">newImage(Device, width, height)</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   370
    <td width="434">Creates a new SWT Image; device can be graphics.getDevice(). Such images are cached and automatically disposed.</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   371
  </tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   372
  <tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   373
    <td class="code">public Image getImage(Device device, String relPath)</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   374
    <td><p>Get an image, accessed by key (filename).  Such an image will be loaded only once.  Use copyImage() if you want to change a shared image.  The image shouldn't be disposed explicitly when created through this call.
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   375
     </p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   376
      <ul>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   377
        <li> device</li>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   378
        <li> relPath &#8212; path relative to the current script</li>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   379
        <li>returns a cached Image</li>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   380
    </ul></td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   381
  </tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   382
  <tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   383
    <td class="code">public Image copyImage(Device device, Image image)</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   384
    <td>Copy an image (from anywhere).  The copy needn't be disposed explicitly when created through this call.</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   385
  </tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   386
  <tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   387
    <td class="code">public Image createIcon(Image bitmap, Image bitmapMask)</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   388
    <td>Create an image from a foreground and a mask.</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   389
  </tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   390
  <tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   391
    <td class="code">public Image createAlphaMaskedIcon(Image bitmap, Image alphaMask)</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   392
    <td>Create an image from a foreground and a mask.</td>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   393
  </tr>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   394
</table>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   395
<p>&nbsp;</p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   396
<h3><a name="issues"></a>Common Issues and Troubleshooting</h3>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   397
<p>The following limitations should be considered when using JavaScript.</p>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   398
<ul>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   399
  <li>JavaScript is a dynamically typed language and  functions are matched based only by name. If a caller calls a routine with too few or  too many arguments, there is no indication of the problem except that arguments  are undefined or ignored.</li>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   400
  <li>The interface between Java and JavaScript routines  may convert function arguments between Java types and JavaScript types.&nbsp; Component implementations look like  JavaScript and Java, so the type conversion may occasionally yield unexpected  results when making calls between UI Designer prototype methods and other  JavaScript methods in the same script. Most  commonly, numbers may become strings. If  you find odd behavior occurring, explicitly convert a string into a number with <span class="code">var &ndash; 0</span>.<br />
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   401
    Numbers are automatically converted to strings based on  context, but if a number unexpectedly becomes a float before it turns into a  string, use <span class="code">&ldquo;&rdquo; + var</span> when you are sure you have an integer.</li>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   402
  <li>switch() on strings &mdash; The values returned by <span class="code">WrappedProperties</span> references are not necessarily the same kind of string JavaScript supports with the switch() statement.  Thus, switch() on strings may not work as expected.  Instead, use nested if statements or a lookup table. An example for calling routines using a lookup table:</li>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   403
</ul>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   404
<blockquote>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   405
  <pre class="listing">table = {
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   406
   &ldquo;string1&rdquo; : MyClass.prototype.routine1,
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   407
   &ldquo;string2&rdquo; : MyClass.prototype.routine2
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   408
}
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   409
table[key].apply(this, [ &lt;arguments&gt; ])  // calls this.routine1(arguments) or this.routine2(arguments)
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   410
</pre>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   411
</blockquote>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   412
<ul>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   413
  <li>Stack traces &mdash; When  an exception occurs in JavaScript code, various entries in the stack trace may  resolve to locations in script.&nbsp; Look for  these at the end of lines coming from the class &ldquo;org.mozilla.javascript.gen.*&rdquo;.</li>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   414
</ul>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   415
<div id="footer">Copyright &copy; 2010 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. <br>License: <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a></div>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   416
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   417
</body>
24ac5a5cf80c updated copyright dates and fixed some css issues
fturovic <frank.turovich@nokia.com>
parents: 0
diff changeset
   418
</html>