Package org.jboss.dashboard.displayer

Examples of org.jboss.dashboard.displayer.DataDisplayer


        if (l == null) l = LocaleManager.currentLocale();
        if (descr == null) descriptions.remove(l.toString());
        else {
            descriptions.put(l.toString(), descr);

            DataDisplayer displayer = getDataDisplayer();
            if (displayer instanceof AbstractChartDisplayer) {
                AbstractChartDisplayer chartDisplayer = (AbstractChartDisplayer) displayer;
                chartDisplayer.setTitle(descr);
            }
        }
View Full Code Here


        Map<String,String> descrMap = kpi.getDescriptionI18nMap();
        for (String lang : descrMap.keySet()) {
            String value = descrMap.get(lang);
            getBundle(bundles, new Locale(lang)).setProperty(kpi.getCode() + ".description", value);

            DataDisplayer dataDisplayer = kpi.getDataDisplayer();
            if (dataDisplayer instanceof TableDisplayer) {
                TableDisplayer tableDisplayer = (TableDisplayer) dataDisplayer;
                processTableDisplayer(tableDisplayer, kpi.getCode(), bundles);
            }
            if (dataDisplayer instanceof AbstractChartDisplayer) {
View Full Code Here

import org.jboss.dashboard.kpi.KPI;

public class KPIHelper {

    public static DataSet getDataSet(KPI kpi) {
        DataDisplayer displayer = kpi.getDataDisplayer();
        if (displayer instanceof AbstractChartDisplayer) {
            AbstractChartDisplayer cdisplayer = (AbstractChartDisplayer) kpi.getDataDisplayer();
            return cdisplayer.buildXYDataSet();
        }
        if (displayer instanceof TableDisplayer) {
View Full Code Here

    public void setKpi(KPI kpi) {
        super.setKpi(kpi);

        this.displayerEditor = null;
        if (kpi != null) {
            DataDisplayer displayer = kpi.getDataDisplayer();
            this.displayerEditor = UIBeanLocator.lookup().getEditor(displayer);
        }
    }
View Full Code Here

        String changeDisplayer = request.getRequestObject().getParameter("changeDisplayer");
        if ("true".equals(changeDisplayer)) return actionChangeDisplayer(request);

        // Change the data provider if necessary.
        Locale locale = LocaleManager.currentLocale();
        DataDisplayer kpiDisplayer = kpi.getDataDisplayer();
        String selProviderCode = request.getRequestObject().getParameter("providerSelected");
        if (selProviderCode != null && !kpi.getDataProvider().getCode().equals(selProviderCode)) {
            DataProvider selProvider = DataDisplayerServices.lookup().getDataProviderManager().getDataProviderByCode(selProviderCode);
            kpi.setDataProvider(selProvider);
            kpiDisplayer.setDataProvider(selProvider);
            setKpi(kpi);
        }

        // Update the configuration.
        displayerEditor.actionSubmit(request);
View Full Code Here

    public CommandResponse actionChangeDisplayer(CommandRequest request) throws Exception {
        String uid = request.getRequestObject().getParameter("uid");
        DataDisplayerType selectedType = DataDisplayerServices.lookup().getDataDisplayerManager().getDisplayerTypeByUid(uid);
        if (selectedType == null) return null;

        DataDisplayer kpiDisplayer = kpi.getDataDisplayer();
        DataDisplayerType kpiDisplayerType = kpiDisplayer.getDataDisplayerType();

        // If the displayer associated to the kpi is not the new displayer, change it.
        if (!kpiDisplayerType.getUid().equals(selectedType.getUid())) {
            DataDisplayer newDisplayer = selectedType.createDataDisplayer();
            newDisplayer.setDefaultSettings();
            newDisplayer.copyFrom(kpiDisplayer);
            kpi.setDataDisplayer(newDisplayer);
            setKpi(kpi);
            return null;
        }
        return null;
View Full Code Here

    public void setKpi(KPI kpi, boolean embeddedMode) {
        this.kpi = kpi;
        this.displayerViewer = null;
        this.embeddedMode=embeddedMode;
        if (kpi != null) {
            DataDisplayer displayer = kpi.getDataDisplayer();
            this.displayerViewer = UIBeanLocator.lookup().getViewer(displayer);
        }
    }
View Full Code Here

    public void beforeRenderBean() {
        // The displayer's title must be the kpi's description.
        // So set it before render the component.
        Locale locale = LocaleManager.currentLocale();
        DataDisplayer kpiDisplayer = kpi.getDataDisplayer();
        if (kpiDisplayer instanceof AbstractChartDisplayer) {
            AbstractChartDisplayer displayer = (AbstractChartDisplayer) kpiDisplayer;
            displayer.setTitle(kpi.getDescription(locale));
        }
    }
View Full Code Here

    public void formatKPIs(ExportOptions options, PrintWriter out, int indent) throws Exception {
        Iterator it = options.getKPIs().iterator();
        while (it.hasNext()) {
            KPI kpi = (KPI) it.next();
            DataProvider provider = kpi.getDataProvider();
            DataDisplayer displayer = kpi.getDataDisplayer();
            DataDisplayerXMLFormat displayerXMLFormat = displayer.getDataDisplayerType().getXmlFormat();

            // Start KPI
            printIndent(out, indent++);
            out.println("<kpi code=\"" + StringEscapeUtils.escapeXml(kpi.getCode()) + "\">");
View Full Code Here

        if (l == null) l = LocaleManager.currentLocale();
        if (descr == null) descriptions.remove(l.toString());
        else {
            descriptions.put(l.toString(), descr);

            DataDisplayer displayer = getDataDisplayer();
            if (displayer instanceof AbstractChartDisplayer) {
                AbstractChartDisplayer chartDisplayer = (AbstractChartDisplayer) displayer;
                chartDisplayer.setTitle(descr);
            }
        }
View Full Code Here

TOP

Related Classes of org.jboss.dashboard.displayer.DataDisplayer

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.