/** * Create and initialize a new discovery application MIDlet. The saved URL is retrieved and the * list of MIDlets are retrieved. */ public DiscoveryApp() { String storageName; display = Display.getDisplay(this); GraphicalInstaller.initSettings(); restoreSettings(); // get the URL of a list of suites to install getUrl(); }
/** * Alert the user that an action was successful. * * @param successMessage message to display to user */ private void displaySuccessMessage(String successMessage) { Image icon; Alert successAlert; icon = GraphicalInstaller.getImageFromInternalStorage("_dukeok8"); successAlert = new Alert(null, successMessage, icon, null); successAlert.setTimeout(GraphicalInstaller.ALERT_TIMEOUT); // We need to prevent "flashing" on fast development platforms. while (System.currentTimeMillis() - lastDisplayChange < GraphicalInstaller.ALERT_TIMEOUT) ; lastDisplayChange = System.currentTimeMillis(); display.setCurrent(successAlert); }
/** Save the URL setting the user entered in to the urlTextBox. */ private void saveURLSetting() { String temp; Exception ex; temp = urlTextBox.getString(); ex = GraphicalInstaller.saveSettings(temp, MIDletSuite.INTERNAL_SUITE_ID); if (ex != null) { displayException(Resource.getString(ResourceConstants.EXCEPTION), ex.toString()); return; } defaultInstallListUrl = temp; displaySuccessMessage(Resource.getString(ResourceConstants.AMS_MGR_SAVED)); }