com.nokia.mid.ui
Class LCDUIUtil

java.lang.Object
  extended by com.nokia.mid.ui.LCDUIUtil

public class LCDUIUtil
extends java.lang.Object

A utility class which provides static methods that allows the caller to read and set value of "traits" associated with a given target object. Each "trait" corresponds to an attribute or property, which is parsed and understood by the target object. Unlike attributes, each target object has a well-defined set of traits and attempting to access an undefined trait for that target will result in a unsuccessful completion of the request.

Traits supported in this specification

Below is shown the list of traits that Nokia UI API implementations must support.

Trait: "nokia.ui.s40.item.substate"

Description: In Series 40 Java touch UI when user taps on editable Form Item the default behavior is that inline editor is activated for the item. Series 40 native UI style uses sub-state editor screens in these cases. This trait allows application to control whether inline or sub-state screen editing style is used in editable form items (e.g. DateField, TextField and Gauge) in Series 40 touch UI devices.

Target(s): javax.microedition.lcdui.Item

Trait Setter [allowed value(s)]: Boolean.TRUE|Boolean.FALSE

Trait Getter [allowed value(s)]: Boolean.TRUE|Boolean.FALSE

Default value object: Boolean.FALSE

Platform scope: Series 40 platform

Trait: "nokia.ui.s40.item.direct_touch"

Description: In Series 40 Java touch UI the default behavior of a CustomItem that system will propagate touch events (pointer and/or gesture) only to a CustomItem that is already set/selected as the current item of the Form (e.g. by user taping on the item or MIDlet setting item as current via Display#setCurrentItem()). However, there are valid use cases where a visible CustomItem needs to receive touch events without the user or the application having to select the item first. This trait allows applications to control whether a given CustomItem instance will receive touch events without having to be set as current (selected) first.

Target(s): javax.microedition.lcdui.CustomItem

Trait Setter [allowed value(s)]: Boolean.TRUE|Boolean.FALSE

Trait Getter [allowed value(s)]: Boolean.TRUE|Boolean.FALSE

Default value object: Boolean.FALSE

Platform scope: Series 40 platform


Method Summary
static java.lang.Object getObjectTrait(java.lang.Object target, java.lang.String traitName)
          This method gets the trait of the specified target object as an object value.
static boolean setObjectTrait(java.lang.Object target, java.lang.String traitName, java.lang.Object value)
          Sets the trait value of the target object as Object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setObjectTrait

public static boolean setObjectTrait(java.lang.Object target,
                                     java.lang.String traitName,
                                     java.lang.Object value)
Sets the trait value of the target object as Object. Values in the given "value" Object are copied into the target's trait so subsequent changes to the "value" Object have no effect on the value of the target's trait.

Parameters:
target - the target object to set the trait to
traitName - the name of the trait to be set.
value - the value of the trait to be set as String.
Returns:
true if the request has succeeded or false otherwise (e.g. trait on this target is read only)
Throws:
java.lang.IllegalArgumentException - with String value "INVALID_ARGUMENT" if the target or traitName object is null.
java.lang.IllegalArgumentException - with String value "ILLEGAL_ARGUMENT" if the target object or value object are illegal for this trait.
java.lang.IllegalArgumentException - with String value "NOT_SUPPORTED" if the specified trait is not supported by this platform.
java.lang.SecurityException - if the application does not have the necessary privilege rights to access this content.

getObjectTrait

public static java.lang.Object getObjectTrait(java.lang.Object target,
                                              java.lang.String traitName)
This method gets the trait of the specified target object as an object value. The returned object is a copy of the target's trait value and will not change if the corresponding trait changes.

Parameters:
target - the target object to read the trait from
traitName - the name of the trait to retrieve.
Returns:
valid Object if the request has succeeded or null otherwise
Throws:
java.lang.IllegalArgumentException - with String value "INVALID_ARGUMENT" if the target or traitName object is null.
java.lang.IllegalArgumentException - with String value "ILLEGAL_ARGUMENT" if the target object is illegal for this trait.
java.lang.IllegalArgumentException - with String value "NOT_SUPPORTED" if the specified trait is not supported by this platform.
java.lang.SecurityException - if the application does not have the necessary privilege rights to access this content.


Copyright © 2010 Nokia Corporation. All rights reserved.

Nokia is registered trademark of Nokia Corporation. Java and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. Other product and company names mentioned herein may be trademarks or trade names of their respective owners. This document is confidential information of Nokia Corporation.

Disclaimer
The information in this document is provided "as is," with no warranties whatsoever, including any warranty of merchantability, fitness for any particular purpose, or any warranty otherwise arising out of any proposal, specification, or sample. Furthermore, information provided in this document is preliminary, and may be changed substantially prior to final release.

Nokia Corporation disclaims all liability, including liability for infringement of any proprietary rights, relating to this document and implementation of any information presented in this document.

Nokia Corporation retains the right to make changes to this document at any time, without notice.

License
Subject to above disclaimer, a license is hereby granted to use this documentation solely under existing Limited License Agreement and non-disclosure agreement between the companies for the agreed application development for Series 40 Nokia phones. No other licenses e.g. to any intellectual property rights are granted herein. Any use of the screen shots of this documentation, including any icons thereof, is subject to Nokia's prior written approval.