Skip to content

Commit ab2868e

Browse files
authored
add onBeforeOpenMenu listener to TrayMenuController (#11)
1 parent 60e32c5 commit ab2868e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/main/java/org/cryptomator/integrations/tray/TrayMenuController.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,16 @@ static Optional<TrayMenuController> get() {
4040
*/
4141
void updateTrayMenu(List<TrayMenuItem> items) throws TrayMenuException;
4242

43+
/**
44+
* Action to run before the tray menu opens.
45+
* <p>
46+
* This method is used to set up an event listener for when the menu is opened,
47+
* e.g. so that the vault list can be updated to reflect volume mount state changes
48+
* which occur while Cryptomator is in the system tray (and not open).
49+
*
50+
* @param listener
51+
* @throws IllegalStateException thrown when adding listeners fails (i.e. there's no tray menu)
52+
*/
53+
void onBeforeOpenMenu(Runnable listener);
54+
4355
}

0 commit comments

Comments
 (0)