/** * Returns a localised version of a string. * * @param value the string value * @return the localised version of {@code value}, or {@code value} if there is no localised version */ public String getLocalString(String value) { return messages.get(value); }
/** * Returns a stream to a local pack. * * @param name the pack name * @return the pack stream */ private InputStream getLocalPackStream(String name) { return resources.getInputStream("packs/pack-" + name); }
/** * 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; }
/** * Load GUI preference information. * * @param installData the GUI installation data * @throws Exception */ private void loadGUIInstallData(GUIInstallData installData, Resources resources) throws Exception { installData.guiPrefs = (GUIPrefs) resources.getObject("GUIPrefs"); }
/** * Returns the text to display. * * @return the text */ @Override protected String getText() { String defaultValue = "Error : could not load the info text !"; return resources.getString("InfoPanel.info", defaultValue); } }
/** * Loads an image. * * @return The image icon. */ private ImageIcon getImage() { ImageIcon img; try { img = resources.getImageIcon("installer.langsel.img"); } catch (Exception err) { img = null; } return img; }
private String getTranslation(String id) { return messages.get(id); }
/** * Returns the stream to a resource. * * @param name the resource name * @return a stream to the resource * @throws ResourceNotFoundException if the resource cannot be found * @throws ResourceException for any other resource error */ @Override public InputStream getInputStream(String name) { // TODO - this is invoked to get multi-volume info, so should check on web dir. return resources.getInputStream(name); }
/** * Provides an {@link Messages}. * * @param locales the locales * @return the messages from the current locale */ public Messages provide(Locales locales) { return locales.getMessages(); } }
/** * Load GUI preference information. * * @param installData the console installation data * @throws Exception */ private void loadConsoleInstallData(ConsoleInstallData installData, Resources resources) throws Exception { installData.consolePrefs = (ConsolePrefs) resources.getObject("ConsolePrefs"); }
public String getDescription() { return messages.get("nextmedia.filedesc"); }
/** * Gets the stream to a resource. * * @param res The resource id. * @return The resource value, null if not found */ public InputStream getResource(String res) { try { // System.out.println ("retrieving resource " + res); return resources.getInputStream(res); } catch (ResourceNotFoundException exception) { return null; } }
/** * Returns the named messages for the current locale. * * @param name the message resource name * @return messages for the current locale * @throws ResourceNotFoundException if the named resource cannot be found */ @Override public Messages getMessages(String name) { InputStream in = resources.getInputStream(name); return new LocaleDatabase(in, this); }
protected static String getString(AutomatedInstallData automatedInstallData, String key) { return automatedInstallData.getMessages().get(key); } }
/** * Helper to return a prompt to create desktop shortcuts. * * @return the desktop shortcut prompt */ public String getCreateDesktopShortcutsPrompt() { return installData.getMessages().get("ShortcutPanel.regular.desktop"); }
public String getCreateForCurrentUserPrompt() { return installData.getMessages().get("ShortcutPanel.regular.currentUser"); }
/** * Helper to return a language resource string. * * @param key the search key * @return the corresponding string, or {@code key} if the string is not found */ public String getString(String key) { return installData.getMessages().get(key); }