Package ag.ion.bion.officelayer.util

Examples of ag.ion.bion.officelayer.util.UtilException


        if(newKey == allFormats[i].getFormatKey())
          return allFormats[i];
      }
    }
    catch(Exception exception) {
      UtilException utilException = new UtilException(exception.getMessage());
      utilException.initCause(exception);
      throw utilException;
    }
    throw new UtilException("The number format is not available.");
  }
View Full Code Here


        formats.add(new NumberFormat(key,xProp,this));
      }
      return formats.toArray(new INumberFormat[formats.size()]);
    }
    catch(Exception exception) {
      UtilException utilException = new UtilException(exception.getMessage());
      utilException.initCause(exception);
      throw utilException;
    }
  }
View Full Code Here

  public double convertStringToNumber(int key, String text) throws UtilException {
    try {
      if(xNumberFormatter == null) {
        IServiceProvider serviceProvider = textDocument.getServiceProvider();
        if(serviceProvider == null)
          throw new UtilException("No service provider available in document.");
        Object formatter = serviceProvider.createServiceWithContext("com.sun.star.util.NumberFormatter");
        xNumberFormatter = (XNumberFormatter)UnoRuntime.queryInterface(XNumberFormatter.class, formatter);
        xNumberFormatter.attachNumberFormatsSupplier(xNumberFormatsSupplier);    
      }
      return xNumberFormatter.convertStringToNumber(key,text);
    }
    catch(Exception exception) {
      UtilException utilException = new UtilException(exception.getMessage());
      utilException.initCause(exception);
      throw utilException;
    }
  }
View Full Code Here

  public String convertNumberToString(int key, double number) throws UtilException {
    try {
      if(xNumberFormatter == null) {
        IServiceProvider serviceProvider = textDocument.getServiceProvider();
        if(serviceProvider == null)
          throw new UtilException("No service provider available in document.");
        Object formatter = serviceProvider.createServiceWithContext("com.sun.star.util.NumberFormatter");
        xNumberFormatter = (XNumberFormatter)UnoRuntime.queryInterface(XNumberFormatter.class, formatter);
        xNumberFormatter.attachNumberFormatsSupplier(xNumberFormatsSupplier);    
      }
      return xNumberFormatter.convertNumberToString(key,number);
    }
    catch(Exception exception) {
      UtilException utilException = new UtilException(exception.getMessage());
      utilException.initCause(exception);
      throw utilException;
    }
  }
View Full Code Here

TOP

Related Classes of ag.ion.bion.officelayer.util.UtilException

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.