KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > sync4j > syncclient > blackberry > SyncClient


1 /**
2  * Copyright (C) 2003-2005 Funambol
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  */

18
19 package sync4j.syncclient.blackberry;
20
21 import java.util.Hashtable JavaDoc;
22
23 import net.rim.blackberry.api.pdap.BlackBerryPIMList;
24 import javax.microedition.pim.PIM;
25
26 import net.rim.device.api.system.Bitmap;
27 import net.rim.device.api.system.PersistentObject;
28 import net.rim.device.api.system.PersistentStore;
29 import net.rim.device.api.system.TrackwheelListener;
30
31 import net.rim.device.api.ui.Field;
32 import net.rim.device.api.ui.MenuItem;
33 import net.rim.device.api.ui.UiApplication;
34
35 import net.rim.device.api.ui.component.BasicEditField;
36 import net.rim.device.api.ui.component.BitmapField;
37 import net.rim.device.api.ui.component.CheckboxField;
38 import net.rim.device.api.ui.component.Dialog;
39 import net.rim.device.api.ui.component.EditField;
40 import net.rim.device.api.ui.component.LabelField;
41 import net.rim.device.api.ui.component.Menu;
42 import net.rim.device.api.ui.component.PasswordEditField;
43 import net.rim.device.api.ui.component.RichTextField;
44 import net.rim.device.api.ui.component.SeparatorField;
45 import net.rim.device.api.ui.container.MainScreen;
46
47 import sync4j.syncclient.blackberry.listener.Sync4jContactListener;
48 import sync4j.syncclient.blackberry.listener.Sync4jEventListener;
49
50 import sync4j.syncclient.spds.SyncManagerFactory;
51 import sync4j.syncclient.util.StaticDataHelper;
52
53 /**
54  * <code>SyncClient</code> provides with the user interface
55  * for synchronizing contact base with SyncServer.
56  *
57  * @author Santosh email: info@telibrahma.com & Lavanya Nadimpalli email:lavanya@telibrahma.com
58  * @author Fabio Maggi @ Funambol
59  * $Id: SyncClient.java,v 1.0
60  */

61
62 public class SyncClient
63 extends UiApplication
64 implements Runnable JavaDoc, TrackwheelListener{
65
66     //----------------------------private Constants
67

68     final private static String JavaDoc PROP_SERVER_URL = "serverUrl" ;
69     final private static String JavaDoc PROP_LOGIN = "login" ;
70     final private static String JavaDoc PROP_GATEWAYAPN = "gatewayApn" ;
71     final private static String JavaDoc PROP_GATEWAYIP = "gatewayIp" ;
72     final private static String JavaDoc PROP_GATEWAYPORT = "gatewayPort" ;
73
74     final private static String JavaDoc ERROR_NOT_AUTHORIZED = "401" ;
75     final private static String JavaDoc ERROR_NOT_FOUND = "404" ;
76
77     final private static String JavaDoc IMMAGE_LOGO = "arrows_sync.gif" ;
78
79     final private static String JavaDoc CONTACT_SORCE_TYPE = "text/x-s4j-contact" ;
80     final private static String JavaDoc CONTACT_SOURCE_NAME = "xcard" ;
81     final private static String JavaDoc CALENDAR_SOURCE_TYPE = "text/x-s4j-calendar" ;
82     final private static String JavaDoc CALENDAR_SOURCE_NAME = "xcal" ;
83
84     //-------------------------------------------------------------- Constants
85

86     private static PersistentObject store;
87
88     private static long CONFIG_KEY = 0xb565a75eda53298eL ;
89
90     //-------------------------------------------------------------- Private data
91

92     private Thread JavaDoc thread = null ;
93     private AppScreen appScreen = null ;
94     private RichTextField statusField = null ;
95     private BlackBerryPIMList listContact = null ;
96     private BlackBerryPIMList listEvent = null ;
97     private Sync4jContactListener listenerContact = null ;
98     private Sync4jEventListener listenerEvent = null ;
99
100     private Hashtable JavaDoc properties = null ;
101
102     private StaticDataHelper sdh = null ;
103
104     private String JavaDoc contactSourceType = null ;
105     private String JavaDoc contactSourceName = null ;
106
107     private String JavaDoc calendarSourceType = null ;
108     private String JavaDoc calendarSourceName = null ;
109
110     static {
111         store = PersistentStore.getPersistentObject(CONFIG_KEY);
112     }
113
114     /**
115      * This is a default constructor for SyncClient class.
116      * It internally opens the blackberry contact list and add's a listener
117      * to the blackberry contact list and pushes the Home screen for SyncContacts.
118      */

119     public SyncClient()
120     throws Exception JavaDoc {
121
122         //
123
// load xml language file
124
//
125
sdh = new StaticDataHelper();
126         sdh.loadLanguage(this.getClass());
127
128         //
129
//Load default properties form jad file
130
//
131
sdh.loadDefaultValue();
132
133         listContact = (BlackBerryPIMList)
134                             PIM.getInstance().
135                                 openPIMList(PIM.CONTACT_LIST, PIM.READ_WRITE);
136
137         listEvent = (BlackBerryPIMList)
138                             PIM.getInstance().
139                                 openPIMList(PIM.EVENT_LIST , PIM.READ_WRITE);
140
141         listenerContact = new Sync4jContactListener ();
142         listenerEvent = new Sync4jEventListener ();
143
144         statusField = new RichTextField("",Field.NON_FOCUSABLE) ;
145         appScreen = new AppScreen() ;
146
147         listContact.addListener(listenerContact) ;
148         listEvent.addListener(listenerEvent) ;
149
150         synchronized(store) {
151
152             String JavaDoc[] contents = (String JavaDoc[])store.getContents();
153
154             if(contents == null) {
155
156                 displayStatus(sdh.getLanguage("conf-not-set"));
157
158             } else {
159
160                 String JavaDoc syncContact = contents[3] ;
161                 String JavaDoc syncCalendar = contents[4] ;
162
163                 if (!("true".equals(syncContact)) && !("true".equals(syncCalendar))) {
164                     displayStatus(sdh.getLanguage("nothing-sync-enable"));
165                 }
166             }
167
168         }
169
170         synchronized(getEventLock()) {
171             pushScreen(appScreen);
172         }
173     }
174
175     /**
176      * This method is invoked when the synchronize button on Home Screen is
177      * clicked.
178      *
179      * @param void
180      * @return void
181      */

182     public void synchronize()
183     throws Exception JavaDoc {
184         try {
185
186             String JavaDoc[] contents = null;
187
188             contactSourceType = CONTACT_SORCE_TYPE ;
189             contactSourceName = CONTACT_SOURCE_NAME ;
190             calendarSourceType = CALENDAR_SOURCE_TYPE ;
191             calendarSourceName = CALENDAR_SOURCE_NAME ;
192
193             synchronized(store) {
194                 contents = (String JavaDoc[])store.getContents();
195                 if(contents == null) {
196                     displayStatus(sdh.getLanguage("conf-not-set"));
197                     return;
198                 }
199             }
200
201             final String JavaDoc serverURL = contents[ 0 ] ;
202             final String JavaDoc contactSourceURI = contents[ 1 ] ;
203             final String JavaDoc calendarSourceURI = contents[ 2 ] ;
204             final String JavaDoc syncContact = contents[ 3 ] ;
205             final String JavaDoc syncCalendar = contents[ 4 ] ;
206             final String JavaDoc gatewayApn = contents[ 7 ] ;
207             final String JavaDoc gatewayIp = contents[ 8 ] ;
208             final String JavaDoc gatewayPort = contents[ 9 ] ;
209
210             final String JavaDoc login = contents[ 5 ] +
211                                              ":" +
212                                              contents[ 6 ] ;
213
214             if (!("true".equals(syncContact)) && !("true".equals(syncCalendar))) {
215                 displayStatus(sdh.getLanguage("nothing-sync-enable") +
216                                               ":\n" +
217                                               sdh.getLanguage("please-configure") );
218                 return;
219             }
220
221             sdh.setCalendarSourceUri (calendarSourceURI ) ;
222             sdh.setContactSourceUri (contactSourceURI ) ;
223
224             properties = new Hashtable JavaDoc();
225
226             properties.put(PROP_SERVER_URL , serverURL );
227             properties.put(PROP_LOGIN , login );
228             properties.put(PROP_GATEWAYAPN , gatewayApn );
229             properties.put(PROP_GATEWAYIP , gatewayIp );
230             properties.put(PROP_GATEWAYPORT , gatewayPort );
231
232             if ("true".equals(syncContact) || "true".equals(syncCalendar)) {
233
234                 Thread JavaDoc syncThread = new Thread JavaDoc(){
235                     public void run() {
236
237                         if ("true".equals(syncContact)) {
238                             displayStatus(sdh.getLanguage("synch-contact-wait") +
239                                           "\n" +
240                                           sdh.getLanguage("please-wait") );
241                             listContact.removeListener(listenerContact);
242                             try {
243
244                                 SyncManagerFactory.getSyncManager(contactSourceURI,
245                                                                   contactSourceType,
246                                                                   contactSourceName,
247                                                                   properties).sync();
248                                 listContact.addListener(listenerContact);
249
250                             } catch(Exception JavaDoc e) {
251                                 displayStatus(sdh.getLanguage("synch-failed") +
252                                               " " +
253                                               getSynchError(e.getMessage() ,
254                                                             "address book" ,
255                                                             contactSourceURI) );
256                                 return;
257                             }
258                         }
259
260                         if ("true".equals(syncCalendar)) {
261                             displayStatus(sdh.getLanguage("synch-calendar-wait") +
262                                           "\n" +
263                                           sdh.getLanguage("please-wait") );
264                             listEvent.removeListener(listenerEvent);
265
266                             try {
267
268                                 SyncManagerFactory.getSyncManager(calendarSourceURI,
269                                                                   calendarSourceType,
270                                                                   calendarSourceName,
271                                                                   properties).sync();
272                                 listEvent.addListener(listenerEvent);
273
274                             } catch(Exception JavaDoc e) {
275                                 displayStatus(sdh.getLanguage("synch-failed") +
276                                               " " +
277                                               getSynchError(e.getMessage() ,
278                                                             "calendar" ,
279                                                             calendarSourceURI) );
280                                 return;
281                             }
282                         }
283
284                         displayStatus(sdh.getLanguage("synch-success"));
285
286                     }
287                 };
288
289                 syncThread.start();
290
291             }
292
293         } catch(Exception JavaDoc e) {
294             displayStatus(sdh.getLanguage("synch-failed") + " " + e.getMessage());
295             throw e;
296         }
297     }
298
299     /**
300      * This method is invoked to set/change the status message on the home screen.
301      *
302      * @param String: Message
303      * @return void
304      */

305     void displayStatus(String JavaDoc message) {
306       synchronized(getEventLock()) {
307
308           AppScreen as = null;
309
310           statusField = new RichTextField("", Field.NON_FOCUSABLE) ;
311           as = new AppScreen() ;
312           statusField.setText(message);
313           as.setStatus(statusField);
314           pushScreen(as);
315
316       }
317     }
318
319     //--captures Trackwheel click events, provided by TrackwheelListener interface
320
public boolean trackwheelClick(int status, int line) {
321         return true;
322     }
323
324     //--captures Trackwheel unclick events, provided by TrackwheelListener interface
325
public boolean trackwheelUnclick(int status, int line) {
326         return true;
327     }
328
329     //--captures Trackwheel roll events, provided by TrackwheelListener interface
330
public boolean trackwheelRoll(int amount,int status, int line) {
331         return true;
332     }
333
334     /**
335      * Over ridden run method of Runnable interface.
336      * A seperate thread is created to synchronize data with sync server
337      *
338      * @param void
339      * @return void
340      */

341     public void run() {
342         try {
343
344             Thread JavaDoc mythread = Thread.currentThread();
345
346             if (thread == mythread) {
347
348                 synchronized (this) {
349                     synchronize();
350                 }
351             }
352
353         } catch(Exception JavaDoc ex) {
354            displayStatus(sdh.getLanguage("exch-while-synch") + " " + ex);
355         }
356     }
357
358     /**
359      * return error message
360      * @param error
361      * @param remoteDBType
362      * @param sourceUri
363      */

364     private String JavaDoc getSynchError(String JavaDoc error ,
365                                  String JavaDoc remoteDBType ,
366                                  String JavaDoc sourceUri ){
367
368         if (ERROR_NOT_AUTHORIZED.equals(error)) {
369
370             return sdh.getLanguage("not-authorized-user-and-password");
371
372         } else if (ERROR_NOT_FOUND.equals(error)) {
373
374             return sdh.getLanguage("not-found-remote-syncsource") +
375                                    ": " +
376                                    sourceUri ;
377
378         } else if (error != null && error.indexOf("Connection refused") != -1) {
379
380             return sdh.getLanguage("error-connecting-to-the-server");
381
382         } else if (error != null && error.indexOf("out-of-memory") != -1) {
383
384             return sdh.getLanguage("out-of-memory");
385
386         } else {
387
388             return error;
389
390         }
391
392     }
393
394     /**
395      * <code>AppScreen</code> is an inner class that creates the home screen.
396      * for syncClient on Blackberry.Extends MainScreen.
397      */

398     class AppScreen extends MainScreen {
399         //-------------------Private UI components
400
private ConfigurationScreen configScreen;
401
402         StaticDataHelper sdh = new StaticDataHelper() ;
403
404         //------Constructor
405
/**
406         * The constructor here creates the home screen with all the UI components on it.
407         */

408         public AppScreen() {
409             Bitmap icon = null ;
410             BitmapField iconField = null ;
411
412             icon = Bitmap.getBitmapResource(IMMAGE_LOGO);
413             iconField = new BitmapField(icon);
414
415             iconField.setSpace(76, 18);
416
417             configScreen = new ConfigurationScreen();
418
419             setTitle (new LabelField(sdh.getLanguage("sync4j-bb-syncclient") ) );
420
421             add (new LabelField(sdh.getLanguage("goto-menu-for-changing") ) );
422             add (new LabelField(sdh.getLanguage("or-to-synchronize") ) );
423             add (iconField);
424
425         }
426
427         /**
428          * This creates a MenuItem containing "Configure" option.
429          * on selecting the configure option. The user is directed to configuration screen.
430          */

431         private MenuItem configMenu = new MenuItem(sdh.getLanguage("configure"), 20000, 10) {
432
433             public void run() {
434                 synchronized(getEventLock()) {
435                     pushScreen(configScreen);
436                 }
437             }
438
439         };
440
441         /**
442          * This creates a MenuItem containing "Synchronize.." option.
443          * on selecting the configure option.
444          * The users information in address book is synchronized.
445          */

446         private MenuItem SyncMenu = new MenuItem(sdh.getLanguage("synchronize"), 10000, 9) {
447             public void run() {
448                 synchronized(this) {
449                     thread = new Thread JavaDoc(SyncClient.this);
450                     thread.start();
451                 }
452             }
453         };
454
455         /**
456          * Adds "Configure" & "synchronize" menu items to the menu on Home Screen
457          * @param Menu : menu to which configure & synchronize menuitems are
458          * to be added
459          * @param int : instance
460          * @return void.
461          */

462         public void makeMenu(Menu menu, int instance) {
463             menu.add(SyncMenu );
464             menu.add(configMenu );
465         }
466
467         /**
468          * This method is invoked on user hitting the escape button when in home screen.
469          * It prompts the user with a YES/NO dialog, if he wants to exit/not.
470          * @param void.
471          * @return void.
472          */

473         public boolean onClose()
474         {
475             int response = 0;
476
477             response = Dialog.ask(Dialog.D_YES_NO, sdh.getLanguage("do-you-want-to-exit"));
478
479             if (Dialog.YES == response ) {
480                 System.exit(0);
481             }
482             if(Dialog.NO == response) {
483                 return false;
484             }
485
486             return true;
487         }
488     }
489
490     /**
491      * <code>ConfigurationScreen</code> is an inner class that creates configuration screen.
492      * for configuring parameters required for sync Client.Extends MainScreen.
493      */

494     class ConfigurationScreen extends MainScreen {
495
496         StaticDataHelper sdh = new StaticDataHelper() ;
497
498         //-------------------Private UI components
499
private BasicEditField homePageField = null ;
500         private BasicEditField userNameField = null ;
501         private BasicEditField contactSourceUriField = null ;
502         private BasicEditField calendarSourceUriField = null ;
503         private PasswordEditField passwordField = null ;
504         private BasicEditField gatewayApnField = null ;
505         private BasicEditField gatewayIpField = null ;
506         private BasicEditField gatewayPortField = null ;
507         private CheckboxField syncContactField = null ;
508         private CheckboxField syncCalendarField = null ;
509
510         //------Constructor
511
/**
512          * The constructor here creates the Configuration screen with all the UI components on it.
513          * and setting default input values.
514          */

515         public ConfigurationScreen() {
516
517             setTitle(new LabelField(sdh.getLanguage("configure-sync4j-bb")));
518
519             userNameField = new BasicEditField
520                                         (sdh.getLanguage("user") + " " ,
521                                         sdh.getUserDefault() );
522
523             passwordField = new PasswordEditField
524                                         (sdh.getLanguage("password") + " " ,
525                                         sdh.getPasswordDefault() );
526
527             homePageField = new BasicEditField
528                                         (sdh.getLanguage("homepage") + " \n" ,
529                                         sdh.getHomePageDefault() );
530
531             contactSourceUriField = new BasicEditField
532                                         (sdh.getLanguage("source-uri-contact") + " " ,
533                                         sdh.getContactSourceUriDefault() );
534
535             calendarSourceUriField = new BasicEditField
536                                         (sdh.getLanguage("source-uri-calendar") + " " ,
537                                         sdh.getCalendarSourceUriDefault() );
538
539             syncContactField = new CheckboxField
540                                         (sdh.getLanguage("enable-sync-contact") ,
541                                         sdh.getSyncContactDefault() );
542
543             syncCalendarField = new CheckboxField
544                                         (sdh.getLanguage("enable-sync-calendar") ,
545                                         sdh.getSyncCalendarDefault() );
546
547             gatewayApnField = new BasicEditField
548                                         (sdh.getLanguage("gateway-apn") + " " ,
549                                         sdh.getGatewayApnDefault() );
550
551             gatewayIpField = new BasicEditField
552                                         (sdh.getLanguage("gateway-ip") + " " ,
553                                         sdh.getGatewayIpDefault() );
554
555             gatewayPortField = new BasicEditField
556                                         (sdh.getLanguage("gateway-port") + " " ,
557                                         sdh.getGatewayPortDefault() ,
558                                         6 ,
559                                         EditField.FILTER_INTEGER );
560
561             SeparatorField separator1 = new SeparatorField();
562             SeparatorField separator2 = new SeparatorField();
563             SeparatorField separator3 = new SeparatorField();
564             SeparatorField separator4 = new SeparatorField();
565
566             add(userNameField );
567             add(passwordField );
568             add(separator1 );
569             add(homePageField );
570             add(contactSourceUriField );
571             add(calendarSourceUriField );
572             add(separator2 );
573             add(syncContactField );
574             add(syncCalendarField );
575             add(separator3 );
576             add(separator4 );
577             add(gatewayApnField );
578             add(gatewayIpField );
579             add(gatewayPortField );
580
581             populateData();
582         }
583
584         /**
585          * populates the UI components with previous settings, if available.
586          * @param void.
587          * @return void.
588          */

589         private void populateData() {
590             String JavaDoc[] data = null;
591
592             synchronized(store) {
593                 data = (String JavaDoc[])store.getContents();
594             }
595
596             if(data != null) {
597
598                homePageField.setText (data[0]);
599                contactSourceUriField.setText (data[1]);
600                calendarSourceUriField.setText (data[2]);
601
602                if ("true".equals(data[3])) {
603                    syncContactField.setChecked (true );
604                } else {
605                    syncContactField.setChecked (false );
606                }
607
608                if ("true".equals(data[4])) {
609                    syncCalendarField.setChecked (true );
610                } else {
611                    syncCalendarField.setChecked (false );
612                }
613
614                userNameField.setText (data[5] ) ;
615                passwordField.setText (data[6] ) ;
616                gatewayApnField.setText (data[7] ) ;
617                gatewayIpField.setText (data[8] ) ;
618                gatewayPortField.setText (data[9] ) ;
619
620             }
621         }
622
623         /**
624          * This creates a MenuItem containing "Save" option.
625          * on selecting the save option the configuration details are saved.
626          */

627         private MenuItem saveConfItem = new MenuItem(sdh.getLanguage("save"), 20000, 10) {
628
629             public void run() {
630                 saveConfiguration();
631             }
632
633         };
634
635         /**
636          * This method is called when a user selects save option from the menu in configuration screen.
637          * or from the dialog when the user exits configuration screen.It saves changes in configuration
638          * into persistant store.
639          * @param void.
640          * @return void.
641          */

642         public void saveConfiguration(){
643
644             String JavaDoc homePage = null ;
645             String JavaDoc userName = null ;
646             String JavaDoc password = null ;
647             String JavaDoc gatewayApn = null ;
648             String JavaDoc gatewayIp = null ;
649             String JavaDoc gatewayPort = null ;
650             String JavaDoc contactSourceUri = null ;
651             String JavaDoc calendarSourceUri = null ;
652             String JavaDoc syncContact = null ;
653             String JavaDoc syncCalendar = null ;
654
655             homePage = homePageField.getText ().trim();
656             contactSourceUri = contactSourceUriField.getText ().trim();
657             calendarSourceUri = calendarSourceUriField.getText ().trim();
658
659             if (syncContactField.getChecked()) {
660                 syncContact = "true";
661             } else {
662                 syncContact = "false";
663             }
664
665             if (syncCalendarField.getChecked()) {
666                 syncCalendar = "true";
667             } else {
668                 syncCalendar = "false";
669             }
670
671             userName = userNameField.getText ().trim() ;
672             password = passwordField.getText ().trim() ;
673             gatewayApn = gatewayApnField.getText ().trim() ;
674             gatewayIp = gatewayIpField.getText ().trim() ;
675             gatewayPort = gatewayPortField.getText ().trim() ;
676
677             if (homePage == null ||
678                 contactSourceUri == null ||
679                 calendarSourceUri == null ||
680                 userName == null ||
681                 password == null) {
682
683                    displayStatus(sdh.getLanguage("configuration-incomplete"));
684
685             } else if (homePage.equals ("") ||
686                 contactSourceUri.equals ("") ||
687                 calendarSourceUri.equals ("") ||
688                 userName.equals ("") ||
689                 password.equals ("")) {
690
691                 displayStatus(sdh.getLanguage("configuration-incomplete"));
692
693             } else if ((homePage.indexOf("http") != 0) && (homePage.indexOf("https") != 0)) {
694
695                 displayStatus(sdh.getLanguage("homepage-not-correct"));
696
697             } else {
698
699                     String JavaDoc[] data = {homePage ,
700                                      contactSourceUri ,
701                                      calendarSourceUri ,
702                                      syncContact ,
703                                      syncCalendar ,
704                                      userName ,
705                                      password ,
706                                      gatewayApn ,
707                                      gatewayIp ,
708                                      gatewayPort };
709
710                     synchronized(store) {
711                         store.setContents(data);
712                         store.commit();
713                     }
714
715                     displayStatus(sdh.getLanguage("data-properly-configured"));
716
717             }
718
719             popScreen(ConfigurationScreen.this);
720         }
721
722         /**
723          * Adds "Save" menu item to the menu on Configuration screen
724          * @param Menu : menu to which save menuitem is to be added
725          * @param int : instance
726          * @return void.
727          */

728         public void makeMenu(Menu menu, int instance) {
729             menu.add(saveConfItem);
730         }
731
732         /**
733          * This method is invoked on user hitting the escape button.
734          * It prompts the user if with a dialog,if he wants to save/discard/cancel
735          * the changes in configuration.
736          * @param void.
737          * @return void.
738          */

739         public boolean onClose() {
740
741             int response = Dialog.ask(Dialog.D_SAVE,sdh.getLanguage("do-you-want-save"));
742
743             if (Dialog.SAVE == response ) {
744                     saveConfiguration();
745             } else if( Dialog.CANCEL == response) {
746                     displayStatus(sdh.getLanguage("no-changes-to-previous"));
747             } else if ( Dialog.DISCARD == response ) {
748                     popScreen(ConfigurationScreen.this);
749                     displayStatus(sdh.getLanguage("no-changes-to-previous"));
750             }
751
752             return true;
753         }
754     }
755
756     /**
757      * This is the entry point for SyncClient Application.
758      * @param String[].
759      * @return void.
760      */

761     public static void main(String JavaDoc s[]) throws Exception JavaDoc {
762         SyncClient test = new SyncClient();
763         test.enterEventDispatcher();
764     }
765
766 }
767
Popular Tags