67
67
import org .jabref .gui .actions .Actions ;
68
68
import org .jabref .gui .actions .AutoLinkFilesAction ;
69
69
import org .jabref .gui .actions .ConnectToSharedDatabaseAction ;
70
+ import org .jabref .gui .actions .DisconnectFromSharelatexAction ;
70
71
import org .jabref .gui .actions .ErrorConsoleAction ;
71
72
import org .jabref .gui .actions .IntegrityCheckAction ;
72
73
import org .jabref .gui .actions .LookupIdentifierAction ;
78
79
import org .jabref .gui .actions .NewSubDatabaseAction ;
79
80
import org .jabref .gui .actions .OpenBrowserAction ;
80
81
import org .jabref .gui .actions .SearchForUpdateAction ;
82
+ import org .jabref .gui .actions .SendChangesToShareLatexAction ;
81
83
import org .jabref .gui .actions .SortTabsAction ;
84
+ import org .jabref .gui .actions .SynchronizeWithShareLatexAction ;
82
85
import org .jabref .gui .autosaveandbackup .AutosaveUIManager ;
83
86
import org .jabref .gui .bibtexkeypattern .BibtexKeyPatternDialog ;
84
87
import org .jabref .gui .customentrytypes .EntryCustomizationDialog ;
153
156
* The main window of the application.
154
157
*/
155
158
public class JabRefFrame extends JFrame implements OutputPrinter {
159
+
156
160
private static final Log LOGGER = LogFactory .getLog (JabRefFrame .class );
157
161
158
162
// Frame titles.
@@ -170,13 +174,13 @@ public class JabRefFrame extends JFrame implements OutputPrinter {
170
174
private final JLabel statusLine = new JLabel ("" , SwingConstants .LEFT );
171
175
private final JLabel statusLabel = new JLabel (
172
176
Localization .lang ("Status" )
173
- + ':' , SwingConstants .LEFT );
177
+ + ':' ,
178
+ SwingConstants .LEFT );
174
179
private final JProgressBar progressBar = new JProgressBar ();
175
180
private final FileHistoryMenu fileHistory = new FileHistoryMenu (prefs , this );
176
181
private final OpenDatabaseAction open = new OpenDatabaseAction (this , true );
177
182
private final EditModeAction editModeAction = new EditModeAction ();
178
183
179
-
180
184
// Here we instantiate menu/toolbar actions. Actions regarding
181
185
// the currently open database are defined as a GeneralAction
182
186
// with a unique command string. This causes the appropriate
@@ -391,6 +395,10 @@ public void actionPerformed(ActionEvent e) {
391
395
Localization .lang ("Unabbreviate journal names of the selected entries" ),
392
396
Globals .getKeyPrefs ().getKey (KeyBinding .UNABBREVIATE ));
393
397
private final AbstractAction manageJournals = new ManageJournalsAction ();
398
+ private final AbstractAction synchronizeWithSharelatex = new SynchronizeWithShareLatexAction ();
399
+ private final AbstractAction sendChangesToShareLatex = new SendChangesToShareLatexAction ();
400
+ private final AbstractAction disconnectFromSharelatex = new DisconnectFromSharelatexAction ();
401
+
394
402
private final AbstractAction databaseProperties = new DatabasePropertiesAction ();
395
403
private final AbstractAction bibtexKeyPattern = new BibtexKeyPatternAction ();
396
404
private final AbstractAction errorConsole = new ErrorConsoleAction ();
@@ -421,8 +429,7 @@ public void actionPerformed(ActionEvent e) {
421
429
private final GeneralAction findUnlinkedFiles = new GeneralAction (
422
430
FindUnlinkedFilesDialog .ACTION_COMMAND ,
423
431
FindUnlinkedFilesDialog .ACTION_MENU_TITLE , FindUnlinkedFilesDialog .ACTION_SHORT_DESCRIPTION ,
424
- Globals .getKeyPrefs ().getKey (KeyBinding .FIND_UNLINKED_FILES )
425
- );
432
+ Globals .getKeyPrefs ().getKey (KeyBinding .FIND_UNLINKED_FILES ));
426
433
private final AutoLinkFilesAction autoLinkFile = new AutoLinkFilesAction ();
427
434
// The action for adding a new entry of unspecified type.
428
435
private final NewEntryAction newEntryAction = new NewEntryAction (this , Globals .getKeyPrefs ().getKey (KeyBinding .NEW_ENTRY ));
@@ -613,9 +620,7 @@ public void windowClosing(WindowEvent e) {
613
620
614
621
// Poor-mans binding to global state
615
622
// We need to invoke this in the JavaFX thread as all the listeners sit there
616
- Platform .runLater (() ->
617
- Globals .stateManager .activeDatabaseProperty ().setValue (Optional .of (currentBasePanel .getBibDatabaseContext ()))
618
- );
623
+ Platform .runLater (() -> Globals .stateManager .activeDatabaseProperty ().setValue (Optional .of (currentBasePanel .getBibDatabaseContext ())));
619
624
if (new SearchPreferences (Globals .prefs ).isGlobalSearch ()) {
620
625
globalSearchBar .performSearch ();
621
626
} else {
@@ -707,7 +712,7 @@ public void setWindowTitle() {
707
712
String changeFlag = panel .isModified () && !isAutosaveEnabled ? "*" : "" ;
708
713
String databaseFile = panel .getBibDatabaseContext ().getDatabaseFile ().map (File ::getPath )
709
714
.orElse (GUIGlobals .UNTITLED_TITLE );
710
- setTitle (FRAME_TITLE + " - " + databaseFile + changeFlag + modeInfo );
715
+ setTitle (FRAME_TITLE + " - " + databaseFile + changeFlag + modeInfo );
711
716
} else if (panel .getBibDatabaseContext ().getLocation () == DatabaseLocation .SHARED ) {
712
717
setTitle (FRAME_TITLE + " - " + panel .getBibDatabaseContext ().getDBMSSynchronizer ().getDBName () + " ["
713
718
+ Localization .lang ("shared" ) + "]" + modeInfo );
@@ -1056,6 +1061,10 @@ private void fillMenu() {
1056
1061
file .addSeparator ();
1057
1062
file .add (connectToSharedDatabaseAction );
1058
1063
file .add (pullChangesFromSharedDatabase );
1064
+ file .addSeparator ();
1065
+ file .add (synchronizeWithSharelatex );
1066
+ file .add (sendChangesToShareLatex );
1067
+ file .add (disconnectFromSharelatex );
1059
1068
1060
1069
file .addSeparator ();
1061
1070
file .add (databaseProperties );
@@ -1332,6 +1341,7 @@ private void createToolBar() {
1332
1341
tlb .addAction (cleanupEntries );
1333
1342
tlb .addAction (mergeEntries );
1334
1343
tlb .addAction (pullChangesFromSharedDatabase );
1344
+ tlb .addAction (synchronizeWithSharelatex );
1335
1345
tlb .addAction (openConsole );
1336
1346
1337
1347
tlb .addSeparator ();
@@ -1582,7 +1592,7 @@ private void trackOpenNewDatabase(BasePanel basePanel) {
1582
1592
1583
1593
Map <String , String > properties = new HashMap <>();
1584
1594
Map <String , Double > measurements = new HashMap <>();
1585
- measurements .put ("NumberOfEntries" , (double )basePanel .getDatabaseContext ().getDatabase ().getEntryCount ());
1595
+ measurements .put ("NumberOfEntries" , (double ) basePanel .getDatabaseContext ().getDatabase ().getEntryCount ());
1586
1596
1587
1597
Globals .getTelemetryClient ().ifPresent (client -> client .trackEvent ("OpenNewDatabase" , properties , measurements ));
1588
1598
}
@@ -1927,6 +1937,7 @@ public GlobalSearchBar getGlobalSearchBar() {
1927
1937
}
1928
1938
1929
1939
private static class MyGlassPane extends JPanel {
1940
+
1930
1941
public MyGlassPane () {
1931
1942
addKeyListener (new KeyAdapter () {
1932
1943
// Nothing
@@ -2087,8 +2098,7 @@ private class ChangeTabAction extends MnemonicAwareAction {
2087
2098
private final boolean next ;
2088
2099
2089
2100
public ChangeTabAction (boolean next ) {
2090
- putValue (Action .NAME , next ? Localization .menuTitle ("Next tab" ) :
2091
- Localization .menuTitle ("Previous tab" ));
2101
+ putValue (Action .NAME , next ? Localization .menuTitle ("Next tab" ) : Localization .menuTitle ("Previous tab" ));
2092
2102
this .next = next ;
2093
2103
putValue (Action .ACCELERATOR_KEY ,
2094
2104
next ? Globals .getKeyPrefs ().getKey (KeyBinding .NEXT_TAB ) : Globals .getKeyPrefs ().getKey (KeyBinding .PREVIOUS_TAB ));
@@ -2125,7 +2135,8 @@ public EditAction(String command, String menuTitle, String description, KeyStrok
2125
2135
putValue (Action .SHORT_DESCRIPTION , description );
2126
2136
}
2127
2137
2128
- @ Override public void actionPerformed (ActionEvent e ) {
2138
+ @ Override
2139
+ public void actionPerformed (ActionEvent e ) {
2129
2140
2130
2141
LOGGER .debug (Globals .getFocusListener ().getFocused ().toString ());
2131
2142
JComponent source = Globals .getFocusListener ().getFocused ();
0 commit comments