File tree Expand file tree Collapse file tree
src/main/java/org/cryptomator/integrations/uiappearance Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ package org .cryptomator .integrations .uiappearance ;
2+
3+ @ FunctionalInterface
4+ public interface UiAppearanceListener {
5+
6+ void systemAppearanceChanged (Theme newTheme );
7+
8+ }
Original file line number Diff line number Diff line change 55 */
66public interface UiAppearanceProvider {
77
8- Theme getCurrentTheme () throws UiAppearanceException ;
8+ /**
9+ * Gets the best-matching theme for the OS's current L&F. This might be an approximation, as the OS might support more variations than we do.
10+ *
11+ * @implSpec Should default to {@link Theme#LIGHT} if the OS theme can't be determined, should not throw exceptions.
12+ * @return The current OS theme
13+ */
14+ Theme getSystemTheme ();
915
10- void addListener () throws UiAppearanceException ;
11- void removeListener () throws UiAppearanceProvider ;
16+ /**
17+ * Adjusts parts of the UI to the desired theme, that can not be directly controlled from within Java.
18+ * This might be required for window decorations or tray icons. Can be no-op.
19+ *
20+ * @implSpec A best-effort attempt should be made. If adjustments fail, do not throw an exception.
21+ * @param theme What theme to adjust to
22+ */
23+ void adjustToTheme (Theme theme );
24+
25+ /**
26+ * Registers a listener that gets notified when the system theme changes.
27+ *
28+ * @param listener The listener
29+ * @throws UiAppearanceException If registering the listener failed.
30+ */
31+ void addListener (UiAppearanceListener listener ) throws UiAppearanceException ;
32+
33+ /**
34+ * Removes a previously registered listener.
35+ *
36+ * @param listener The listener
37+ * @throws UiAppearanceException If removing the listener failed.
38+ */
39+ void removeListener (UiAppearanceListener listener ) throws UiAppearanceException ;
1240
1341}
You can’t perform that action at this time.
0 commit comments