com.ibm.mashups.enabler.model.state
Interface WidgetAccessor

All Superinterfaces:
Accessor

public WidgetAccessor
extends Accessor

Interface representing a WidgetAccessor. Reserved Widget Paramers: "cp" : the reserved paremeter for widget customized state. "h" : the reserved paremeter for widget height. "w" : the reserved paremeter for widget width. "st" : the reserved paremeter for widget window state. "md" : the reserved paremeter for widget mode.


Field Summary
 String MIN
           "minimize" window state supported by enabler
 String MAX
           "maximize" window state supported by enabler
 String NORMAL
           "normal" window state supported by enabler
 
Method Summary
 String getWidgetID()
           Returns the widget id of the Widget
 String[] getWidgetStateValues(String key)
           Returns the values of the required widget state parameter.
 String getWidgetState(String key)
           Returns the state of the required widget state parameter
 WidgetAccessor setWidgetState(String key, String[] values)
           Set the value of a widget state parameter
 Boolean confirmSetWidgetState(String key, String[] values)
           Confirms whether setting the values for the given widget state parameter is possible.
 WidgetAccessor setWidgetState(String key, String value)
           Set the value of a widget state parameter
 Boolean confirmSetWidgetState(String key, String value)
           Confirms whether setting the value for the given widget state parameter is possible.
 WidgetAccessor removeWidgetState(String key)
           Remove a widget state parameter
 Boolean confirmRemoveWidgetState(String key)
           Confirms whether removing a widget state parameter is possible
 String[] getWidgetStateNames()
           Returns the names of custimized widget state
 String getWidgetMode()
           Returns the mode of the required widget
 WidgetAccessor setWidgetMode(String mode)
           Set the mode of a widget
 Boolean confirmSetWidgetMode(String mode)
           Confirms whether it's possible or not to set the widget to a new mode
 String getWindowState()
           Returns the window state of the required widget
 WidgetAccessor setWindowState(String windowState)
           Set the window state of a widget
 Boolean confirmSetWindowState(String windowState)
           Confirms whether it's possible or not to set the widget to a new window state
 Object getSize()
           Returns the size of the required widget
 WidgetAccessor setSize(String width, String height)
           Set the size of a widget
 Boolean confirmSetSize(String width, String height)
           Confirms whether it's possible or not to set the widget to the new width and height
 

Field Detail

MIN

String MIN
"minimize" window state supported by enabler


MAX

String MAX
"maximize" window state supported by enabler


NORMAL

String NORMAL
"normal" window state supported by enabler

Method Detail

getWidgetID

String getWidgetID()
Returns the widget id of the Widget

Returns:
ID of required Widget

getWidgetStateValues

String[] getWidgetStateValues(String key)
Returns the values of the required widget state parameter. If state has only one value, this method returns a single array with a length of 1.

Parameters:
key - The name of the required parameter of Widget Navigation State "cp" is the reserved parameter for widget customized state.
Returns:
Values of required parameter
Since:
2.4

getWidgetState

String getWidgetState(String key)
Returns the state of the required widget state parameter

Parameters:
key - The name of the required parameter of Widget Navigation State "cp" is the reserved parameter for widget customized state.
Returns:
Value of required parameter

setWidgetState

WidgetAccessor setWidgetState(String key,
                              String[] values)
Set the value of a widget state parameter

Parameters:
key - The name of the required parameter
values - The values of the required parameter
Returns:
return an handle of WidgetAccessor upon successful, null upon failure.
Since:
2.4

confirmSetWidgetState

Boolean confirmSetWidgetState(String key,
                              String[] values)
Confirms whether setting the values for the given widget state parameter is possible.

Parameters:
key - The name of the required parameter
values - The values of the required parameter
Returns:
true if the values can be set, otherwise false.
Since:
2.4

setWidgetState

WidgetAccessor setWidgetState(String key,
                              String value)
Set the value of a widget state parameter

Parameters:
key - The name of the required parameter
value - The value of the required parameter
Returns:
return an handle of WidgetAccessor upon successful, null upon failure.
Since:
2.4

confirmSetWidgetState

Boolean confirmSetWidgetState(String key,
                              String value)
Confirms whether setting the value for the given widget state parameter is possible.

Parameters:
key - The name of the required parameter
value - The value of the required parameter
Returns:
true if the value can be set, otherwise false.
Since:
2.4

removeWidgetState

WidgetAccessor removeWidgetState(String key)
Remove a widget state parameter

Parameters:
key - The name of the required parameter
Returns:
return an handle of WidgetAccessor upon successful, null upon failure.

confirmRemoveWidgetState

Boolean confirmRemoveWidgetState(String key)
Confirms whether removing a widget state parameter is possible

Parameters:
key - The name of the required parameter
Returns:
return true if the required parameter can be removed
Since:
2.4

getWidgetStateNames

String[] getWidgetStateNames()
Returns the names of custimized widget state

Returns:
an array of customized widget state names

getWidgetMode

String getWidgetMode()
Returns the mode of the required widget

Returns:
The mode of the required widget and null if no mode is set yet.

setWidgetMode

WidgetAccessor setWidgetMode(String mode)
Set the mode of a widget

Parameters:
mode - of the required widget
Returns:
return an handle of WidgetAccessor upon successful, null upon failure.

confirmSetWidgetMode

Boolean confirmSetWidgetMode(String mode)
Confirms whether it's possible or not to set the widget to a new mode

Parameters:
mode - of the required widget
Returns:
return true if it's possible to set widget to the new model

getWindowState

String getWindowState()
Returns the window state of the required widget

Returns:
The window state of the required widget following states are allowed: "normal","minimize","maximize". It returns null if no windowstate is set yet.

setWindowState

WidgetAccessor setWindowState(String windowState)
Set the window state of a widget

Parameters:
windowState - The window state of the required widget
Returns:
return an handle of WidgetAccessor upon successful, null upon failure.

confirmSetWindowState

Boolean confirmSetWindowState(String windowState)
Confirms whether it's possible or not to set the widget to a new window state

Parameters:
windowState - The window state of the required widget
Returns:
return true if it's possible to set widget to the new window state

getSize

Object getSize()
Returns the size of the required widget

Returns:
A JSON object representing the widget width/height, for example: { w:"200",h:"400"}

setSize

WidgetAccessor setSize(String width,
                       String height)
Set the size of a widget

Parameters:
width - The width of the widget
height - The height of the widget
Returns:
return an handle of WidgetAccessor upon successful, null upon failure.

confirmSetSize

Boolean confirmSetSize(String width,
                       String height)
Confirms whether it's possible or not to set the widget to the new width and height

Parameters:
width - The width of the widget
height - The height of the widget
Returns:
return true if it's possible to set widget to the new width and height


Copyright IBM Corp. 2010 All Rights Reserved.