org.appcelerator.kroll
Class KrollModule

java.lang.Object
  extended by org.appcelerator.kroll.KrollProxy
      extended by org.appcelerator.kroll.KrollModule
All Implemented Interfaces:
Handler.Callback, KrollProxyListener, org.appcelerator.kroll.KrollProxySupport, org.appcelerator.titanium.TiLifecycle.OnLifecycleEvent

@Kroll.module(name="KrollModule")
public class KrollModule
extends KrollProxy
implements KrollProxyListener, org.appcelerator.titanium.TiLifecycle.OnLifecycleEvent

This is the parent class for all modules. All modules must extend this class.


Constructor Summary
KrollModule()
          Constructs a new KrollModule object.
KrollModule(String name)
          Instantiates and registers module with TiApplication.
 
Method Summary
 void listenerAdded(String type, int count, KrollProxy proxy)
          Subclasses can override this method to be notified when an event listener for a specific type has been added.
 void listenerRemoved(String type, int count, KrollProxy proxy)
          Subclasses can override this method to be notified when an event listener for a specific type has been removed.
 void onDestroy(Activity activity)
          A place holder for subclasses to extend.
 void onPause(Activity activity)
          A place holder for subclasses to extend.
 void onResume(Activity activity)
          A place holder for subclasses to extend.
 void onStart(Activity activity)
          A place holder for subclasses to extend.
 void onStop(Activity activity)
          A place holder for subclasses to extend.
 void processProperties(KrollDict properties)
          Implementing classes can use this method to examine the properties passed into the proxy when it's first created.
 void propertyChanged(String key, Object oldValue, Object newValue, KrollProxy proxy)
          A place holder for subclasses to extend.
 
Methods inherited from class org.appcelerator.kroll.KrollProxy
fireEvent, fireSyncEvent, getActivity, getCreationUrl, getKrollObject, getLangConversionTable, getProperties, getProperty, handleCreationArgs, handleCreationDict, handleDefaultValues, hasListeners, hasProperty, release, resolveUrl, setModelListener, setProperty, setPropertyAndFire
 

Constructor Detail

KrollModule

public KrollModule()
Constructs a new KrollModule object.


KrollModule

public KrollModule(String name)
Instantiates and registers module with TiApplication.

Parameters:
name - the name of module.
Method Detail

onResume

public void onResume(Activity activity)
A place holder for subclasses to extend. Its purpose is to receive native Android onResume life cycle events.

Parameters:
activity - the activity attached to this module.

onPause

public void onPause(Activity activity)
A place holder for subclasses to extend. Its purpose is to receive native Android onPause life cycle events.

Parameters:
activity - the activity attached to this module.

onDestroy

public void onDestroy(Activity activity)
A place holder for subclasses to extend. Its purpose is to receive native Android onDestroy life cycle events.

Parameters:
activity - the activity attached to this module.

onStart

public void onStart(Activity activity)
A place holder for subclasses to extend. Its purpose is to receive native Android onStart life cycle events.

Parameters:
activity - the activity attached to this module.

onStop

public void onStop(Activity activity)
A place holder for subclasses to extend. Its purpose is to receive native Android onStop life cycle events.

Parameters:
activity - the activity attached to this module.

listenerAdded

public void listenerAdded(String type,
                          int count,
                          KrollProxy proxy)
Subclasses can override this method to be notified when an event listener for a specific type has been added.

Specified by:
listenerAdded in interface KrollProxyListener
Parameters:
type - the event type
count - the count of event listeners for the event
proxy - the proxy instance that the event listener was added to

listenerRemoved

public void listenerRemoved(String type,
                            int count,
                            KrollProxy proxy)
Subclasses can override this method to be notified when an event listener for a specific type has been removed.

Specified by:
listenerRemoved in interface KrollProxyListener
Parameters:
type - the event type
count - the count of event listeners for the event
proxy - the proxy instance that the event listener was removed from

processProperties

public void processProperties(KrollDict properties)
Implementing classes can use this method to examine the properties passed into the proxy when it's first created.

Specified by:
processProperties in interface KrollProxyListener
Parameters:
properties - a set of properties to process.

propertyChanged

public void propertyChanged(String key,
                            Object oldValue,
                            Object newValue,
                            KrollProxy proxy)
A place holder for subclasses to extend. Its purpose is to be notified when an existing property is changed.

Specified by:
propertyChanged in interface KrollProxyListener
Parameters:
key - the key of the property.
oldValue - the property's old value.
newValue - the property's new value.
proxy - the associated proxy.


Copyright © 2010-2012 Appcelerator, Inc. Licensed under the Apache License 2.0