From 454fbc12f34ccc27ca48bd880617c14ad94db6f1 Mon Sep 17 00:00:00 2001 From: Henri Kerola Date: Sat, 18 Feb 2017 11:51:34 -0800 Subject: [PATCH] Fix indentations --- .../vaadin/hene/popupbutton/PopupButton.java | 2 +- .../client/ui/PopupButtonConnector.java | 64 +++++++++---------- .../widgetset/client/ui/PopupButtonState.java | 4 +- .../vaadin/hene/popupbutton/DefaultView.java | 16 ++--- .../popupbutton/ShortcutActionTestView.java | 2 +- 5 files changed, 44 insertions(+), 44 deletions(-) diff --git a/addon/src/main/java/org/vaadin/hene/popupbutton/PopupButton.java b/addon/src/main/java/org/vaadin/hene/popupbutton/PopupButton.java index 5d889d1..dc3d717 100644 --- a/addon/src/main/java/org/vaadin/hene/popupbutton/PopupButton.java +++ b/addon/src/main/java/org/vaadin/hene/popupbutton/PopupButton.java @@ -253,7 +253,7 @@ public interface PopupVisibilityListener extends Serializable { Method popupVisibilityMethod = ReflectTools.findMethod( PopupVisibilityListener.class, "popupVisibilityChange", - PopupVisibilityEvent.class); + PopupVisibilityEvent.class); /** * Pass to {@link PopupButton.PopupVisibilityEvent} to start listening diff --git a/addon/src/main/java/org/vaadin/hene/popupbutton/widgetset/client/ui/PopupButtonConnector.java b/addon/src/main/java/org/vaadin/hene/popupbutton/widgetset/client/ui/PopupButtonConnector.java index cada17a..855fc12 100644 --- a/addon/src/main/java/org/vaadin/hene/popupbutton/widgetset/client/ui/PopupButtonConnector.java +++ b/addon/src/main/java/org/vaadin/hene/popupbutton/widgetset/client/ui/PopupButtonConnector.java @@ -151,41 +151,41 @@ public void onPreviewNativeEvent(NativePreviewEvent event) { Element target = Element .as(event.getNativeEvent().getEventTarget()); switch (event.getTypeInt()) { - case Event.ONCLICK: - if (getWidget().isOrHasChildOfButton(target)) { - if (getState().popupVisible && getState().buttonClickTogglesPopupVisibility) { - getWidget().sync(); - rpc.setPopupVisible(false); + case Event.ONCLICK: + if (getWidget().isOrHasChildOfButton(target)) { + if (getState().popupVisible && getState().buttonClickTogglesPopupVisibility) { + getWidget().sync(); + rpc.setPopupVisible(false); + } } - } - break; - case Event.ONMOUSEDOWN: - if (!getWidget().isOrHasChildOfPopup(target) - && !getWidget().isOrHasChildOfConsole(target) - && !getWidget().isOrHasChildOfButton(target) - && getState().closePopupOnOutsideClick) { + break; + case Event.ONMOUSEDOWN: + if (!getWidget().isOrHasChildOfPopup(target) + && !getWidget().isOrHasChildOfConsole(target) + && !getWidget().isOrHasChildOfButton(target) + && getState().closePopupOnOutsideClick) { + if (getState().popupVisible) { + getWidget().sync(); + rpc.setPopupVisible(false); + } + } + break; + case Event.ONKEYPRESS: + if (getWidget().isOrHasChildOfPopup(target)) { + // Catch children that use keyboard, so we can unfocus + // them + // when + // hiding + getWidget().addToActiveChildren(target); + } + break; + case Event.ONKEYDOWN: if (getState().popupVisible) { - getWidget().sync(); - rpc.setPopupVisible(false); + getWidget().onKeyDownOnVisiblePopup(event.getNativeEvent(), this); } - } - break; - case Event.ONKEYPRESS: - if (getWidget().isOrHasChildOfPopup(target)) { - // Catch children that use keyboard, so we can unfocus - // them - // when - // hiding - getWidget().addToActiveChildren(target); - } - break; - case Event.ONKEYDOWN: - if (getState().popupVisible) { - getWidget().onKeyDownOnVisiblePopup(event.getNativeEvent(), this); - } - break; - default: - break; + break; + default: + break; } } } diff --git a/addon/src/main/java/org/vaadin/hene/popupbutton/widgetset/client/ui/PopupButtonState.java b/addon/src/main/java/org/vaadin/hene/popupbutton/widgetset/client/ui/PopupButtonState.java index a59cad9..d2f9e2e 100644 --- a/addon/src/main/java/org/vaadin/hene/popupbutton/widgetset/client/ui/PopupButtonState.java +++ b/addon/src/main/java/org/vaadin/hene/popupbutton/widgetset/client/ui/PopupButtonState.java @@ -6,8 +6,8 @@ public class PopupButtonState extends ButtonState { - public boolean popupVisible; - public Connector popupPositionConnector; + public boolean popupVisible; + public Connector popupPositionConnector; @DelegateToWidget public int direction = 0; diff --git a/demo/src/main/java/org/vaadin/hene/popupbutton/DefaultView.java b/demo/src/main/java/org/vaadin/hene/popupbutton/DefaultView.java index 122b00c..08a8522 100644 --- a/demo/src/main/java/org/vaadin/hene/popupbutton/DefaultView.java +++ b/demo/src/main/java/org/vaadin/hene/popupbutton/DefaultView.java @@ -75,14 +75,14 @@ public DefaultView() { listenerButton.setCaption("VisibilityListener"); listenerButton.addPopupVisibilityListener(event -> { String msg = "Popup closed"; - if (event.getPopupButton().isPopupVisible()) { - msg = "Popup opened"; - b.setClickShortcut(ShortcutAction.KeyCode.ENTER); - } else { - b.removeClickShortcut(); - } - Notification.show(msg); - }); + if (event.getPopupButton().isPopupVisible()) { + msg = "Popup opened"; + b.setClickShortcut(ShortcutAction.KeyCode.ENTER); + } else { + b.removeClickShortcut(); + } + Notification.show(msg); + }); horizontalLayout.addComponent(listenerButton); listenerButton.addClickListener(event -> { if (!listenerButton.isButtonClickTogglesPopupVisibility()) { diff --git a/demo/src/main/java/org/vaadin/hene/popupbutton/ShortcutActionTestView.java b/demo/src/main/java/org/vaadin/hene/popupbutton/ShortcutActionTestView.java index 23fa1ce..0d77ff1 100644 --- a/demo/src/main/java/org/vaadin/hene/popupbutton/ShortcutActionTestView.java +++ b/demo/src/main/java/org/vaadin/hene/popupbutton/ShortcutActionTestView.java @@ -20,7 +20,7 @@ public ShortcutActionTestView() { VerticalLayout popupLayout = new VerticalLayout(); popupLayout.addComponent(new TextField()); Button button = new Button("Click me!", event -> - Notification.show("Hello World!") + Notification.show("Hello World!") ); // When the popup is open pressing the enter should show "Hello World!"