GpsGate Server JavaScript API

UI  1.0.0

GpsGate Server JavaScript API > UI > Franson.UI.PopupMenu
Search:
 
Filters

Class Franson.UI.PopupMenu

todo: expose CSS styling todo: handle hierarchial menus?

Constructor

Franson.UI.PopupMenu(menuContent, [mode='stateless'])
Parameters:
menuContent <string>
[mode='stateless'] <string> one of: [ 'stateless', 'checkbox', 'radiobutton' ]

Properties

_components - private Map[id->IStateFul]


_ih - private IntervalHandler


_updateIterval - private {integer} ms

interval at which to scan registered components for changes

StateManager - object

State poller, brute force, doesn't depend on signals or similar. assumes state extraction is cheap. intended for stuff that are not explicit settings, typically UI state etc. states are treated as black-box JSON blobs. todo: stubbed, WS-methods not set yet todo: hmm, generalize this a bit. Prototype has a TimedObserver that is similar for example todo: could be "fancy" and support different poll frequencty for different components etc. ok name?

Methods

attach

void attach(element)
only run once!
Parameters:
element <DOM>
Returns: void

getInterval

integer getInterval()
Returns: integer
ms

isStatefulLike

boolean isStatefulLike(obj)
validate if obj implements the Interface necessary for saving state. typically UI controls. (ok name?) note: also requirement that the "blob" from _saveState contains an .id property.
Parameters:
obj <object>
Returns: boolean

loadStates

void loadStates()
Returns: void

registerComponent

void registerComponent()
todo: could take am (optional) comparer also? todo: or optionally enable explicit signal attaching? (i.e remove obj from poll-loop only save when signalled)
Returns: void

setInterval

void setInterval(interval)
Parameters:
interval <integer> ms
Returns: void

start

void start()
starts the "thread" that keeps the components' state in sync with server
Returns: void

stop

void stop()
stops the "thread"
Returns: void

unregisterComponent

void unregisterComponent()
Returns: void


Copyright © 2009 Franson Technology AB, Sweden. All rights reserved.