29
29
import org .jabref .model .database .BibDatabaseMode ;
30
30
import org .jabref .model .entry .BibEntry ;
31
31
import org .jabref .model .entry .InternalBibtexFields ;
32
- import org .jabref .model .entry .event .EntryChangedEvent ;
33
32
34
- import com .google .common .eventbus .Subscribe ;
35
33
import org .apache .commons .logging .Log ;
36
34
import org .apache .commons .logging .LogFactory ;
37
35
import org .fxmisc .easybind .EasyBind ;
@@ -52,7 +50,6 @@ public SourceTab(BasePanel panel, BibEntry entry, BooleanProperty movingToDiffer
52
50
this .entry = entry ;
53
51
this .panel = panel ;
54
52
this .movingToDifferentEntry = movingToDifferentEntry ;
55
- panel .getBibDatabaseContext ().getDatabase ().registerListener (this );
56
53
this .setText (Localization .lang ("%0 source" , mode .getFormattedName ()));
57
54
this .setTooltip (new Tooltip (Localization .lang ("Show/edit %0 source" , mode .getFormattedName ())));
58
55
this .setGraphic (IconTheme .JabRefIcon .SOURCE .getGraphicNode ());
@@ -67,26 +64,17 @@ private static String getSourceString(BibEntry entry, BibDatabaseMode type) thro
67
64
return stringWriter .getBuffer ().toString ();
68
65
}
69
66
70
- @ Subscribe
71
- public void listen (EntryChangedEvent event ) {
72
- if (codeArea != null && this .entry .equals (event .getBibEntry ())) {
73
- DefaultTaskExecutor .runInJavaFXThread (() -> updateSourcePane ());
74
- }
75
- }
76
-
77
- public void deregisterListeners () {
78
- this .entry .unregisterListener (this );
79
- }
80
-
81
- private void updateSourcePane () {
82
- try {
83
- codeArea .clear ();
84
- codeArea .appendText (getSourceString (entry , mode ));
85
- } catch (IOException ex ) {
86
- codeArea .appendText (ex .getMessage () + "\n \n " +
87
- Localization .lang ("Correct the entry, and reopen editor to display/edit source." ));
88
- codeArea .setEditable (false );
89
- LOGGER .debug ("Incorrect entry" , ex );
67
+ public void updateSourcePane () {
68
+ if (codeArea != null ) {
69
+ try {
70
+ codeArea .clear ();
71
+ codeArea .appendText (getSourceString (entry , mode ));
72
+ } catch (IOException ex ) {
73
+ codeArea .appendText (ex .getMessage () + "\n \n " +
74
+ Localization .lang ("Correct the entry, and reopen editor to display/edit source." ));
75
+ codeArea .setEditable (false );
76
+ LOGGER .debug ("Incorrect entry" , ex );
77
+ }
90
78
}
91
79
}
92
80
0 commit comments