org.jSyncManager.Client

Class ApplicationJMenuBar

Implemented Interfaces:
LogStreamInterface

public final class ApplicationJMenuBar
extends JMenuBar
implements LogStreamInterface

The main menu bar class. This class handled the menu bar for the jSyncmanager Swing GUI.

Field Summary

static String
ON_SYNC_BACKUP
The "Backup Sync" sync type button text.
static String
ON_SYNC_RESTORE
The "Restore Sync" sync type button text.
static String
ON_SYNC_STANDARD_SYNC
The "Standard Sync" sync type button text.

Constructor Summary

ApplicationJMenuBar(ApplicationJFrame frame, RegistrationData prefs)
Creates a new instance of the jSyncManager menu bar.

Method Summary

RegistrationData
getPreferences()
int
getSyncTypeSelection()
Retreives the sync type selection.
void
postToLog(String in)
Post a message to the synchronization log.
void
saveUserPreferences()
Saves the user application preferences object.
void
setPreferences(RegistrationData value)
Sets the user application preferences object.

Field Details

ON_SYNC_BACKUP

public static String ON_SYNC_BACKUP
The "Backup Sync" sync type button text.

ON_SYNC_RESTORE

public static String ON_SYNC_RESTORE
The "Restore Sync" sync type button text.

ON_SYNC_STANDARD_SYNC

public static String ON_SYNC_STANDARD_SYNC
The "Standard Sync" sync type button text.

Constructor Details

ApplicationJMenuBar

public ApplicationJMenuBar(ApplicationJFrame frame,
                           RegistrationData prefs)
Creates a new instance of the jSyncManager menu bar.
Parameters:
frame - the ApplicationJFrame that is the parent of this menu bar.
prefs - the user application preferences object to use with this menu bar.

Method Details

getPreferences

public RegistrationData getPreferences()

getSyncTypeSelection

public int getSyncTypeSelection()
Retreives the sync type selection.
Returns:
ON_SYNC_STANDARD_SYNC for standard sync, ON_SYNC_BACKUP for a backup sync, or ON_SYNC_RESTORE for a restore sync.

postToLog

public void postToLog(String in)
Post a message to the synchronization log.
Specified by:
postToLog in interface LogStreamInterface
Parameters:
in - a String containing the message to port.

saveUserPreferences

public void saveUserPreferences()
Saves the user application preferences object.

setPreferences

public void setPreferences(RegistrationData value)
Sets the user application preferences object.
Parameters:
value - the user application preferences object to attach to this instance.