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 String
ON_REDRAW_EVENT
static int
OVERLAP_ALL_PAGE
static int
OVERLAP_PARENT
static int
OVERLAP_SELF
static int
OVERLAP_TAB_PANEL
-
Constructor Summary
Constructors Constructor Description LayoutUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static void
addSclass(String cls, org.zkoss.zk.ui.HtmlBasedComponent target)
static void
addSlideSclass(org.zkoss.zul.LayoutRegion region)
enable slide sclass ( when slide out ) for collapsible regionstatic void
autoDetachOnClose(org.zkoss.zul.Popup popup)
call popup.detach when it 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)
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 parent control of child control, parent must implementISupportMask
if parentClass !static org.zkoss.zul.Popup
findPopup(org.zkoss.zk.ui.Component comp)
find popup ancestor of compstatic boolean
hasSclass(String cls, org.zkoss.zk.ui.HtmlBasedComponent target)
static boolean
isReallyVisible(org.zkoss.zk.ui.Component component)
static org.zkoss.zk.ui.Component
makeRightAlign(Label label)
static void
openEmbeddedWindow(org.zkoss.zk.ui.Component ref, org.zkoss.zul.Window window, String position)
open embedded window relative to the ref componentstatic void
openHighlightedWindow(org.zkoss.zk.ui.Component ref, org.zkoss.zul.Window window, String position)
open highlighted window relative to the ref componentstatic void
openOverlappedWindow(org.zkoss.zk.ui.Component ref, org.zkoss.zul.Window window, String position)
open popup window relative to the ref componentstatic void
openPopupWindow(org.zkoss.zk.ui.Component ref, org.zkoss.zul.Window window)
static void
openPopupWindow(org.zkoss.zk.ui.Component ref, org.zkoss.zul.Window window, int delayMs)
open popup window overlapping the ref componentstatic void
openPopupWindow(org.zkoss.zk.ui.Component ref, org.zkoss.zul.Window window, String position)
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 componentstatic void
positionWindow(org.zkoss.zk.ui.Component ref, org.zkoss.zul.Window window, String position)
position opened window relative to the ref componentstatic void
redraw(org.zkoss.zk.ui.AbstractComponent component)
static void
removeSclass(String cls, org.zkoss.zk.ui.HtmlBasedComponent target)
static void
sameWidth(org.zkoss.zk.ui.HtmlBasedComponent target, org.zkoss.zk.ui.HtmlBasedComponent ref)
set target same width as ref using client side scriptstatic void
sendDeferLayoutEvent(org.zkoss.zul.Borderlayout layout, int timeout)
Deprecated.protected static void
showWindowWithMask(org.zkoss.zul.Window window, ISupportMask mask)
Show window in center of componentstatic 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.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
-
-
-
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 implementISupportMask
make newMask
object 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 implementISupportMask
if 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:
Mask
objec 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 implementISupportMask
if 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:
Popup
if 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
-
-
-