FunctionHelper.java (7950f2af) | FunctionHelper.java (2e3a1b6e) |
---|---|
1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 229 unchanged lines hidden (view full) --- 238 } 239 // mode 2) create an internal office window as child of our given java 240 // parent window 241 else 242 { 243 // try new version of creation first: directly using of the window 244 // handle. The old implementation of the corresponding toolkit method 245 // requires a process ID. If this id isn't the right one a null object | 1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 229 unchanged lines hidden (view full) --- 238 } 239 // mode 2) create an internal office window as child of our given java 240 // parent window 241 else 242 { 243 // try new version of creation first: directly using of the window 244 // handle. The old implementation of the corresponding toolkit method 245 // requires a process ID. If this id isn't the right one a null object |
246 // is returned. But normaly nobody outside the office knows this id. | 246 // is returned. But normally nobody outside the office knows this id. |
247 // New version of this method ignore the id parameter and creation will 248 // work. | 247 // New version of this method ignore the id parameter and creation will 248 // work. |
249 // Note: You must be shure if your window handle can be really used by | 249 // Note: You must be sure if your window handle can be really used by |
250 // the remote office. Means if this java client and the remote office 251 // use the same display! 252 com.sun.star.awt.XSystemChildFactory xChildFactory = 253 (com.sun.star.awt.XSystemChildFactory)UnoRuntime.queryInterface( 254 com.sun.star.awt.XSystemChildFactory.class, xToolkit); 255 256 try 257 { --- 369 unchanged lines hidden (view full) --- 627 * 628 * @param xDocument document for saving changes 629 */ 630 public static void saveDocument(com.sun.star.lang.XComponent xDocument) 631 { 632 try 633 { 634 // Check for supported model functionality. | 250 // the remote office. Means if this java client and the remote office 251 // use the same display! 252 com.sun.star.awt.XSystemChildFactory xChildFactory = 253 (com.sun.star.awt.XSystemChildFactory)UnoRuntime.queryInterface( 254 com.sun.star.awt.XSystemChildFactory.class, xToolkit); 255 256 try 257 { --- 369 unchanged lines hidden (view full) --- 627 * 628 * @param xDocument document for saving changes 629 */ 630 public static void saveDocument(com.sun.star.lang.XComponent xDocument) 631 { 632 try 633 { 634 // Check for supported model functionality. |
635 // Normaly the application documents (text, spreadsheet ...) do so 636 // but some other ones (e.g. db components) doesn't do that. | 635 // Normally the application documents (text, spreadsheet ...) do so 636 // but some other ones (e.g. db components) don't do that. |
637 // They can't be save then. 638 com.sun.star.frame.XModel xModel = (com.sun.star.frame.XModel)UnoRuntime.queryInterface( 639 com.sun.star.frame.XModel.class, 640 xDocument); 641 if(xModel!=null) 642 { 643 // Check for modifications => break save process if there is nothing to do. 644 com.sun.star.util.XModifiable xModified = (com.sun.star.util.XModifiable)UnoRuntime.queryInterface( --- 39 unchanged lines hidden (view full) --- 684 public static void saveAsHTML(com.sun.star.lang.XComponent xDocument, 685 String sURL ) 686 { 687 try 688 { 689 // First detect factory of this document. 690 // Ask for the supported service name of this document. 691 // If information is available it can be used to find out which | 637 // They can't be save then. 638 com.sun.star.frame.XModel xModel = (com.sun.star.frame.XModel)UnoRuntime.queryInterface( 639 com.sun.star.frame.XModel.class, 640 xDocument); 641 if(xModel!=null) 642 { 643 // Check for modifications => break save process if there is nothing to do. 644 com.sun.star.util.XModifiable xModified = (com.sun.star.util.XModifiable)UnoRuntime.queryInterface( --- 39 unchanged lines hidden (view full) --- 684 public static void saveAsHTML(com.sun.star.lang.XComponent xDocument, 685 String sURL ) 686 { 687 try 688 { 689 // First detect factory of this document. 690 // Ask for the supported service name of this document. 691 // If information is available it can be used to find out which |
692 // filter exist for HTML export. Normaly this filter should be searched | 692 // filter exist for HTML export. Normally this filter should be searched |
693 // inside the filter configuration but this little demo doesn't do so. 694 // (see service com.sun.star.document.FilterFactory for further 695 // informations too) 696 // Well known filter names are used directly. They must exist in current 697 // office installation. Otherwise this code will fail. But to prevent 698 // this code against missing filters it check for existing state of it. 699 com.sun.star.lang.XServiceInfo xInfo = (com.sun.star.lang.XServiceInfo) 700 UnoRuntime.queryInterface(com.sun.star.lang.XServiceInfo.class, --- 349 unchanged lines hidden --- | 693 // inside the filter configuration but this little demo doesn't do so. 694 // (see service com.sun.star.document.FilterFactory for further 695 // informations too) 696 // Well known filter names are used directly. They must exist in current 697 // office installation. Otherwise this code will fail. But to prevent 698 // this code against missing filters it check for existing state of it. 699 com.sun.star.lang.XServiceInfo xInfo = (com.sun.star.lang.XServiceInfo) 700 UnoRuntime.queryInterface(com.sun.star.lang.XServiceInfo.class, --- 349 unchanged lines hidden --- |