return result.toString();
}
- private boolean runningLayout = false;
-
/**
- * Causes a re-calculation/re-layout of all paintables in a container.
+ * Does absolutely nothing. Replaced by {@link LayoutManager}.
*
* @param container
+ * @deprecated As of 7.0, serves no purpose
*/
+ @Deprecated
public void runDescendentsLayout(HasWidgets container) {
- if (runningLayout) {
- return;
- }
- runningLayout = true;
- internalRunDescendentsLayout(container);
- runningLayout = false;
}
/**
VConsole.log("forceLayout in " + duration.elapsedMillis() + " ms");
}
- private void internalRunDescendentsLayout(HasWidgets container) {
- // getConsole().log(
- // "runDescendentsLayout(" + Util.getSimpleName(container) + ")");
- final Iterator<Widget> childWidgets = container.iterator();
- while (childWidgets.hasNext()) {
- final Widget child = childWidgets.next();
-
- if (getConnectorMap().isConnector(child)) {
-
- if (handleComponentRelativeSize(child)) {
- /*
- * Only need to propagate event if "child" has a relative
- * size
- */
-
- if (child instanceof ContainerResizedListener) {
- ((ContainerResizedListener) child).iLayout();
- }
-
- if (child instanceof HasWidgets) {
- final HasWidgets childContainer = (HasWidgets) child;
- internalRunDescendentsLayout(childContainer);
- }
- }
- } else if (child instanceof HasWidgets) {
- // propagate over non Paintable HasWidgets
- internalRunDescendentsLayout((HasWidgets) child);
- }
-
- }
- }
-
/**
- * Converts relative sizes into pixel sizes.
+ * Returns false
*
- * @param child
- * @return true if the child has a relative size
+ * @param paintable
+ * @return false, always
+ * @deprecated As of 7.0, serves no purpose
*/
+ @Deprecated
private boolean handleComponentRelativeSize(ComponentConnector paintable) {
return false;
}
/**
- * Converts relative sizes into pixel sizes.
+ * Returns false
*
- * @param child
- * @return true if the child has a relative size
+ * @param paintable
+ * @return false, always
+ * @deprecated As of 7.0, serves no purpose
*/
+ @Deprecated
public boolean handleComponentRelativeSize(Widget widget) {
return handleComponentRelativeSize(connectorMap.getConnector(widget));
/**
* ContainerResizedListener interface is useful for Widgets that support
* relative sizes and who need some additional sizing logic.
+ *
+ * @deprecated As of 7.0, serves no purpose. Use {@link LayoutManager} and its
+ * methods instead.
*/
+@Deprecated
public interface ContainerResizedListener {
/**
* This function is run when container box has been resized. Object
* container has resized. runAnchestorsLayout(HasWidgets parent) function
* from Util class may be a good helper for this.
*
+ * @deprecated As of 7.0, this method is never called by the framework.
+ *
*/
+ @Deprecated
public void iLayout();
}
} else if (getChildWidget() != newWidget) {
replaceWidget(newWidget);
}
- if (contentUidl.getBooleanAttribute("cached")) {
- /*
- * The size of a cached, relative sized component must be
- * updated to report correct size.
- */
- client.handleComponentRelativeSize(newPntbl.getWidget());
- }
if (isOpen() && isDynamicHeight()) {
setHeightFromWidget();
}
}
// TODO refactor this code to be the same as in resize timer
- boolean needsReLayout = false;
if (availW > total) {
// natural size is smaller than available space
final int extraSpace = availW - total;
final int totalWidthR = total - totalExplicitColumnsWidths;
int checksum = 0;
- needsReLayout = true;
if (extraSpace == 1) {
// We cannot divide one single pixel so we give it the first
initializedAndAttached = true;
- if (needsReLayout) {
- scrollBody.reLayoutComponents();
- }
-
updatePageLength();
/*
* Ensures the column alignments are correct at initial loading. <br/>
* (child components widths are correct)
*/
- scrollBody.reLayoutComponents();
Scheduler.get().scheduleDeferred(new Command() {
@Override
}
}
- private void reLayoutComponents() {
- for (Widget w : this) {
- VScrollTableRow r = (VScrollTableRow) w;
- for (Widget widget : r) {
- client.handleComponentRelativeSize(widget);
- }
- }
- }
-
public int getLastRendered() {
return lastRendered;
}
Util.notifyParentOfSizeChange(VScrollTable.this, false);
}
}
- scrollBody.reLayoutComponents();
Scheduler.get().scheduleDeferred(new Command() {
@Override
tp.showWidget(activeTabIndex);
VTabsheet.this.iLayout();
- /*
- * The size of a cached, relative sized component must be updated to
- * report correct size to updateOpenTabSize().
- */
- if (contentUIDL.getBooleanAttribute("cached")) {
- client.handleComponentRelativeSize(content.getWidget());
- }
updateOpenTabSize();
VTabsheet.this.removeStyleDependentName("loading");
}
import com.google.gwt.user.client.Element;
import com.google.gwt.user.client.Event;
import com.google.gwt.user.client.Window;
-import com.google.gwt.user.client.ui.HasWidgets;
import com.google.gwt.user.client.ui.Widget;
import com.vaadin.client.ApplicationConnection;
import com.vaadin.client.BrowserInfo;
}
private void updateContentsSize() {
- Widget childWidget = getWidget();
-
- // Update child widget dimensions
- if (client != null && childWidget != null) {
- client.handleComponentRelativeSize(childWidget);
- if (childWidget instanceof HasWidgets) {
- client.runDescendentsLayout((HasWidgets) childWidget);
- }
- }
-
LayoutManager layoutManager = getLayoutManager();
layoutManager.setNeedsMeasure(ConnectorMap.get(client).getConnector(
this));
getWidget().iLayout();
- // Re run relative size update to ensure optimal scrollbars
- // TODO isolate to situation that visible tab has undefined height
- try {
- client.handleComponentRelativeSize(getWidget().tp
- .getWidget(getWidget().tp.getVisibleWidget()));
- } catch (Exception e) {
- // Ignore, most likely empty tabsheet
- }
-
getWidget().waitingForResponse = false;
}