diff options
author | Artur Signell <artur@vaadin.com> | 2015-06-24 11:29:50 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2015-06-26 07:54:06 +0000 |
commit | 7355f1a26277d7644cfc974f4c4d8b7bc898c366 (patch) | |
tree | 281633f608a704bbaaa8b564d3b55c422b2811be /client/src | |
parent | afefa100a75760a05519038e19e6b64669411549 (diff) | |
download | vaadin-framework-7355f1a26277d7644cfc974f4c4d8b7bc898c366.tar.gz vaadin-framework-7355f1a26277d7644cfc974f4c4d8b7bc898c366.zip |
Reformat with Luna SR2
Change-Id: I8a666061496022ef16ed44812b5728e1360b9c4d
Diffstat (limited to 'client/src')
-rw-r--r-- | client/src/com/vaadin/client/BrowserInfo.java | 3 | ||||
-rw-r--r-- | client/src/com/vaadin/client/VTooltip.java | 25 | ||||
-rw-r--r-- | client/src/com/vaadin/client/renderers/ImageRenderer.java | 3 | ||||
-rw-r--r-- | client/src/com/vaadin/client/ui/VFormLayout.java | 2 | ||||
-rw-r--r-- | client/src/com/vaadin/client/ui/VMenuBar.java | 4 | ||||
-rw-r--r-- | client/src/com/vaadin/client/ui/VTabsheet.java | 27 |
6 files changed, 36 insertions, 28 deletions
diff --git a/client/src/com/vaadin/client/BrowserInfo.java b/client/src/com/vaadin/client/BrowserInfo.java index 01968a17a6..8b274623c1 100644 --- a/client/src/com/vaadin/client/BrowserInfo.java +++ b/client/src/com/vaadin/client/BrowserInfo.java @@ -88,7 +88,8 @@ public class BrowserInfo { } else if (browserDetails.isIE()) { touchDevice = detectIETouchDevice(); } else { - //PhantomJS pretends to be a touch device which breaks some UI tests + // PhantomJS pretends to be a touch device which breaks some UI + // tests touchDevice = !browserDetails.isPhantomJS() && detectTouchDevice(); } } diff --git a/client/src/com/vaadin/client/VTooltip.java b/client/src/com/vaadin/client/VTooltip.java index b9392e3941..4e59040298 100644 --- a/client/src/com/vaadin/client/VTooltip.java +++ b/client/src/com/vaadin/client/VTooltip.java @@ -177,7 +177,7 @@ public class VTooltip extends VOverlay { int x = 0; int y = 0; - if(BrowserInfo.get().isTouchDevice()) { + if (BrowserInfo.get().isTouchDevice()) { setMaxWidth(Window.getClientWidth()); offsetWidth = getOffsetWidth(); offsetHeight = getOffsetHeight(); @@ -239,8 +239,8 @@ public class VTooltip extends VOverlay { private int getFinalTouchX(int offsetWidth) { int x = 0; int widthNeeded = 10 + offsetWidth; - int roomLeft = currentElement != null ? - currentElement.getAbsoluteLeft() : EVENT_XY_POSITION_OUTSIDE; + int roomLeft = currentElement != null ? currentElement + .getAbsoluteLeft() : EVENT_XY_POSITION_OUTSIDE; int viewPortWidth = Window.getClientWidth(); int roomRight = viewPortWidth - roomLeft; if (roomRight > widthNeeded) { @@ -249,7 +249,8 @@ public class VTooltip extends VOverlay { x = roomLeft - offsetWidth; } if (x + offsetWidth - Window.getScrollLeft() > viewPortWidth) { - x = viewPortWidth - offsetWidth + Window.getScrollLeft(); + x = viewPortWidth - offsetWidth + + Window.getScrollLeft(); } if (roomLeft != EVENT_XY_POSITION_OUTSIDE) { @@ -316,17 +317,20 @@ public class VTooltip extends VOverlay { */ private int getFinalTouchY(int offsetHeight) { int y = 0; - int heightNeeded = 10 + offsetHeight; - int roomAbove = currentElement != null ? - currentElement.getAbsoluteTop() + currentElement.getOffsetHeight() + int heightNeeded = 10 + offsetHeight; + int roomAbove = currentElement != null ? currentElement + .getAbsoluteTop() + + currentElement.getOffsetHeight() : EVENT_XY_POSITION_OUTSIDE; int roomBelow = Window.getClientHeight() - roomAbove; if (roomBelow > heightNeeded) { y = roomAbove; } else { - y = roomAbove - offsetHeight - - (currentElement != null ? currentElement.getOffsetHeight() : 0); + y = roomAbove + - offsetHeight + - (currentElement != null ? currentElement + .getOffsetHeight() : 0); } if (y + offsetHeight - Window.getScrollTop() > Window @@ -355,7 +359,6 @@ public class VTooltip extends VOverlay { } } - /** * For assistive tooltips to work correctly we must have the tooltip visible * and attached to the DOM well in advance. For this reason both isShowing @@ -537,7 +540,7 @@ public class VTooltip extends VOverlay { @Override public void onMouseDown(MouseDownEvent event) { - handleHideEvent(); + handleHideEvent(); } @Override diff --git a/client/src/com/vaadin/client/renderers/ImageRenderer.java b/client/src/com/vaadin/client/renderers/ImageRenderer.java index 9e61e60919..d52bc1ba6d 100644 --- a/client/src/com/vaadin/client/renderers/ImageRenderer.java +++ b/client/src/com/vaadin/client/renderers/ImageRenderer.java @@ -42,8 +42,7 @@ public class ImageRenderer extends ClickableRenderer<String, Image> { public void render(RendererCellReference cell, String url, Image image) { if (url == null) { image.setUrl(TRANSPARENT_GIF_1PX); - } - else { + } else { image.setUrl(url); } } diff --git a/client/src/com/vaadin/client/ui/VFormLayout.java b/client/src/com/vaadin/client/ui/VFormLayout.java index 42dbbde32a..84a9b4f3dd 100644 --- a/client/src/com/vaadin/client/ui/VFormLayout.java +++ b/client/src/com/vaadin/client/ui/VFormLayout.java @@ -366,7 +366,7 @@ public class VFormLayout extends SimplePanel { public ErrorFlag(ComponentConnector owner) { setStyleName(CLASSNAME); - if(!BrowserInfo.get().isTouchDevice()) { + if (!BrowserInfo.get().isTouchDevice()) { sinkEvents(VTooltip.TOOLTIP_EVENTS); } diff --git a/client/src/com/vaadin/client/ui/VMenuBar.java b/client/src/com/vaadin/client/ui/VMenuBar.java index c6c4b444e5..fb8ba013f7 100644 --- a/client/src/com/vaadin/client/ui/VMenuBar.java +++ b/client/src/com/vaadin/client/ui/VMenuBar.java @@ -914,8 +914,8 @@ public class VMenuBar extends SimpleFocusablePanel implements String currentStyles = super.getStyleName(); List<String> customStyles = new ArrayList<String>(); - for(String style : currentStyles.split(" ")) { - if(!style.isEmpty() && !style.startsWith(primaryStyleName)) { + for (String style : currentStyles.split(" ")) { + if (!style.isEmpty() && !style.startsWith(primaryStyleName)) { customStyles.add(style); } } diff --git a/client/src/com/vaadin/client/ui/VTabsheet.java b/client/src/com/vaadin/client/ui/VTabsheet.java index 8e4f3cb643..ded9977f5e 100644 --- a/client/src/com/vaadin/client/ui/VTabsheet.java +++ b/client/src/com/vaadin/client/ui/VTabsheet.java @@ -1101,7 +1101,8 @@ public class VTabsheet extends VTabsheetBase implements Focusable, SubPartAware } private boolean isScrollerHidden() { - return scroller.getStyle().getDisplay().equals(Display.NONE.getCssName()); + return scroller.getStyle().getDisplay() + .equals(Display.NONE.getCssName()); } private boolean isIndexSkippingHiddenTabs() { @@ -1124,16 +1125,16 @@ public class VTabsheet extends VTabsheetBase implements Focusable, SubPartAware // Should not set tabs visible if they are scrolled out of view tab.setVisible(false); } else { - //When the tab was hidden and then turned visible again - //and there is space for it, it should be in view (#17096) (#17333) + // When the tab was hidden and then turned visible again + // and there is space for it, it should be in view (#17096) (#17333) if (isTabSetVisibleBeforeScroller(tabState, index, tab)) { scrollerIndex = index; tab.setVisible(true); tab.setStyleNames(false, true); - //scroll to the currently selected tab if it got clipped - //after making another tab visible - if(isClippedTabs()) { + // scroll to the currently selected tab if it got clipped + // after making another tab visible + if (isClippedTabs()) { scrollIntoView(getActiveTab()); } } else { @@ -1149,16 +1150,20 @@ public class VTabsheet extends VTabsheetBase implements Focusable, SubPartAware } /** - * Checks whether the tab has been set to visible and the scroller is at the first visible tab. - * That means that the scroller has to be adjusted so that the tab is visible again. + * Checks whether the tab has been set to visible and the scroller is at the + * first visible tab. That means that the scroller has to be adjusted so + * that the tab is visible again. */ - private boolean isTabSetVisibleBeforeScroller(TabState tabState, int index, Tab tab) { + private boolean isTabSetVisibleBeforeScroller(TabState tabState, int index, + Tab tab) { return isIndexSkippingHiddenTabs() && isScrollerAtFirstVisibleTab() - && hasTabChangedVisibility(tabState, tab) && scrolledOutOfView(index); + && hasTabChangedVisibility(tabState, tab) + && scrolledOutOfView(index); } /** - * Checks whether the tab is visible on server but is not visible on client yet. + * Checks whether the tab is visible on server but is not visible on client + * yet. */ private boolean hasTabChangedVisibility(TabState tabState, Tab tab) { return !tab.isVisible() && tabState.visible; |