|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sybase.uep.bobclient.utils.Util
public class Util
This is the Utility class Contains static helper methods
Field Summary | |
---|---|
static java.lang.String |
ASTERISK_MARK
|
static long |
KEY
|
static java.lang.String |
QUESTION_MARK
|
Constructor Summary | |
---|---|
Util()
|
Method Summary | |
---|---|
static void |
addAll(java.util.Vector target,
java.lang.Object[] source)
Collection util method, Add all source elements to target Vector |
static void |
addAll(java.util.Vector target,
java.util.Vector source)
Collection util method, Add all elements of source Vecotr to target Vector |
static void |
addVariable(java.lang.String key,
java.lang.Object value,
java.lang.String type,
java.lang.String schemaType)
Add variables to persistent store |
static void |
addVariables(java.util.Hashtable variables)
Add a hashtable of variables |
static java.lang.String |
appendInternalPackageString(java.lang.String fullDatabaseClassName)
Appends 'intrnl' as package name |
static void |
applyAllProfileInfo2ObjectAPI(ClientProfileList profileList,
java.lang.String clientName)
Apply all profile info to the static fields of MyDatabase class of Object API |
static void |
applyProfileInfo2ObjectAPI(ClientProfileList profileList,
java.lang.String profileId,
java.lang.String clientName)
Apply profile info of specified profile ID to the static fields of MyDatabase class of Object API |
static void |
applyProfileInfo2ObjectAPI(ClientProfile clientProfile,
java.lang.String clientName)
Apply the properties of spcified client profile into to Object API |
static void |
callBlackberryBrowser(java.lang.String url)
|
static boolean |
canLoginToSync(java.lang.String packageName)
Checks whether the specified package can call loginToSync. |
static void |
changeLinkParamOptions(IBOBScreen screen,
java.lang.String mobileAppID,
LinkParamNode linkParam,
java.lang.String name,
java.lang.String value)
Change the link parameter select box options when it has been changed |
static int |
checkColorString(java.lang.String str,
int defaultColor)
Check the color string if it has pound sign or not. |
static void |
checkNonEmpty(java.lang.String str,
java.lang.String errmsg)
|
static void |
checkNonNull(java.lang.Object obj,
java.lang.String errmsg)
|
static void |
checkWirelessConnection()
Check device radio states |
static boolean |
containsFocusableControlsAfterTable(java.lang.String tableFieldMobileAppID)
This is mainly used in the TableField where we want to check if there are controls after the table If there are controls we would want to move the focus to that control |
static java.lang.Object |
convert2ScalarArrayIfNeed(java.lang.String schemaType,
java.lang.Object value)
Check if the value need to be converted to a scalar array. |
static java.lang.String |
converToValidName(java.lang.String oldName)
Remove "_" from name |
static java.lang.String |
convertPackageName(java.lang.String packageName)
Converts the server version of package name to its realy package name. |
static java.lang.Object |
convertToAFXObject(java.lang.Object value,
DataType datatype)
Convert J2ME type to AFX type. |
static java.lang.String |
convertToDataTypeName(java.lang.String schemaType)
Convert the name of schema_type to the name which can be recognized by the method of DataType.forName(). |
static java.lang.Object |
convertToJ2MEObject(java.lang.Object value,
int datatype)
Convert AFX type to J2ME type. |
static long |
convertToLong(java.lang.String valueToConvert)
|
static java.lang.Object |
convertValueBySchemaType(java.lang.String schemaType,
java.lang.Object value)
Converts value to a specific java type based on schemaType Support convertion from String value to object of specified schematype ( For SCHEMA_TYPE_STRING, just return value ), byte[] value to SCHEMA_TYPE_BINARY, call getStringValue(Object) to convert value to corresponding String instance
when specified schameType is SCHEMA_TYPE_STRING. |
static void |
deleteAllMobileApplicationLogs()
Delete all the mobile application logs when exiting the client |
static void |
deleteAllMobileApplications(MBOModel[] mobileApps)
Delete a list of mobile application objects |
static void |
elementsToArray(java.util.Hashtable h,
java.lang.Object[] array)
|
static boolean |
equals(java.lang.Object obj1,
java.lang.Object obj2)
Indicates whether two objects are equal to each other. |
static boolean |
equals(java.util.Vector vect1,
java.util.Vector vect2)
Indicates whether two Vector objects are equal to each other. |
static MobileAppTable |
findTableControl(net.rim.device.api.ui.Field f)
Find table control widget |
static TwoColumnLayout |
findTwoColumnLayoutControl(net.rim.device.api.ui.Field f)
Find two column layout control widget |
static void |
getAllControls(net.rim.device.api.ui.Field f,
java.util.Vector controls)
Get the list of controls on this manager field |
static Control[] |
getAllControlsOnScreen(IBOBScreen screen)
Get all the controls on the screen |
static Control[] |
getAllControlsOnScreen(net.rim.device.api.ui.Screen screen)
Get all the controls on the screen |
static java.lang.String |
getAppID()
Gets the client application ID |
static java.lang.String |
getAssociationKey(java.lang.String packageName,
java.lang.String name)
We need the package name and association name to identify an association. |
static AttributeMetaData |
getAttributeMetaData(MBOModel mboModel,
java.lang.String attrName)
Gets attribute meta data |
static boolean |
getBooleanByString(java.lang.String value)
Get the boolean value by string If the string isn't "true" or "false", return true |
static boolean |
getBooleanByString(java.lang.String value,
boolean defaultBoolean)
Get the boolean value by string If the string isn't "true" or "false", return the default boolean value |
static Control |
getControlByName(Control[] listControls,
java.lang.Object key)
Loops through the list of controls on the screen and check for matching control name |
static Control |
getControlsByID(java.lang.String controlID)
Get all the controls on the screen |
static Control[] |
getControlsByID(java.lang.String[] controlIDs)
Get all the controls on the screen |
static java.lang.Object |
getDataFromSPMBO(java.lang.String id,
boolean isAll)
Retrieve the data stored in the structured parameter(complex datatype) mbo |
static java.lang.String |
getDeviceEmail()
Get the device email address |
static java.lang.String |
getDeviceID()
Get the device identification number |
static net.rim.device.api.system.EncodedImage |
getEncodedImage(java.lang.String imageStr)
Get the EncodedImage object based on the image name. |
static net.rim.device.api.system.EncodedImage |
getEncodedImage(java.lang.String moduleName,
java.lang.String imageName)
For custom coding, we are not sure what module name is, the deal is to first retrieve the image without module name, and if nothing is returned we then try the module name. |
static net.rim.device.api.ui.Field[] |
getFieldControls(net.rim.device.api.ui.Field f)
Get controls from field object |
static net.rim.device.api.ui.Field |
getFieldFocusOnScreen(net.rim.device.api.ui.Screen screen)
Get field with focus on screen |
static int |
getFieldIndexOnScreen(net.rim.device.api.ui.Screen screen,
net.rim.device.api.ui.Field field)
Gets the field index among all fields on the screen |
static int |
getFieldMaxWidth(net.rim.device.api.ui.Font font,
MBOAttribute[] columns)
|
static net.rim.device.api.ui.Field |
getFieldWithFocus(net.rim.device.api.ui.Field f)
|
static net.rim.device.api.ui.Field |
getFocusField(net.rim.device.api.ui.Screen screen)
return the control with focus in specific screen. |
static java.lang.Integer |
getGUID()
Get a GUID |
static long |
getHorizontalAlignment(long style)
Get the horizontal alignment |
static long |
getHorizontalAlignment(long style,
long defaultAlignment)
Get the horizontal alignment |
static java.lang.String |
getHTTPPushAddress()
Get the HTTP push address |
static net.rim.device.api.system.Bitmap |
getImageBitmap(java.lang.String imageStr)
Get the Bitmap object based on the image name. |
static net.rim.device.api.system.Bitmap |
getImageBitmap(java.lang.String imageStr,
net.rim.device.api.system.Bitmap defaultImage)
Get the Bitmap object based on the image name. |
static net.rim.device.api.system.Bitmap |
getImageBitmap(java.lang.String moduleName,
java.lang.String imageStr,
net.rim.device.api.system.Bitmap defaultImage)
Get the Bitmap object based on the image name. |
static int |
getMaxNumberOfPersistentObjects()
|
static java.util.Vector |
getMDCList(IBOBScreen screen,
boolean currentTabOnly)
Gets all MobileDataControl contained in the given screen |
static ClassMetaData |
getMetaData(java.lang.String packageName,
java.lang.String complexDataType)
Get the meta data for a given complex data type class |
static java.lang.String[] |
getMobileAppIDsByPublication(java.lang.String packageName,
java.lang.String publication)
Obtains an array of ids of all mobile business objects within the given publication |
static MobileDataControl |
getMobileDataControlByMobileAppID(IBOBScreen screen,
java.lang.String mobileAppID,
boolean onCurrentTabOnly)
Get only the mobile data controls |
static void |
getMobileDataControls(net.rim.device.api.ui.Field f,
java.util.Vector results,
boolean currentTabOnly)
Search for Mobile data controls |
static java.lang.String |
getObjectAPIPath()
Gets the package name of generated Object API |
static java.lang.Object |
getObjectFromString(DataType dataType,
java.lang.Object value)
|
static java.lang.String |
getOSVersionNumber()
|
static java.lang.String |
getPackageName(java.lang.String mboId)
Gets the name of the package that contains the given MBO |
static java.util.Hashtable |
getParametersFromSubmitElement(java.util.Vector submitElements)
Returns a hashtable of parameters from the submit elements. |
static MobileDataControl |
getParentMDC(IBOBScreen screen,
java.lang.String mboId)
Finds the MobileDataControl with the mbo id on parent screen or parent tab |
static DataType |
getPrimitiveDatatype(DataType listType)
|
static java.lang.String |
getPublicationByMobileApp(MBOMobileApplication application)
Utility method to get the publication name by mobile application id |
static java.lang.String |
getResourceString(int resourceID)
Get the resource string |
static java.lang.String |
getResourceString(int resourceID,
net.rim.device.api.i18n.ResourceBundle res)
Get the resource string |
static java.lang.String |
getResourceString(int resourceID,
java.lang.String defaultValue)
Get the resource string |
static java.lang.String |
getServerURL(java.lang.String serverName,
int serverPort)
|
static java.lang.String |
getStockScreenLabel(java.lang.Object obj)
Get the stock screen label value based on the object being passed in |
static java.lang.String |
getStockScreenLabel(java.lang.Object obj,
net.rim.device.api.i18n.ResourceBundle res)
Get the stock screen label value based on the object being passed in |
static java.lang.String |
getStringValue(java.lang.Object varValue)
Return String object representing specified varValue. |
static java.lang.String |
getStringValue(java.lang.Object varValue,
boolean needTrim)
Return String object representing specified varValue. |
static TabLayoutManager |
getTabLayoutManager(net.rim.device.api.ui.Field f)
Finds tab layout manager on the field |
static TabLayoutManager |
getTabLayoutManager(IBOBScreen screen)
Finds tab layout manager on the BOB screen |
static java.lang.String |
getTextWithinRowspan(net.rim.device.api.ui.Field field,
int rowSpan,
java.lang.String text)
Gets truncated text that can be displayed within the RowSpan of the specified field |
static java.lang.String |
getTruncatedText(java.lang.String text,
int availableWidth,
FontStyle displayFont)
Truncates a text by given width, and appends ellipsis at the end of the truncated text. |
static java.lang.String |
getTruncatedText(java.lang.String text,
int availableWidthPerRow,
int rowCount,
FontStyle displayFont)
|
static java.lang.String |
getTruncatedTextWithinRowspan(net.rim.device.api.ui.Field field,
int rowSpan,
java.lang.String text,
FontStyle displayFont)
|
static java.lang.String |
getUniqueID()
|
static java.lang.Object |
getVariableValue(ControlVariable variable)
Get the variable value stroed in the persistent store |
static long |
getVerticalAlignment(long style)
Get the vertical alignment |
static long |
getVerticalAlignment(long style,
long defaultAlignment)
Get the vertical alignment |
static boolean |
hasFocusableControlBeside(net.rim.device.api.ui.Screen screen,
net.rim.device.api.ui.Field control,
boolean isForward)
Gets if there is focusable control besides the current focus control |
static boolean |
hasFreePersistentObjHandlers(int numOfObjectsToPersist)
|
static boolean |
hasRelationship(IBOBScreen screen)
Whether any mbo referenced by this screen has relationship |
static boolean |
hasVariables()
Check to see if there are varables |
static boolean |
hasWirelessConnection()
|
static void |
initAppLoggerWrapper()
Initializes the logger wrapper for Util |
static void |
initAppLoggerWrapperForUnitTest()
Initializes the logger wrapper for Util in the case of UnitTest |
static void |
invokeAddressBook()
Invoke the address book application |
static void |
invokeBrowser(java.lang.String location)
|
static void |
invokeCamera()
Invoke the camera application |
static void |
invokeEmail()
Invoke the email application |
static void |
invokeEmail(java.lang.String email)
Invoke the email application |
static void |
invokePhone(java.lang.String phoneNumber)
Invoke the phone application |
static boolean |
isConnected(java.lang.String sourceMBOId,
java.lang.String targetMBOId,
java.lang.String relationship)
Checks whether the 2 mbo is connected by the given relationship |
static boolean |
isInteger(java.lang.String value)
Check if the given string value is an Integer |
static boolean |
isOS38AndUp()
|
static boolean |
isSource(java.lang.String sourceMBOId,
java.lang.String relationship)
Check if the given source mbo is the source node of the relationship |
static boolean |
isStormDevice()
Check if this device is storm device |
static long |
parseCalendarDate(java.lang.String dateStr)
|
static java.lang.Object[] |
parseChoices(java.lang.Object obj)
|
static java.lang.String |
parseDate(java.lang.String schemaType,
java.util.Date value)
Parse the date |
static java.lang.String |
parseDate(java.lang.String schemaType,
long longVal)
Parse the date |
static java.lang.String |
parseDate(java.lang.String schemaType,
java.lang.String value)
Parse the date |
static long |
parseDateString(java.lang.String date)
|
static java.util.Vector |
parseOSVersionNumber(java.lang.String strOSVersion)
|
static void |
postGlobalEvent(long guid,
java.lang.String clientName,
java.lang.Object object0)
|
static void |
printMemoryStats()
|
static void |
pushLoginScreen(UIController controller)
Push the login screen. |
static byte[] |
readBinaryData(java.lang.String fileName)
Read binary data from device |
static byte[] |
readBinaryData(java.lang.String fileName,
boolean reportErrors)
Read binary data from device |
static void |
refreshAllMobileApplicationOnScreen(IBOBScreen screen)
Refresh all the mobile data controls on screen |
static void |
refreshControls(net.rim.device.api.ui.Field f)
Refresh all controls within given field object |
static void |
refreshLinkParameterControls(IBOBScreen screen)
Refresh the link parameters controls on the screen supplied |
static void |
removeDuplicateMenuItems(java.util.Vector menus)
Removes duplicate menu items from menu list |
static void |
reorganizeMenuItems(java.util.Vector menus,
int length)
Sorts menu items by alpha and remove duplicate menu items |
static int |
replace(java.lang.String str,
java.lang.String pattern)
|
static java.lang.String |
replaceInputString(java.lang.String origStr,
java.lang.String[] inputStr)
Replace '{0}' with input string |
static int |
replacePoundColor(java.lang.String str,
int defaultColor)
|
static int |
replacePoundColor(java.lang.String str,
java.lang.String pattern,
int defaultColor)
|
static net.rim.device.api.system.EncodedImage |
scaleImage(net.rim.device.api.system.EncodedImage image,
int scalingWidth,
int scalingHeight,
boolean isPreserveRatio)
Scales an image to a certain size |
static void |
setApplicationData(IBOBScreen screen,
MBOModel appData)
Set the application data object to mobile object table on the screen |
static void |
setApplicationDataByMobileAppID(IBOBScreen screen,
java.lang.String mobileAppID,
MBOModel appData)
Set the application data with any matching mobile data control on the screen |
static void |
setCurrentAssociationName(java.lang.String associationName)
Save he current association name for relationship |
static void |
setMBODataProperties(IBOBScreen screen,
java.lang.Object[] properties)
Set the MOB data properties to any matching mobile data control on the screen |
static boolean |
setPushConnectionProfile(java.lang.String packageName)
Sets up push settings for specified package's synchronization profile. |
static void |
setTableVariableValues(java.lang.String mobileAppID,
java.util.Hashtable columnValues)
Set the current table variable values |
static void |
setupTableContextVariables(MobileDataControl control)
Setup the mobile data control context variables |
static void |
synchronizeMeta(java.lang.String mboMobileAppID)
Synchronize meta for a specific mobile business object ID |
static void |
syncPackages(java.lang.String[] packageNames)
Synchronize the packages |
static void |
updateMobileDataControlContextVariables(MBOModel model,
java.lang.Object data,
boolean isAddtoContext)
Update the context variable for the given mbo |
static java.lang.String |
uppercaseFirstChar(java.lang.String value)
Change the first character of the string to uppercase |
static java.lang.String |
validateStr(java.lang.String str)
This method converts XML 'Unsafe' characters to XML 'Safe' characters. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.lang.String ASTERISK_MARK
public static java.lang.String QUESTION_MARK
public static final long KEY
Constructor Detail |
---|
public Util()
Method Detail |
---|
public static long parseDateString(java.lang.String date)
public static java.lang.String getUniqueID()
public static void checkWirelessConnection() throws net.rim.device.api.system.RadioException
net.rim.device.api.system.RadioException
public static boolean hasWirelessConnection()
public static void checkNonEmpty(java.lang.String str, java.lang.String errmsg)
public static void checkNonNull(java.lang.Object obj, java.lang.String errmsg)
public static void elementsToArray(java.util.Hashtable h, java.lang.Object[] array)
public static void callBlackberryBrowser(java.lang.String url)
public static void invokeBrowser(java.lang.String location)
public static boolean isOS38AndUp()
public static java.lang.String getOSVersionNumber()
public static java.util.Vector parseOSVersionNumber(java.lang.String strOSVersion)
public static long parseCalendarDate(java.lang.String dateStr)
public static long convertToLong(java.lang.String valueToConvert)
public static java.lang.String validateStr(java.lang.String str)
str
- The String to examine for the occurance of 'Unsafe' characters
public static int getMaxNumberOfPersistentObjects()
public static boolean hasFreePersistentObjHandlers(int numOfObjectsToPersist)
public static void printMemoryStats()
public static int checkColorString(java.lang.String str, int defaultColor)
str
- - string value for the colordefaultColor
- - default color is the string color is not found
public static int replacePoundColor(java.lang.String str, int defaultColor)
public static int replacePoundColor(java.lang.String str, java.lang.String pattern, int defaultColor)
public static int replace(java.lang.String str, java.lang.String pattern)
public static final java.lang.Object[] parseChoices(java.lang.Object obj)
public static java.lang.Integer getGUID()
public static java.lang.String getDeviceID()
public static boolean isStormDevice()
public static java.lang.String getDeviceEmail()
public static void setCurrentAssociationName(java.lang.String associationName)
associationName
- - association name used for relationshippublic static void setupTableContextVariables(MobileDataControl control)
control
- - Mobile Data Control objectpublic static MobileAppTable findTableControl(net.rim.device.api.ui.Field f)
f
- - Field control
public static TwoColumnLayout findTwoColumnLayoutControl(net.rim.device.api.ui.Field f)
f
- - Field control
public static net.rim.device.api.ui.Field getFieldWithFocus(net.rim.device.api.ui.Field f)
public static void setTableVariableValues(java.lang.String mobileAppID, java.util.Hashtable columnValues)
columnValues
- - select row column valuespublic static boolean hasVariables()
public static void addVariable(java.lang.String key, java.lang.Object value, java.lang.String type, java.lang.String schemaType)
key
- - key of the variablevalue
- - value of the keytype
- - type of variablepublic static void addVariables(java.util.Hashtable variables)
variables
- - hashtable of variablespublic static java.lang.Object getVariableValue(ControlVariable variable)
variable
- - the control variable object
public static java.lang.String getServerURL(java.lang.String serverName, int serverPort)
public static net.rim.device.api.ui.Field getFieldFocusOnScreen(net.rim.device.api.ui.Screen screen)
screen
- - screen to check field on focus
public static Control[] getAllControlsOnScreen(IBOBScreen screen)
screen
- - screen to search for controls
public static Control[] getAllControlsOnScreen(net.rim.device.api.ui.Screen screen)
screen
- - screen to search for controls
public static boolean hasFocusableControlBeside(net.rim.device.api.ui.Screen screen, net.rim.device.api.ui.Field control, boolean isForward)
screen
- control
- - current focus controlisForward
- - true means to get if there is focusable control in front of the current control
public static int getFieldIndexOnScreen(net.rim.device.api.ui.Screen screen, net.rim.device.api.ui.Field field)
screen
- field
-
public static MobileDataControl getMobileDataControlByMobileAppID(IBOBScreen screen, java.lang.String mobileAppID, boolean onCurrentTabOnly)
screen
- - BOB screen to searchmobileAppID
- - mobile application to searchonCurrentTabOnly
- - search on current tab panel only if there is tabspublic static Control getControlsByID(java.lang.String controlID)
controlID
- - control ID
public static Control[] getControlsByID(java.lang.String[] controlIDs)
controlIDs
- - string array of control IDs
public static boolean containsFocusableControlsAfterTable(java.lang.String tableFieldMobileAppID)
tableFieldMobileAppID
- - Mobile Application ID of the current table
public static void getAllControls(net.rim.device.api.ui.Field f, java.util.Vector controls)
manager
- - manager field to search throughcontrols
- - vector of found controlspublic static int getFieldMaxWidth(net.rim.device.api.ui.Font font, MBOAttribute[] columns)
public static boolean getBooleanByString(java.lang.String value)
value
- - string boolean value
public static boolean getBooleanByString(java.lang.String value, boolean defaultBoolean)
value
- - string boolean valuedefaultBoolean
- - default boolean value if undefined
public static net.rim.device.api.system.Bitmap getImageBitmap(java.lang.String imageStr)
imageStr
- - image name
public static net.rim.device.api.system.EncodedImage getEncodedImage(java.lang.String imageStr)
imageStr
- - image name
public static net.rim.device.api.system.Bitmap getImageBitmap(java.lang.String imageStr, net.rim.device.api.system.Bitmap defaultImage)
imageStr
- - image namedefaultImage
- - this image gets returned if image is not found or undefined
public static net.rim.device.api.system.Bitmap getImageBitmap(java.lang.String moduleName, java.lang.String imageStr, net.rim.device.api.system.Bitmap defaultImage)
imageStr
- - image namedefaultImage
- - this image gets returned if image is not found or undefined
public static net.rim.device.api.system.EncodedImage getEncodedImage(java.lang.String moduleName, java.lang.String imageName)
moduleName
- the module that contains the imageimageName
- the image name
public static long getHorizontalAlignment(long style)
style
- - style that contains the horizontal alignment value
public static long getHorizontalAlignment(long style, long defaultAlignment)
style
- - style that contains the horizontal alignment valuedefaultAlignment
- - default horizontal aignment
eg. Field.FIELD_LEFT, Field.FIELD_RIGHT, or Field.FIELD_HCENTER
public static long getVerticalAlignment(long style)
style
- - style that contains the vertical alignment value
public static long getVerticalAlignment(long style, long defaultAlignment)
style
- - style that contains the vertical alignment valuedefaultAlignment
- - default vertical aignment
eg. Field.FIELD_TOP, Field.FIELD_BOTTOM, or Field.FIELD_VCENTER
public static java.lang.String getHTTPPushAddress()
settings
- - settings object that holds push information
public static void synchronizeMeta(java.lang.String mboMobileAppID)
mboMobileAppID
- - mobile business object IDpublic static void deleteAllMobileApplicationLogs()
public static void syncPackages(java.lang.String[] packageNames)
packageNames
- - packages that are synchronizingpublic static java.lang.String replaceInputString(java.lang.String origStr, java.lang.String[] inputStr)
origStr
- - original string that contains place holder like '{0}'inputStrs
- - string array to replace the place holderpublic static void getMobileDataControls(net.rim.device.api.ui.Field f, java.util.Vector results, boolean currentTabOnly)
f
- - controlresults
- - mobile data control result listcurrentTabOnly
- - search on current tab panel only if there is tabpublic static void refreshAllMobileApplicationOnScreen(IBOBScreen screen)
screen
- - IBOBScreen referencepublic static boolean hasRelationship(IBOBScreen screen)
screen
-
public static net.rim.device.api.ui.Field[] getFieldControls(net.rim.device.api.ui.Field f)
f
- - Field object
public static void refreshControls(net.rim.device.api.ui.Field f)
f
- - field object to refreshpublic static void setMBODataProperties(IBOBScreen screen, java.lang.Object[] properties)
screen
- - IBOBScreen referenceproperties
- - array of mobile app ID and data properties objectpublic static void setApplicationData(IBOBScreen screen, MBOModel appData)
screen
- - IBOBScreen referenceappData
- - MBOModel objectpublic static void setApplicationDataByMobileAppID(IBOBScreen screen, java.lang.String mobileAppID, MBOModel appData)
screen
- - IBOBScreen referencemobileAppID
- - mobile application IDappData
- - MBOModel object to setpublic static void refreshLinkParameterControls(IBOBScreen screen)
screen
- - IBOBScreen referencepublic static void changeLinkParamOptions(IBOBScreen screen, java.lang.String mobileAppID, LinkParamNode linkParam, java.lang.String name, java.lang.String value)
screen
- - IBOBScreen referencemobileAppID
- - mobile application IDlinkParam
- - Link Parameter objectname
- - select box display namevalue
- - select box selected valuepublic static void deleteAllMobileApplications(MBOModel[] mobileApps)
mobileApps
- - list of mobile applications to deletepublic static java.lang.String parseDate(java.lang.String schemaType, java.util.Date value)
schemaType
- - schema typevalue
- - date value as String for the date
public static java.lang.String parseDate(java.lang.String schemaType, java.lang.String value)
schemaType
- - schema typevalue
- - long value as String for the date
public static java.lang.String parseDate(java.lang.String schemaType, long longVal)
schemaType
- - schema typevalue
- - long value for the date
public static byte[] readBinaryData(java.lang.String fileName)
fileName
- - file path
public static byte[] readBinaryData(java.lang.String fileName, boolean reportErrors)
fileName
- - file pathreportErrors
- - if true, will log an errors that occur
public static java.lang.String getStringValue(java.lang.Object varValue, boolean needTrim)
varValue
- The variable value objectneedTrim
- indicate the return result need to be trimmed or not
public static java.lang.String getStringValue(java.lang.Object varValue)
varValue
- The variable value object
public static java.lang.Object convertToJ2MEObject(java.lang.Object value, int datatype)
value
- datatype
- public static java.lang.Object convertToAFXObject(java.lang.Object value, DataType datatype)
value
- datatype
- public static java.lang.String convertToDataTypeName(java.lang.String schemaType)
schemaType
- public static java.lang.Object getObjectFromString(DataType dataType, java.lang.Object value)
public static java.lang.String getStockScreenLabel(java.lang.Object obj)
obj
- - this can be a String or a Integer object. If Integer, it means it a localization resource ID
public static java.lang.String getStockScreenLabel(java.lang.Object obj, net.rim.device.api.i18n.ResourceBundle res)
obj
- - this can be a String or a Integer object. If Integer, it means it a localization resource IDbundle
- - the resouce bundle
public static java.lang.String getResourceString(int resourceID)
resourceID
- - localization resouce ID
public static java.lang.String getResourceString(int resourceID, net.rim.device.api.i18n.ResourceBundle res)
resourceID
- - localization resouce ID
public static java.lang.String getResourceString(int resourceID, java.lang.String defaultValue)
resourceID
- - localization resouce IDdefaultValue
- - default value if the localization resource ID is invalid or null
public static void invokePhone(java.lang.String phoneNumber)
phoneNumber
- - phone numberpublic static void invokeEmail()
public static void invokeEmail(java.lang.String email)
email
- - email addresspublic static void invokeAddressBook()
public static void invokeCamera()
public static java.lang.String getPackageName(java.lang.String mboId)
mboId
-
public static java.lang.String getObjectAPIPath()
public static java.lang.String getAppID()
public static void initAppLoggerWrapper()
public static void initAppLoggerWrapperForUnitTest()
public static java.lang.Object convertValueBySchemaType(java.lang.String schemaType, java.lang.Object value)
getStringValue(Object)
to convert value to corresponding String
instance
when specified schameType
is SCHEMA_TYPE_STRING. (the result will be trimmed)
If the specified value is null, return null.
schemaType
- - Defines in MBOAttribute, eg. MBOAttribute.SCHEMA_TYPE_STRINGvalue
-
getStringValue(Object)
public static java.lang.String getPublicationByMobileApp(MBOMobileApplication application)
id
- of the mobile application
public static java.lang.String[] getMobileAppIDsByPublication(java.lang.String packageName, java.lang.String publication)
packageName
- String
value for the package namepublication
- String
value for the publication name
public static TabLayoutManager getTabLayoutManager(IBOBScreen screen)
screen
- BOB screen
public static TabLayoutManager getTabLayoutManager(net.rim.device.api.ui.Field f)
f
- the Field
public static MobileDataControl getParentMDC(IBOBScreen screen, java.lang.String mboId)
screen
- BOB screenmboId
- mbo id
public static java.util.Vector getMDCList(IBOBScreen screen, boolean currentTabOnly)
MobileDataControl
contained in the given screen
screen
- the screen to search oncurrentTabOnly
- search on current active tab panel only if there are tab panels
public static void pushLoginScreen(UIController controller)
public static boolean isConnected(java.lang.String sourceMBOId, java.lang.String targetMBOId, java.lang.String relationship)
sourceMBOId
- targetMBOId
- relationship
-
public static boolean isSource(java.lang.String sourceMBOId, java.lang.String relationship)
sourceMBOId
- relationship
- public static java.lang.String getTruncatedTextWithinRowspan(net.rim.device.api.ui.Field field, int rowSpan, java.lang.String text, FontStyle displayFont)
public static java.lang.String getTextWithinRowspan(net.rim.device.api.ui.Field field, int rowSpan, java.lang.String text)
field
- - the field that has RowSpan setrowSpan
- - value of RowSpantext
- - the text that the field contains
public static Control getControlByName(Control[] listControls, java.lang.Object key)
listControls
- - the list of controlskey
- - key to match the name of the control
public static void updateMobileDataControlContextVariables(MBOModel model, java.lang.Object data, boolean isAddtoContext)
model
- data
- isAddtoContext
- whether to create new context item if no context exists for this mbopublic static java.lang.String uppercaseFirstChar(java.lang.String value)
value
-
public static java.lang.String converToValidName(java.lang.String oldName)
oldName
-
public static void addAll(java.util.Vector target, java.lang.Object[] source)
target
- source
- public static void addAll(java.util.Vector target, java.util.Vector source)
target
- source
- public static boolean equals(java.util.Vector vect1, java.util.Vector vect2)
vect1
- vect2
-
public static boolean equals(java.lang.Object obj1, java.lang.Object obj2)
obj1
- obj2
-
public static DataType getPrimitiveDatatype(DataType listType)
listType
-
public static java.lang.String appendInternalPackageString(java.lang.String fullDatabaseClassName)
fullDatabaseClassName
-
public static boolean setPushConnectionProfile(java.lang.String packageName)
packageName
- the specified package name
public static java.lang.Object getDataFromSPMBO(java.lang.String id, boolean isAll)
id
- structured parameter mbo idisAll
- if it's true return all data, otherwise, only return the first one.
public static void removeDuplicateMenuItems(java.util.Vector menus)
menus
- Vector
list of menuspublic static java.lang.String getTruncatedText(java.lang.String text, int availableWidth, FontStyle displayFont)
text
- - original textavailableWidth
- - width that the text is truncated todisplayFont
- - font style by which the text is displayed
public static java.lang.String getTruncatedText(java.lang.String text, int availableWidthPerRow, int rowCount, FontStyle displayFont)
public static java.lang.String getAssociationKey(java.lang.String packageName, java.lang.String name)
packageName
- name
-
public static net.rim.device.api.system.EncodedImage scaleImage(net.rim.device.api.system.EncodedImage image, int scalingWidth, int scalingHeight, boolean isPreserveRatio)
image
- - image that is scalingscalingWidth
- - width that the image is scaling toscalingHeight
- - height that the image is scaling toisPreserveRatio
- - true means to scale as aspect fit, false as aspect fill
public static void applyProfileInfo2ObjectAPI(ClientProfile clientProfile, java.lang.String clientName)
clientProfile
- public static void applyProfileInfo2ObjectAPI(ClientProfileList profileList, java.lang.String profileId, java.lang.String clientName)
profileList
- profileId
- clientName
- parameter clientName represent the name of client application in options module, while this method called in client application module, its value should be nullpublic static void applyAllProfileInfo2ObjectAPI(ClientProfileList profileList, java.lang.String clientName)
profileList
- clientName
- public static void postGlobalEvent(long guid, java.lang.String clientName, java.lang.Object object0)
guid
- The guid of event IDclientName
- The name of the client applicationobject0
- Additional information associated with the eventpublic static java.util.Hashtable getParametersFromSubmitElement(java.util.Vector submitElements)
submitElements
- submit element list
public static java.lang.String convertPackageName(java.lang.String packageName)
packageName
- server version of package name
public static boolean canLoginToSync(java.lang.String packageName)
packageName
- the package to check
public static void reorganizeMenuItems(java.util.Vector menus, int length)
menus
- Vector
list of menuslength
- int
value for the end indexpublic static ClassMetaData getMetaData(java.lang.String packageName, java.lang.String complexDataType)
packageName
- complexDataType
-
public static AttributeMetaData getAttributeMetaData(MBOModel mboModel, java.lang.String attrName)
mboModel
- attrName
- - attribute display name
public static java.lang.Object convert2ScalarArrayIfNeed(java.lang.String schemaType, java.lang.Object value)
schemaType
- value
-
public static net.rim.device.api.ui.Field getFocusField(net.rim.device.api.ui.Screen screen)
screen
-
public static boolean isInteger(java.lang.String value)
value
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |