Skip to content

Commit

Permalink
Make logviewer menubar available (#39)
Browse files Browse the repository at this point in the history
Make menubar available outside the logviewer, as clients might wish to
* set the system menubar property
* remove the menubar
* add items to the menubar
  • Loading branch information
petebankhead authored Jun 22, 2023
1 parent 2e625ac commit 577f3b9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 10 additions & 0 deletions log-viewer/src/main/java/qupath/ui/logviewer/LogViewer.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ public class LogViewer extends BorderPane {
private static final DateFormat TIMESTAMP_FORMAT = new SimpleDateFormat(System.getProperty("timestamp.format", "HH:mm:ss"));
private final static ResourceBundle resources = ResourceBundle.getBundle("qupath.ui.logviewer.strings");

@FXML
private MenuBar menubar;
@FXML
private Menu threadFilterMenu;
@FXML
Expand Down Expand Up @@ -94,6 +96,14 @@ public LogViewer() throws IOException {
loader.load();
}

/**
* Get the default menubar associated with the log viewer.
* @return the menubar
*/
public MenuBar getMenubar() {
return menubar;
}

@FXML
private void initialize() {
setUpDisplayedLogLevels();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<?import javafx.scene.layout.FlowPane?>
<?import javafx.scene.layout.HBox?>

<fx:root maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" stylesheets="@css/styles.css" type="BorderPane" xmlns="http://javafx.com/javafx/19" xmlns:fx="http://javafx.com/fxml/1">
<fx:root maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" stylesheets="@css/styles.css" type="BorderPane" xmlns="http://javafx.com/javafx/20.0.1" xmlns:fx="http://javafx.com/fxml/1">
<center>
<BorderPane prefHeight="200.0" prefWidth="200.0" BorderPane.alignment="CENTER">
<center>
Expand Down Expand Up @@ -62,7 +62,7 @@
</BorderPane>
</center>
<top>
<MenuBar BorderPane.alignment="CENTER">
<MenuBar fx:id="menubar" BorderPane.alignment="CENTER">
<Menu mnemonicParsing="false" text="%Menu.File">
<MenuItem mnemonicParsing="false" onAction="#close" text="%Action.File.close">
<accelerator>
Expand Down

0 comments on commit 577f3b9

Please sign in to comment.