public class Layouts extends Object
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_CHILD_SIZE |
Constructor and Description |
---|
Layouts() |
Modifier and Type | Method and Description |
---|---|
static boolean |
disableNearestScrollPanel(com.google.gwt.user.client.ui.Widget w)
Disables the scrolling behaviour of the nearest scrollpanel found in the given widget's containment hierarchy.
|
static String |
getContainedHierarchy(com.google.gwt.user.client.ui.Widget startAt)
Returns a multi-line string detailing layout information about the given widget and each of its descendants in
the widget tree.
|
static String |
getContainmentHierarchy(com.google.gwt.user.client.ui.Widget w)
Returns a multi-line string detailing layout information about the given widget and each of its ancestors in the
widget tree.
|
static String |
getContainmentHierarchy(com.google.gwt.user.client.ui.Widget w,
boolean setDebugIds)
Returns a multi-line string detailing layout information about the given widget and each of its ancestors in the
widget tree, optionally setting debug IDs on each widget to assist in locating them in browser DOM explorer
tools.
|
static int |
heightOrDefault(PanelDefinition def) |
static void |
setToFillParent(com.google.gwt.user.client.ui.Widget w)
Sets the CSS on the given widget so it automatically fills the available space, rather than being sized based on
the amount of space required by its contents.
|
static int |
widthOrDefault(PanelDefinition def) |
static int |
widthOrHeight(CompassPosition position,
PanelDefinition definition)
Returns the current width or height of the given panel definition.
|
public static final int DEFAULT_CHILD_SIZE
public static void setToFillParent(com.google.gwt.user.client.ui.Widget w)
To achieve this, the element is given relative positioning with top and left set to 0px and width and height set
to 100%. This makes the widget fill its nearest ancestor which has relative or absolute positioning. This
technique is compatible with GWT's LayoutPanel system. Note that, like LayoutPanels, this only works if the host
page is in standards mode (has a <!DOCTYPE html>
header).
w
- the widget that should always fill its available space, rather than being sized to fit its contents.public static String getContainmentHierarchy(com.google.gwt.user.client.ui.Widget w)
w
- the widget to start at. Null is permitted, and results in this method returning an empty string.public static String getContainmentHierarchy(com.google.gwt.user.client.ui.Widget w, boolean setDebugIds)
w
- the widget to start at. Null is permitted, and results in this method returning an empty string.setDebugIds
- if true, the element and each of its ancestors will have its ID set to
"containment-parent-depth"
, where depth is 0 for the given widget, 1 for
its parent, 2 for its grandparent, and so on. This ID will replace any ID that was previously set on
the element, so it may break some CSS and even javascript functionality. Use with caution.public static String getContainedHierarchy(com.google.gwt.user.client.ui.Widget startAt)
startAt
- the widget to start at. Null is permitted.public static int widthOrHeight(CompassPosition position, PanelDefinition definition)
position
- determines which dimension (width or height) to return.definition
- the definition to get the size information from.public static int heightOrDefault(PanelDefinition def)
public static int widthOrDefault(PanelDefinition def)
public static boolean disableNearestScrollPanel(com.google.gwt.user.client.ui.Widget w)
FIXME this is a really horrible workaround! should instead modify UF API to allow PanelDefinition to opt out of having a scroll panel. The better fix would require changes to:
Copyright © 2012–2019 JBoss by Red Hat. All rights reserved.