Example usage for com.vaadin.server ThemeResource ThemeResource

List of usage examples for com.vaadin.server ThemeResource ThemeResource

Introduction

In this page you can find the example usage for com.vaadin.server ThemeResource ThemeResource.

Prototype

public ThemeResource(String resourceId) 

Source Link

Document

Creates a resource.

Usage

From source file:com.gnts.pem.txn.synd.SyndFlat.java

License:Open Source License

@SuppressWarnings("deprecation")
void setComponentStyle() {
    tfEvaluationNumber.setWidth(strComponentWidth);
    slBankBranch.setWidth(strComponentWidth);
    tfEvaluationPurpose.setWidth(strComponentWidth);
    dfDateofValuation.setWidth("150px");
    tfValuatedBy.setWidth(strComponentWidth);
    dfVerifiedDate.setWidth("150px");
    tfVerifiedBy.setWidth(strComponentWidth);
    tfDynamicEvaluation1.setWidth(strComponentWidth);
    tfDynamicEvaluation2.setWidth(strComponentWidth);
    dfDateofValuation.addValidator(new DateValidation("Invalid date entered"));
    dfDateofValuation.setImmediate(true);
    dfVerifiedDate.addValidator(new DateValidation("Invalid date entered"));
    dfVerifiedDate.setImmediate(true);/*from   w w  w .j a  v a2  s. c o m*/

    dfDateofValuation.setResolution(PopupDateField.RESOLUTION_DAY);
    dfDateofValuation.setDateFormat("dd-MMM-yyyy");
    dfVerifiedDate.setResolution(PopupDateField.RESOLUTION_DAY);
    dfVerifiedDate.setDateFormat("dd-MMM-yyyy");
    dfSearchEvalDate.setResolution(PopupDateField.RESOLUTION_DAY);
    dfSearchEvalDate.setDateFormat("dd-MMM-yyyy");

    tfCustomerName.setWidth(strComponentWidth);
    slPropertyDesc.setWidth(strComponentWidth);
    tfCustomerAddr.setWidth(strComponentWidth);
    tfCustomerAddr.setHeight("150px");
    slPropertyDesc.setNullSelectionAllowed(false);

    // for matching boundary
    slMatchingBoundary.setWidth(strComponentWidth);
    slPlotDemarcated.setWidth(strComponentWidth);
    slApproveLandUse.setWidth(strComponentWidth);
    slTypeofProperty.setWidth(strComponentWidth);
    tfDynamicmatching1.setWidth(strComponentWidth);
    tfDynamicmatching2.setWidth(strComponentWidth);

    // no of rooms
    tfNoofRooms.setWidth(strComponentWidth);
    tfLivingDining.setWidth(strComponentWidth);
    tfBedRooms.setWidth(strComponentWidth);
    tfKitchen.setWidth(strComponentWidth);
    tfToilets.setWidth(strComponentWidth);
    tfDynamicRooms1.setWidth(strComponentWidth);
    tfDynamicRooms2.setWidth(strComponentWidth);

    // no of floors
    tfTotNoofFloors.setWidth(strComponentWidth);
    tfPropertyLocated.setWidth(strComponentWidth);
    tfApproxAgeofBuilding.setWidth(strComponentWidth);
    tfResidualAgeofBuilding.setWidth(strComponentWidth);
    slTypeofStructures.setWidth(strComponentWidth);
    tfDynamicFloors1.setWidth(strComponentWidth);
    tfDynamicFloors2.setWidth(strComponentWidth);

    // tenure / occupancy details
    tfStatusofTenure.setWidth(strComponentWidth);
    slOwnedorRent.setWidth(strComponentWidth);
    tfNoOfYears.setWidth(strComponentWidth);
    tfRelationship.setWidth(strComponentWidth);
    tfDynamicTenure1.setWidth(strComponentWidth);
    tfDynamicTenure2.setWidth(strComponentWidth);

    // for area details
    tfSiteArea.setWidth(strComponentWidth);
    tfSuperbuiltup.setWidth(strComponentWidth);
    tfCarpetArea.setWidth(strComponentWidth);
    tfSalableArea.setWidth(strComponentWidth);
    tfRemarks.setWidth(strComponentWidth);
    tfRemarks.setHeight("95px");
    tfDynamicAreaDetail1.setWidth(strComponentWidth);
    tfDynamicAreaDetail2.setWidth(strComponentWidth);

    // details of apartment
    slNatureofApartment.setWidth(strComponentWidth);
    tfNameofApartment.setWidth(strComponentWidth);
    tfPostalAddress.setWidth(strComponentWidth);
    tfApartmant.setWidth(strComponentWidth);
    tfFlatNumber.setWidth(strComponentWidth);
    tfSFNumber.setWidth(strComponentWidth);
    tfFloor.setWidth(strComponentWidth);
    tfVillageLoc.setWidth(strComponentWidth);
    tfTalukLoc.setWidth(strComponentWidth);
    tfDisrictLoc.setWidth(strComponentWidth);
    slDescriptionofLocality.setWidth(strComponentWidth);
    tfNoofFloors.setWidth(strComponentWidth);
    slTypeofStructure.setWidth(strComponentWidth);
    tfNumberofFlats.setWidth(strComponentWidth);
    tfDynamicApartment1.setWidth(strComponentWidth);
    tfDynamicApartment2.setWidth(strComponentWidth);

    // for flat valuation
    tfFlatisSituated.setWidth(strComponentWidth);
    tfDynamicFlatValuation1.setWidth(strComponentWidth);
    tfDynamicFlatValuation2.setWidth(strComponentWidth);

    // for details of plan approval
    tfLandandBuilding.setHeight("25");
    slLandandBuilding.setHeight("25");
    slBuilding.setHeight("25");
    tfBuilding.setHeight("25");
    tfLandandBuilding.setWidth(strComponentWidth);
    slLandandBuilding.setWidth(strComponentWidth);
    slBuilding.setWidth(strComponentWidth);
    tfBuilding.setWidth(strComponentWidth);
    tfPlanApprovedBy.setWidth(strComponentWidth);
    dfLicenseFrom.setWidth(strComponentWidth);
    tfDynamicPlanApproval1.setWidth(strComponentWidth);
    slIsLicenceForced.setWidth(strComponentWidth);
    slAllApprovalRecved.setWidth(strComponentWidth);
    slConstAsperAppPlan.setWidth(strComponentWidth);
    tfDynamicPlanApproval2.setWidth(strComponentWidth);

    // for land valuation
    tfUndividedShare.setWidth(strComponentWidth);
    tfSuperBuiltupArea.setWidth(strComponentWidth);
    tfCostofApartment.setWidth(strComponentWidth);
    tfRateofApartment.setWidth(strComponentWidth);
    slIsRateReasonable.setWidth(strComponentWidth);
    tfStageOfConstruction.setWidth(strComponentWidth);
    tfCostOfConstAsAtSite.setWidth(strComponentWidth);
    tfCostOfConstAsPerAgree.setWidth(strComponentWidth);
    tfDynamicConstValuation1.setWidth(strComponentWidth);
    tfDynamicConstValuation2.setWidth(strComponentWidth);

    tfLandMark.setWidth(strComponentWidth);
    tfPropertyAddress.setWidth(strComponentWidth);
    tfPropertyAddress.setHeight("130px");
    tfDynamicAsset1.setWidth(strComponentWidth);
    tfDynamicAsset2.setWidth(strComponentWidth);

    //for Null representation
    tfSearchBankBranch.setNullSelectionAllowed(false);
    //tfSearchBankBranch.setInputPrompt(Common.SELECT_PROMPT);
    tfSearchCustomer.setInputPrompt("Enter Customer");
    tfSearchEvalNumber.setInputPrompt("Enter Evaluation Number");

    tfEvaluationNumber.setNullRepresentation("");
    slBankBranch.setNullSelectionAllowed(false);
    tfEvaluationPurpose.setNullRepresentation("");
    tfValuatedBy.setNullRepresentation("");
    tfVerifiedBy.setNullRepresentation("");
    tfDynamicEvaluation1.setNullRepresentation("");
    tfDynamicEvaluation2.setNullRepresentation("");

    tfCustomerName.setNullRepresentation("");
    slPropertyDesc.setNullSelectionAllowed(false);
    tfCustomerAddr.setNullRepresentation("");
    tfCustomerAddr.setHeight("130px");
    slPropertyDesc.setNullSelectionAllowed(false);

    // for matching boundary
    slMatchingBoundary.setNullSelectionAllowed(false);
    slPlotDemarcated.setNullSelectionAllowed(false);
    slApproveLandUse.setNullSelectionAllowed(false);
    slTypeofProperty.setNullSelectionAllowed(false);
    tfDynamicmatching1.setNullRepresentation("");
    tfDynamicmatching2.setNullRepresentation("");

    // no of rooms
    tfNoofRooms.setNullRepresentation("");
    tfLivingDining.setNullRepresentation("");
    tfBedRooms.setNullRepresentation("");
    tfKitchen.setNullRepresentation("");
    tfToilets.setNullRepresentation("");
    tfDynamicRooms1.setNullRepresentation("");
    tfDynamicRooms2.setNullRepresentation("");

    // no of floors
    tfTotNoofFloors.setNullRepresentation("");
    tfPropertyLocated.setNullRepresentation("");
    tfApproxAgeofBuilding.setNullRepresentation("");
    tfResidualAgeofBuilding.setNullRepresentation("");
    slTypeofStructures.setNullSelectionAllowed(false);
    tfDynamicFloors1.setNullRepresentation("");
    tfDynamicFloors2.setNullRepresentation("");

    // tenure / occupancy details
    tfStatusofTenure.setNullRepresentation("");
    slOwnedorRent.setNullSelectionAllowed(false);
    tfNoOfYears.setNullRepresentation("");
    tfRelationship.setNullRepresentation("");
    tfDynamicTenure1.setNullRepresentation("");
    tfDynamicTenure2.setNullRepresentation("");

    // for area details
    tfSiteArea.setNullRepresentation("");
    tfSuperbuiltup.setNullRepresentation("");
    tfCarpetArea.setNullRepresentation("");
    tfSalableArea.setNullRepresentation("");
    tfRemarks.setNullRepresentation("");
    tfDynamicAreaDetail1.setNullRepresentation("");
    tfDynamicAreaDetail2.setNullRepresentation("");

    // details of apartment
    slNatureofApartment.setNullSelectionAllowed(false);
    tfNameofApartment.setNullRepresentation("");
    tfPostalAddress.setNullRepresentation("");
    tfApartmant.setNullRepresentation("");
    tfFlatNumber.setNullRepresentation("");
    tfSFNumber.setNullRepresentation("");
    tfFloor.setNullRepresentation("");
    tfVillageLoc.setNullRepresentation("");
    tfTalukLoc.setNullRepresentation("");
    tfDisrictLoc.setNullRepresentation("");
    slDescriptionofLocality.setNullSelectionAllowed(false);
    tfNoofFloors.setNullRepresentation("");
    slTypeofStructure.setNullSelectionAllowed(false);
    tfNumberofFlats.setNullRepresentation("");
    tfDynamicApartment1.setNullRepresentation("");
    tfDynamicApartment2.setNullRepresentation("");

    // for flat valuation
    tfFlatisSituated.setNullRepresentation("");
    tfDynamicFlatValuation1.setNullRepresentation("");
    tfDynamicFlatValuation2.setNullRepresentation("");

    // for details of plan approval
    tfLandandBuilding.setNullRepresentation("");
    tfBuilding.setNullRepresentation("");
    slLandandBuilding.setNullSelectionAllowed(false);
    slBuilding.setNullSelectionAllowed(false);
    tfPlanApprovedBy.setNullRepresentation("");
    tfDynamicPlanApproval1.setNullRepresentation("");
    slIsLicenceForced.setNullSelectionAllowed(false);
    slAllApprovalRecved.setNullSelectionAllowed(false);
    slConstAsperAppPlan.setNullSelectionAllowed(false);
    tfDynamicPlanApproval2.setNullRepresentation("");
    dfLicenseFrom.setNullRepresentation("");

    // for land valuation
    tfUndividedShare.setNullRepresentation("");
    tfSuperBuiltupArea.setNullRepresentation("");
    tfCostofApartment.setNullRepresentation("");
    tfRateofApartment.setNullRepresentation("");
    slIsRateReasonable.setNullSelectionAllowed(false);
    tfStageOfConstruction.setNullRepresentation("");
    tfCostOfConstAsAtSite.setNullRepresentation("");
    tfCostOfConstAsPerAgree.setNullRepresentation("");
    tfDynamicConstValuation1.setNullRepresentation("");
    tfDynamicConstValuation2.setNullRepresentation("");

    tfLandMark.setNullRepresentation("");
    tfPropertyAddress.setNullRepresentation("");
    tfPropertyAddress.setHeight("130px");
    tfDynamicAsset1.setNullRepresentation("");
    tfDynamicAsset2.setNullRepresentation("");

    // for dynamic
    btnDynamicEvaluation1.setIcon(new ThemeResource(Common.strAddIcon));
    btnDynamicEvaluation1.setStyleName(Runo.BUTTON_LINK);
    btnAddOwner.setIcon(new ThemeResource(Common.strAddIcon));
    btnAddOwner.setStyleName(Runo.BUTTON_LINK);
    btnDynamicAsset.setIcon(new ThemeResource(Common.strAddIcon));
    btnDynamicAsset.setStyleName(Runo.BUTTON_LINK);
    btnAddLegalDoc.setIcon(new ThemeResource(Common.strAddIcon));
    btnAddNorDoc.setIcon(new ThemeResource(Common.strAddIcon));
    btnAddNorDoc.setStyleName(Runo.BUTTON_LINK);
    btnAddLegalDoc.setStyleName(Runo.BUTTON_LINK);
    btnAddAdjoinProperty.setIcon(new ThemeResource(Common.strAddIcon));
    btnAddAdjoinProperty.setStyleName(Runo.BUTTON_LINK);
    btnAddDimension.setIcon(new ThemeResource(Common.strAddIcon));
    btnAddDimension.setStyleName(Runo.BUTTON_LINK);
    btnDynamicRooms.setIcon(new ThemeResource(Common.strAddIcon));
    btnDynamicRooms.setStyleName(Runo.BUTTON_LINK);
    btnDynamicFloor.setIcon(new ThemeResource(Common.strAddIcon));
    btnDynamicFloor.setStyleName(Runo.BUTTON_LINK);
    btnDynamicTenure.setIcon(new ThemeResource(Common.strAddIcon));
    btnDynamicTenure.setStyleName(Runo.BUTTON_LINK);
    btnDynamicmatching.setIcon(new ThemeResource(Common.strAddIcon));
    btnDynamicmatching.setStyleName(Runo.BUTTON_LINK);
    btnDynamicAreaDetail.setIcon(new ThemeResource(Common.strAddIcon));
    btnDynamicAreaDetail.setStyleName(Runo.BUTTON_LINK);
    btnDynamicConstValuation.setIcon(new ThemeResource(Common.strAddIcon));
    btnDynamicConstValuation.setStyleName(Runo.BUTTON_LINK);
    btnDynamicApartment.setIcon(new ThemeResource(Common.strAddIcon));
    btnDynamicApartment.setStyleName(Runo.BUTTON_LINK);

    btnDynamicFlatValuation.setIcon(new ThemeResource(Common.strAddIcon));
    btnDynamicFlatValuation.setStyleName(Runo.BUTTON_LINK);
    btnDynamicPlanApproval.setIcon(new ThemeResource(Common.strAddIcon));
    btnDynamicPlanApproval.setStyleName(Runo.BUTTON_LINK);
    btnAddBuildSpec.setStyleName(Runo.BUTTON_LINK);
    btnAddBuildSpec.setIcon(new ThemeResource(Common.strAddIcon));

    tfStatusofTenure.setValue(Common.strNA);
    tfRelationship.setValue(Common.strNA);
    tfSuperbuiltup.setValue(Common.strNil);
    tfCarpetArea.setValue(Common.strNil);
    tfRemarks.setValue(Common.strNil);

}

From source file:com.gnts.pem.txn.synd.SyndFlat.java

License:Open Source License

public void buttonClick(ClickEvent event) {
    notifications.close();//from  ww w .  j a  v  a 2  s. co m
    if (btnAddNorDoc == event.getButton()) {

        panelNormalDocumentDetails.addComponent(new ComponentIteratorNormlDoc(null, null, "", ""));
    }

    if (btnAddLegalDoc == event.getButton()) {

        panelLegalDocumentDetails.addComponent(new ComponentIteratorLegalDoc("", "", null));
    }
    if (btnAddOwner == event.getButton()) {

        layoutOwnerDetails1.addComponent(new ComponentIterOwnerDetails("", ""));
    }

    if (btnAddAdjoinProperty == event.getButton()) {
        panelAdjoinProperties.addComponent(new ComponentIteratorAdjoinProperty(null, true, true, true));
    }

    if (btnAddDimension == event.getButton()) {

        panelDimension.addComponent(new ComponentIterDimensionofPlot(null, true, true, true));
    }
    if (btnAddBuildSpec == event.getButton()) {
        panelBuildSpecfication.addComponent(new ComponentIterBuildingSpecfication(null, true, true, true));
    }

    if (btnAdd == event.getButton()) {
        btnSave.setVisible(true);
        btnCancel.setVisible(true);
        btnSubmit.setVisible(true);
        tablePanel.setVisible(false);
        searchPanel.setVisible(false);
        mainPanel.setVisible(true);
        headerid = beanEvaluation.getNextSequnceId("seq_pem_evaldtls_docid");
        resetAllFieldsFields();
        lblAddEdit.setValue(" > Add New");
        lblAddEdit.setVisible(true);
        lblFormTittle.setVisible(false);
        hlBreadCrumbs.setVisible(true);
        hlFileDownloadLayout.removeAllComponents();
        hlFileDownloadLayout.addComponent(btnDownload);
        getExportTableDetails();

    }

    if (btnEdit == event.getButton()) {
        btnSave.setVisible(true);
        btnCancel.setVisible(true);
        btnSubmit.setVisible(true);
        tablePanel.setVisible(false);
        searchPanel.setVisible(false);
        mainPanel.setVisible(true);
        resetAllFieldsFields();
        editDetails();
        lblAddEdit.setValue(" > Modify");
        lblAddEdit.setVisible(true);
        lblFormTittle.setVisible(false);
        hlBreadCrumbs.setVisible(true);

    }
    if (btnDynamicEvaluation1 == event.getButton()) {

        strSelectedPanel = "1";
        showSubWindow();

    }

    if (btnDynamicAsset == event.getButton()) {
        strSelectedPanel = "3";
        showSubWindow();

    }

    if (btnDynamicTenure == event.getButton()) {
        strSelectedPanel = "4";
        showSubWindow();

    }

    if (btnDynamicmatching == event.getButton()) {
        strSelectedPanel = "5";
        showSubWindow();

    }
    if (btnDynamicRooms == event.getButton()) {
        strSelectedPanel = "6";
        showSubWindow();

    }
    if (btnDynamicFloor == event.getButton()) {
        strSelectedPanel = "7";
        showSubWindow();

    }

    if (btnDynamicAreaDetail == event.getButton()) {
        strSelectedPanel = "8";
        showSubWindow();

    }
    if (btnDynamicApartment == event.getButton()) {
        strSelectedPanel = "9";
        showSubWindow();

    }
    if (btnDynamicFlatValuation == event.getButton()) {
        strSelectedPanel = "10";
        showSubWindow();

    }
    if (btnDynamicPlanApproval == event.getButton()) {
        strSelectedPanel = "11";
        showSubWindow();

    }
    if (btnDynamicConstValuation == event.getButton()) {
        strSelectedPanel = "12";
        showSubWindow();

    }

    if (myButton == event.getButton()) {

        if (tfCaption.getValue() != null && tfCaption.getValue().trim().length() > 0) {

            if (strSelectedPanel.equals("1")) {
                if (tfDynamicEvaluation1.isVisible()) {
                    tfDynamicEvaluation2.setCaption(tfCaption.getValue());
                    tfDynamicEvaluation2.setVisible(true);
                } else {
                    tfDynamicEvaluation1.setCaption(tfCaption.getValue());
                    tfDynamicEvaluation1.setVisible(true);
                }
            } else if (strSelectedPanel.equals("3")) {
                if (tfDynamicAsset1.isVisible()) {
                    tfDynamicAsset2.setCaption(tfCaption.getValue());
                    tfDynamicAsset2.setVisible(true);
                } else {
                    tfDynamicAsset1.setCaption(tfCaption.getValue());
                    tfDynamicAsset1.setVisible(true);
                }
            } else if (strSelectedPanel.equals("4")) {
                if (tfDynamicTenure1.isVisible()) {
                    tfDynamicTenure2.setCaption(tfCaption.getValue());
                    tfDynamicTenure2.setVisible(true);
                } else {
                    tfDynamicTenure1.setCaption(tfCaption.getValue());
                    tfDynamicTenure1.setVisible(true);
                }
            } else if (strSelectedPanel.equals("5")) {
                if (tfDynamicmatching1.isVisible()) {
                    tfDynamicmatching2.setCaption(tfCaption.getValue());
                    tfDynamicmatching2.setVisible(true);
                } else {
                    tfDynamicmatching1.setCaption(tfCaption.getValue());
                    tfDynamicmatching1.setVisible(true);
                }
            } else if (strSelectedPanel.equals("6")) {
                if (tfDynamicRooms1.isVisible()) {
                    tfDynamicRooms2.setCaption(tfCaption.getValue());
                    tfDynamicRooms2.setVisible(true);
                } else {
                    tfDynamicRooms1.setCaption(tfCaption.getValue());
                    tfDynamicRooms1.setVisible(true);
                }
            } else if (strSelectedPanel.equals("7")) {
                if (tfDynamicFloors1.isVisible()) {
                    tfDynamicFloors2.setCaption(tfCaption.getValue());
                    tfDynamicFloors2.setVisible(true);
                } else {
                    tfDynamicFloors1.setCaption(tfCaption.getValue());
                    tfDynamicFloors1.setVisible(true);
                }
            } else if (strSelectedPanel.equals("8")) {
                if (tfDynamicAreaDetail1.isVisible()) {
                    tfDynamicAreaDetail2.setCaption(tfCaption.getValue());
                    tfDynamicAreaDetail2.setVisible(true);
                } else {
                    tfDynamicAreaDetail1.setCaption(tfCaption.getValue());
                    tfDynamicAreaDetail1.setVisible(true);
                }
            } else if (strSelectedPanel.equals("9")) {
                if (tfDynamicApartment1.isVisible()) {
                    tfDynamicApartment2.setCaption(tfCaption.getValue());
                    tfDynamicApartment2.setVisible(true);
                } else {
                    tfDynamicApartment1.setCaption(tfCaption.getValue());
                    tfDynamicApartment1.setVisible(true);
                }
            } else if (strSelectedPanel.equals("10")) {
                if (tfDynamicFlatValuation1.isVisible()) {
                    tfDynamicFlatValuation2.setCaption(tfCaption.getValue());
                    tfDynamicFlatValuation2.setVisible(true);
                } else {
                    tfDynamicFlatValuation1.setCaption(tfCaption.getValue());
                    tfDynamicFlatValuation1.setVisible(true);
                }
            } else if (strSelectedPanel.equals("11")) {
                if (tfDynamicPlanApproval1.isVisible()) {
                    tfDynamicPlanApproval2.setCaption(tfCaption.getValue());
                    tfDynamicPlanApproval2.setVisible(true);
                } else {
                    tfDynamicPlanApproval1.setCaption(tfCaption.getValue());
                    tfDynamicPlanApproval1.setVisible(true);
                }
            } else if (strSelectedPanel.equals("12")) {
                if (tfDynamicConstValuation1.isVisible()) {
                    tfDynamicConstValuation2.setCaption(tfCaption.getValue());
                    tfDynamicConstValuation2.setVisible(true);
                } else {
                    tfDynamicConstValuation1.setCaption(tfCaption.getValue());
                    tfDynamicConstValuation1.setVisible(true);
                }
            }

        }
        mywindow.close();
    }

    if (btnSave == event.getButton()) {
        setComponentError();
        if (tfEvaluationNumber.isValid() && slBankBranch.isValid() && tfEvaluationPurpose.isValid()
                && dfDateofValuation.isValid()) {

            saveEvaluationDetails();
        }
        //btnSave.setVisible(false);
    }
    if (btnSubmit == event.getButton()) {
        setComponentError();
        if (tfEvaluationNumber.isValid() && slBankBranch.isValid() && tfEvaluationPurpose.isValid()
                && dfDateofValuation.isValid()) {
            saveEvaluationDetails();
            updateEvaluationDetails();
            btnSubmit.setEnabled(false);
            btnSave.setEnabled(false);
        }
        //   saveExcel.setVisible(true);

    }
    if (btnCancel == event.getButton()) {
        resetFields();
        btnSave.setVisible(false);
        btnCancel.setVisible(false);
        btnSubmit.setVisible(false);
        btnSave.setEnabled(true);
        btnSubmit.setEnabled(true);
        //saveExcel.setVisible(false);
        tablePanel.setVisible(true);
        searchPanel.setVisible(true);
        mainPanel.setVisible(false);
        btnEdit.setEnabled(false);
        btnAdd.setEnabled(true);
        populateAndConfig(false);
        lblFormTittle.setValue("&nbsp;&nbsp;<b>" + screenName + "</b>&nbsp;::&nbsp;Search");
        lblNotificationIcon.setIcon(null);
        lblSaveNotification.setValue("");
        lblFormTittle.setVisible(true);
        hlBreadCrumbs.setVisible(false);
        lblAddEdit.setVisible(false);
        btnView.setEnabled(false);
        hlFileDownloadLayout.removeAllComponents();
        hlFileDownloadLayout.addComponent(btnDownload);
        getExportTableDetails();
    }
    if (btnSearch == event.getButton()) {
        populateAndConfig(true);
        if (total == 0) {
            lblNotificationIcon.setIcon(new ThemeResource("img/msg_info.png"));
            lblSaveNotification.setValue("No Records found");
        } else {
            lblNotificationIcon.setIcon(null);
            lblSaveNotification.setValue("");
        }
        hlFileDownloadLayout.removeAllComponents();
        hlFileDownloadLayout.addComponent(btnDownload);
        getExportTableDetails();
    }
    if (btnReset == event.getButton()) {
        tfSearchEvalNumber.setValue("");
        tfSearchCustomer.setValue("");
        dfSearchEvalDate.setValue(null);
        tfSearchBankBranch.setValue(null);
        lblNotificationIcon.setIcon(null);
        lblSaveNotification.setValue("");
        populateAndConfig(false);
    } else if (btnBack == event.getButton()) {
        resetFields();
        btnSave.setVisible(false);
        btnCancel.setVisible(false);
        btnSubmit.setVisible(false);
        //saveExcel.setVisible(false);
        tablePanel.setVisible(true);
        searchPanel.setVisible(true);
        mainPanel.setVisible(false);
        btnEdit.setEnabled(false);
        btnAdd.setEnabled(true);
        populateAndConfig(false);
        lblFormTittle.setValue("&nbsp;&nbsp;<b>" + screenName + "</b>&nbsp;::&nbsp;Search");
        lblNotificationIcon.setIcon(null);
        lblSaveNotification.setValue("");
        lblFormTittle.setVisible(true);
        hlBreadCrumbs.setVisible(false);
        lblAddEdit.setVisible(false);
        btnView.setEnabled(false);

    }
    /* else if (btnView == event.getButton()) {
            
    StreamResource sr = getPDFStream();
    FileDownloader fileDownloader = new FileDownloader(sr);
    fileDownloader.extend(btnView);
            
       }*/
    else if (btnDownload == event.getButton()) {

        event.getButton().removeStyleName("unread");

        if (notifications != null && notifications.getUI() != null)
            notifications.close();
        else {
            buildNotifications(event);
            UI.getCurrent().addWindow(notifications);
            notifications.focus();
            ((VerticalLayout) UI.getCurrent().getContent()).addLayoutClickListener(new LayoutClickListener() {
                @Override
                public void layoutClick(LayoutClickEvent event) {
                    notifications.close();
                    ((VerticalLayout) UI.getCurrent().getContent()).removeLayoutClickListener(this);
                }
            });
        }
    }

}

From source file:com.hack23.cia.web.impl.ui.application.views.common.AbstractView.java

License:Apache License

/**
 * Creates the basic layout with panel and footer.
 *
 * @param panelName// w w  w .j  av  a 2s.  c o m
 *            the panel name
 */
protected final void createBasicLayoutWithPanelAndFooter(final String panelName) {
    final VerticalLayout layout = new VerticalLayout();
    layout.setMargin(true);
    layout.setSpacing(true);
    layout.setWidth(100, Unit.PERCENTAGE);
    layout.setHeight(100, Unit.PERCENTAGE);

    final VerticalLayout pageModeContent = new VerticalLayout();
    pageModeContent.setMargin(true);
    pageModeContent.setSpacing(true);
    pageModeContent.setWidth(100, Unit.PERCENTAGE);
    pageModeContent.setHeight(100, Unit.PERCENTAGE);

    layout.addComponent(pageModeContent);

    final ThemeResource ciaLogoResource = new ThemeResource("cia-logo.png");

    final Image ciaLogoImage = new Image(null, ciaLogoResource);

    final HorizontalLayout topHeader = new HorizontalLayout();

    topHeader.addComponent(ciaLogoImage);
    ciaLogoImage.setWidth("75px");
    ciaLogoImage.setHeight("75px");
    topHeader.setComponentAlignment(ciaLogoImage, Alignment.MIDDLE_LEFT);
    topHeader.setExpandRatio(ciaLogoImage, ContentRatio.SMALL);

    final HorizontalLayout topTitleHeadertPanel = new HorizontalLayout();

    final Label titleLabel = new Label("Citizen Intelligence Agency");
    titleLabel.setStyleName("Header");
    topTitleHeadertPanel.addComponent(titleLabel);
    topTitleHeadertPanel.setComponentAlignment(titleLabel, Alignment.MIDDLE_LEFT);

    final Label sloganLabel = new Label("// Tracking politicians like bugs!");
    sloganLabel.setStyleName("HeaderSlogan");
    topTitleHeadertPanel.addComponent(sloganLabel);
    topTitleHeadertPanel.setComponentAlignment(sloganLabel, Alignment.MIDDLE_RIGHT);

    topHeader.addComponent(topTitleHeadertPanel);
    topHeader.setComponentAlignment(topTitleHeadertPanel, Alignment.MIDDLE_LEFT);
    topHeader.setExpandRatio(topTitleHeadertPanel, ContentRatio.GRID);

    topHeaderRightPanel.removeAllComponents();
    topHeader.addComponent(topHeaderRightPanel);
    topHeader.setComponentAlignment(topHeaderRightPanel, Alignment.MIDDLE_RIGHT);
    topHeader.setExpandRatio(topHeaderRightPanel, ContentRatio.LARGE);

    if (UserContextUtil.allowRoleInSecurityContext(ROLE_ADMIN)
            || UserContextUtil.allowRoleInSecurityContext(ROLE_USER)) {

        final Link userHomePageLink = pageLinkFactory.createUserHomeViewPageLink();
        topHeaderRightPanel.addComponent(userHomePageLink);
        topHeaderRightPanel.setComponentAlignment(userHomePageLink, Alignment.MIDDLE_RIGHT);

        final Button logoutButton = new Button(LOGOUT, FontAwesome.SIGN_OUT);

        final LogoutRequest logoutRequest = new LogoutRequest();
        logoutRequest.setSessionId(RequestContextHolder.currentRequestAttributes().getSessionId());
        logoutButton.addClickListener(new LogoutClickListener(logoutRequest, applicationManager));

        topHeaderRightPanel.addComponent(logoutButton);
        topHeaderRightPanel.setComponentAlignment(logoutButton, Alignment.MIDDLE_RIGHT);

    } else {
        final Link createRegisterPageLink = pageLinkFactory.createRegisterPageLink();
        topHeaderRightPanel.addComponent(createRegisterPageLink);
        topHeaderRightPanel.setComponentAlignment(createRegisterPageLink, Alignment.MIDDLE_RIGHT);

        final Link createLoginPageLink = pageLinkFactory.createLoginPageLink();
        topHeaderRightPanel.addComponent(createLoginPageLink);
        topHeaderRightPanel.setComponentAlignment(createLoginPageLink, Alignment.MIDDLE_RIGHT);
    }

    topHeaderRightPanel.setWidth("100%");
    topHeaderRightPanel.setHeight("60px");

    topHeader.setWidth("100%");
    topHeader.setHeight("60px");

    pageModeContent.addComponent(topHeader);
    pageModeContent.setComponentAlignment(topHeader, Alignment.TOP_CENTER);

    pageModeContent.addComponent(getBarmenu());
    pageModeContent.setComponentAlignment(getBarmenu(), Alignment.TOP_CENTER);

    panel = new Panel(panelName);

    panel.setSizeFull();
    pageModeContent.addComponent(panel);
    pageModeContent.setExpandRatio(panel, ContentRatio.FULL_SIZE);

    pageModeContent.addComponent(pageLinkFactory.createMainViewPageLink());
    setContent(layout);

    setWidth(100, Unit.PERCENTAGE);
    setHeight(100, Unit.PERCENTAGE);
    setSizeFull();

}

From source file:com.hybridbpm.ui.component.access.UserLayout.java

License:Apache License

public UserLayout(User user) {
    Design.read(this);
    if (user == null) {
        user = new User();
        user.setLocale(HybridbpmUI.getCurrent().getLocale().toString());
    }//from  w ww . j a  va  2 s . c om
    binder.setItemDataSource(user);
    binder.bind(username, "username");
    binder.bind(firstName, "firstName");
    binder.bind(lastName, "lastName");
    binder.bind(email, "email");
    binder.bind(manager, "manager");
    binder.bind(userLocale, "locale");
    binder.bind(firstVisibleHourOfDay, "firstVisibleHourOfDay");
    binder.bind(lastVisibleHourOfDay, "lastVisibleHourOfDay");
    binder.setBuffered(true);

    if (user.getId() != null) {
        username.setReadOnly(true);
    }
    if (user.getImage() != null) {
        image = user.getImage().toStream();
        StreamResource.StreamSource imagesource = new UserImageSource(image);
        StreamResource resource = new StreamResource(imagesource, UUID.randomUUID().toString());
        userImage.setSource(resource);
    } else {
        userImage.setSource(new ThemeResource("img/profile-pic-300px.jpg"));
    }
    imageUpload.setImmediate(true);
    imageUpload.addSucceededListener(imageUploader);
    imageUpload.setReceiver(imageUploader);
    //        password1.addValueChangeListener(new PasswordChangeListener());
    password1.setImmediate(true);
    password2.setImmediate(true);
    //        password2.addValueChangeListener(new PasswordChangeListener());

    manager.addContainerProperty(NAME, String.class, null);
    manager.setItemCaptionMode(AbstractSelect.ItemCaptionMode.PROPERTY);
    manager.setItemCaptionPropertyId(NAME);
    for (User u : HybridbpmUI.getAccessAPI().getAllUsers()) {
        Item item = manager.addItem(u);
        item.getItemProperty(NAME).setValue(u.getFullName() + " (" + u.getEmail() + ")");
    }
    for (Locale l : Locale.getAvailableLocales()) {
        Item item = userLocale.addItem(l.toString());
        userLocale.setItemCaptionMode(AbstractSelect.ItemCaptionMode.EXPLICIT);
        userLocale.setItemCaption(l.toString(), l.getDisplayName());
    }

    if (HybridbpmUI.getAccessAPI().isAdministrator()) {
        readOnly = false;
        errorLabel.setVisible(false);
        manager.setEnabled(true);
    } else if (Objects.equals(user.getUsername(), HybridbpmUI.getUser().getUsername())) {
        readOnly = false;
        errorLabel.setVisible(false);
        manager.setEnabled(false);
        manager.setReadOnly(true);
    } else {
        readOnly = true;
        password1.setVisible(false);
        password2.setVisible(false);
        imageUpload.setVisible(false);
        errorLabel.setVisible(false);
        manager.setEnabled(false);
        manager.setReadOnly(true);
    }
}

From source file:com.hybridbpm.ui.component.bpm.TaskFormHeader.java

License:Apache License

public void setUserImage() {
    User user = HybridbpmUI.getUser();//from   w  w w .j av  a 2 s. c  o m
    if (user.getImage() != null) {
        StreamResource.StreamSource imagesource = new UserImageSource(user.getImage().toStream());
        StreamResource resource = new StreamResource(imagesource, UUID.randomUUID().toString());
        userImage.setSource(resource);
    } else {
        userImage.setSource(new ThemeResource("img/profile-pic-300px.jpg"));
    }
}

From source file:com.hybridbpm.ui.component.comment.CommentViewLayout.java

License:Apache License

public void setUserImage() {
    User user = HybridbpmUI.getAccessAPI().getUserById(comment.getCreator());
    if (user.getImage() != null) {
        StreamResource.StreamSource imagesource = new UserImageSource(user.getImage().toStream());
        StreamResource resource = new StreamResource(imagesource, UUID.randomUUID().toString());
        userImage.setSource(resource);//from  w  ww.j  ava2s  . co  m
    } else {
        userImage.setSource(new ThemeResource("img/profile-pic-300px.jpg"));
    }
    senderUsername.setCaption("@" + user.getUsername());
    senderName.setValue(user.getFullName());
}

From source file:com.hybridbpm.ui.MainMenu.java

License:Apache License

public void setUserImage() {
    User user = HybridbpmUI.getUser();//from  ww  w  .ja  va  2 s  .  co m
    settingsItem.setText(user.getUsername());
    if (user.getImage() != null) {
        StreamResource.StreamSource imagesource = new UserImageSource(user.getImage().toStream());
        StreamResource resource = new StreamResource(imagesource, UUID.randomUUID().toString());
        userImage.setSource(resource);
    } else {
        userImage.setSource(new ThemeResource("img/profile-pic-300px.jpg"));
    }
}

From source file:com.jain.addon.action.ActionButtonGroup.java

License:Apache License

private void findNAddIcon(JNAction action, Button actionButton) {
    if (StringHelper.isNotEmptyWithTrim(action.icon())) {
        String iconPath = PropertyReader.instance().getProperty(action.icon());

        if (StringHelper.isNotEmptyWithTrim(iconPath)) {
            ThemeResource icon = new ThemeResource(iconPath);
            actionButton.setIcon(icon);//from ww w . j  a  v a2 s  .c  o  m
        }
    }
}

From source file:com.jain.addon.action.ActionMenuBar.java

License:Apache License

private void findNAddIcon(String actionIcon, MenuItem action) {
    if (StringHelper.isNotEmptyWithTrim(actionIcon)) {
        String iconPath = PropertyReader.instance().getProperty(actionIcon);

        if (StringHelper.isNotEmptyWithTrim(iconPath)) {
            ThemeResource icon = new ThemeResource(iconPath);
            action.setIcon(icon);/* w  ww.  ja v  a 2  s  .c o  m*/
        }
    }
}

From source file:com.jain.addon.action.confirm.ConfirmWindow.java

License:Apache License

/**
 * /*from   w w  w  . ja v a2  s . c  o m*/
 * @param confirm
 * @param layout
 */
private void findNAddIcon(JNConfirm confirm, HorizontalLayout layout) {
    if (StringHelper.isNotEmptyWithTrim(confirm.icon())) {
        String iconPath = PropertyReader.instance().getProperty(confirm.icon());

        if (StringHelper.isNotEmptyWithTrim(iconPath)) {
            Label label = new Label();
            ThemeResource icon = new ThemeResource(iconPath);
            label.setIcon(icon);
            layout.addComponent(label);
            layout.setComponentAlignment(label, Alignment.MIDDLE_CENTER);
        }
    }
}