Package org.adempiere.webui
Class LayoutUtils
- java.lang.Object
-
- org.adempiere.webui.LayoutUtils
-
public final class LayoutUtils extends Object
- Author:
- Low Heng Sin
-
-
Field Summary
Fields Modifier and Type Field Description static StringON_REDRAW_EVENTstatic intOVERLAP_ALL_PAGEstatic intOVERLAP_PARENTstatic intOVERLAP_SELFstatic intOVERLAP_TAB_PANEL
-
Constructor Summary
Constructors Constructor Description LayoutUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static voidaddSclass(String cls, org.zkoss.zk.ui.HtmlBasedComponent target)static voidaddSlideSclass(org.zkoss.zul.LayoutRegion region)enable slide sclass ( when slide out ) for collapsible regionstatic voidautoDetachOnClose(org.zkoss.zul.Popup popup)call popup.detach when it is closestatic voidcompactTo(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 voidexpandTo(org.zkoss.zul.Grid grid, int min)static voidexpandTo(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 ISupportMaskfindMaskParent(org.zkoss.zk.ui.Component child, Class<?> parentClass)find parent control of child control, parent must implementISupportMaskif parentClass !static org.zkoss.zul.PopupfindPopup(org.zkoss.zk.ui.Component comp)find popup ancestor of compstatic booleanhasSclass(String cls, org.zkoss.zk.ui.HtmlBasedComponent target)static booleanisReallyVisible(org.zkoss.zk.ui.Component component)static org.zkoss.zk.ui.ComponentmakeRightAlign(Label label)static voidopenEmbeddedWindow(org.zkoss.zk.ui.Component ref, org.zkoss.zul.Window window, String position)open embedded window relative to the ref componentstatic voidopenHighlightedWindow(org.zkoss.zk.ui.Component ref, org.zkoss.zul.Window window, String position)open highlighted window relative to the ref componentstatic voidopenOverlappedWindow(org.zkoss.zk.ui.Component ref, org.zkoss.zul.Window window, String position)open popup window relative to the ref componentstatic voidopenPopupWindow(org.zkoss.zk.ui.Component ref, org.zkoss.zul.Window window)static voidopenPopupWindow(org.zkoss.zk.ui.Component ref, org.zkoss.zul.Window window, int delayMs)open popup window overlapping the ref componentstatic voidopenPopupWindow(org.zkoss.zk.ui.Component ref, org.zkoss.zul.Window window, String position)static voidopenPopupWindow(org.zkoss.zk.ui.Component ref, org.zkoss.zul.Window window, String position, int delayMs)open popup window relative to the ref componentstatic voidpositionWindow(org.zkoss.zk.ui.Component ref, org.zkoss.zul.Window window, String position)position opened window relative to the ref componentstatic voidredraw(org.zkoss.zk.ui.AbstractComponent component)static voidremoveSclass(String cls, org.zkoss.zk.ui.HtmlBasedComponent target)static voidsameWidth(org.zkoss.zk.ui.HtmlBasedComponent target, org.zkoss.zk.ui.HtmlBasedComponent ref)set target same width as ref using client side scriptstatic voidsendDeferLayoutEvent(org.zkoss.zul.Borderlayout layout, int timeout)Deprecated.protected static voidshowWindowWithMask(org.zkoss.zul.Window window, ISupportMask mask)Show window in center of componentstatic ISupportMaskshowWindowWithMask(org.zkoss.zul.Window window, org.zkoss.zk.ui.Component childOfOwn, int ownModel)show window with a mask below. mask over tabPanel, all window or only over a control, dependency ownModel flag.static MaskshowWindowWithMask(org.zkoss.zul.Window window, org.zkoss.zk.ui.Component ownWindow, Mask mask)Show window over ownWindow with a mask, use when ownWindow isn't implementISupportMask
-
-
-
Field Detail
-
ON_REDRAW_EVENT
public static final String ON_REDRAW_EVENT
- See Also:
- Constant Field Values
-
OVERLAP_TAB_PANEL
public static final int OVERLAP_TAB_PANEL
- See Also:
- Constant Field Values
-
OVERLAP_ALL_PAGE
public static final int OVERLAP_ALL_PAGE
- See Also:
- Constant Field Values
-
OVERLAP_PARENT
public static final int OVERLAP_PARENT
- See Also:
- Constant Field Values
-
OVERLAP_SELF
public static final int OVERLAP_SELF
- See Also:
- Constant Field Values
-
-
Method Detail
-
sendDeferLayoutEvent
@Deprecated public static void sendDeferLayoutEvent(org.zkoss.zul.Borderlayout layout, int timeout)
Deprecated.- Parameters:
layout-
-
addSclass
public static void addSclass(String cls, org.zkoss.zk.ui.HtmlBasedComponent target)
- Parameters:
cls-target-
-
hasSclass
public static boolean hasSclass(String cls, org.zkoss.zk.ui.HtmlBasedComponent target)
- Parameters:
cls-target-- Returns:
- boolean
-
makeRightAlign
public static org.zkoss.zk.ui.Component makeRightAlign(Label label)
- Parameters:
label-- Returns:
- wrapped label
-
openPopupWindow
public static void openPopupWindow(org.zkoss.zk.ui.Component ref, org.zkoss.zul.Window window)
-
openPopupWindow
public static void openPopupWindow(org.zkoss.zk.ui.Component ref, org.zkoss.zul.Window window, int delayMs)open popup window overlapping the ref component- Parameters:
ref-window-
-
openPopupWindow
public static void openPopupWindow(org.zkoss.zk.ui.Component ref, org.zkoss.zul.Window window, String position)
-
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 the ref component- Parameters:
ref-window-position-
-
openOverlappedWindow
public static void openOverlappedWindow(org.zkoss.zk.ui.Component ref, org.zkoss.zul.Window window, String position)open popup window relative to the ref component- Parameters:
ref-window-position-
-
positionWindow
public static void positionWindow(org.zkoss.zk.ui.Component ref, org.zkoss.zul.Window window, String position)position opened window relative to the ref component- Parameters:
ref-window-position-
-
openEmbeddedWindow
public static void openEmbeddedWindow(org.zkoss.zk.ui.Component ref, org.zkoss.zul.Window window, String position)open embedded window relative to the ref component- Parameters:
ref-window-position-
-
openHighlightedWindow
public static void openHighlightedWindow(org.zkoss.zk.ui.Component ref, org.zkoss.zul.Window window, String position)open highlighted window relative to the ref component- Parameters:
ref-window-position-
-
redraw
public static void redraw(org.zkoss.zk.ui.AbstractComponent 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
public static void removeSclass(String cls, org.zkoss.zk.ui.HtmlBasedComponent 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. mask over tabPanel, all window or only over a control, dependency ownModel flag. when ownModel ==OVERLAP_SELF, window show overlap childOfOwn, when childOfOwn isn't implementISupportMaskmake newMaskobject to make mask layout ownModel ==OVERLAP_ALL_PAGE, window show overlap all page ownModel ==OVERLAP_TAB_PANEL, window show overlap tabPanel ownModel ==OVERLAP_PARENT, search near parent of childOfOwn implementISupportMaskif not exist user as OVERLAP_ALL_PAGE- Parameters:
window-childOfOwn-ownModel-- Returns:
- when show success return IMask object, it is own window, use
ISupportMask.hideMask()to hidden mask. other return null.
-
showWindowWithMask
protected static void showWindowWithMask(org.zkoss.zul.Window window, ISupportMask mask)Show window in center of component- 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 isn't implementISupportMask- Parameters:
window-ownWindow-mask- if mask = null, make new and return it- Returns:
Maskobjec for hiden mask when close window.
-
findMaskParent
public static ISupportMask findMaskParent(org.zkoss.zk.ui.Component child, Class<?> parentClass)
find parent control of child control, parent must implementISupportMaskif parentClass != null, parent class must extends parentClass- Parameters:
child-parentClass-- Returns:
-
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)
-
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 popup ancestor of comp- Parameters:
comp-- Returns:
Popupif comp or one of its ancestor is Popup
-
autoDetachOnClose
public static void autoDetachOnClose(org.zkoss.zul.Popup popup)
call popup.detach when it is close- Parameters:
popup-
-
sameWidth
public static void sameWidth(org.zkoss.zk.ui.HtmlBasedComponent target, org.zkoss.zk.ui.HtmlBasedComponent ref)set target same width as ref using client side script- Parameters:
target-ref-
-
-