Package net.sourceforge.processdash.i18n

Examples of net.sourceforge.processdash.i18n.Resources


        pos = bundleName.lastIndexOf('.');
        if (pos != -1 && bundleName.indexOf('/', pos) == -1)
            bundleName = bundleName.substring(0, pos);

        try {
            Resources bundle = Resources.getTemplateBundle(bundleName);
            getInterpolator().addResources(bundle);
        } catch (MissingResourceException mre) {
            System.out.println("Couldn't find resource file: " + bundleName);
            System.out.println("(Specified as '" + filename + "' from '" +
                               context +"')");
View Full Code Here


            if (parameters.containsKey(key))
                return (String) parameters.get(key);

            Iterator i = resources.iterator();
            while (i.hasNext()) {
                Resources r = (Resources) i.next();
                try {
                    return r.getString(key);
                } catch (Exception e) {}
            }

            return "";
        }
View Full Code Here

                uri = uri.substring(1);
            this.uri = "//" + uri;

            // Get the resource bundle for messages
            String resourcePrefix = xml.getAttribute("resources");
            Resources res = Resources.getDashBundle(resourcePrefix);
            setText(res.getString("Menu_Text"));
        }
View Full Code Here

            Document doc = XMLUtils.parse(in);
            ExtensionManager.addXmlDoc(doc, filename, baseUrl);
            root = doc.getDocumentElement();
        } catch (SAXException se) {
            String message = XMLUtils.exceptionMessage(se);
            Resources r = Resources.getDashBundle("Templates");
            if (message == null)
                message = r.format("Error_FMT", filename);
            else
                message = r.format("Error_Message_FMT", filename, message);
            logTemplateError(message);
            return;
        }

        AutoData.registerTemplates(root, data);
View Full Code Here

     *  files.
     */
    private static ErrorReporter errorReporter = null;
    public synchronized static void logTemplateError(String error) {
        if (errorReporter == null) {
            Resources r = Resources.getDashBundle("Templates");
            errorReporter = new ErrorReporter
                (r.getString("Error_Title"),
                 r.getStrings("Error_Header"),
                 r.getStrings("Error_Footer"));
        }
        errorReporter.logError(error);
    }
View Full Code Here

    public static void ensureVersionsOrExit() {
        List<Incompatibility> unsatisfied = checkPackageVersions();
        if (unsatisfied.isEmpty())
            return;
       
        Resources res = Resources.getDashBundle(
            "ProcessDashboard.Errors.Version_Incompatibility");
        StringBuilder upgradeList = new StringBuilder();
        StringBuilder missingList = new StringBuilder();
        for (Incompatibility item: unsatisfied) {
            String itemDisplay = res.format("Item_FMT", item
                    .getPackageDisplayName(), item.minVersion);
            (item.pkg == null ? missingList : upgradeList).append("\n")
                    .append(BULLET).append(itemDisplay);
        }
        String title = res.getString("Title");
        Object[] message = new Object[3];
        message[0] = res.getStrings("Header");
        if (missingList.length() > 0) {
            message[1] = missingList.substring(1).split("\n");
            message[2] = res.getStrings("Missing_Message");
        } else {
            message[1] = upgradeList.substring(1).split("\n");
            message[2] = res.getStrings("Upgrade_Message");
        }
        JOptionPane.showMessageDialog(null, message, title,
            JOptionPane.ERROR_MESSAGE);
        System.exit(1);
    }
View Full Code Here

        if (uri.startsWith("/"))
            uri = uri.substring(1);

        // Get the resource bundle for messages
        String resourcePrefix = view.getAttribute("resources");
        Resources res = Resources.getDashBundle(resourcePrefix);

        // Construct the link HTML and print it
        String linkHtml = StringUtils.findAndReplace(SHOW_ALT_LINK, "[URI]",
            uri);
        interpOutLink(linkHtml, EVReportSettings.PURPOSE_OTHER, res);
View Full Code Here

   
    /** process a resources directive within the buffer */
    private void processResourcesDirective(DirectiveMatch resDir)
        throws IOException
    {
        Resources r = null;

        // what bundle do they want us to include?
        String bundle = resDir.getAttribute("bundle");
        if (bundle != null) {
            try {
View Full Code Here

    private String getResource(String name) {
        if (resources != null) {
            Iterator i = resources.iterator();
            while (i.hasNext()) {
                Resources r = (Resources) i.next();
                try {
                    return r.getString(name);
                } catch (Exception e) {}
            }
        }
        return null;
    }
View Full Code Here

TOP

Related Classes of net.sourceforge.processdash.i18n.Resources

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.