/** * Provides an {@link Messages}. * * @param locales the locales * @return the messages from the current locale */ public Messages provide(Locales locales) { return locales.getMessages(); } }
/** * Returns the locale-specific messages. * * @return the messages */ public Messages getMessages() { return locales.getMessages(); }
/** * Changes the quit button text. If <tt>text</tt> is null, the default quit text is used. * * @param text text to be used for changes */ public void setQuitButtonText(String text) { if (text == null) { Messages messages = locales.getMessages(); text = messages.get("installer.quit"); } navigator.setQuitText(text); }
/** * Creates a new messages instance from the named resource that inherits the current messages. * * @param name the messages resource name * @return the messages */ @Override public Messages newMessages(String name) { Messages child = locales.getMessages(name); Messages result = new LocaleDatabase(this, locales); result.add(child); return result; }
/** * Add the contents of a custom langpack to the default langpack, if it exists. * * @param installData the install data to be used */ public static void addCustomLangpack(AutomatedInstallData installData, Locales locales) { // We try to load and add a custom langpack. try { installData.getMessages().add(locales.getMessages(Resources.CUSTOM_TRANSLATIONS_RESOURCE_NAME)); logger.fine("Found custom langpack for " + installData.getLocaleISO3()); } catch (ResourceNotFoundException exception) { logger.fine("No custom langpack for " + installData.getLocaleISO3() + " available"); } }
/** * Writes uninstall data if it is required. * <p/> * An error message will be displayed if the write fails. * * @return <tt>true</tt> if uninstall data was written successfully or is not required, otherwise <tt>false</tt> */ private boolean writeUninstallData() { boolean result = true; if (uninstallDataWriter.isUninstallRequired()) { result = uninstallDataWriter.write(); if (!result) { Messages messages = locales.getMessages(); String title = messages.get("installer.error"); String message = messages.get("installer.uninstall.writefailed"); JOptionPane.showMessageDialog(this, message, title, JOptionPane.ERROR_MESSAGE); } } return result; }
/** * Sets the selected locale on the installation data. * * @param code the locale ISO code */ public void propagateLocale(String code) { try { locales.setLocale(code); Locale newLocale = locales.getLocale(); Locale.setDefault(newLocale); installData.setLocale(locales.getLocale(), locales.getISOCode()); installData.setMessages(locales.getMessages()); AbstractInstallDataProvider.addCustomLangpack(installData, locales); } catch (Exception exception) { logger.log(Level.SEVERE, exception.getMessage(), exception); } } }
private void performHeadingCounter(IzPanelView panel) { if (headingCounterComponent != null) { int curPanelNo = panels.getVisibleIndex(panel); int visPanelsCount = panels.getVisible(); Messages messages = locales.getMessages(); String message = String.format( "%s %d %s %d", messages.get("installer.step"), curPanelNo + 1, messages.get("installer.of"), visPanelsCount ); if (headingCounterComponent instanceof JProgressBar) { updateProgressBar(visPanelsCount, curPanelNo + 1, message); } else { updateProgressCounter(message); } } }
Messages messages = locales.getMessages(); navigator.updateButtonText(messages);
/** * Sets the selected locale on the installation data. * * @param code the locale ISO code */ public void propagateLocale(String code) { try { locales.setLocale(code); Locale newLocale = locales.getLocale(); Locale.setDefault(newLocale); JComponent.setDefaultLocale(newLocale); SwingUtilities.updateComponentTreeUI(this); installData.setLocale(locales.getLocale(), locales.getISOCode()); installData.setMessages(locales.getMessages()); AbstractInstallDataProvider.addCustomLangpack(installData, locales); // Configure buttons after locale has been loaded installData.configureGuiButtons(); } catch (Exception exception) { logger.log(Level.SEVERE, exception.getMessage(), exception); } }
Messages messages = locales.getMessages();
/** * Load a default locale in the installData * * @param installData the installation data * @param locales the supported locales * @throws IOException for any I/O error */ protected void loadDefaultLocale(AutomatedInstallData installData, Locales locales) { Locale locale = locales.getLocale(); if (locale != null) { installData.setInstallationRecord(new XMLElementImpl("AutomatedInstallation")); installData.setLocale(locale, locales.getISOCode()); installData.setMessages(locales.getMessages()); } }
if (installdata.isRebootNecessary()) Messages messages = locales.getMessages(); String message; String title;
installData.setMessages(locales.getMessages()); installData.setLocale(locales.getLocale(), locales.getISOCode()); installData.setMediaPath(mediaPath);