本文整理了Java中com.sun.star.util.XCloseable
类的一些代码示例,展示了XCloseable
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XCloseable
类的具体详情如下:
包路径:com.sun.star.util.XCloseable
类名称:XCloseable
暂无
代码示例来源:origin: cuba-platform/yarg
public void closeXComponent(XComponent xComponent) {
XCloseable xCloseable = as(XCloseable.class, xComponent);
try {
xCloseable.close(false);
} catch (com.sun.star.util.CloseVetoException e) {
xComponent.dispose();
}
FileUtils.deleteQuietly(temporaryFile);
}
代码示例来源:origin: com.haulmont.yarg/yarg
public void closeXComponent(XComponent xComponent) {
XCloseable xCloseable = as(XCloseable.class, xComponent);
try {
xCloseable.close(false);
} catch (com.sun.star.util.CloseVetoException e) {
xComponent.dispose();
}
FileUtils.deleteQuietly(temporaryFile);
}
代码示例来源:origin: com.artofsolving/jodconverter
private void storeDocument(XComponent document, String outputUrl, Map storeProperties) throws com.sun.star.io.IOException {
try {
XStorable storable = (XStorable) UnoRuntime.queryInterface(XStorable.class, document);
storable.storeToURL(outputUrl, toPropertyValues(storeProperties));
} finally {
XCloseable closeable = (XCloseable) UnoRuntime.queryInterface(XCloseable.class, document);
if (closeable != null) {
try {
closeable.close(true);
} catch (CloseVetoException closeVetoException) {
logger.warn("document.close() vetoed");
}
} else {
document.dispose();
}
}
}
代码示例来源:origin: stackoverflow.com
System.out.println("starting...");
String oooExeFolder = "/usr/lib/openoffice/program";
XComponentContext xContext = BootstrapSocketConnector.bootstrap(oooExeFolder);
XMultiComponentFactory xMCF = xContext.getServiceManager();
Object oDesktop = xMCF.createInstanceWithContext("com.sun.star.frame.Desktop", xContext);
XComponentLoader xCLoader = (XComponentLoader) UnoRuntime.queryInterface(XComponentLoader.class, oDesktop);
System.out.println("loading ");
PropertyValue[] printerDesc = new PropertyValue[1];
printerDesc[0] = new PropertyValue();
printerDesc[0].Name = "PaperOrientation";
printerDesc[0].Value = PaperOrientation.LANDSCAPE;
// Create a document
XComponent document = xCLoader.loadComponentFromURL(loadUrl, "_blank", 0, printerDesc);
// Following property will convert doc into requested orientation.
XPrintable xPrintable = (XPrintable) UnoRuntime.queryInterface(XPrintable.class, document);
xPrintable.setPrinter(printerDesc);
PropertyValue[] conversionProperties = new PropertyValue[3];
conversionProperties[1] = new PropertyValue();
conversionProperties[1].Name = "FilterName";
conversionProperties[1].Value = "writer_pdf_Export";//
conversionProperties[0] = new PropertyValue();
conversionProperties[0].Name = "Overwrite ";
conversionProperties[0].Value = new Boolean(true);
System.out.println("closing");
XStorable xstorable = (XStorable) UnoRuntime.queryInterface(XStorable.class, document);
xstorable.storeToURL(storeUrl, conversionProperties);
System.out.println("closing");
XCloseable xcloseable = (XCloseable) UnoRuntime.queryInterface(XCloseable.class, document);
xcloseable.close(false);
代码示例来源:origin: stackoverflow.com
if(xCloseable != null)
xCloseable.close(true);
xCloseable = null;
代码示例来源:origin: com.github.livesense/jodconverter-core
public void execute(OfficeContext context) throws OfficeException {
XComponent document = null;
try {
document = loadDocument(context, inputFile);
modifyDocument(document);
storeDocument(document, outputFile);
} catch (OfficeException officeException) {
throw officeException;
} catch (Exception exception) {
throw new OfficeException("conversion failed", exception);
} finally {
if (document != null) {
XCloseable closeable = cast(XCloseable.class, document);
if (closeable != null) {
try {
closeable.close(true);
} catch (CloseVetoException closeVetoException) {
// whoever raised the veto should close the document
}
} else {
document.dispose();
}
}
}
}
代码示例来源:origin: org.alfresco/alfresco-repository
closeable.close(true);
} catch (CloseVetoException closeVetoException)
代码示例来源:origin: mirkonasato/jodconverter
public void execute(OfficeContext context) throws OfficeException {
XComponent document = null;
try {
document = loadDocument(context, inputFile);
modifyDocument(document);
storeDocument(document, outputFile);
} catch (OfficeException officeException) {
throw officeException;
} catch (Exception exception) {
throw new OfficeException("conversion failed", exception);
} finally {
if (document != null) {
XCloseable closeable = cast(XCloseable.class, document);
if (closeable != null) {
try {
closeable.close(true);
} catch (CloseVetoException closeVetoException) {
// whoever raised the veto should close the document
}
} else {
document.dispose();
}
}
}
}
代码示例来源:origin: Alfresco/alfresco-repository
closeable.close(true);
} catch (CloseVetoException closeVetoException)
代码示例来源:origin: com.bbossgroups.plugins/bboss-jodconverter-core
public void execute(OfficeContext context) throws OfficeException {
XComponent document = null;
try {
document = loadDocument(context, inputFile);
modifyDocument(document);
storeDocument(document, outputFile);
} catch (OfficeException officeException) {
throw officeException;
} catch (Exception exception) {
throw new OfficeException("conversion failed", exception);
} finally {
if (document != null) {
XCloseable closeable = cast(XCloseable.class, document);
if (closeable != null) {
try {
closeable.close(true);
} catch (CloseVetoException closeVetoException) {
// whoever raised the veto should close the document
}
} else {
document.dispose();
}
}
}
}
代码示例来源:origin: org.libreoffice/officebean
xCloseable.close(true);
内容来源于网络,如有侵权,请联系作者删除!