com.funambol.client.source
Class AppSyncSource

java.lang.Object
  extended by com.funambol.client.source.AppSyncSource

public class AppSyncSource
extends java.lang.Object

This class represents a sync source in the application. In the application a sync source is a pluggable component that allow users to deal with the synchronization of a given type of data. An AppSyncSource abstracts the following concepts: 1) SyncSource (at SyncML API level) 2) Displayable name 3) Icon (optional) 4) Main configuration screen 5) numerical ID (set by the application and optional) 6) Persistable configuration (stored in AppSyncSourceConfig) 7) Position in the UI 8) UI representation in home and settings screens 9) UI controller An abstract sync source can be in different status, depending on various things: 1) active if it is enabled in the customization and the server supports it 2) enabled if the user enabled it in the settings (or if enabled by default) 3) working if the client was able to set up all the bits and pieces to perform synchronizations


Field Summary
protected  java.lang.Class buttonClass
           
protected  AppSyncSourceConfig config
           
protected  boolean refreshFromServerSupported
           
protected  boolean refreshToServerSupported
           
protected  java.lang.Class settingsClass
           
protected  SettingsUISyncSource settingsUISource
           
static int SYNC_FOLDER_SETTING
           
static int SYNC_MODE_SETTING
           
protected  UISyncSource uiSource
           
protected  java.lang.String warningOnFirstSync
           
 
Constructor Summary
AppSyncSource(java.lang.String name)
           
AppSyncSource(java.lang.String name, SyncSource source)
           
 
Method Summary
 UISyncSource createButtonUISyncSource(Screen screen)
           
 SettingsUISyncSource createSettingsUISyncSource(Screen screen)
           
 ExternalAppManager getAppManager()
           
 AppSyncSourceConfig getConfig()
           
 java.lang.String getDisabledIconName()
           
 java.lang.String getDisabledLabel()
           
 java.lang.String getEnabledLabel()
           
 java.lang.String getIconName()
           
 int getId()
           
 java.lang.String getName()
           
 java.lang.Object getNativeListener()
           
 java.util.Hashtable getSettings()
           
 java.lang.Class getSettingsUIClass()
           
 SettingsUISyncSource getSettingsUISyncSource()
           
 boolean getSyncedInSession()
          Returns true if this source was synced in this session.
 SyncSource getSyncSource()
           
 int getUiSourceIndex()
           
 UISyncSource getUISyncSource()
           
 UISyncSourceController getUISyncSourceController()
           
 java.lang.String getWarningOnFirstSync()
          Returns the message to show at the very first sync for this source.
 boolean hasSetting(int setting)
           
 boolean hasSettings()
           
 boolean isEnabled()
          Deprecated. Use AppSyncSourceConfig directly instead
 boolean isRefreshSupported(int direction)
           
 boolean isVisible()
           
 boolean isWorking()
           
 int prepareRefresh(int direction)
           
 void reapplyConfiguration()
          This method is invoked when there is a change in the configuration that impacts the source config.
 void setAppManager(ExternalAppManager manager)
           
 void setButtonUIClass(java.lang.Class buttonClass)
           
 void setConfig(AppSyncSourceConfig config)
           
 void setDisabledIconName(java.lang.String name)
           
 void setDisabledLabel(java.lang.String disabledLabel)
           
 void setEnabledLabel(java.lang.String enabledLabel)
           
 void setHasSetting(int setting, boolean value, java.lang.Object possibleValues)
           
 void setIconName(java.lang.String name)
           
 void setId(int id)
           
 void setIsRefreshSupported(boolean value)
           
 void setIsRefreshSupported(int direction, boolean value)
           
 void setIsVisible(boolean value)
           
 void setNativeListener(java.lang.Object nativeListener)
           
 void setSettingsUIClass(java.lang.Class settingsClass)
           
 void setSyncedInSession(boolean value)
           
 void setSyncSource(SyncSource source)
           
 void setUiSourceIndex(int index)
           
 void setUISyncSourceController(UISyncSourceController controller)
           
 void setWarningOnFirstSync(java.lang.String message)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SYNC_MODE_SETTING

public static final int SYNC_MODE_SETTING
See Also:
Constant Field Values

SYNC_FOLDER_SETTING

public static final int SYNC_FOLDER_SETTING
See Also:
Constant Field Values

uiSource

protected UISyncSource uiSource

settingsUISource

protected SettingsUISyncSource settingsUISource

refreshFromServerSupported

protected boolean refreshFromServerSupported

refreshToServerSupported

protected boolean refreshToServerSupported

warningOnFirstSync

protected java.lang.String warningOnFirstSync

config

protected AppSyncSourceConfig config

settingsClass

protected java.lang.Class settingsClass

buttonClass

protected java.lang.Class buttonClass
Constructor Detail

AppSyncSource

public AppSyncSource(java.lang.String name,
                     SyncSource source)

AppSyncSource

public AppSyncSource(java.lang.String name)
Method Detail

setConfig

public void setConfig(AppSyncSourceConfig config)

getConfig

public AppSyncSourceConfig getConfig()

setId

public void setId(int id)

getId

public int getId()

isEnabled

public boolean isEnabled()
Deprecated. Use AppSyncSourceConfig directly instead

Convenience method to get if a source is enabled.


getUiSourceIndex

public int getUiSourceIndex()

setUiSourceIndex

public void setUiSourceIndex(int index)

setSyncSource

public void setSyncSource(SyncSource source)

setAppManager

public void setAppManager(ExternalAppManager manager)

getAppManager

public ExternalAppManager getAppManager()

getSyncSource

public SyncSource getSyncSource()

getName

public java.lang.String getName()

getEnabledLabel

public java.lang.String getEnabledLabel()

setEnabledLabel

public void setEnabledLabel(java.lang.String enabledLabel)

getDisabledLabel

public java.lang.String getDisabledLabel()

setDisabledLabel

public void setDisabledLabel(java.lang.String disabledLabel)

isWorking

public boolean isWorking()

getIconName

public java.lang.String getIconName()

setIconName

public void setIconName(java.lang.String name)

setDisabledIconName

public void setDisabledIconName(java.lang.String name)

getDisabledIconName

public java.lang.String getDisabledIconName()

createButtonUISyncSource

public UISyncSource createButtonUISyncSource(Screen screen)

getUISyncSource

public UISyncSource getUISyncSource()

setButtonUIClass

public void setButtonUIClass(java.lang.Class buttonClass)

getUISyncSourceController

public UISyncSourceController getUISyncSourceController()

setUISyncSourceController

public void setUISyncSourceController(UISyncSourceController controller)

getSettingsUIClass

public java.lang.Class getSettingsUIClass()

setSettingsUIClass

public void setSettingsUIClass(java.lang.Class settingsClass)

createSettingsUISyncSource

public SettingsUISyncSource createSettingsUISyncSource(Screen screen)

getSettingsUISyncSource

public SettingsUISyncSource getSettingsUISyncSource()

hasSettings

public boolean hasSettings()

hasSetting

public boolean hasSetting(int setting)

getSettings

public java.util.Hashtable getSettings()

setHasSetting

public void setHasSetting(int setting,
                          boolean value,
                          java.lang.Object possibleValues)

prepareRefresh

public int prepareRefresh(int direction)

isRefreshSupported

public boolean isRefreshSupported(int direction)

setIsRefreshSupported

public void setIsRefreshSupported(int direction,
                                  boolean value)

setIsRefreshSupported

public void setIsRefreshSupported(boolean value)

getNativeListener

public java.lang.Object getNativeListener()

setNativeListener

public void setNativeListener(java.lang.Object nativeListener)

isVisible

public boolean isVisible()

setIsVisible

public void setIsVisible(boolean value)

getWarningOnFirstSync

public java.lang.String getWarningOnFirstSync()
Returns the message to show at the very first sync for this source. The method returns null if there are no messages to show


setWarningOnFirstSync

public void setWarningOnFirstSync(java.lang.String message)

getSyncedInSession

public boolean getSyncedInSession()
Returns true if this source was synced in this session. This is a volatile property and it is reset across application restarts. AppSyncSourceConfig has a similar property that lives across restarts


setSyncedInSession

public void setSyncedInSession(boolean value)

reapplyConfiguration

public void reapplyConfiguration()
This method is invoked when there is a change in the configuration that impacts the source config. By default the method does not do anything, but the class can be derived to force specific behaviors



Copyright © 2001-2009 Funambol.