Package org.adempiere.webui
Class LayoutUtils
java.lang.Object
org.adempiere.webui.LayoutUtils
Some static UI helper methods
- Author:
- Low Heng Sin
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final int
static final int
static final int
static final int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
append cls to target's sclass propertystatic void
addSlideSclass
(org.zkoss.zul.LayoutRegion region) enable slide sclass ( when slide out ) for collapsible regionstatic void
autoDetachOnClose
(org.zkoss.zul.Popup popup) Auto call popup.detach when popup is closestatic void
compactTo
(org.zkoss.zul.Grid grid, int limit) Compact grid to limit (for e.g, to max of 2 column).
Note: doesn't handle row spanstatic void
expandTo
(org.zkoss.zul.Grid grid, int min) Expand number of grid column to min (for e.g, to min of 2 column)static void
expandTo
(org.zkoss.zul.Grid grid, int min, boolean fillWithSpace) Expand grid to min (for e.g, to min of 2 column).
Note: doesn't handle row spanstatic ISupportMask
findMaskParent
(org.zkoss.zk.ui.Component child, Class<?> parentClass) find nearest parent of child component that implementISupportMask
.
if parentClass !static org.zkoss.zul.Popup
findPopup
(org.zkoss.zk.ui.Component comp) find first Popup ancestor of compstatic boolean
Is target's sclass property contains clsstatic boolean
isReallyVisible
(org.zkoss.zk.ui.Component component) static org.zkoss.zk.ui.Component
makeRightAlign
(Label label) create right align label (wrapped in div)static void
openEmbeddedWindow
(org.zkoss.zk.ui.Component ref, org.zkoss.zul.Window window, String position) open embedded window relative to ref componentstatic void
openHighlightedWindow
(org.zkoss.zk.ui.Component ref, org.zkoss.zul.Window window, String position) open highlighted window relative to ref componentstatic void
openOverlappedWindow
(org.zkoss.zk.ui.Component ref, org.zkoss.zul.Window window, String position) open overlapped window (mode overlapped) relative to ref componentstatic void
openPopupWindow
(org.zkoss.zk.ui.Component ref, org.zkoss.zul.Window window) open popup window overlapping ref componentstatic void
openPopupWindow
(org.zkoss.zk.ui.Component ref, org.zkoss.zul.Window window, int delayMs) open popup window overlapping ref componentstatic void
openPopupWindow
(org.zkoss.zk.ui.Component ref, org.zkoss.zul.Window window, String position) open popup window relative to ref componentstatic void
openPopupWindow
(org.zkoss.zk.ui.Component ref, org.zkoss.zul.Window window, String position, int delayMs) open popup window relative to ref componentstatic void
positionComponent
(org.zkoss.zk.ui.Component ref, org.zkoss.zk.ui.Component component, String position) position component relative to ref componentstatic void
positionWindow
(org.zkoss.zk.ui.Component ref, org.zkoss.zul.Window window, String position) position opened window relative to ref componentstatic void
redraw
(org.zkoss.zk.ui.AbstractComponent component) Force redraw of componentstatic void
removeSclass
(String cls, org.zkoss.zk.ui.HtmlBasedComponent target) Remove cls from target's sclass propertystatic void
sameWidth
(org.zkoss.zk.ui.HtmlBasedComponent target, org.zkoss.zk.ui.HtmlBasedComponent ref) Make target same width as ref using client side scriptstatic void
sendDeferLayoutEvent
(org.zkoss.zul.Borderlayout layout, int timeout) Deprecated, for removal: This API element is subject to removal in a future version.protected static void
showWindowWithMask
(org.zkoss.zul.Window window, ISupportMask mask) Show window in center of maskstatic ISupportMask
showWindowWithMask
(org.zkoss.zul.Window window, org.zkoss.zk.ui.Component childOfOwn, int ownModel) show window with a mask below.static Mask
showWindowWithMask
(org.zkoss.zul.Window window, org.zkoss.zk.ui.Component ownWindow, Mask mask) Show window over ownWindow with a mask, use when ownWindow doesn't implementISupportMask
-
Field Details
-
ON_REDRAW_EVENT
- See Also:
-
OVERLAP_TAB_PANEL
public static final int OVERLAP_TAB_PANEL- See Also:
-
OVERLAP_ALL_PAGE
public static final int OVERLAP_ALL_PAGE- See Also:
-
OVERLAP_PARENT
public static final int OVERLAP_PARENT- See Also:
-
OVERLAP_SELF
public static final int OVERLAP_SELF- See Also:
-
-
Constructor Details
-
LayoutUtils
public LayoutUtils()
-
-
Method Details
-
sendDeferLayoutEvent
@Deprecated(forRemoval=true, since="11") public static void sendDeferLayoutEvent(org.zkoss.zul.Borderlayout layout, int timeout) Deprecated, for removal: This API element is subject to removal in a future version.- Parameters:
layout
-
-
addSclass
append cls to target's sclass property- Parameters:
cls
-target
-
-
hasSclass
Is target's sclass property contains cls- Parameters:
cls
-target
-- Returns:
- true if target's sclass property contain cls
-
makeRightAlign
create right align label (wrapped in div)- Parameters:
label
-- Returns:
- right align label (wrapped in div)
-
openPopupWindow
public static void openPopupWindow(org.zkoss.zk.ui.Component ref, org.zkoss.zul.Window window) open popup window overlapping ref component- Parameters:
ref
-window
-
-
openPopupWindow
public static void openPopupWindow(org.zkoss.zk.ui.Component ref, org.zkoss.zul.Window window, int delayMs) open popup window overlapping ref component- Parameters:
ref
-window
-delayMs
-
-
openPopupWindow
public static void openPopupWindow(org.zkoss.zk.ui.Component ref, org.zkoss.zul.Window window, String position) open popup window relative to ref component- Parameters:
ref
-window
-position
- Refer to https://www.zkoss.org/javadoc/latest/jsdoc/_global_/jqzk.html#position-_global_.Dimension-_global_.String-_global_.Map-
-
openPopupWindow
public static void openPopupWindow(org.zkoss.zk.ui.Component ref, org.zkoss.zul.Window window, String position, int delayMs) open popup window relative to ref component- Parameters:
ref
-window
-position
- Refer to https://www.zkoss.org/javadoc/latest/jsdoc/_global_/jqzk.html#position-_global_.Dimension-_global_.String-_global_.Map-delayMs
-
-
openOverlappedWindow
public static void openOverlappedWindow(org.zkoss.zk.ui.Component ref, org.zkoss.zul.Window window, String position) open overlapped window (mode overlapped) relative to ref component- Parameters:
ref
-window
-position
- Refer to https://www.zkoss.org/javadoc/latest/jsdoc/_global_/jqzk.html#position-_global_.Dimension-_global_.String-_global_.Map-
-
positionWindow
public static void positionWindow(org.zkoss.zk.ui.Component ref, org.zkoss.zul.Window window, String position) position opened window relative to ref component- Parameters:
ref
-window
-position
- Refer to https://www.zkoss.org/javadoc/latest/jsdoc/_global_/jqzk.html#position-_global_.Dimension-_global_.String-_global_.Map-
-
positionComponent
public static void positionComponent(org.zkoss.zk.ui.Component ref, org.zkoss.zk.ui.Component component, String position) position component relative to ref component- Parameters:
ref
-component
-position
- Refer to https://www.zkoss.org/javadoc/latest/jsdoc/_global_/jqzk.html#position-_global_.Dimension-_global_.String-_global_.Map-
-
openEmbeddedWindow
public static void openEmbeddedWindow(org.zkoss.zk.ui.Component ref, org.zkoss.zul.Window window, String position) open embedded window relative to ref component- Parameters:
ref
-window
-position
- Refer to https://www.zkoss.org/javadoc/latest/jsdoc/_global_/jqzk.html#position-_global_.Dimension-_global_.String-_global_.Map-
-
openHighlightedWindow
public static void openHighlightedWindow(org.zkoss.zk.ui.Component ref, org.zkoss.zul.Window window, String position) open highlighted window relative to ref component- Parameters:
ref
-window
-position
- Refer to https://www.zkoss.org/javadoc/latest/jsdoc/_global_/jqzk.html#position-_global_.Dimension-_global_.String-_global_.Map-
-
redraw
public static void redraw(org.zkoss.zk.ui.AbstractComponent component) Force redraw of component- Parameters:
component
-
-
isReallyVisible
public static boolean isReallyVisible(org.zkoss.zk.ui.Component component) - Parameters:
component
-- Returns:
- true if the component and all its parent are visible
-
removeSclass
Remove cls from target's sclass property- Parameters:
cls
-target
-
-
showWindowWithMask
public static ISupportMask showWindowWithMask(org.zkoss.zul.Window window, org.zkoss.zk.ui.Component childOfOwn, int ownModel) show window with a mask below. Depends on ownModel flag, mask is shown over tabPanel, all window or over a component.when ownModel is -
OVERLAP_SELF
, mask childOfOwn. if childOfOwn doesn't implementISupportMask
, make newMask
object to mask it -OVERLAP_ALL_PAGE
, window show overlap all page -OVERLAP_TAB_PANEL
, window show overlap tabPanel -OVERLAP_PARENT
, search nearest parent of childOfOwn that implementISupportMask
, if not found use as OVERLAP_ALL_PAGE- Parameters:
window
-childOfOwn
- Component below windowownModel
- OVERLAP_TAB_PANEL, OVERLAP_ALL_PAGE, OVERLAP_PARENT or OVERLAP_SELF- Returns:
- when show success return ISupportMask object, use
ISupportMask.hideMask()
to hide mask.
-
showWindowWithMask
Show window in center of mask- Parameters:
window
-mask
-
-
showWindowWithMask
public static Mask showWindowWithMask(org.zkoss.zul.Window window, org.zkoss.zk.ui.Component ownWindow, Mask mask) Show window over ownWindow with a mask, use when ownWindow doesn't implementISupportMask
- Parameters:
window
-ownWindow
-mask
- if mask = null, make new and return it- Returns:
Mask
object for hidden mask when close window.
-
findMaskParent
find nearest parent of child component that implementISupportMask
.
if parentClass != null, parent class must extends parentClass- Parameters:
child
-parentClass
-- Returns:
ISupportMask
-
compactTo
public static void compactTo(org.zkoss.zul.Grid grid, int limit) Compact grid to limit (for e.g, to max of 2 column).
Note: doesn't handle row span- Parameters:
grid
-limit
-
-
expandTo
public static void expandTo(org.zkoss.zul.Grid grid, int min) Expand number of grid column to min (for e.g, to min of 2 column)- Parameters:
grid
-min
-
-
expandTo
public static void expandTo(org.zkoss.zul.Grid grid, int min, boolean fillWithSpace) Expand grid to min (for e.g, to min of 2 column).
Note: doesn't handle row span- Parameters:
grid
-min
-fillWithSpace
- if true, fill up row with space instead of moving element from next row
-
addSlideSclass
public static void addSlideSclass(org.zkoss.zul.LayoutRegion region) enable slide sclass ( when slide out ) for collapsible region- Parameters:
region
-
-
findPopup
public static org.zkoss.zul.Popup findPopup(org.zkoss.zk.ui.Component comp) find first Popup ancestor of comp- Parameters:
comp
-- Returns:
Popup
if comp or one of its ancestor is Popup
-
autoDetachOnClose
public static void autoDetachOnClose(org.zkoss.zul.Popup popup) Auto call popup.detach when popup is close- Parameters:
popup
-
-
sameWidth
public static void sameWidth(org.zkoss.zk.ui.HtmlBasedComponent target, org.zkoss.zk.ui.HtmlBasedComponent ref) Make target same width as ref using client side script- Parameters:
target
-ref
-
-