Package jxl.biff

Examples of jxl.biff.DisplayFormat


      cfRight.setAlignment(Alignment.RIGHT);
     
      WritableCellFormat cfRightBold = new WritableCellFormat(wfBold);
      cfRightBold.setAlignment(Alignment.RIGHT);
     
      DisplayFormat df = new NumberFormat("###,##0.00");
      WritableCellFormat cfNumber = new WritableCellFormat(wfNormal, df);
      cfNumber.setAlignment(Alignment.RIGHT);
     
      WritableCellFormat cfNumberBold = new WritableCellFormat(wfBold, df);
      cfNumberBold.setAlignment(Alignment.RIGHT);
     
      DisplayFormat df_ = new NumberFormat("########0");
      WritableCellFormat cfIntNumber = new WritableCellFormat(wfNormal, df_);
      cfIntNumber.setAlignment(Alignment.RIGHT);
     
      WritableCellFormat cfIntRightBold = new WritableCellFormat(wfBold, df_);
      cfIntRightBold.setAlignment(Alignment.RIGHT);
View Full Code Here


         {
            cellFormat = new WritableCellFormat(NumberFormats.DEFAULT);
         }
         else
         {
            DisplayFormat displayFormat = JXLFactory.createNumberFormat(cellStyle.formatMask);
            if (displayFormat != null)
            {
               cellFormat = new WritableCellFormat(displayFormat);
            }
            else
            {
               try
               {
                  cellFormat = new WritableCellFormat(new NumberFormat(cellStyle.formatMask));
               }
               catch (IllegalArgumentException e)
               {
                  throw new ExcelWorkbookException(Interpolator.instance().interpolate("Could not create number format for mask {0}", cellStyle.formatMask), e);
               }
            }
         }
         break;
      case date:
         /*
          * If there is no mask, creates a default date format cell If there is
          * a mask, tries to match it against a constant name If the constant
          * can't be created, creates a custom date format from the mask
          */

         if (cellStyle.formatMask == null)
         {
            cellFormat = new WritableCellFormat(DateFormats.DEFAULT);
         }
         else
         {
            DisplayFormat displayFormat = JXLFactory.createDateFormat(cellStyle.formatMask);
            if (displayFormat != null)
            {
               cellFormat = new WritableCellFormat(displayFormat);
            }
            else
View Full Code Here

   private DisplayFormat getGenericDisplayFormat(String formatMask) {
        if (formatMask == null)
        {
            return null;
        }
        DisplayFormat displayFormat = JXLFactory.createNumberFormat(formatMask);
        if (displayFormat != null)
        {
            return displayFormat;
        }
        displayFormat = JXLFactory.createDateFormat(formatMask);
View Full Code Here

         {
            cellFormat = new WritableCellFormat(NumberFormats.DEFAULT);
         }
         else
         {
            DisplayFormat displayFormat = JXLFactory.createNumberFormat(cellStyle.formatMask);
            if (displayFormat != null)
            {
               cellFormat = new WritableCellFormat(displayFormat);
            }
            else
            {
               try
               {
                  cellFormat = new WritableCellFormat(new NumberFormat(cellStyle.formatMask));
               }
               catch (IllegalArgumentException e)
               {
                  throw new ExcelWorkbookException(Interpolator.instance().interpolate("Could not create number format for mask {0}", cellStyle.formatMask), e);
               }
            }
         }
         break;
      case date:
         /*
          * If there is no mask, creates a default date format cell If there is
          * a mask, tries to match it against a constant name If the constant
          * can't be created, creates a custom date format from the mask
          */

         if (cellStyle.formatMask == null)
         {
            cellFormat = new WritableCellFormat(DateFormats.DEFAULT);
         }
         else
         {
            DisplayFormat displayFormat = JXLFactory.createDateFormat(cellStyle.formatMask);
            if (displayFormat != null)
            {
               cellFormat = new WritableCellFormat(displayFormat);
            }
            else
            {
               try
               {
                  cellFormat = new WritableCellFormat(new DateFormat(cellStyle.formatMask));
               }
               catch (IllegalArgumentException e)
               {
                  throw new ExcelWorkbookException(Interpolator.instance().interpolate("Could not create date format for mask {0}", cellStyle.formatMask), e);
               }
            }
         }
         break;
      case formula:
         DisplayFormat displayFormat = getGenericDisplayFormat(cellStyle.formatMask);
         cellFormat = displayFormat != null ? new WritableCellFormat(displayFormat) : new WritableCellFormat();
         break;
      case bool:
         cellFormat = new WritableCellFormat();
         break;
View Full Code Here

TOP

Related Classes of jxl.biff.DisplayFormat

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.