Package com.agilebooster.view

Source Code of com.agilebooster.view.DashboardBean

/*
* (C) Copyright 2014 Agile Booster.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
*     Maxime ESCOURBIAC
*/
package com.agilebooster.view;

import java.io.Serializable;
import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ManagedProperty;
import javax.faces.bean.RequestScoped;
import org.primefaces.model.DashboardColumn;
import org.primefaces.model.DashboardModel;
import org.primefaces.model.DefaultDashboardColumn;
import org.primefaces.model.DefaultDashboardModel;

/**
* Bean used by the index page.
*
* @author Maxime ESCOURBIAC
*/
@ManagedBean(name = "dashboardBean")
@RequestScoped
public class DashboardBean implements Serializable {

    @ManagedProperty(value = "#{sessionBean}")
    private SessionBean sessionBean;
    private DashboardModel model;

    @PostConstruct
    public void init() {
        //Dashboard
        model = new DefaultDashboardModel();
        DashboardColumn column1 = new DefaultDashboardColumn();
        DashboardColumn column2 = new DefaultDashboardColumn();
        column1.addWidget("myCalendar");
        column1.addWidget("myItems");
        column2.addWidget("myContinousIntegration");
        column2.addWidget("myProjects");
        model.addColumn(column1);
        model.addColumn(column2);
    }

    public DashboardModel getModel() {
        return model;
    }

    /**
     * Session Bean.
     *
     * @return Session Bean.
     */
    public SessionBean getSessionBean() {
        return sessionBean;
    }

    /**
     * Session Bean.
     *
     * @param sessionBean Session Bean.
     */
    public void setSessionBean(SessionBean sessionBean) {
        this.sessionBean = sessionBean;
    }
}
TOP

Related Classes of com.agilebooster.view.DashboardBean

TOP
Copyright © 2018 www.massapi.com. 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.