Package org.zkoss.poi.hssf.usermodel

Examples of org.zkoss.poi.hssf.usermodel.HSSFDataValidation


      if (r instanceof DVRecord) {
        final DVRecord dvRecord = (DVRecord) r;
        final CellRangeAddressList regions = dvRecord.getCellRangeAddress();
        final DataValidationConstraint constraint = createContraint(dvRecord);
        if (constraint != null) {
          HSSFDataValidation dataValidation = new HSSFDataValidation(regions, constraint);
          final boolean allowed = dvRecord.getEmptyCellAllowed();
          final int errStyle = dvRecord.getErrorStyle();
          final boolean showErr = dvRecord.getShowErrorOnInvalidValue();
          final boolean showPrompt = dvRecord.getShowPromptOnCellSelected();
          final boolean suppress = dvRecord.getSuppressDropdownArrow();
         
          final String promptTitle = dvRecord.getPromptTitle();
          final String promptText = dvRecord.getPromptText();
          final String errorTitle = dvRecord.getErrorTitle();
          final String errorText = dvRecord.getErrorText();
          if (showPrompt) {
            dataValidation.createPromptBox(promptTitle, promptText);
          }
          if (showErr) {
            dataValidation.createErrorBox(errorTitle, errorText);
          }
          dataValidation.setEmptyCellAllowed(allowed);
          dataValidation.setErrorStyle(errStyle);
          dataValidation.setShowErrorBox(showErr);
          dataValidation.setShowPromptBox(showPrompt);
          dataValidation.setSuppressDropDownArrow(suppress);
         
          _dataValidations.add(dataValidation);
        }
      }
    }
View Full Code Here

TOP

Related Classes of org.zkoss.poi.hssf.usermodel.HSSFDataValidation

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.