use of org.jabref.gui.entryeditor.EntryEditor in project jabref by JabRef.
the class BasePanel method updateEntryEditorIfShowing.
public void updateEntryEditorIfShowing() {
if (mode == BasePanelMode.SHOWING_EDITOR) {
if (currentEditor.getDisplayedBibEntryType().equals(currentEditor.getEntry().getType())) {
currentEditor.updateSource();
} else {
// The entry has changed type, so we must get a new editor.
newEntryShowing(null);
final EntryEditor newEditor = getEntryEditor(currentEditor.getEntry());
showEntryEditor(newEditor);
}
}
}
use of org.jabref.gui.entryeditor.EntryEditor in project jabref by JabRef.
the class BasePanel method showEntry.
public void showEntry(final BibEntry be) {
if (getShowing() == be) {
if (splitPane.getBottomComponent() == null) {
// This is the special occasion when showing is set to an
// entry, but no entry editor is in fact shown. This happens
// after Preferences dialog is closed, and it means that we
// must make sure the same entry is shown again. We do this by
// setting showing to null, and recursively calling this method.
newEntryShowing(null);
showEntry(be);
}
return;
}
String visName = null;
if ((getShowing() != null) && isShowingEditor()) {
visName = ((EntryEditor) splitPane.getBottomComponent()).getVisiblePanelName();
}
// We must instantiate a new editor.
EntryEditor entryEditor = new EntryEditor(frame, BasePanel.this, be);
if (visName != null) {
entryEditor.setVisiblePanel(visName);
}
showEntryEditor(entryEditor);
newEntryShowing(be);
}
use of org.jabref.gui.entryeditor.EntryEditor in project jabref by JabRef.
the class SharedDatabaseUIManager method listen.
@Subscribe
public void listen(SharedEntryNotPresentEvent event) {
BasePanel panel = jabRefFrame.getCurrentBasePanel();
EntryEditor entryEditor = panel.getCurrentEditor();
panel.getUndoManager().addEdit(new UndoableRemoveEntry(panel.getDatabase(), event.getBibEntry(), panel));
if (Objects.nonNull(entryEditor) && (entryEditor.getEntry() == event.getBibEntry())) {
JOptionPane.showMessageDialog(jabRefFrame, Localization.lang("The BibEntry you currently work on has been deleted on the shared side.") + "\n" + Localization.lang("You can restore the entry using the \"Undo\" operation."), Localization.lang("Shared entry is no longer present"), JOptionPane.INFORMATION_MESSAGE);
SwingUtilities.invokeLater(() -> panel.hideBottomComponent());
}
}
Aggregations