Package com.sun.star.frame

Examples of com.sun.star.frame.XComponentLoader


    public XModel createDocument( String sDocType )
    {
        XModel aResult = null;
        try
        {
            XComponentLoader aLoader = (XComponentLoader)
                UnoRuntime.queryInterface(XComponentLoader.class,
                maMCFactory.createInstanceWithContext("com.sun.star.frame.Desktop",
                                                      maContext) );

            aResult = (XModel) UnoRuntime.queryInterface(
                XModel.class,
                aLoader.loadComponentFromURL( "private:factory/" + sDocType,
                                              "_blank",
                                              0,
                                              new PropertyValue[ 0 ] ) );
        }
        catch( Exception e )
View Full Code Here


  public WoogieDocumentConverter(OpenOfficeConnection connection, DocumentFormatRegistry formatRegistry, int width, int height) {
    super(connection, formatRegistry, width, height);
  }

  protected void loadAndExport(String inputUrl, Map/*<String,Object>*/ loadProperties, String outputUrl, Map/*<String,Object>*/ storeProperties) throws Exception {
    XComponentLoader desktop = openOfficeConnection.getDesktop();
    XComponent document = desktop.loadComponentFromURL(inputUrl, "_blank", 0, null);
   
       
    if (document == null) {
            throw new OpenOfficeException("conversion failed: input document is null after loading");
        }
View Full Code Here

  public OogieDocumentConverter(OpenOfficeConnection connection, DocumentFormatRegistry formatRegistry, int width, int height) {
    super(connection, formatRegistry, width, height);
  }

  protected void loadAndExport(String inputUrl, Map/*<String,Object>*/ loadProperties, String outputUrl, Map/*<String,Object>*/ storeProperties) throws Exception {
    XComponentLoader desktop = openOfficeConnection.getDesktop();
    XComponent document = desktop.loadComponentFromURL(inputUrl, "_blank", 0, toPropertyValues(loadProperties));
        if (document == null) {
            throw new OpenOfficeException("conversion failed: input document is null after loading");
        }
   
    refreshDocument(document);
View Full Code Here

        }
   
    private XComponent loadComponent(String _sName, Object _xComponent, ArrayList _aPropertyList)
        {
            XComponent xDocComponent = null;
            XComponentLoader xComponentLoader = (XComponentLoader) UnoRuntime.queryInterface( XComponentLoader.class, _xComponent );

            try
            {
                PropertyValue[] aLoadProperties = PropertyHelper.createPropertyValueArrayFormArrayList(_aPropertyList);
                log.println("Load component: '" + _sName + "'");
                xDocComponent = xComponentLoader.loadComponentFromURL(_sName, "_blank", 0, aLoadProperties);
            }
            catch (com.sun.star.io.IOException e)
            {
                log.println("ERROR: Exception caught");
                log.println("Can't load document '" + _sName + "'");
View Full Code Here

        createTestCase();

        try
        {
      Object object = getFactory().createInstance("com.sun.star.frame.Desktop");
      XComponentLoader xComponentLoader = (XComponentLoader)UnoRuntime.queryInterface(XComponentLoader.class, object);
      XComponent xComponent = xComponentLoader.loadComponentFromURL(m_database.getDocumentURL(), "_blank",FrameSearchFlag.ALL, new PropertyValue[0]);
      m_database.close();
      XStorable storable = (XStorable)UnoRuntime.queryInterface(XStorable.class,xComponent);
      storable.store();
            XCloseable close = (XCloseable)UnoRuntime.queryInterface(XCloseable.class,xComponent);
            close.close(true);
View Full Code Here

        }
   
    private XComponent loadComponent(String _sName, Object _xComponent, ArrayList _aPropertyList)
        {
            XComponent xDocComponent = null;
            XComponentLoader xComponentLoader = (XComponentLoader) UnoRuntime.queryInterface( XComponentLoader.class, _xComponent );

            try
            {
                PropertyValue[] aLoadProperties = PropertyHelper.createPropertyValueArrayFormArrayList(_aPropertyList);
                log.println("Load component: '" + _sName + "'");
                xDocComponent = xComponentLoader.loadComponentFromURL(_sName, "_blank", 0, aLoadProperties);
            }
            catch (com.sun.star.io.IOException e)
            {
                log.println("ERROR: Exception caught");
                log.println("Can't load document '" + _sName + "'");
View Full Code Here

            properties[1].Name="ReadOnly";
            properties[1].Value=Boolean.valueOf(true);
            properties[2]=new PropertyValue();
            properties[2].Value="AsTemplate";
            properties[2].Value=Boolean.valueOf(true);
            XComponentLoader loader = (XComponentLoader)UnoRuntime.queryInterface(XComponentLoader.class,xFrame);
            XComponent xComp  = null;
            xComp = loader.loadComponentFromURL(fName, "_blank", 0, properties);

            XTextDocument textDocument = (XTextDocument) UnoRuntime.queryInterface(XTextDocument.class,xComp);
            XStorable storable = (XStorable) UnoRuntime.queryInterface(
                XStorable.class, xComp) ;
            /*XStorable storable = (XStorable) UnoRuntime.queryInterface(
View Full Code Here

            properties[1].Name="ReadOnly";
            properties[1].Value=Boolean.valueOf(true);
            properties[2]=new PropertyValue();
            properties[2].Value="AsTemplate";
            properties[2].Value=Boolean.valueOf(true);
            XComponentLoader loader = (XComponentLoader)UnoRuntime.queryInterface(XComponentLoader.class,xFrame);
            XComponent xComp  = null;
            xComp = loader.loadComponentFromURL(fName, "_blank", 0, properties);

            XTextDocument textDocument = (XTextDocument) UnoRuntime.queryInterface(XTextDocument.class,xComp);
            XStorable storable = (XStorable) UnoRuntime.queryInterface(
                XStorable.class, xComp) ;
            /*XStorable storable = (XStorable) UnoRuntime.queryInterface(
View Full Code Here

       
        public static void openInOpenOffice(Component parent,final String fName, XFrame xFrame) throws com.sun.star.lang.IllegalArgumentException, com.sun.star.io.IOException {
            if (!Configuration.isUseExec()) {
                String sLoadUrl = Util.fileNameToOOoURL(fName);
                XComponentLoader loader = (XComponentLoader)UnoRuntime.queryInterface(XComponentLoader.class,xFrame);
                XComponent xComp = loader.loadComponentFromURL(sLoadUrl, "_blank", 0, new PropertyValue[0]);
                XTextDocument aTextDocument = (XTextDocument)UnoRuntime.queryInterface(com.sun.star.text.XTextDocument.class, xComp);
            } else {
                // bad luck, we need to use direct method to run OO.org :-(
                String cmd[] = {"open", Configuration.getPathForOOoExec(parent) , fName};
                try {
View Full Code Here

      logger.trace("Bootstrap OK");
      XMultiComponentFactory xMCF = xContext.getServiceManager();
      logger.trace("ServiceManager OK");
      Object desktop = xMCF.createInstanceWithContext(
          "com.sun.star.frame.Desktop", xContext);
      XComponentLoader loader = unoCast(XComponentLoader.class, desktop);

      String internalLocation = getSupportedLocation(location, xContext);
      // internalLocation = correctLocation;
      if (logger.isDebugEnabled()) {
        logger.debug("Chargement du fichier : " + internalLocation);
      }

      String mode;
      if (hidden) {
        mode = "_hidden";
      } else {
        mode = "_default";
      }
      XComponent component = loader.loadComponentFromURL(
          internalLocation, mode, 0, null);

      if (component == null) {
        throw new ImpressException("Probleme de chargement du fichier "
            + internalLocation);
View Full Code Here

TOP

Related Classes of com.sun.star.frame.XComponentLoader

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.