Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
128 commits
Select commit Hold shift + click to select a range
936f1a5
create PDF Comments Tab
ayanai1 Aug 29, 2016
ab37a01
Add importer class to extract pdf file comments
Braunch Aug 29, 2016
9dcc1e9
create PDF Comments Tab
ayanai1 Aug 29, 2016
28432ac
Change to PDF_File icon, fix language
mairdl Aug 29, 2016
cc004f5
Add a javadoc comment
mairdl Aug 29, 2016
dbd4bf1
Merge branch 'PdfTab' of https://github.com/ayanai1/jabref into PdfTab
Braunch Aug 29, 2016
828c10a
Create class for pdf comments tab
mairdl Aug 29, 2016
8857f18
Add final modifier, add commentList to panel
mairdl Sep 1, 2016
34e676c
Delete old version, make PdfCommentsTab extends JPanel
mairdl Sep 1, 2016
bf6c92c
Add textareas for further information display
mairdl Sep 1, 2016
374d4f4
Use regex to fix path from file field
Braunch Sep 3, 2016
66171be
Rewrite loading pdf file to use convenience method
Braunch Sep 5, 2016
8c4b6fb
Enable PdfCommentImporter to import multiple files
Braunch Sep 5, 2016
b439de8
create PDF Comments Tab
ayanai1 Aug 29, 2016
2f31783
Add importer class to extract pdf file comments
Braunch Aug 29, 2016
e849e31
Change to PDF_File icon, fix language
mairdl Aug 29, 2016
91b0b40
Add a javadoc comment
mairdl Aug 29, 2016
598c089
Create class for pdf comments tab
mairdl Aug 29, 2016
5d4afb9
Add final modifier, add commentList to panel
mairdl Sep 1, 2016
cf0f86c
Delete old version, make PdfCommentsTab extends JPanel
mairdl Sep 1, 2016
70cb937
Add textareas for further information display
mairdl Sep 1, 2016
e0983f2
Use regex to fix path from file field
Braunch Sep 3, 2016
169ebe6
Rewrite loading pdf file to use convenience method
Braunch Sep 5, 2016
69c1963
Enable PdfCommentImporter to import multiple files
Braunch Sep 5, 2016
c7713aa
Merge branch 'PdfTab' of https://github.com/ayanai1/jabref into PdfTab
Braunch Sep 5, 2016
8ae1190
Remove uncompilable code
Braunch Sep 5, 2016
748dd04
Merge branch 'PdfTab' of https://github.com/ayanai1/jabref into PdfTab
ayanai1 Sep 5, 2016
ea6434f
UI Prototype design
ayanai1 Sep 5, 2016
5b8f4d7
refactor PdfCommentsTab
mairdl Sep 6, 2016
fec55ad
use Localization.lang instead of just strings
mairdl Sep 6, 2016
7056113
reword fields, delete duplicates, add new fields
mairdl Sep 6, 2016
95f06b3
Load Pdf comments only when the tab is focused
Braunch Sep 6, 2016
58bb379
Merge branch 'PdfTab' of https://github.com/ayanai1/jabref into PdfTab
Braunch Sep 6, 2016
7dc3786
Use PdfComment model class instead of PDAnnotations
Braunch Sep 6, 2016
7a65c5d
Link textFields with the comments table
Braunch Sep 6, 2016
1069015
Enable default message when invalid path is given
Braunch Sep 6, 2016
7b2c044
Filter comments without any content to not be shown in the list
Braunch Sep 6, 2016
71889e3
Update UI PDF-Tab
ayanai1 Sep 8, 2016
59b2393
Add open pdf to external programms in preferences
mairdl Sep 8, 2016
25dbba3
Merge branch 'PdfTab' of https://github.com/ayanai1/jabref into PdfTab
mairdl Sep 8, 2016
367d04c
add missing translation keys
mairdl Sep 8, 2016
d31c64a
Store the selected of the comments list
Braunch Sep 12, 2016
834a1d3
Use GridBagLayout in PDFCommentsTab
mairdl Sep 12, 2016
e6e02d1
Add actions to browse button in preferences dialog
mairdl Sep 12, 2016
6e0d9ba
Merge branch 'PdfTab' of https://github.com/ayanai1/jabref into PdfTab
mairdl Sep 12, 2016
1626b80
Increase usage of GridBagLayout and move buttons
mairdl Sep 12, 2016
8206734
Implement importing highlighted text from pdf
Braunch Sep 12, 2016
e61b3f1
Merge branch 'PdfTab' of https://github.com/ayanai1/jabref into PdfTab
Braunch Sep 12, 2016
8b7d708
Abbreviate comment content when used in the comments list
Braunch Sep 12, 2016
d47e627
Merge remote-tracking branch 'upstream/master' into PdfTab
Braunch Sep 12, 2016
43f7169
Ui Design changed
ayanai1 Sep 13, 2016
e455bad
UI Design improved
ayanai1 Sep 14, 2016
569c49f
Change layout to boxlayout and organize components via formbuilder
mairdl Sep 14, 2016
fca775a
UI design improved
ayanai1 Sep 15, 2016
9791a51
Sort PdfComments by page and add file link to the text area
Braunch Sep 15, 2016
681bc48
Merge branch 'PdfTab' of https://github.com/ayanai1/jabref into PdfTab
Braunch Sep 15, 2016
ca97310
Pdf File dropdown menu added
ayanai1 Sep 15, 2016
f19c2c6
Add lineWrap to comments tab and import comments before initializing GUI
Braunch Sep 15, 2016
e96a127
Merge branch 'PdfTab' of https://github.com/ayanai1/jabref into PdfTab
Braunch Sep 15, 2016
1968c42
UI modification
ayanai1 Sep 15, 2016
91d4fac
PDFTab label color changed to common label coloring in EntryEditorTab
ayanai1 Sep 15, 2016
429739c
Rewise comments importer and add entryEditorTabbedPane
Braunch Sep 19, 2016
4163c34
Merge branch 'PdfTab' of https://github.com/ayanai1/jabref into PdfTab
Braunch Sep 19, 2016
7ec0050
Make pdfTab reload pdfs every time an entry is selected
Braunch Sep 19, 2016
4cb900b
Add thesis-example.pdf for testing
mairdl Sep 19, 2016
f28e2bc
Merge branch 'PdfTab' of https://github.com/ayanai1/jabref into PdfTab
mairdl Sep 19, 2016
c13272c
Add icons to the comment list depending on the annotation type
Braunch Sep 19, 2016
6c2d6b5
Merge branch 'PdfTab' of https://github.com/ayanai1/jabref into PdfTab
Braunch Sep 19, 2016
0f80fdd
Merge remote-tracking branch 'upstream/master' into PdfTab
mairdl Sep 19, 2016
a2237d4
Add optional for caret support
Braunch Sep 20, 2016
627cc47
Use cell renderer to mark linked comments
Braunch Sep 20, 2016
6ae1e5c
Repaint list on valueChange to refresh highlighting
Braunch Sep 20, 2016
08df105
Merge remote-tracking branch 'upstream/master' into PdfTab
Braunch Sep 20, 2016
1aa7e16
Put filename combo box on top of comment list
Braunch Sep 21, 2016
35ac467
Merge branch 'PdfTab' of https://github.com/ayanai1/jabref into PdfTab
Braunch Sep 21, 2016
2a940d5
Merge remote-tracking branch 'upstream/master' into PdfTab
Braunch Sep 21, 2016
03a5219
Change highlight color of comment linked to the selected one
Braunch Sep 21, 2016
37cbc8d
Parse relative path of pdf file to an absolute one
Braunch Sep 21, 2016
3d2fb3e
Make the contents field show highlighted text as well as the linked a…
Braunch Sep 21, 2016
e30592f
drop usage of StringBuilder, use StrinJoiner instead
mairdl Sep 21, 2016
7228fca
Fix typo
mairdl Sep 21, 2016
622c5df
Fix codacy issue
Braunch Sep 22, 2016
1d688f0
Merge branch 'PdfTab' of https://github.com/ayanai1/jabref into PdfTab
Braunch Sep 22, 2016
99ae908
Remove unused fields, add comments and javadoc
Braunch Sep 22, 2016
7d563a4
Merge remote-tracking branch 'upstream/master' into PdfTab
mairdl Sep 22, 2016
adc916b
Merge remote-tracking branch 'upstream/master' into PdfTab
Braunch Sep 26, 2016
5d9efd0
Open pdf on a specified page with acrobat reader on linux
Braunch Sep 26, 2016
1797dba
Open pdf with acrobat on linux
Braunch Sep 26, 2016
17cd742
Store settings of which reader is selected
mairdl Sep 26, 2016
3c0d751
Merge branch 'PdfTab' of https://github.com/ayanai1/jabref into PdfTab
mairdl Sep 26, 2016
ddbbd69
Merge remote-tracking branch 'upstream/master' into PdfTab
Braunch Sep 26, 2016
c82a288
Merge branch 'PdfTab' of https://github.com/ayanai1/jabref into PdfTab
Braunch Sep 26, 2016
861c041
Filter file field for web addresses
Braunch Sep 26, 2016
4c80cd1
Merge remote-tracking branch 'upstream/master' into PdfTab
Braunch Sep 27, 2016
b1c5019
Change Ui and load pdf only when tab is selected
Braunch Sep 27, 2016
bb69657
Add localizations
Braunch Sep 27, 2016
341594c
Use consistent color for PDF tab text areas
Braunch Sep 27, 2016
b77f947
More intelligent copy to clipboard
Braunch Sep 29, 2016
3fb6177
Open pdf experiment for other OS
Braunch Sep 29, 2016
3edb88d
Implement openPdf for Linux and Windows
Braunch Sep 29, 2016
e421a6f
Remove file separator for windows
Braunch Sep 29, 2016
95e1605
Use single array to open pdf on windows
Braunch Oct 4, 2016
1671818
Fix wrong usage of JabRef preferences
Braunch Oct 4, 2016
c13201d
Add filePath and quotes to the command for windows
Braunch Oct 4, 2016
4c3d94f
Start process builder
Braunch Oct 4, 2016
de58145
Add javadoc and handle preferneces not set for reader
Braunch Oct 4, 2016
0f979e6
Make the external tab reflect the selected reader on startup
Braunch Oct 4, 2016
62c4da4
Merge remote-tracking branch 'upstream/master' into PdfTab
Braunch Oct 4, 2016
6d600c5
Use generalized interface and better naming for importer and annotati…
Braunch Oct 5, 2016
eeb2eab
Merge remote-tracking branch 'upstream/master' into PdfTab
Braunch Oct 5, 2016
9d28d0f
Generalized UI matching any attached file type
Braunch Oct 5, 2016
36d172b
Introduce annotaton cache
Braunch Oct 10, 2016
61ea695
Merge remote-tracking branch 'upstream/master' into PdfTab
Braunch Oct 10, 2016
61c69c5
Add library to gradle
Braunch Oct 10, 2016
31d975b
Use Bridge method to access awt.geom from logic package
Braunch Oct 11, 2016
4f76145
Fix localization for annotationsTab
Braunch Oct 11, 2016
819bce9
Merge remote-tracking branch 'upstream/master' into PdfTab
Braunch Oct 11, 2016
c05d88f
Add reload button
Braunch Oct 11, 2016
43a73fe
Ãset both panels to the same size
chriba Oct 17, 2016
e413f48
Merge remote-tracking branch 'upstream/master' into PdfTab
Braunch Oct 24, 2016
a0bb762
Merge branch 'PdfTab' of https://github.com/ayanai1/jabref into PdfTab
Braunch Oct 24, 2016
a8b0fdb
Add exception for awt.geom package to architectural test
Braunch Oct 25, 2016
a3ea307
Show sumatra in preferences on windows only
Braunch Oct 25, 2016
32a903f
Extract Predicates to increase readability
Braunch Oct 25, 2016
c372162
Add Sumatra support
Braunch Oct 25, 2016
6077a12
Detect if file could not be imported
Braunch Oct 26, 2016
2fc265c
Fix localization
Braunch Oct 26, 2016
c13f8bd
Merge remote-tracking branch 'upstream/master' into PdfTab
Braunch Oct 26, 2016
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
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ dependencies {
compile 'commons-logging:commons-logging:1.2'

compile 'org.apache.commons:commons-lang3:3.4'
compile 'org.apache.commons:commons-collections4:4.0'

compile 'org.jsoup:jsoup:1.9.2'
compile 'com.mashape.unirest:unirest-java:1.4.9'
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/net/sf/jabref/gui/BasePanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
import net.sf.jabref.logic.l10n.Localization;
import net.sf.jabref.logic.layout.Layout;
import net.sf.jabref.logic.layout.LayoutHelper;
import net.sf.jabref.logic.pdf.FileAnnotationCache;
import net.sf.jabref.logic.search.SearchQuery;
import net.sf.jabref.logic.util.FileExtensions;
import net.sf.jabref.logic.util.UpdateField;
Expand Down Expand Up @@ -156,6 +157,7 @@ public class BasePanel extends JPanel implements ClipboardOwner, FileUpdateListe
private final MainTableDataModel tableModel;

private final CitationStyleCache citationStyleCache;
private final FileAnnotationCache annotationCache;

// To contain instantiated entry editors. This is to save time
// As most enums, this must not be null
Expand Down Expand Up @@ -224,6 +226,7 @@ public BasePanel(JabRefFrame frame, BibDatabaseContext bibDatabaseContext) {
this.tableModel = new MainTableDataModel(getBibDatabaseContext());

citationStyleCache = new CitationStyleCache(bibDatabaseContext);
annotationCache = new FileAnnotationCache(bibDatabaseContext);

setupMainPanel();

Expand Down Expand Up @@ -2415,6 +2418,10 @@ public CitationStyleCache getCitationStyleCache() {
return citationStyleCache;
}

public FileAnnotationCache getAnnotationCache() {
return annotationCache;
}

public PreviewPanel getPreviewPanel() {
if (selectionListener == null) {
// only occurs if this is called while instantiating this BasePanel
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/net/sf/jabref/gui/IconTheme.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,11 @@ public enum JabRefIcon {
PASTE("\uf192") /*css: content-paste*/,
CUT("\uf190") /*css: content-cut*/,
COPY("\uf18f") /*css: content-copy */,
COMMENT("\uF188") /*css: comment*/,
REDO("\uf44e") /*css: redo*/,
UNDO("\uf54c") /*css: undo*/,
MARK_ENTRIES("\uf0c0") /*css: bookmark */,
MARKER("\uF524") /*css: marker */,
UNMARK_ENTRIES("\uf0c3") /*css: bookmark-outline */,
REFRESH("\uf450") /*css: refresh */,
DELETE_ENTRY("\uf1c0") /*css: delete */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import java.io.File;
import java.io.IOException;
import java.nio.file.Paths;
import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
Expand Down Expand Up @@ -32,6 +33,11 @@ public void openConsole(String absolutePath) throws IOException {
LOGGER.error("This feature is not supported by your Operating System.");
}

@Override
public void openPdfWithParameters(String filePath, List<String> parameters) throws IOException {
//TODO imlement default
}

@Override
public String detectProgramPath(String programName, String directoryName) {
return programName;
Expand Down
23 changes: 23 additions & 0 deletions src/main/java/net/sf/jabref/gui/desktop/os/Linux.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,16 @@
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.file.Paths;
import java.util.List;
import java.util.Optional;
import java.util.StringJoiner;

import net.sf.jabref.gui.externalfiletype.ExternalFileType;
import net.sf.jabref.gui.externalfiletype.ExternalFileTypes;
import net.sf.jabref.preferences.JabRefPreferences;

import static net.sf.jabref.preferences.JabRefPreferences.ADOBE_ACROBAT_COMMAND;
import static net.sf.jabref.preferences.JabRefPreferences.USE_PDF_READER;

public class Linux implements NativeDesktop {
@Override
Expand Down Expand Up @@ -81,6 +87,23 @@ public void openConsole(String absolutePath) throws IOException {
}
}

@Override
public void openPdfWithParameters(String filePath, List<String> parameters) throws IOException {

String application;
if(JabRefPreferences.getInstance().get(USE_PDF_READER).equals(JabRefPreferences.getInstance().get(ADOBE_ACROBAT_COMMAND))){
application = "acroread";

StringJoiner sj = new StringJoiner(" ");
sj.add(application);
parameters.forEach((param) -> sj.add(param));

openFileWithApplication(filePath, sj.toString());
} else {
openFile( filePath, "PDF");
}
}

@Override
public String detectProgramPath(String programName, String directoryName) {
return programName;
Expand Down
9 changes: 9 additions & 0 deletions src/main/java/net/sf/jabref/gui/desktop/os/NativeDesktop.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package net.sf.jabref.gui.desktop.os;

import java.io.IOException;
import java.util.List;

public interface NativeDesktop {
void openFile(String filePath, String fileType) throws IOException;
Expand All @@ -18,5 +19,13 @@ public interface NativeDesktop {

void openConsole(String absolutePath) throws IOException;

/**
* This method opens a pdf using the giving the parameters to the executing pdf reader
* @param filePath absolute path to the pdf file to be opened
* @param parameters console parameters depending on the pdf reader
* @throws IOException
*/
void openPdfWithParameters(String filePath, List<String> parameters) throws IOException;

String detectProgramPath(String programName, String directoryName);
}
6 changes: 6 additions & 0 deletions src/main/java/net/sf/jabref/gui/desktop/os/OSX.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.awt.Desktop;
import java.io.File;
import java.io.IOException;
import java.util.List;
import java.util.Optional;

import net.sf.jabref.gui.externalfiletype.ExternalFileType;
Expand Down Expand Up @@ -40,6 +41,11 @@ public void openConsole(String absolutePath) throws IOException {
Runtime.getRuntime().exec("open -a Terminal " + absolutePath, null, new File(absolutePath));
}

@Override
public void openPdfWithParameters(String filePath, List<String> parameters) throws IOException {
//TODO implement
}

@Override
public String detectProgramPath(String programName, String directoryName) {
return programName;
Expand Down
22 changes: 22 additions & 0 deletions src/main/java/net/sf/jabref/gui/desktop/os/Windows.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,16 @@
import java.io.File;
import java.io.IOException;
import java.nio.file.Paths;
import java.util.List;
import java.util.Optional;

import net.sf.jabref.gui.externalfiletype.ExternalFileType;
import net.sf.jabref.gui.externalfiletype.ExternalFileTypes;
import net.sf.jabref.preferences.JabRefPreferences;

import static net.sf.jabref.preferences.JabRefPreferences.ADOBE_ACROBAT_COMMAND;
import static net.sf.jabref.preferences.JabRefPreferences.SUMATRA_PDF_COMMAND;
import static net.sf.jabref.preferences.JabRefPreferences.USE_PDF_READER;

public class Windows implements NativeDesktop {
private static String DEFAULT_EXECUTABLE_EXTENSION = ".exe";
Expand Down Expand Up @@ -52,4 +58,20 @@ public void openConsole(String absolutePath) throws IOException {
process.directory(new File(absolutePath));
process.start();
}

@Override
public void openPdfWithParameters(String filePath, List<String> parameters) throws IOException {
String pdfReaderPath = JabRefPreferences.getInstance().get(USE_PDF_READER);
if (pdfReaderPath.equals(SUMATRA_PDF_COMMAND) || pdfReaderPath.equals(ADOBE_ACROBAT_COMMAND)) {
String[] command = new String[parameters.size() + 2];
command[0] = "\"" + Paths.get(pdfReaderPath).toString() + "\"";
for (int i = 1; i < command.length - 1; i++) {
command[i] = "\"" + parameters.get(i - 1) + "\"";
}
command[command.length - 1] = "\"" + filePath + "\"";
new ProcessBuilder(command).start();
} else {
openFile(filePath, "PDF");
}
}
}
36 changes: 32 additions & 4 deletions src/main/java/net/sf/jabref/gui/entryeditor/EntryEditor.java
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ public class EntryEditor extends JPanel implements EntryContainer {

private final BasePanel panel;

private FileAnnotationTab fileAnnotationTab;

private boolean updateSource = true; // This can be set to false to stop the source
private boolean movingToDifferentEntry; // Indicates that we are about to go to the next or previous entry
private boolean validEntry = true;
Expand Down Expand Up @@ -226,7 +228,6 @@ public EntryEditor(JabRefFrame frame, BasePanel panel, BibEntry entry) {
private void setupFieldPanels() {
tabbed.removeAll();
tabs.clear();

EntryType type = EntryTypes.getTypeOrDefault(entry.getType(),
this.frame.getCurrentBasePanel().getBibDatabaseContext().getMode());

Expand Down Expand Up @@ -310,6 +311,7 @@ private void setupFieldPanels() {
addGeneralTabs();
// source tab
addSourceTab();
addPdfTab();
}

private void addGeneralTabs() {
Expand All @@ -332,7 +334,7 @@ private void addSourceTab() {
tabbed.addTab(panelName, IconTheme.JabRefIcon.SOURCE.getSmallIcon(), srcPanel, toolTip);
tabs.add(srcPanel);
sourceIndex = tabs.size() - 1; // Set the sourceIndex variable.
srcPanel.setFocusCycleRoot(true);
srcPanel.setFocusCycleRoot(false);
}

private void addOtherTab(List<String> otherFields) {
Expand Down Expand Up @@ -371,6 +373,22 @@ private void addOptionalTab(EntryType type) {
tabs.add(optionalPanel);
}

/**
* Add a tab for displaying comments from a PDF
*/
private void addPdfTab() {
tabbed.remove(fileAnnotationTab);
tabs.remove(fileAnnotationTab);
Optional<String> field = entry.getField(FieldName.FILE);
if (field.isPresent()) {
fileAnnotationTab = new FileAnnotationTab(this, panel, tabbed);
tabbed.addTab(Localization.lang("File annotations"), IconTheme.JabRefIcon.COMMENT.getSmallIcon(), fileAnnotationTab,
Localization.lang("Show file annotations"));
tabs.add(fileAnnotationTab);
}

}

public String getDisplayedBibEntryType() {
return displayedBibEntryType;
}
Expand Down Expand Up @@ -469,7 +487,6 @@ public void rebuildPanels() {
// Remove change listener, because the rebuilding causes meaningless
// events and trouble:
tabbed.removeChangeListener(tabListener);

setupFieldPanels();
// Add the change listener again:
tabbed.addChangeListener(tabListener);
Expand Down Expand Up @@ -651,9 +668,10 @@ public void requestFocus() {

private void activateVisible() {
Object activeTab = tabs.get(tabbed.getSelectedIndex());

if (activeTab instanceof EntryEditorTab) {
((EntryEditorTab) activeTab).activate();
} else if (activeTab instanceof FileAnnotationTab) {
((FileAnnotationTab)activeTab).requestFocus();
} else {
source.requestFocus();
}
Expand Down Expand Up @@ -765,6 +783,7 @@ public synchronized void switchTo(BibEntry switchEntry) {
validateAllFields();
updateSource();
panel.newEntryShowing(switchEntry);
addPdfTab();

}

Expand Down Expand Up @@ -922,6 +941,7 @@ public void validateAllFields() {
if (tab instanceof EntryEditorTab) {
((EntryEditorTab) tab).validateAllFields();
}

}
}

Expand Down Expand Up @@ -1032,6 +1052,13 @@ public void stateChanged(ChangeEvent event) {
// or more of the same fields as this one:
SwingUtilities.invokeLater(() -> {
Object activeTab = tabs.get(tabbed.getSelectedIndex());
if (activeTab instanceof FileAnnotationTab && !((FileAnnotationTab) activeTab).isInitialized()) {
//Initialize by getting notes from cache if they are cached
FileAnnotationTab.initializeTab((FileAnnotationTab) activeTab,
panel.getAnnotationCache().getFromCache(Optional.of(entry)));
panel.getAnnotationCache().addToCache(entry, ((FileAnnotationTab) activeTab).getAllNotes());
}

if (activeTab instanceof EntryEditorTab) {
((EntryEditorTab) activeTab).updateAll();
activateVisible();
Expand All @@ -1040,6 +1067,7 @@ public void stateChanged(ChangeEvent event) {
}
}


class DeleteAction extends AbstractAction {
public DeleteAction() {
super(Localization.lang("Delete"), IconTheme.JabRefIcon.DELETE_ENTRY.getIcon());
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package net.sf.jabref.gui.entryeditor;

import javax.swing.JTabbedPane;

public class EntryEditorTabbedPane extends JTabbedPane {

private FileAnnotationTab pdfTab;

public EntryEditorTabbedPane() {
super();
}

public void hidePdfTab(FileAnnotationTab pdfTab){
this.pdfTab = pdfTab;
this.remove(pdfTab);
}

}
Loading