|
||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES | |||||||
See:
Description
| Callback Summary | |
|---|---|
| ActionCallback | This interface represents a function prototype for a user interface action. |
| ChannelCallback | This interface represents function protocol for obtaining the channel handles. |
| Comparator | This interface represents function prototype for a comparison function, which imposes a total ordering on some collection of objects. |
| FailureCallback | This interface represents function prototype for a failed server operation. |
| KeyCallback | This interface represents a function prototype for a key action. |
| MemberCallback | This interface represents function protocol for handling the changes in channel member list. |
| MenuCallback | This interface represents a function prototype for acquiring the Menu instance. |
| MessageCallback | This interface represents function protype for channel message handling. |
| PaintCallback | This interface represents a function prototype for custom component paint events. |
| ResponseCallback | This interface represents a function prototype for response sending on inter widget communication. |
| Runnable | This interface represents function prototype for any runnable operation. |
| Script | This interface specifies the callbacks that system may call on widget script. |
| ServiceCallback | This interface represents a function prototype for service request handling. |
| SoftKeyCallback | This interface represents a function prototype for soft key bindings. |
| SuccessCallback | This interface represents a function prototype for a successful server operation. |
| TimerCallback | This interface represents a function prototype for timer events. |
| Class Summary | |
|---|---|
| API | This class contains constants and functions that available on scripts globally, without any prefix. |
| Banner | Banner component shows a banner ad image. |
| Buffer | A string buffer implements a mutable sequence of characters. |
| ByteArray |
This class implements an facade for byte[]. |
| Calendar |
Calendar is a class for getting and setting dates
using a set of integer fields such as
YEAR, MONTH, DAY. |
| Camera | Camera component shows the camera preview feed and provides the logic to take a snapshot. |
| Canvas | Canvas is a component which is painted by script. |
| Channel | This class represents messaging channel. |
| Choice | Choice component gives a user a predefined set of choices to choose from. |
| Component | Component is base class for user interface elements. |
| Config | This class represents set of parameters for Widget. |
| Flow | Flow is a container class for other user interface Components. |
| Font | This class is a handle to font. |
| Graphics | Provides simple 2D geometric rendering capability. |
| HyperText | HyperText is multiline text component that supports different text styles and embedded links. |
| Image | This class represents loaded image that can be draw to screen. |
| Input | Creates text field component used for input. |
| InputStream | The InputStream class provides
for reading bytes from a binary stream and
reconstructing from them data in
the primitive types. |
| IntArray | This class implements an facade for int[]. |
| Label | Label component shows a single line of text. |
| List | The List class implements a growable array of objects. |
| Map | This class implements a hashtable, which maps keys to values. |
| Member | This class represents participant on Channel. |
| Menu | This class represents the Menus that are shown to user. |
| MenuItem | This class represents an individual item on a Menu. |
| NativeInput | Deprecated. Use Input instead |
| Object | Class Object is the root of the class hierarchy. |
| OutputStream | The OutputStream class provides
for converting data from any of the
primitive types to a series of bytes and
writing these bytes to a binary stream. |
| Picture | Picture component shows a single image. |
| Player | Handle to sound being played. |
| Popup | Popup is a root of single windowed user interface screen. |
| Progress | Progress component implements user interface element for definite and continuous progress indicators. |
| Prompt | This class represents a simple popup with text, optional image and optional progress bar. |
| Scrollable | This class contains exactly one child component and provides an ability to scroll it automatically when focus changes or programmatically. |
| Shell | Shell is a root of single user interface screen. |
| Store | This class is a Widget specific persistent storage. |
| String | The String class represents character strings. |
| Style | This class represents the look and feel of Component. |
| Text | Text component shows multiple lines of text. |
| Ticker | Implements a "ticker-tape", a piece of text that runs continuously across the component area. |
| Timer | Handle to scheduled execution. |
| TimeZone | TimeZone represents a time zone offset, and also figures out daylight savings. |
| Value | Value is a general composite type. |
| View | View provides programmable access to UI elements normally created with <view> elements on widget XML specification. |
| Widget | This class represents Widget instance. |
| Annotation Types Summary | |
|---|---|
| Since | This annotation is used by compiler to determine the lowest client version than is capable of running the widget being compiled. |
Widsets Scripting
This API specifies the facilities available for WidSets scripting language, called Helium. Helium contains facilities that cannot be represented in terms of standard javadoc; here's reading instructions for those:
Dollar sign indicates that function or method can take variable number of arguments. One such function is printf$.
interface ...Callback
Specifies a protype of function pointer. Whenever a API method expects one of the Callback interfaces a function may be passed with a matching signature to the sole method defined on the interface:
/* Function matches PaintCallback */ void my_paint(Component c, Graphics g, Style style, int w, int h) { g.setColor(0xffffff); g.fillRect(0, 0, w, h); g.setColor(0xff0000); int x = w/4; int y = h/4; g.fillRect(x, y, w-2*x, h-2*y); } Canvas c = new Canvas(getStyle("myCanvasStyle"), my_paint);
Here the function my_paint is passed to the
constructor of Canvas. Instead of the default callback
Script.paint(Component, Graphics, Style, int, int)
the function my_paint will be called when painting
of the Canvas is needed.
All other callback functions work in the same fashion.
Multiple return values
Certain methods can return multiple, typed values, called tuples. All of the elements in tuple must be either assigned to variables or passed to another function:
int w, int h = getScreenSize(); // See description setSize(getScreenSize()); function setSize(int w, int h) { ... }
There are several operators in Helium that can not be found in Java. The operators get, set, array and append are used to manipulate data structures such as Value and List using brackets. These operators work in a similar way as when dealing with arrays.
The operators bind and append are used to create Value bindings which are simply key-value pairs of Values.
The operator cast is used to cast object types from one to another. The notation looks like a function call. The benefits of this kind of notation is reduced number of parentheses in real programming situations such as when operations are chained.
<R> <C>.operator_get(<K> key)
Get a value from container:
<C> obj = ...;
<K> key = ...;
<R> val = obj[key];
example:
List list = new List();
list.add("one");
list.add("two");
list.add("three");
list.add("four");
String fourth = String(list[3]);
<V> <C>.operator_set(<K> key, <V> value)
Set a value to container:
<C> obj = ...;
<K> key = ...;
<V> val = ...;
obj[key] = val;
example:
Map map = new Map();
map["message"] = "hello";
OR a dot notation can be used:
Map map = new Map();
map.message = "hello";
<A> operator_array()
Creates an array which is composite class Value:
// create an empty array
Value arr = [];
<A> operator_bind(...)
Creates a key-to-value binding that is only used with
Value:
Value bind = "key"=>"value";
void <C>.operator_append(<E> elem)
Initializes elements in a container. This may only be used with
operator_array(), and therefore only Value supports
this:
Value v = ["key"=>"value", "key2"=>"value2"];
<T> operator_cast_<T>(<S> source)
Cast from one type to another:
<S> src = ...;
<T> trg = <T>(src);
Object msg = map["message"];
int length = String(msg).length();
operator_start(<T>, ...) and operator_next(<T>, ...)
This classes enable foreach statement support for
implementing class <T>:
List list = new List();
list.add("a");
list.add("b");
list.add("c");
foreach(String x: list) {
printf("%s", x);
}
|
||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES | |||||||