当前位置: 首页>>代码示例>>Java>>正文


Java CloseVetoException类代码示例

本文整理汇总了Java中com.sun.star.util.CloseVetoException的典型用法代码示例。如果您正苦于以下问题:Java CloseVetoException类的具体用法?Java CloseVetoException怎么用?Java CloseVetoException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


CloseVetoException类属于com.sun.star.util包,在下文中一共展示了CloseVetoException类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: execute

import com.sun.star.util.CloseVetoException; //导入依赖的package包/类
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();
            }
        }
    }
}
 
开发者ID:qjx378,项目名称:wenku,代码行数:26,代码来源:AbstractConversionTask.java

示例2: storeDocument

import com.sun.star.util.CloseVetoException; //导入依赖的package包/类
/**
 * Store document.
 * @param document
 *            the document
 * @param outputUrl
 *            the output url
 * @param storeProperties
 *            the store properties
 */
@SuppressWarnings("unchecked")
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) {
				if (Converter.DEBUG_MODE) {
					closeVetoException.printStackTrace();
				}
			}
		} else {
			document.dispose();
		}
	}
}
 
开发者ID:heartsome,项目名称:translationstudio8,代码行数:31,代码来源:OpenOfficeDocumentConverter.java

示例3: close

import com.sun.star.util.CloseVetoException; //导入依赖的package包/类
public void close() {
    try {
        XCloseable xCloseable = UnoRuntime.queryInterface(XCloseable.class, doc);

        if (xCloseable == null) {
            throw new IllegalStateException("XSpreadsheet is not closable");
        }

        xCloseable.close(false);
    } catch (CloseVetoException e) {
        throw new LibreOfficeException(e);
    }
}
 
开发者ID:kamax-io,项目名称:libreoffice4j,代码行数:14,代码来源:SpreadsheetDocument.java

示例4: execute

import com.sun.star.util.CloseVetoException; //导入依赖的package包/类
/**
 * Execute method. 
 * @param context OfficeContext
 * @throws OfficeException in case of conversion failure
 */
public void execute(OfficeContext context) throws OfficeException {
	XComponent document = null;
	try {
		if (inputFile != null) {
			document = loadDocument(context, inputFile);
		} else {
			document = loadDocument(context, inputFileURL);
		}
		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();
			}
		}
	}
}
 
开发者ID:kuzavas,项目名称:ephesoft,代码行数:34,代码来源:AbstractConversionTask.java

示例5: terminate

import com.sun.star.util.CloseVetoException; //导入依赖的package包/类
private void terminate(int nExitCode) 
  {
      sysCaller.exitProcess(sProcessId);
      sysCaller.closeObject(sCrtObjHandle);
      XCloseable xcloseable = (XCloseable) UnoRuntime.queryInterface(XCloseable.class, xComp);
      try {
	xcloseable.close(true);
} catch (CloseVetoException e) {
	// TODO Auto-generated catch block
	e.printStackTrace();
}
      System.exit(nExitCode);
  }
 
开发者ID:PM-Master,项目名称:Harmonia-1.5,代码行数:14,代码来源:OfficeLauncher.java

示例6: queryClosing

import com.sun.star.util.CloseVetoException; //导入依赖的package包/类
@Override
public void queryClosing(EventObject arg0, boolean arg1)
    throws CloseVetoException
{}
 
开发者ID:WollMux,项目名称:WollMux,代码行数:5,代码来源:MailMergeDatasource.java

示例7: queryClosing

import com.sun.star.util.CloseVetoException; //导入依赖的package包/类
/**
 * Is called when somewhere tries to close listened object.
 * 
 * @param eventObject source event object
 * @param getsOwnership information about the ownership
 * 
 * @throws CloseVetoException close veto exception
 * 
 * @author Andreas Bröker
 */
public void queryClosing(EventObject eventObject, boolean getsOwnership)
    throws CloseVetoException {
  CloseEvent closeEvent = new CloseEvent(eventObject, getServiceProvider());
  closeListener.queryClosing(closeEvent, getsOwnership);
  if(closeEvent.getVeto())
    throw new CloseVetoException();    
}
 
开发者ID:LibreOffice,项目名称:noa-libre,代码行数:18,代码来源:CloseListenerWrapper.java


注:本文中的com.sun.star.util.CloseVetoException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。