50
50
import javafx .scene .layout .Pane ;
51
51
import javafx .scene .layout .Priority ;
52
52
import javafx .stage .Stage ;
53
- import javafx .util .Duration ;
54
53
55
54
import org .jabref .Globals ;
56
55
import org .jabref .JabRefExecutorService ;
132
131
import org .jabref .preferences .LastFocusedTabPreferences ;
133
132
134
133
import com .google .common .eventbus .Subscribe ;
135
- import com .jfoenix .controls .JFXSnackbar ;
136
- import com .jfoenix .controls .JFXSnackbar .SnackbarEvent ;
137
- import com .jfoenix .controls .JFXSnackbarLayout ;
138
134
import org .eclipse .fx .ui .controls .tabpane .DndTabPane ;
139
135
import org .eclipse .fx .ui .controls .tabpane .DndTabPaneFactory ;
140
136
import org .fxmisc .easybind .EasyBind ;
@@ -151,12 +147,11 @@ public class JabRefFrame extends BorderPane {
151
147
public static final String FRAME_TITLE = "JabRef" ;
152
148
153
149
private static final Logger LOGGER = LoggerFactory .getLogger (JabRefFrame .class );
154
- private static final Duration TOAST_MESSAGE_DISPLAY_TIME = Duration .millis (3000 );
155
150
156
151
private final SplitPane splitPane = new SplitPane ();
157
152
private final JabRefPreferences prefs = Globals .prefs ;
158
153
private final GlobalSearchBar globalSearchBar = new GlobalSearchBar (this );
159
- private final JFXSnackbar statusLine = new JFXSnackbar ( this );
154
+
160
155
private final ProgressBar progressBar = new ProgressBar ();
161
156
private final FileHistoryMenu fileHistory = new FileHistoryMenu (prefs , this );
162
157
@@ -182,7 +177,7 @@ public class JabRefFrame extends BorderPane {
182
177
183
178
public JabRefFrame (Stage mainStage ) {
184
179
this .mainStage = mainStage ;
185
- this .dialogService = new FXDialogService (mainStage );
180
+ this .dialogService = new FXDialogService (mainStage , this );
186
181
init ();
187
182
}
188
183
@@ -962,16 +957,6 @@ public void addParserResult(ParserResult pr, boolean focusPanel) {
962
957
}
963
958
}
964
959
965
- /**
966
- * Displays the given message at the bottom of the main frame
967
- *
968
- * @deprecated use {@link DialogService#notify(String)} instead. However, do not remove this method, it's called from the dialogService
969
- */
970
- @ Deprecated
971
- public void output (final String message ) {
972
- DefaultTaskExecutor .runInJavaFXThread (() -> statusLine .fireEvent (new SnackbarEvent (new JFXSnackbarLayout (message ), TOAST_MESSAGE_DISPLAY_TIME , null )));
973
- }
974
-
975
960
private void initActions () {
976
961
/*
977
962
openDatabaseOnlyActions.clear();
@@ -1279,7 +1264,7 @@ private boolean confirmClose(BasePanel panel) {
1279
1264
return true ;
1280
1265
}
1281
1266
// The action was either canceled or unsuccessful.
1282
- output (Localization .lang ("Unable to save library" ));
1267
+ dialogService . notify (Localization .lang ("Unable to save library" ));
1283
1268
} catch (Throwable ex ) {
1284
1269
LOGGER .error ("A problem occurred when trying to save the file" , ex );
1285
1270
dialogService .showErrorDialogAndWait (Localization .lang ("Save library" ), Localization .lang ("Could not save file." ), ex );
@@ -1321,7 +1306,7 @@ private void removeTab(BasePanel panel) {
1321
1306
panel .cleanUp ();
1322
1307
tabbedPane .getTabs ().remove (getTab (panel ));
1323
1308
setWindowTitle ();
1324
- output (Localization .lang ("Closed library" ) + '.' );
1309
+ dialogService . notify (Localization .lang ("Closed library" ) + '.' );
1325
1310
// update tab titles
1326
1311
updateAllTabTitles ();
1327
1312
});
0 commit comments