use of com.sun.star.container.XEnumeration in project jabref by JabRef.
the class OOBibBase method getTextDocuments.
private List<XTextDocument> getTextDocuments() throws NoSuchElementException, WrappedTargetException {
List<XTextDocument> result = new ArrayList<>();
XEnumerationAccess enumAccess = xDesktop.getComponents();
XEnumeration componentEnumeration = enumAccess.createEnumeration();
while (componentEnumeration.hasMoreElements()) {
Object nextElement = componentEnumeration.nextElement();
XComponent component = UnoRuntime.queryInterface(XComponent.class, nextElement);
XTextDocument document = UnoRuntime.queryInterface(XTextDocument.class, component);
if (document != null) {
result.add(document);
}
}
return result;
}
Aggregations