Examples of XFunctionAccess


Examples of com.sun.star.sheet.XFunctionAccess

   * @throws Exception
   */
  public double toDate (Date date) throws Exception
  {
    XFunctionAccess fa = getFunctionAccess();

    Calendar c = Calendar.getInstance ();
    c.setTime (date);
   
    Object [] dateArgs = {new Integer(c.get (Calendar.YEAR)),
                          new Integer(c.get (Calendar.MONTH) + 1),
                          new Integer(c.get (Calendar.DAY_OF_MONTH))};
    double result = (Double)(fa.callFunction ("DATE", dateArgs));
    Object [] timeArgs = {new Integer(c.get (Calendar.HOUR_OF_DAY)),
                          new Integer(c.get (Calendar.MINUTE)),
                          new Integer(c.get (Calendar.SECOND))};
    result += (Double)(fa.callFunction ("TIME", timeArgs));
    myLog.debug ("result = " + result);
    return result;
  }
View Full Code Here

Examples of com.sun.star.sheet.XFunctionAccess

   * @throws Exception
   * @throws ParseException
   */
  public Date toDate (double val) throws ParseException, Exception
  {
    XFunctionAccess fa = getFunctionAccess();

    Object [] args = {new Double(val), "YYYY-MM-DD HH:MM:SS"};
    String text = (String)(fa.callFunction ("TEXT", args));

    if (myToDateSdf == null) {
      myToDateSdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    }
    Date d = myToDateSdf.parse (text);
View Full Code Here

Examples of com.sun.star.sheet.XFunctionAccess

   *
   * @throws Exception
   */
  public double toDouble (Date date, boolean includeDate, boolean includeTime) throws Exception
  {
    XFunctionAccess fa = getFunctionAccess();

    Calendar c = Calendar.getInstance ();
    c.setTime (date);

    double val = 0.0;

    if (includeDate) {
      Object [] args = {new Integer(c.get (Calendar.YEAR)), new Integer(c.get (Calendar.MONTH) + 1), new Integer(c.get (Calendar.DAY_OF_MONTH))};
      myLog.debug("Date = {}-{}-{}", args);
      Double v = (Double)(fa.callFunction ("DATE", args));
      val = v.doubleValue ();
    }
    if (includeTime) {
      Object [] args = {new Integer(c.get (Calendar.HOUR)), new Integer(c.get (Calendar.MINUTE)), new Integer(c.get (Calendar.SECOND))};
      myLog.debug("Time = {}-{}-{}", args);
      Double v = (Double)(fa.callFunction ("TIME", args));
      val += v.doubleValue ();
    }
    myLog.debug("return {}", val);
    return val;
  }
View Full Code Here

Examples of com.sun.star.sheet.XFunctionAccess

                Object objectFunctionAccess =
                    xmultiservicefactory.createInstance("com.sun.star.sheet.FunctionAccess" );
               
                // Querying for the interface XFunctionAccess on service
                // FunctionAccess
                XFunctionAccess xfunctionaccess = (XFunctionAccess)
                    UnoRuntime.queryInterface(XFunctionAccess.class,
                                              objectFunctionAccess );
               
                // Creating vector for holidays
                Vector vectorHolidays = new Vector();
View Full Code Here

Examples of com.sun.star.sheet.XFunctionAccess

                    m_xMCF.createInstanceWithContext(
                        "com.sun.star.sheet.FunctionAccess", m_cmpCtx );
               
                // Querying for the interface XFunctionAccess on service
                // FunctionAccess
                XFunctionAccess xfunctionaccess = (XFunctionAccess)
                    UnoRuntime.queryInterface(XFunctionAccess.class,
                                              objectFunctionAccess );
               
                // Creating vector for holidays
                Vector vectorHolidays = new Vector();
View Full Code Here

Examples of com.sun.star.sheet.XFunctionAccess

                    m_xMCF.createInstanceWithContext(
                        "com.sun.star.sheet.FunctionAccess", m_cmpCtx );
               
                // Querying for the interface XFunctionAccess on service
                // FunctionAccess
                XFunctionAccess xfunctionaccess = (XFunctionAccess)
                    UnoRuntime.queryInterface(XFunctionAccess.class,
                                              objectFunctionAccess );
               
                // Creating vector for holidays
                Vector vectorHolidays = new Vector();
View Full Code Here

Examples of com.sun.star.sheet.XFunctionAccess

                Object objectFunctionAccess =
                    xmultiservicefactory.createInstance("com.sun.star.sheet.FunctionAccess" );
               
                // Querying for the interface XFunctionAccess on service
                // FunctionAccess
                XFunctionAccess xfunctionaccess = (XFunctionAccess)
                    UnoRuntime.queryInterface(XFunctionAccess.class,
                                              objectFunctionAccess );
               
                // Creating vector for holidays
                Vector vectorHolidays = new Vector();
View Full Code Here

Examples of com.sun.star.sheet.XFunctionAccess

                    m_xMCF.createInstanceWithContext(
                        "com.sun.star.sheet.FunctionAccess", m_cmpCtx );
               
                // Querying for the interface XFunctionAccess on service
                // FunctionAccess
                XFunctionAccess xfunctionaccess = (XFunctionAccess)
                    UnoRuntime.queryInterface(XFunctionAccess.class,
                                              objectFunctionAccess );
               
                // Creating vector for holidays
                Vector vectorHolidays = new Vector();
View Full Code Here

Examples of com.sun.star.sheet.XFunctionAccess

                Object objectFunctionAccess =
                    xmultiservicefactory.createInstance("com.sun.star.sheet.FunctionAccess" );
               
                // Querying for the interface XFunctionAccess on service
                // FunctionAccess
                XFunctionAccess xfunctionaccess = (XFunctionAccess)
                    UnoRuntime.queryInterface(XFunctionAccess.class,
                                              objectFunctionAccess );
               
                // Creating vector for holidays
                Vector vectorHolidays = new Vector();
View Full Code Here

Examples of com.sun.star.sheet.XFunctionAccess

                    m_xMCF.createInstanceWithContext(
                        "com.sun.star.sheet.FunctionAccess", m_cmpCtx );
               
                // Querying for the interface XFunctionAccess on service
                // FunctionAccess
                XFunctionAccess xfunctionaccess = (XFunctionAccess)
                    UnoRuntime.queryInterface(XFunctionAccess.class,
                                              objectFunctionAccess );
               
                // Creating vector for holidays
                Vector vectorHolidays = new Vector();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.