Package org.jboss.dashboard

Examples of org.jboss.dashboard.LocaleManager


        this.nameI18nMap = nameI18nMap;
    }

    public String getHint(Locale l) {
        if (hintI18nMap.containsKey(l)) return hintI18nMap.get(l);
        LocaleManager i18n = LocaleManager.lookup();
        String result = (String) i18n.localize(hintI18nMap);
        if (result != null) return result;

        return getName(l);
    }
View Full Code Here


            List<Section> sectionList = new ArrayList<Section>(sections.keySet());
            Collections.sort(sectionList);
            int sectionCount = sectionList.size();
            for (Section section : sectionList) {
                Map children = (Map) sections.get(section);
                LocaleManager localeManager = LocaleManager.lookup();

                String sectionTitle = StringUtil.replaceAll(localeManager.localize(section.getTitle()).toString(), "\\", "\\\\");
                sectionTitle = StringUtil.replaceAll(sectionTitle, "'", "\\'");
                result += "['" + sectionTitle + "', '" + section.getId() + "_" + section.getPosition() + "_" + (sectionCount - 1) + "'";

                if (children != null && !children.isEmpty()) {
                    result += ", ";
View Full Code Here

    public void setPanelParams(Set<PanelParameter> panelParams) {
        this.panelParams = panelParams;
    }

    public Map<String, String> getTitle() {
        LocaleManager localeManager = LocaleManager.lookup();
        final String[] langs = localeManager.getPlatformAvailableLangs();
        Map<String, String> title = new AbstractMap<String, String>() {
            public Set<Entry<String, String>> entrySet() {
                return new AbstractSet<Entry<String, String>>() {
                    public int size() {
                        return langs.length;
View Full Code Here

        };
        return title;
    }

    public String getTitle(String language) {
        LocaleManager localeManager = LocaleManager.lookup();
        return (String) localeManager.localize(getTitle());
    }
View Full Code Here

    private void doAddParameter(PanelProviderParameter parameter) {
        Properties properties = parameter.getProvider().getProperties();
        String parameterId = parameter.getId();
        if (parameter.isI18n()) {
            LocaleManager localeManager = LocaleManager.lookup();
            String[] langs = localeManager.getPlatformAvailableLangs();
            for (String lang : langs) {
                String defaultValueInLang = properties.getProperty("parameter." + parameterId + "." + lang + ".default");
                if (!StringUtils.isEmpty(defaultValueInLang))
                    parameter.setDefaultValue(defaultValueInLang, lang);
            }
View Full Code Here

        return new ShowPanelPage(panel, request, pageId);
    }

    public Map getTextShownByInstance(PanelInstance instance) {
        Map m = new HashMap();
        LocaleManager localeManager = LocaleManager.lookup();
        String[] langs = localeManager.getPlatformAvailableLangs();
        for (int i = 0; i < langs.length; i++) {
            String lang = langs[i];
            String before = instance.getParameterValue(PanelInstance.PARAMETER_HTML_BEFORE, lang);
            String panelBody = getPanelHTMLContent(instance, lang);
            String after = instance.getParameterValue(PanelInstance.PARAMETER_HTML_AFTER, lang);
View Full Code Here

    /**
     * Return a string describing the panel.
     * Sample: Workspace de procesos > Tareas pendientes > Lista de tareas [id=13456]
     */
    public String getFullDescription() {
        LocaleManager localeManager = LocaleManager.lookup();
        StringBuffer buf = new StringBuffer();
        if (getSection() != null) buf.append(localeManager.localize(getSection().getWorkspace().getTitle())).append(" \u003E ");
        if (getSection() != null) buf.append(localeManager.localize(getSection().getTitle())).append(" \u003E ");
        if (getInstance() != null) buf.append(localeManager.localize(getInstance().getTitle())).append(" [id=").append(getPanelId()).append("]");
        return buf.toString();
    }
View Full Code Here

TOP

Related Classes of org.jboss.dashboard.LocaleManager

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.