Package org.jboss.dashboard.ui

Examples of org.jboss.dashboard.ui.Dashboard


        }
    }

    public CommandResponse actionClear(CommandRequest request) {
        try {
            Dashboard dashboard = getDashboard();
            if (dashboard.unfilter()) {
                return new ShowCurrentScreenResponse();
            }
        } catch (Exception e) {
            log.error("Cannot refresh dashboard.",e);
        }
View Full Code Here


    public CommandResponse actionDeleteFilteredProperty(CommandRequest request) {
        String propertyToDelete = request.getRequestObject().getParameter("filteredPropertyToDelete");
        if (propertyToDelete == null || propertyToDelete.trim().length() == 0) return null;

        try {
            Dashboard dashboard = getDashboard();
            if (dashboard.unfilter(propertyToDelete)) {
                return new ShowCurrentScreenResponse();
            }
        } catch (Exception e) {
            log.error("Cannot remove filter property.",e);
        }
View Full Code Here

    private static final String PARAM_REFRESH = "refresh";

    @Override
    protected boolean processRequest() throws Exception {
        Dashboard dashboard = DashboardHandler.lookup().getCurrentDashboard();
        if (dashboard != null) {
            String refresh = getRequest().getParameter(PARAM_REFRESH);
            boolean isRefresh = Boolean.parseBoolean(refresh);
            if (isRefresh) dashboard.refresh();
        }

        return true;
    }
View Full Code Here

        DashboardHandler dashboardHandler = DashboardHandler.lookup();
        for (String workspaceId : selectedSectionIds.keySet()) {
            WorkspaceImpl workspace = (WorkspaceImpl) UIServices.lookup().getWorkspacesManager().getWorkspace(workspaceId);
            Set<Section> sections = getSelectedSections(workspace);
            for (Section section : sections) {
                Dashboard dash = dashboardHandler.getDashboard(section);
                Iterator it = section.getPanels().iterator();
                while (it.hasNext()) {
                    KPI kpi = dash.getKPI((Panel) it.next());
                    if (kpi != null && !results.contains(kpi)) results.add(kpi);
                }
            }
        }
        final Locale l = LocaleManager.currentLocale();
View Full Code Here

    protected Command createCommand(String commandName) {
        Command command = super.createCommand(commandName);
        if (command != null && RequestContext.getCurrentContext() != null) {

            // Pass the current dashboard filter to the command.
            Dashboard dashboard = DashboardHandler.lookup().getCurrentDashboard();
            command.setDataFilter(dashboard.getDashboardFilter());

        }
        return command;
    }
View Full Code Here

public class DashboardProcessor implements RequestChainProcessor {

    private static final String PARAM_REFRESH = "refresh";

    public boolean processRequest(CommandRequest request) throws Exception {
        Dashboard dashboard = DashboardHandler.lookup().getCurrentDashboard();
        if (dashboard != null) {
            String refresh = request.getRequestObject().getParameter(PARAM_REFRESH);
            boolean isRefresh = Boolean.parseBoolean(refresh);
            if (isRefresh) dashboard.refresh();
        }

        return true;
    }
View Full Code Here

        // Return an existent dashboard.
        Long key = section.getDbid();
        if (dashboards.containsKey(key)) return dashboards.get(key);

        // Initialize a dashboard instance for the section.
        Dashboard dashboard = new Dashboard();
        dashboard.setSection(section);
        dashboard.addListener(listener);
        dashboards.put(key, dashboard);

        // Init the dashboard (the related data sets will be loaded).
        dashboard.init();
        return dashboard;
    }
View Full Code Here

    /**
     * Get the dashboard for the current page.
     */
    public synchronized Dashboard getCurrentDashboard() {
        NavigationManager navMgr = NavigationManager.lookup();
        Dashboard dashboard = getDashboard(navMgr.getCurrentSection());
        if (dashboard == null) return null// When a section is being deleted the current section is null.
       
        if (currentDashboard == null) return currentDashboard = dashboard;
        if (dashboard.equals(currentDashboard)) return currentDashboard;

        // If the dashboard has been abandoned then re-initialize it when coming back.
        currentDashboard = dashboard;
        dashboard.init();
        return dashboard;
    }
View Full Code Here

            AbstractChartDisplayer abstractChartDisplayer = (AbstractChartDisplayer) getDataDisplayer();
            DataProperty property = abstractChartDisplayer.getDomainProperty();
            Integer series = Integer.decode(request.getRequestObject().getParameter(PARAM_NSERIE));
            DataSet dataSet = abstractChartDisplayer.buildXYDataSet();
            Interval interval = (Interval) dataSet.getValueAt(series, 0);
            Dashboard dashboard = DashboardHandler.lookup().getCurrentDashboard();
            if (dashboard.filter(property.getPropertyId(), interval, FilterByCriteria.ALLOW_ANY)) {
                return new ShowCurrentScreenResponse();
            }
        } catch (Exception e) {
            log.error("Cannot apply filter.",e);
        }
View Full Code Here

        AbstractChartDisplayer abstractChartDisplayer = (AbstractChartDisplayer) getDataDisplayer();
        DataProperty property = abstractChartDisplayer.getDomainProperty();
        Integer series = Integer.decode(request.getRequestObject().getParameter(PARAM_NSERIE));
        DataSet dataSet = abstractChartDisplayer.buildXYDataSet();
        Interval interval = (Interval) dataSet.getValueAt(series, 0);
        Dashboard dashboard = DashboardHandler.lookup().getCurrentDashboard();
        if (dashboard.filter(property.getPropertyId(), interval, FilterByCriteria.ALLOW_ANY)) {
            return new ShowCurrentScreenResponse();
        }
        return null;
    }
View Full Code Here

TOP

Related Classes of org.jboss.dashboard.ui.Dashboard

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.