Collection<ElementResizeListener> listeners = elementResizeListeners
.get(element);
if (listeners != null) {
+ Profiler.enter("Layout fire resize events - listeners not null");
+ Profiler.enter("ElementResizeListener.onElementResize copy list");
ElementResizeListener[] array = listeners
.toArray(new ElementResizeListener[listeners
.size()]);
+ Profiler.leave("ElementResizeListener.onElementResize copy list");
ElementResizeEvent event = new ElementResizeEvent(this,
element);
for (ElementResizeListener listener : array) {
try {
String key = null;
if (Profiler.isEnabled()) {
- key = "ElementReizeListener.onElementReize for "
+ Profiler.enter("ElementResizeListener.onElementResize construct profiler key");
+ key = "ElementResizeListener.onElementResize for "
+ Util.getSimpleName(listener);
+ Profiler.leave("ElementResizeListener.onElementResize construct profiler key");
Profiler.enter(key);
}
VConsole.error(e);
}
}
+ Profiler.leave("Layout fire resize events - listeners not null");
}
}
listenersToFire.clear();
private void onConnectorChange(ComponentConnector connector,
boolean widthChanged, boolean heightChanged) {
Profiler.enter("LayoutManager.onConnectorChange");
+ Profiler.enter("LayoutManager.onConnectorChange setNeedsOverflowFix");
setNeedsOverflowFix(connector);
+ Profiler.leave("LayoutManager.onConnectorChange setNeedsOverflowFix");
+ Profiler.enter("LayoutManager.onConnectorChange heightChanged");
if (heightChanged) {
currentDependencyTree.markHeightAsChanged(connector);
}
+ Profiler.leave("LayoutManager.onConnectorChange heightChanged");
+ Profiler.enter("LayoutManager.onConnectorChange widthChanged");
if (widthChanged) {
currentDependencyTree.markWidthAsChanged(connector);
}
+ Profiler.leave("LayoutManager.onConnectorChange widthChanged");
Profiler.leave("LayoutManager.onConnectorChange");
}
}
Profiler.leave("AbstractComponentConnector.onStateChanged update tab index");
+ Profiler.enter("AbstractComponentConnector.onStateChanged AbstractConnector.onStateChanged()");
super.onStateChanged(stateChangeEvent);
+ Profiler.leave("AbstractComponentConnector.onStateChanged AbstractConnector.onStateChanged()");
// Style names
+ Profiler.enter("AbstractComponentConnector.onStateChanged updateWidgetStyleNames");
updateWidgetStyleNames();
+ Profiler.leave("AbstractComponentConnector.onStateChanged updateWidgetStyleNames");
/*
* updateComponentSize need to be after caption update so caption can be
* taken into account
*/
+ Profiler.enter("AbstractComponentConnector.onStateChanged updateComponentSize");
updateComponentSize();
+ Profiler.leave("AbstractComponentConnector.onStateChanged updateComponentSize");
Profiler.enter("AbstractComponentContainer.onStateChanged check tooltip");
if (!tooltipListenersAttached && hasTooltip()) {
import com.vaadin.client.FastStringSet;
import com.vaadin.client.HasComponentsConnector;
import com.vaadin.client.JsArrayObject;
+import com.vaadin.client.Profiler;
import com.vaadin.client.ServerConnector;
import com.vaadin.client.Util;
import com.vaadin.client.VConsole;
}
public void markSizeAsChanged() {
+ Profiler.enter("LayoutDependency.markSizeAsChanged phase 1");
// When the size has changed, all that use that size should be
// layouted
JsArrayString needsSizeForLayout = getNeedsSizeForLayout();
LayoutDependency layoutDependency = getDependency(connectorId,
direction);
if (layoutDependency.connector instanceof ManagedLayout) {
+ Profiler.enter("LayoutDependency.markSizeAsChanged setNeedsLayout");
layoutDependency.setNeedsLayout(true);
+ Profiler.leave("LayoutDependency.markSizeAsChanged setNeedsLayout");
} else {
+ Profiler.enter("LayoutDependency.markSizeAsChanged propagatePostLayoutMeasure");
// Should simulate setNeedsLayout(true) + markAsLayouted ->
// propagate needs measure
layoutDependency.propagatePostLayoutMeasure();
+ Profiler.leave("LayoutDependency.markSizeAsChanged propagatePostLayoutMeasure");
}
}
+ Profiler.leave("LayoutDependency.markSizeAsChanged phase 1");
+ Profiler.enter("LayoutDependency.markSizeAsChanged scrollbars");
// Should also go through the hierarchy to discover appeared or
// disappeared scrollbars
ComponentConnector scrollingBoundary = getScrollingBoundary(connector);
getDependency(scrollingBoundary.getConnectorId(),
getOppositeDirection()).setNeedsMeasure(true);
}
+ Profiler.leave("LayoutDependency.markSizeAsChanged scrollbars");
}
}
private void propagatePostLayoutMeasure() {
+ Profiler.enter("LayoutDependency.propagatePostLayoutMeasure getResizedByLayout");
JsArrayString resizedByLayout = getResizedByLayout();
+ Profiler.leave("LayoutDependency.propagatePostLayoutMeasure getResizedByLayout");
int length = resizedByLayout.length();
for (int i = 0; i < length; i++) {
+ Profiler.enter("LayoutDependency.propagatePostLayoutMeasure setNeedsMeasure");
String resizedId = resizedByLayout.get(i);
LayoutDependency layoutDependency = getDependency(resizedId,
direction);
layoutDependency.setNeedsMeasure(true);
+ Profiler.leave("LayoutDependency.propagatePostLayoutMeasure setNeedsMeasure");
}
// Special case for e.g. wrapping texts
+ Profiler.enter("LayoutDependency.propagatePostLayoutMeasure horizontal case");
if (direction == HORIZONTAL && !connector.isUndefinedWidth()
&& connector.isUndefinedHeight()) {
LayoutDependency dependency = getDependency(
connector.getConnectorId(), VERTICAL);
dependency.setNeedsMeasure(true);
}
+ Profiler.leave("LayoutDependency.propagatePostLayoutMeasure horizontal case");
}
@Override
import com.vaadin.client.ConnectorHierarchyChangeEvent;
import com.vaadin.client.LayoutManager;
import com.vaadin.client.Paintable;
+import com.vaadin.client.Profiler;
import com.vaadin.client.UIDL;
import com.vaadin.client.ui.AbstractSingleComponentContainerConnector;
import com.vaadin.client.ui.ClickEventHandler;
VPanel panel = getWidget();
LayoutManager layoutManager = getLayoutManager();
+ Profiler.enter("PanelConnector.layout getHeights");
int top = layoutManager.getOuterHeight(panel.captionNode);
int bottom = layoutManager.getInnerHeight(panel.bottomDecoration);
+ Profiler.leave("PanelConnector.layout getHeights");
+ Profiler.enter("PanelConnector.layout modify style");
Style style = panel.getElement().getStyle();
panel.captionNode.getParentElement().getStyle()
.setMarginTop(-top, Unit.PX);
panel.bottomDecoration.getStyle().setMarginBottom(-bottom, Unit.PX);
style.setPaddingTop(top, Unit.PX);
style.setPaddingBottom(bottom, Unit.PX);
+ Profiler.leave("PanelConnector.layout modify style");
// Update scroll positions
+ Profiler.enter("PanelConnector.layout update scroll positions");
panel.contentNode.setScrollTop(panel.scrollTop);
panel.contentNode.setScrollLeft(panel.scrollLeft);
+ Profiler.leave("PanelConnector.layout update scroll positions");
+
// Read actual value back to ensure update logic is correct
+ Profiler.enter("PanelConnector.layout read scroll positions");
panel.scrollTop = panel.contentNode.getScrollTop();
panel.scrollLeft = panel.contentNode.getScrollLeft();
+ Profiler.leave("PanelConnector.layout read scroll positions");
}
@Override