Package org.jboss.dashboard

Examples of org.jboss.dashboard.LocaleManager


     * @param request
     * @return true if the language has changed.
     */
    protected boolean localeChanged(CommandRequest request) {
        String localeLangParm = request.getRequestObject().getParameter("localeLang");
        LocaleManager lManager = LocaleManager.lookup();
        if (localeLangParm != null && !localeLangParm.equals("") && !localeLangParm.equals(lManager.getCurrentLang())) {
            lManager.setCurrentLang(localeLangParm);
            return true;
        }
        return false;
    }
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

    /**
     * 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();
        buf.append(localeManager.localize(getSection().getWorkspace().getTitle())).append(" \u003E ");
        buf.append(localeManager.localize(getSection().getTitle())).append(" \u003E ");
        buf.append(localeManager.localize(getInstance().getTitle())).append(" [id=").append(getPanelId()).append("]");
        return buf.toString();
    }
View Full Code Here

        protected Map<String,Object> context;

        public PanelActionTrace(Section section, Panel panel, String pAction) {
            super(panel.getInstanceId().toString());
            LocaleManager localeManager = LocaleManager.lookup();
            context = new LinkedHashMap<String,Object>();
            context.put("Workspace", localeManager.localize(section.getWorkspace().getTitle()));
            context.put("Section", localeManager.localize(section.getTitle()));
            context.put("Panel", localeManager.localize(panel.getInstance().getTitle()).toString());
            context.put("Panel id.", panel.getPanelId().toString());
            context.put("Panel driver", panel.getProvider().getDriver().getClass().getName());
            context.put("Panel action", pAction);

            ThreadProfile threadProfile = Profiler.lookup().getCurrentThreadProfile();
View Full Code Here

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

    public Map getTitle() {
        LocaleManager localeManager = LocaleManager.lookup();
        final String[] langs = localeManager.getPlatformAvailableLangs();
        Map title = new AbstractMap() {
            public Set entrySet() {
                return new AbstractSet() {
                    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

        } catch (Exception e) {
            //Ignore "parsing" errors
        }

        //Remove language information if any
        LocaleManager localeManager = LocaleManager.lookup();
        String[] possibleLangs = localeManager.getPlatformAvailableLangs();
        for (int i = 0; i < possibleLangs.length; i++) {
            String lang = possibleLangs[i];
            if (uri.startsWith(lang + "/")) {
                uri = uri.substring(lang.length() + 1);
                break;
View Full Code Here

            int sectionCount = sectionList.size();
            for (int i = 0; i < sectionCount; i++) {
                Section section = (Section) sectionList.get(i);

                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

    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 (int i = 0; i < langs.length; i++) {
                String lang = langs[i];
                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

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.