}
public static void dispose(XMultiServiceFactory xMSF, XComponent xComponent) {
try {
if (xComponent != null) {
XModifiable xModified = (XModifiable) UnoRuntime.queryInterface(XModifiable.class, xComponent);
XModel xModel = (XModel) UnoRuntime.queryInterface(XModel.class, xComponent);
XFrame xFrame = xModel.getCurrentController().getFrame();
if (xModified.isModified())
xModified.setModified(false);
Desktop.dispatchURL(xMSF, ".uno:CloseDoc", xFrame);
}
} catch (PropertyVetoException exception) {
exception.printStackTrace(System.out);
}}