mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-28 14:57:12 +00:00
Added ResizableFlowPanel to be able to fix hierarchical resizing
This commit is contained in:
1 parent
7223a23984
commit
f76c8c2e1e
1 file changed
+23
+23
@@ -0,0 +1,23 @@
|
||||
package com.sap.sailing.gwt.ui.raceboard;
|
||||
|
||||
import com.google.gwt.user.client.ui.FlowPanel;
|
||||
import com.google.gwt.user.client.ui.RequiresResize;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.google.gwt.user.client.ui.WidgetCollection;
|
||||
|
||||
/**
|
||||
* Utility class extending {@link FlowPanel} and implementing {@link RequiresResize} interface. All
|
||||
* {@link #getChildren() children} also implementing {@link RequiresResize} are informed by calling their
|
||||
* {@link RequiresResize#onResize()} method.
|
||||
*/
|
||||
class ResizableFlowPanel extends FlowPanel implements RequiresResize {
|
||||
@Override
|
||||
public void onResize() {
|
||||
WidgetCollection children = getChildren();
|
||||
for (Widget widget : children) {
|
||||
if (widget instanceof RequiresResize) {
|
||||
((RequiresResize) widget).onResize();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user