use of com.sun.star.beans.IllegalTypeException in project jabref by JabRef.
the class OpenOfficePanel method pushEntries.
private void pushEntries(boolean inParenthesisIn, boolean withText, boolean addPageInfo) {
if (!ooBase.isConnectedToDocument()) {
JOptionPane.showMessageDialog(frame, Localization.lang("Not connected to any Writer document. Please" + " make sure a document is open, and use the 'Select Writer document' button to connect to it."), Localization.lang("Error"), JOptionPane.ERROR_MESSAGE);
return;
}
Boolean inParenthesis = inParenthesisIn;
String pageInfo = null;
if (addPageInfo) {
AdvancedCiteDialog citeDialog = new AdvancedCiteDialog(frame);
citeDialog.showDialog();
if (citeDialog.canceled()) {
return;
}
if (!citeDialog.getPageInfo().isEmpty()) {
pageInfo = citeDialog.getPageInfo();
}
inParenthesis = citeDialog.isInParenthesisCite();
}
BasePanel panel = frame.getCurrentBasePanel();
if (panel != null) {
final BibDatabase database = panel.getDatabase();
List<BibEntry> entries = panel.getSelectedEntries();
if (!entries.isEmpty() && checkThatEntriesHaveKeys(entries)) {
try {
if (style == null) {
style = loader.getUsedStyle();
}
ooBase.insertEntry(entries, database, getBaseList(), style, inParenthesis, withText, pageInfo, preferences.syncWhenCiting());
} catch (FileNotFoundException ex) {
JOptionPane.showMessageDialog(frame, Localization.lang("You must select either a valid style file, or use one of the default styles."), Localization.lang("No valid style file defined"), JOptionPane.ERROR_MESSAGE);
LOGGER.warn("Problem with style file", ex);
} catch (ConnectionLostException ex) {
showConnectionLostErrorMessage();
} catch (UndefinedCharacterFormatException ex) {
reportUndefinedCharacterFormat(ex);
} catch (UndefinedParagraphFormatException ex) {
reportUndefinedParagraphFormat(ex);
} catch (com.sun.star.lang.IllegalArgumentException | UnknownPropertyException | PropertyVetoException | CreationException | NoSuchElementException | WrappedTargetException | IOException | BibEntryNotFoundException | IllegalTypeException | PropertyExistException | NotRemoveableException ex) {
LOGGER.warn("Could not insert entry", ex);
}
}
}
}
Aggregations