com.funambol.client.ui
Interface UISyncSource


public interface UISyncSource

This interface is a model for a generic representation of a SyncSource in the UI. A sync source is visualized with a title, an icon, a status message and a status icon that may change if the item is enabled/disabled. Each concrete implementation can decide to represent the above properties in some different way. For example a button representation can use labels and icons, while a progress bar representation can use a gauge with messages. The representation has also the concept of being selectable, meaning the user chose this source as the current one. In such a case the representation can decide to represent itself in a particular way, typically by showing the selected status icon and using the colors for the selected/deselected mode.


Method Summary
 AppSyncSource getSource()
          Returns the AppSyncSource this item represents
 boolean isDisabled()
          Check if the item is enabled/disabled
 boolean isSelected()
          Return the selected status
 void redraw()
          Forces the current item to be re-drawn
 void setContainer(UISyncSourceContainer container)
          Set the container this item belongs to
 void setEnabled(boolean flag)
          Enable or disabled this item
 void setFont(Font font)
          Set the item font used for the title and the status
 void setIcon(Bitmap image)
          Set the item icon
 void setSelection(boolean selected, boolean fromUi)
          Set the selected status
 void setSource(AppSyncSource source)
          Set the AppSyncSource this item represents
 void setStatusIcon(Bitmap image)
          Set the status icon to be used when the item is not selected
 void setStatusString(java.lang.String value)
          Set the status string
 void setTitle(java.lang.String value)
          Set the title
 void setTitleDisabledColor(int color)
          Set the title color when the item is disabled
 void setTitleEnabledColor(int color)
          Set the title color when the item is enabled
 void syncEnded()
          This method is invoked when a sync for this source is completed
 void syncStarted()
          This method is invoked when a sync for this source is started
 

Method Detail

setTitle

void setTitle(java.lang.String value)
Set the title


setTitleEnabledColor

void setTitleEnabledColor(int color)
Set the title color when the item is enabled


setTitleDisabledColor

void setTitleDisabledColor(int color)
Set the title color when the item is disabled


setEnabled

void setEnabled(boolean flag)
Enable or disabled this item


isDisabled

boolean isDisabled()
Check if the item is enabled/disabled


setIcon

void setIcon(Bitmap image)
Set the item icon


setStatusIcon

void setStatusIcon(Bitmap image)
Set the status icon to be used when the item is not selected


setStatusString

void setStatusString(java.lang.String value)
Set the status string


setSelection

void setSelection(boolean selected,
                  boolean fromUi)
Set the selected status

Parameters:
selected - is the selection status
fromUi - specifies if the selection was manually performed from the UI

isSelected

boolean isSelected()
Return the selected status


getSource

AppSyncSource getSource()
Returns the AppSyncSource this item represents


setSource

void setSource(AppSyncSource source)
Set the AppSyncSource this item represents


redraw

void redraw()
Forces the current item to be re-drawn


setContainer

void setContainer(UISyncSourceContainer container)
Set the container this item belongs to


setFont

void setFont(Font font)
Set the item font used for the title and the status


syncStarted

void syncStarted()
This method is invoked when a sync for this source is started


syncEnded

void syncEnded()
This method is invoked when a sync for this source is completed



Copyright © 2001-2009 Funambol.