Example usage for com.vaadin.ui GridLayout GridLayout

List of usage examples for com.vaadin.ui GridLayout GridLayout

Introduction

In this page you can find the example usage for com.vaadin.ui GridLayout GridLayout.

Prototype

public GridLayout(int columns, int rows) 

Source Link

Document

Constructor for a grid of given size (number of columns and rows).

Usage

From source file:com.cms.view.ExportContractFromTaxCode.java

private void buildGridThongtinChung() {
    gridThongtinChung = new GridLayout(4, 5);
    CommonUtils.setBasicAttributeLayout(gridThongtinChung, BundleUtils.getString("customer.common.infor"),
            true);/*  w w w . j av a2  s .co m*/
    txtTaxCode = CommonUtils.buildTextField("customer.taxCode", 14);
    txtTaxCode.setRequired(true);
    txtName = CommonUtils.buildTextField("customer.name", 200);
    txtName.setRequired(true);
    txtName.addTextChangeListener((event) -> {
        String code = event.getText();
        if (!DataUtil.isStringNullOrEmpty(code)) {
            txtName.setValue(code.toUpperCase());
        }
    });
    txtName.setTextChangeEventMode(AbstractTextField.TextChangeEventMode.EAGER);
    txtEmail = CommonUtils.buildTextField("customer.email", 50);
    txtTelNumber = CommonUtils.buildTextField("customer.telNumber", 50);
    txtFax = CommonUtils.buildTextField("customer.fax", 50);
    txtOfficeAddress = CommonUtils.buildTextField("customer.officeAddress", 500);
    txtDeployAddress = CommonUtils.buildTextField("customer.deployAddress", 500);
    txtTaxDepartment = CommonUtils.buildTextField("customer.taxAuthority", 100);

    txtTenNguoiDaidien = CommonUtils.buildTextField("customer.representativeName", 500);
    txtCMND = CommonUtils.buildTextField("customer.representativeId", 20);
    txtNgaycapCMND = CommonUtils.buildTextField("customer.ngaycapCMND", 20);
    cboChuvuNguoiDaidien = CommonUtils.buildComboBox("customer.contact.regency");
    txtEmailNguoiDaidien = CommonUtils.buildTextField("customer.contact.email", 100);
    txtSDTNguoiDaidien = CommonUtils.buildTextField("customer.contact.telNumber", 100);

    cboUtils.fillDataCombo(cboChuvuNguoiDaidien, Constants.NULL, Constants.NULL, lstChucvu,
            Constants.APP_PARAMS.CUSTOMER_CONTACT_REGENCY);

    gridThongtinChung.addComponent(txtTaxCode, 0, 0);
    gridThongtinChung.addComponent(txtName, 1, 0, 2, 0);
    gridThongtinChung.addComponent(txtEmail, 3, 0);
    createButtonGetThongTin();
    gridThongtinChung.addComponent(txtDeployAddress, 0, 2, 1, 2);
    gridThongtinChung.addComponent(txtOfficeAddress, 2, 2, 3, 2);

    gridThongtinChung.addComponent(txtTelNumber, 0, 3);
    gridThongtinChung.addComponent(txtFax, 1, 3);
    gridThongtinChung.addComponent(txtTaxDepartment, 2, 3);
    gridThongtinChung.addComponent(txtCMND, 3, 3);

    gridThongtinChung.addComponent(txtTenNguoiDaidien, 0, 4);
    gridThongtinChung.addComponent(cboChuvuNguoiDaidien, 1, 4);
    gridThongtinChung.addComponent(txtSDTNguoiDaidien, 2, 4);
    gridThongtinChung.addComponent(txtEmailNguoiDaidien, 3, 4);

    layoutMain.addComponent(gridThongtinChung);
}

From source file:com.cms.view.ExportContractFromTaxCode.java

private void buildGridThongtinLienHe() {
    gridThongtinLienHe = new GridLayout(4, 1);
    CommonUtils.setBasicAttributeLayout(gridThongtinLienHe, BundleUtils.getString("customer.contact"), true);
    //        cboChonNguoilienhe = CommonUtils.buildComboBox("label.choose.contact");
    txtTenNguoiLienhe = CommonUtils.buildTextField("customerContact.name", 200);
    cboChucvuNguoiLienhe = CommonUtils.buildComboBox("customer.contact.regency");
    txtSDTNguoiLienhe = CommonUtils.buildTextField("customer.contact.telNumber", 50);
    txtEmailNguoiLienhe = CommonUtils.buildTextField("customer.contact.email", 100);

    cboUtils.fillDataCombo(cboChucvuNguoiLienhe, Constants.NULL, Constants.NULL, lstChucvu,
            Constants.APP_PARAMS.CUSTOMER_CONTACT_REGENCY);

    //        gridThongtinLienHe.addComponent(cboChonNguoilienhe, 0, 0);
    gridThongtinLienHe.addComponent(txtTenNguoiLienhe, 0, 0);
    gridThongtinLienHe.addComponent(cboChucvuNguoiLienhe, 1, 0);
    gridThongtinLienHe.addComponent(txtSDTNguoiLienhe, 2, 0);
    gridThongtinLienHe.addComponent(txtEmailNguoiLienhe, 3, 0);

    layoutMain.addComponent(gridThongtinLienHe);
}

From source file:com.cms.view.ExportContractFromTaxCode.java

private void buildGridGoicuoc() {
    gridGoicuoc = new GridLayout(6, 1);
    CommonUtils.setBasicAttributeLayout(gridGoicuoc, BundleUtils.getString("information.package"), true);

    cboNhacungcap = CommonUtils.buildComboBox("term.information.provider");
    cboNhacungcap.setRequired(true);/*from  w ww .  ja v  a 2s .com*/
    cboGoicuoc = CommonUtils.buildComboBox("package");
    cboGoicuoc.setRequired(true);

    cboHinhthuc = CommonUtils.buildComboBox("type.contract.register");
    cboHinhthuc.setRequired(true);

    cboBieuMau = CommonUtils.buildComboBox("contract.template");
    cboBieuMau.setRequired(true);
    tfSotienCuoc = CommonUtils.buildTextField("value.contract", 15);
    tfSotienChietkhau = CommonUtils.buildTextField("discount", 15);
    gridGoicuoc.addComponent(cboNhacungcap, 0, 0);
    gridGoicuoc.addComponent(cboHinhthuc, 1, 0);
    gridGoicuoc.addComponent(cboBieuMau, 2, 0);
    gridGoicuoc.addComponent(cboGoicuoc, 3, 0);
    gridGoicuoc.addComponent(tfSotienCuoc, 4, 0);
    gridGoicuoc.addComponent(tfSotienChietkhau, 5, 0);
    layoutMain.addComponent(gridGoicuoc);
}

From source file:com.cms.view.ListStaffDepartment.java

public ListStaffDepartment() {
    super(BundleUtils.getString("caption.title.listDept"), BundleUtils.getString("caption.title.listEmp"));
    mainLayout.setSplitPosition(30, Unit.PERCENTAGE);
    setCompositionRoot(mainLayout);//from  ww w .  j  a v  a  2s. c o  m
    //khoi tao cac thanh phan
    //khoi tao form search
    searchDepartmentForm = new DepartmentSearchPanel();
    //khoi tao table ui
    tblListDepartmentUI = new CommonTableFilterPanel();

    //100316 NgocND6 chuyen quyen quan ly hang hoa
    btnTransferRoleCusts = new Button(TRANSFERROLE);
    btnTransferRoleCusts.setIcon(new ThemeResource("img/transfer_icon.png"));
    //them cac component vao layout
    GridLayout horizontalLayout = new GridLayout(2, 1);
    horizontalLayout.setWidth("-1px");
    horizontalLayout.setMargin(true);
    horizontalLayout.setSpacing(true);
    //btn search
    btnSearchDept = new Button(Constants.BUTTON_SEARCH);
    btnSearchDept.setIcon(new ThemeResource(Constants.ICON.SEARCH));
    horizontalLayout.addComponent(btnSearchDept, 0, 0);
    //btn refresh
    btnRefreshDept = new Button(Constants.BUTTON_REFRESH);
    btnRefreshDept.setIcon(new ThemeResource(Constants.ICON.RESET));
    horizontalLayout.addComponent(btnRefreshDept, 1, 0);
    //add component
    leftLayout.addComponent(searchDepartmentForm);
    leftLayout.addComponent(horizontalLayout);
    leftLayout.addComponent(tblListDepartmentUI);
    leftLayout.setComponentAlignment(horizontalLayout, Alignment.MIDDLE_CENTER);
    leftLayout.setMargin(true);

    //===============right==========================
    searchStaffForm = new StaffSearchPanel();
    //khoi tao table ui
    tblListStaffUI = new CommonTableFilterPanel();

    btnAddMapStaffCustomer = new Button(BundleUtils.getString("staff.customer.map"));
    btnAddMapStaffCustomer.setDescription(BundleUtils.getString("staff.customer.map"));
    btnAddMapStaffCustomer.setIcon(new ThemeResource(Constants.ICON.IMPORT));

    btnAssignRole = new Button(BundleUtils.getString("assign.roles.button"));
    btnAssignRole.setIcon(FontAwesome.ANCHOR);
    //them cac component vao layout
    GridLayout horizontalLayout2 = new GridLayout(3, 1);
    horizontalLayout2.setWidth("-1px");
    horizontalLayout2.setMargin(true);
    horizontalLayout2.setSpacing(true);
    //NgocND6 tao layout de add button chuyen quyen cho nhan vien
    GridLayout gridLayout = new GridLayout(3, 1);
    gridLayout.setMargin(true);
    gridLayout.setSpacing(true);
    gridLayout.addComponent(btnAssignRole, 0, 0);
    //        gridLayout.addComponent(btnAddMapStaffCustomer, 1, 0);
    gridLayout.addComponent(btnTransferRoleCusts, 2, 0);
    //Tam thoi an nut phan bo lai khach hang
    btnTransferRoleCusts.setVisible(false);
    //btn search emp
    btnSearchEmp = new Button(Constants.BUTTON_SEARCH);
    btnSearchEmp.setIcon(new ThemeResource(Constants.ICON.SEARCH));
    horizontalLayout2.addComponent(btnSearchEmp, 0, 0);
    //btn refresh emp
    btnRefreshEmp = new Button(Constants.BUTTON_REFRESH);
    btnRefreshEmp.setIcon(new ThemeResource(Constants.ICON.RESET));
    horizontalLayout2.addComponent(btnRefreshEmp, 1, 0);
    //

    //add component
    rightLayout.addComponent(searchStaffForm);
    rightLayout.addComponent(horizontalLayout2);
    rightLayout.addComponent(tblListStaffUI);
    rightLayout.setComponentAlignment(horizontalLayout2, Alignment.MIDDLE_CENTER);
    rightLayout.addComponent(gridLayout);
    rightLayout.setComponentAlignment(gridLayout, Alignment.MIDDLE_CENTER);
    rightLayout.setMargin(true);
    //=============

    this.listDeptAndStaffController = new ListDeptAndStaffController(this);
}

From source file:com.cms.view.ManageCustomerStatusView.java

private void buildSearchLayout() {
    searchLayout = new GridLayout(4, 2);
    CommonUtils.setBasicAttributeLayout(searchLayout, "Tm kim khch hng  phn b", true);

    cbxService = CommonUtils.buildComboBox("Dch v");
    cbxService.setRequired(true);//from w  w  w .  ja  va  2  s  .c o  m
    cbxStatus = CommonUtils.buildComboBox(BundleUtils.getString("customerStatusForm.status"));
    dfFromStartTime = CommonUtils.buildDateField("T ngy phn b");
    dfToStartTime = CommonUtils.buildDateField("?n ngy phn b");

    cbxMineName = CommonUtils.buildComboBox(BundleUtils.getString("customer.mineName"));
    cbxMineName.setInputPrompt("Ch?n danh sch");

    lstServices = DataUtil.getListApParams(Constants.APP_PARAMS.SERVICE_TYPE);
    lstCustomerStatus = DataUtil.getListApParams(Constants.APP_PARAMS.CUSTOMER_SERVICE_STATUS);
    // Loi b? nhng tr?ng hp OK
    List<String> lstNoDelete = Arrays.asList("3", "8", "16");
    lstCustomerStatus = lstCustomerStatus.stream().filter(a -> !lstNoDelete.contains(a.getParCode()))
            .collect(Collectors.toList());
    comboUtils = new ComboComponent();
    //Khoi tao comboBox dich vu
    String serviceDefault = Constants.NULL;
    if (!DataUtil.isListNullOrEmpty(lstServices)) {
        serviceDefault = lstServices.get(0).getParCode();
    }
    comboUtils.fillDataCombo(cbxService, Constants.NULL, serviceDefault, lstServices,
            Constants.APP_PARAMS.SERVICE_TYPE);
    List<ConditionBean> lstConditions = new ArrayList<>();
    AppParamsDTO serviceDTO = (AppParamsDTO) cbxService.getValue();
    if (serviceDTO != null && !DataUtil.isStringNullOrEmpty(serviceDTO.getParCode())) {
        lstConditions.add(new ConditionBean("service", serviceDTO.getParCode(),
                ConditionBean.Operator.NAME_EQUAL, ConditionBean.Type.STRING));
    }
    try {
        lstCategoryList = WSCategoryList.getListCategoryListByCondition(lstConditions, 0, Constants.INT_100,
                Constants.ASC, Constants.CATEGORY_LIST.CODE);
    } catch (Exception e) {
        lstCategoryList = new ArrayList<>();
    }
    try {
        mapCustServiceStatus = DataUtil.buildHasmap(lstCustomerStatus, Constants.APP_PARAMS.PAR_CODE,
                Constants.APP_PARAMS.PAR_NAME);
    } catch (Exception e) {
        mapCustServiceStatus = new HashMap();
    }
    comboUtils.setValues(cbxMineName, lstCategoryList, Constants.CATEGORY_LIST.NAME, true);
    //Khoi tao comboBox customerStatus
    String custStatusDefault = Constants.NULL;
    if (!DataUtil.isListNullOrEmpty(lstCustomerStatus)) {
        custStatusDefault = lstCustomerStatus.get(0).getParCode();
    }
    comboUtils.fillDataCombo(cbxStatus, Constants.NULL, custStatusDefault, lstCustomerStatus,
            Constants.APP_PARAMS.CUSTOMER_SERVICE_STATUS);
    cbxStaff = CommonUtils.buildComboBox("Nhn vin");
    cbxStaff.setRequired(true);

    try {
        StaffDTO search = new StaffDTO();
        search.setStaffType(Constants.STAFF.STAFF_TYPE_3);
        search.setStatus(Constants.ACTIVE);
        lstStaffs = WSStaff.getListStaffDTO(search, 0, Constants.INT_100, "asc", "code");
    } catch (Exception e) {
        lstStaffs = new ArrayList<>();
        //            e.printStackTrace();
    }
    comboUtils.setValues(cbxStaff, lstStaffs, Constants.STAFF.CODE, Boolean.TRUE);
    searchLayout.addComponent(cbxService, 0, 0);
    searchLayout.addComponent(cbxMineName, 1, 0);
    searchLayout.addComponent(cbxStaff, 2, 0);
    searchLayout.addComponent(cbxStatus, 3, 0);

    searchLayout.addComponent(dfFromStartTime, 0, 1);
    searchLayout.addComponent(dfToStartTime, 1, 1);

    layoutMain.addComponent(searchLayout);

    GridManyButton gridManyButton = new GridManyButton(
            new String[] { Constants.BUTTON_SEARCH, Constants.BUTTON_DELETE });
    btnSearch = gridManyButton.getBtnCommon().get(0);

    btnDelete = gridManyButton.getBtnCommon().get(1);
    layoutMain.addComponent(gridManyButton);
}

From source file:com.cms.view.MapStaffCustomerView.java

private void buildSearchLayout() {
    searchLayout = new GridLayout(4, 3);
    CommonUtils.setBasicAttributeLayout(searchLayout, SEARCH_LAYOUT, true);
    cbxService = CommonUtils.buildComboBox(BundleUtils.getString("customerStatusForm.service"));
    cbxService.setRequired(true);/* w  w w.  ja  v a  2  s .  com*/
    cbxStatus = CommonUtils.buildComboBox(BundleUtils.getString("customerStatusForm.status"));
    dfFromStartTime = CommonUtils.buildDateField(BundleUtils.getString("term.information.fromStartTime"));
    dfToStartTime = CommonUtils.buildDateField(BundleUtils.getString("term.information.toStartTime"));
    dfFromEndTime = CommonUtils.buildDateField(BundleUtils.getString("term.information.fromEndTime"));
    dfToEndTime = CommonUtils.buildDateField(BundleUtils.getString("term.information.toEndTime"));
    dfFromDateRegister = CommonUtils.buildDateField(BundleUtils.getString("term.information.fromDateRegister"));
    dfToDateRegister = CommonUtils.buildDateField(BundleUtils.getString("term.information.toDateRegister"));
    cbxMaxSearch = CommonUtils.buildComboBox(BundleUtils.getString("max.search"));
    cbxMineName = CommonUtils.buildComboBox(BundleUtils.getString("customer.mineName"));
    cbxMineName.setInputPrompt("Ch?n danh sch");
    tfMineName = CommonUtils.buildTextField(BundleUtils.getString("customer.mineName"), 100);
    cbxMineName.setRequired(true);

    searchLayout.addComponent(cbxService, 0, 0);
    searchLayout.addComponent(cbxMineName, 1, 0);

    searchLayout.addComponent(dfFromStartTime, 0, 1);
    searchLayout.addComponent(dfToStartTime, 1, 1);
    searchLayout.addComponent(dfFromEndTime, 2, 1);
    searchLayout.addComponent(dfToEndTime, 3, 1);

    searchLayout.addComponent(dfFromDateRegister, 0, 2);
    searchLayout.addComponent(dfToDateRegister, 1, 2);

    buildComboBoxMultiProvider();//0,2
    buildComboBoxMultiCity();// 1,2        
    searchLayout.addComponent(cbxMaxSearch, 2, 2);

    layoutMain.addComponent(searchLayout);

    GridManyButton gridManyButton = new GridManyButton(new String[] { Constants.BUTTON_SEARCH,
            Constants.BUTTON_REFRESH, Constants.BUTTON_INSERT, Constants.BUTTON_SAVE });
    btnSearch = gridManyButton.getBtnCommon().get(0);
    btnReset = gridManyButton.getBtnCommon().get(1);
    btnExecute = gridManyButton.getBtnCommon().get(2);
    btnExecute.setCaption(BundleUtils.getString("staff.customer.map"));
    btnSave = gridManyButton.getBtnCommon().get(3);
    layoutMain.addComponent(gridManyButton);
}

From source file:com.cms.view.SearchCustomerFromTaxCode.java

private void buildSearchGrid() {
    leftPanel.setCaption("Tm kim khch hng");
    Label lbTaxCode = CommonUtils.buildLabel("M s thu", false);
    taxCode = CommonUtils.buildTextField(null, 20, "ALT + 1");
    taxCode.focus();/*from w  w w  .  j ava 2s.  c  o m*/
    taxCode.addShortcutListener(new AbstractField.FocusShortcut(taxCode, ShortcutAction.KeyCode.NUM1,
            ShortcutAction.ModifierKey.ALT));
    btnSearch = new Button("Tm kim", FontAwesome.SEARCH);
    searchGrid = new GridLayout(3, 1);
    CommonUtils.setBasicAttributeLayout(searchGrid, "Tm kim thng tin theo m s thu", true);
    searchGrid.addComponent(lbTaxCode, 0, 0);
    searchGrid.addComponent(taxCode, 1, 0);
    searchGrid.addComponent(btnSearch, 2, 0);
    searchGrid.setComponentAlignment(lbTaxCode, Alignment.MIDDLE_RIGHT);
    searchGrid.setComponentAlignment(taxCode, Alignment.MIDDLE_LEFT);
    searchGrid.setComponentAlignment(btnSearch, Alignment.MIDDLE_LEFT);
    leftLayout.addComponent(searchGrid);
}

From source file:com.compomics.jtraml.web.TramlConverterApplication.java

License:Apache License

/**
 * Initiate the main layout.//w w w .j  a  v a  2s.c o m
 */
private void initLayout() {
    window.addComponent(new HeaderPanel(this));

    iInputForm = new ConversionForm(this);

    iOutputTable = new ResultsPanel(this);

    iSeparatorPanel = new Panel();
    iSeparatorPanel.setStyleName("v-split-line");

    if (iOutputTable.getNumberOfResults() == 0) {
        iOutputTable.setVisible(false);
        iSeparatorPanel.setVisible(false);
    }

    GridLayout grid = new GridLayout(3, 1);

    grid.addComponent(iInputForm, 0, 0);
    grid.addComponent(iSeparatorPanel, 1, 0);
    grid.addComponent(iOutputTable, 2, 0);

    window.addComponent(grid);
    window.addComponent(new FooterPanel(this));
}

From source file:com.compomics.sigpep.webapp.MyVaadinApplication.java

License:Apache License

@Override
public void init() {
    iApplication = this;
    iSigPepSessionFactory = ApplicationLocator.getInstance().getApplication().getSigPepSessionFactory();

    //add theme/*  ww  w .  ja v  a  2 s.  c o m*/
    setTheme("sigpep");

    //add main window
    Window lMainwindow = new Window("Sigpep Application");
    setMainWindow(lMainwindow);
    lMainwindow.addStyleName("v-app-my");

    //add notification component
    iNotifique = new Notifique(Boolean.FALSE);
    CustomOverlay lCustomOverlay = new CustomOverlay(iNotifique, getMainWindow());
    getMainWindow().addComponent(lCustomOverlay);

    //add form help
    iFormHelp = new FormHelp();
    iFormHelp.setFollowFocus(Boolean.TRUE);
    this.getMainWindow().getContent().addComponent(iFormHelp);

    //add panels
    iCenterLeft = new Panel();
    iCenterLeft.addStyleName(Reindeer.PANEL_LIGHT);
    iCenterLeft.setHeight("400px");
    iCenterLeft.setWidth("100%");

    iCenterRight = new Panel();
    iCenterRight.addStyleName(Reindeer.PANEL_LIGHT);
    iCenterRight.setHeight("400px");
    iCenterRight.setWidth("75%");

    //add form tabs
    iFormTabSheet = new FormTabSheet(this);
    iCenterLeft.addComponent(iFormTabSheet);

    iBottomLayoutResults = new VerticalLayout();

    if (PropertiesConfigurationHolder.showTestDemoFolder()) {
        Button lButton = new Button("load test data");
        lButton.addListener(new Button.ClickListener() {
            public void buttonClick(Button.ClickEvent event) {
                new BackgroundThread().run();
            }
        });
        iBottomLayoutResults.addComponent(lButton);
    }

    // Add the selector component
    iSelectionComponent = new TransitionSelectionComponent(MyVaadinApplication.this);
    iCenterRight.addComponent(iSelectionComponent);

    iHeaderLayout = new HorizontalLayout();
    iHeaderLayout.setSizeFull();
    iHeaderLayout.setHeight("100px");
    iHeaderLayout.addStyleName("v-header");

    VerticalLayout lVerticalLayout = new VerticalLayout();

    GridLayout lGridLayout = new GridLayout(2, 1);
    lGridLayout.setSpacing(true);
    lGridLayout.setSizeFull();

    lGridLayout.addComponent(iCenterLeft, 0, 0);
    lGridLayout.setComponentAlignment(iCenterLeft, Alignment.TOP_LEFT);

    lGridLayout.addComponent(iCenterRight, 1, 0);
    lGridLayout.setComponentAlignment(iCenterRight, Alignment.TOP_CENTER);

    lVerticalLayout.addComponent(iHeaderLayout);
    lVerticalLayout.addComponent(lGridLayout);
    lVerticalLayout.addComponent(iBottomLayoutResults);

    lVerticalLayout.setComponentAlignment(iHeaderLayout, Alignment.MIDDLE_CENTER);
    lVerticalLayout.setComponentAlignment(lGridLayout, Alignment.MIDDLE_CENTER);
    lVerticalLayout.setComponentAlignment(iBottomLayoutResults, Alignment.MIDDLE_CENTER);

    lMainwindow.addComponent(lVerticalLayout);
    lMainwindow.addComponent(pusher);

    // Create a tracker for vaadin.com domain.
    String lDomainName = PropertiesConfigurationHolder.getInstance().getString("analytics.domain");
    String lPageId = PropertiesConfigurationHolder.getInstance().getString("analytics.page");

    GoogleAnalyticsTracker tracker = new GoogleAnalyticsTracker("UA-26252212-1", lDomainName);
    lMainwindow.addComponent(tracker);
    tracker.trackPageview(lPageId);

    /**
     * Sets an UncaughtExceptionHandler and executes the thread by the ExecutorsService
     */
    Thread.setDefaultUncaughtExceptionHandler(new MyUncaughtExceptionHandler());

    parseSessionId();
}

From source file:com.esofthead.mycollab.mobile.module.project.view.ProjectDashboardViewImpl.java

License:Open Source License

@Override
public void displayDashboard() {
    mainLayout.removeAllComponents();//from  w ww .  j  a  v a  2  s .  c om
    SimpleProject currentProject = CurrentProjectVariables.getProject();
    VerticalLayout projectInfo = new VerticalLayout();
    projectInfo.setStyleName("project-info-layout");
    projectInfo.setWidth("100%");
    projectInfo.setDefaultComponentAlignment(Alignment.TOP_CENTER);

    Label projectIcon = new Label("<span aria-hidden=\"true\" data-icon=\"&#xe614\"></span>");
    projectIcon.setStyleName("project-icon");
    projectIcon.setContentMode(ContentMode.HTML);
    projectIcon.setWidthUndefined();
    projectInfo.addComponent(projectIcon);

    Label projectName = new Label(StringUtils.trim(currentProject.getName(), 50, true));
    projectName.setWidth("100%");
    projectName.setStyleName("project-name");
    projectInfo.addComponent(projectName);

    GridLayout projectModulesList = new GridLayout(2, 3);
    projectModulesList.setStyleName("project-modules-layout");
    projectModulesList.setWidth("100%");
    projectModulesList.setSpacing(true);
    projectModulesList.setDefaultComponentAlignment(Alignment.TOP_CENTER);

    projectModulesList.addComponent(
            new ProjectModuleButton(AppContext.getMessage(ProjectCommonI18nEnum.VIEW_MESSAGE), "&#xf04f;"));

    projectModulesList.addComponent(
            new ProjectModuleButton(AppContext.getMessage(ProjectCommonI18nEnum.VIEW_MILESTONE), "&#xf075;"));

    projectModulesList.addComponent(
            new ProjectModuleButton(AppContext.getMessage(ProjectCommonI18nEnum.VIEW_TASK), "&#xe60f;"));

    projectModulesList.addComponent(
            new ProjectModuleButton(AppContext.getMessage(ProjectCommonI18nEnum.VIEW_BUG), "&#xf188;"));

    // projectModulesList.addComponent(new ProjectModuleButton(AppContext
    // .getMessage(ProjectCommonI18nEnum.VIEW_FILE), "&#xf017;"));
    //
    // projectModulesList.addComponent(new ProjectModuleButton(AppContext
    // .getMessage(ProjectCommonI18nEnum.VIEW_RISK), "&#xf02d;"));
    //
    // projectModulesList.addComponent(new ProjectModuleButton(AppContext
    // .getMessage(ProjectCommonI18nEnum.VIEW_PROBLEM), "&#xf0d2;"));
    //
    // projectModulesList.addComponent(new ProjectModuleButton(AppContext
    // .getMessage(ProjectCommonI18nEnum.VIEW_TIME), "&#xe612;"));
    //
    // projectModulesList.addComponent(new ProjectModuleButton(AppContext
    // .getMessage(ProjectCommonI18nEnum.VIEW_STANDAUP), "&#xf0c0;"));

    projectModulesList.addComponent(
            new ProjectModuleButton(AppContext.getMessage(ProjectCommonI18nEnum.VIEW_USERS), "&#xe601;"), 0, 2,
            1, 2);

    mainLayout.addComponent(projectInfo);
    mainLayout.addComponent(projectModulesList);
}