Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initializing EntryEditor Tabs on focus #3331

Merged
merged 2 commits into from
Oct 21, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
- We now set the WM_CLASS of the UI to org-jabref-JabRefMain to allow certain Un*x window managers to properly identify its windows
- We changed the default paths for the OpenOffice/LibreOffice binaries to the default path for LibreOffice
- We no longer create a new entry editor when selecting a new entry to increase performance. [#3187](https://github.com/JabRef/jabref/pull/3187)
- We increased performance and decreased the memory footprint of the entry editor drastically. [#3331](https://github.com/JabRef/jabref/pull/3331)


### Fixed
- We fixed the translation of \textendash in the entry preview [#3307](https://github.com/JabRef/jabref/issues/3307)
Expand Down
9 changes: 5 additions & 4 deletions src/main/java/org/jabref/gui/entryeditor/FieldsEditorTab.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,21 @@
*/
class FieldsEditorTab extends EntryEditorTab {

private final Region panel;
private final List<String> fields;
private final EntryEditor parent;
private final Map<String, FieldEditorFX> editors = new LinkedHashMap<>();
private final JabRefFrame frame;
private final BasePanel basePanel;
private final BibEntry entry;
private final boolean isCompressed;
private Region panel;
private FieldEditorFX activeField;


public FieldsEditorTab(JabRefFrame frame, BasePanel basePanel, List<String> fields, EntryEditor parent, boolean addKeyField, boolean compressed, BibEntry entry) {
this.entry = Objects.requireNonNull(entry);
this.fields = new ArrayList<>(Objects.requireNonNull(fields));

this.isCompressed = compressed;
// Add the edit field for Bibtex-key.
if (addKeyField) {
this.fields.add(BibEntry.KEY_FIELD);
Expand All @@ -61,8 +63,6 @@ public FieldsEditorTab(JabRefFrame frame, BasePanel basePanel, List<String> fiel
this.frame = frame;
this.basePanel = basePanel;

panel = setupPanel(frame, basePanel, compressed);

// The following line makes sure focus cycles inside tab instead of being lost to other parts of the frame:
//panel.setFocusCycleRoot(true);
}
Expand Down Expand Up @@ -305,6 +305,7 @@ public void requestFocus() {

@Override
protected void initialize() {
panel = setupPanel(frame, basePanel, isCompressed);
setContent(panel);
}
}