Commit 1022e90b authored by Sergey Malenkov's avatar Sergey Malenkov
Browse files

IDEA-159498 add logging for native preferences

parent d3076678
Showing with 8 additions and 2 deletions
+8 -2
...@@ -251,7 +251,9 @@ final class MacScrollBarUI extends DefaultScrollBarUI { ...@@ -251,7 +251,9 @@ final class MacScrollBarUI extends DefaultScrollBarUI {
ID defaults = invoke("NSUserDefaults", "standardUserDefaults"); ID defaults = invoke("NSUserDefaults", "standardUserDefaults");
invoke(defaults, "synchronize"); invoke(defaults, "synchronize");
ID behavior = invoke(defaults, "boolForKey:", nsString("AppleScrollerPagingBehavior")); ID behavior = invoke(defaults, "boolForKey:", nsString("AppleScrollerPagingBehavior"));
return 1 == behavior.intValue() ? JumpToSpot : NextPage; Behavior value = 1 == behavior.intValue() ? JumpToSpot : NextPage;
Logger.getInstance(MacScrollBarUI.class).debug("scroll bar behavior ", value, " from ", behavior);
return value;
} }
}; };
private static final Producer<ID> INIT = () -> invoke(invoke("NSDistributedNotificationCenter", "defaultCenter"), private static final Producer<ID> INIT = () -> invoke(invoke("NSDistributedNotificationCenter", "defaultCenter"),
...@@ -286,7 +288,9 @@ final class MacScrollBarUI extends DefaultScrollBarUI { ...@@ -286,7 +288,9 @@ final class MacScrollBarUI extends DefaultScrollBarUI {
@Override @Override
public Style produce() { public Style produce() {
ID style = invoke(getObjcClass("NSScroller"), "preferredScrollerStyle"); ID style = invoke(getObjcClass("NSScroller"), "preferredScrollerStyle");
return 1 == style.intValue() ? Overlay : Legacy; Style value = 1 == style.intValue() ? Overlay : Legacy;
Logger.getInstance(MacScrollBarUI.class).debug("scroll bar style ", value, " from ", style);
return value;
} }
}; };
private static final Producer<ID> INIT = () -> invoke(invoke("NSNotificationCenter", "defaultCenter"), private static final Producer<ID> INIT = () -> invoke(invoke("NSNotificationCenter", "defaultCenter"),
...@@ -302,6 +306,7 @@ final class MacScrollBarUI extends DefaultScrollBarUI { ...@@ -302,6 +306,7 @@ final class MacScrollBarUI extends DefaultScrollBarUI {
private T myValue; private T myValue;
public Native() { public Native() {
Logger.getInstance(MacScrollBarUI.class).debug("initialize scroll bar");
UIUtil.invokeLaterIfNeeded(this); UIUtil.invokeLaterIfNeeded(this);
} }
...@@ -311,6 +316,7 @@ final class MacScrollBarUI extends DefaultScrollBarUI { ...@@ -311,6 +316,7 @@ final class MacScrollBarUI extends DefaultScrollBarUI {
@SuppressWarnings("UnusedDeclaration") @SuppressWarnings("UnusedDeclaration")
public void callback(ID self, Pointer selector, ID event) { public void callback(ID self, Pointer selector, ID event) {
Logger.getInstance(MacScrollBarUI.class).debug("update scroll bar");
UIUtil.invokeLaterIfNeeded(this); UIUtil.invokeLaterIfNeeded(this);
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment