Package org.adempiere.webui.apps
Class AEnv
- java.lang.Object
-
- org.adempiere.webui.apps.AEnv
-
public final class AEnv extends Object
ZK Application Environment and utilities- Version:
- $Id: AEnv.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $ Colin Rooney (croo) and kstan_79 RFE#1670185
- Author:
- Jorg Janke
-
-
Constructor Summary
Constructors Constructor Description AEnv()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static void
actionRefresh(Lookup lookup, Object value, boolean mandatory, boolean shortList)
static void
actionZoom(Lookup lookup, Object value)
static void
cacheReset(String tableName, int Record_ID)
Cache Resetstatic boolean
contains(org.zkoss.zk.ui.Component parent, org.zkoss.zk.ui.Component child)
static void
executeAsyncDesktopTask(Runnable runnable)
Execute asynchronous task in UI thread.static void
executeDesktopTask(Runnable runnable)
Execute synchronous task in UI thread.static void
exit(int status)
Exit Systemstatic int
getADWindowID(int windowNo)
Get adWindowId below gridField when field lie in window, it's id of this window when field lie in process parameter dialog it's ad_window_id of window open this process when field lie in process parameter open in a standalone window (run process from menu) return id of dummy windowstatic String
getApplicationUrl()
static org.zkoss.zk.ui.Desktop
getDesktop()
Get current desktopstatic String
getDialogHeader(Properties ctx, int windowNo)
static String
getDialogHeader(Properties ctx, int windowNo, String prefix)
Get title for dialog windowstatic URI
getImage(String fileNameInImageDir)
Get ImageIcon.static Language
getLanguage(Properties ctx)
static WTableDirEditor
getListDocumentLanguage(MClient client)
static Locale
getLocale(Properties ctx)
static char
getMnemonic(String text)
Get Mnemonic character from text.static GridWindowVO
getMWindowVO(int WindowNo, int AD_Window_ID, int AD_Menu_ID)
Get Window Modelstatic boolean
getOrSetExecutionAttribute(String attribute)
static String
getWindowHeader(Properties ctx, int WindowNo)
Get window titlestatic String
getZoomUrlTableID(PO po)
Return the link for direct access to the record using tableIDstatic String
getZoomUrlTableName(PO po)
Return the link for direct access to the record using tablenamestatic boolean
isBrowserSupported()
Deprecated.See IDEMPIERE-1022static boolean
isFirefox2()
static boolean
isInternetExplorer()
static boolean
isTablet()
Deprecated.replace by ClientInfo.isMobile()static void
logout()
logout AD_Sessionstatic void
mergePdf(List<File> pdfList, File outFile)
static String
postImmediate(int WindowNo, int AD_Client_ID, int AD_Table_ID, int Record_ID, boolean force)
Post Immediatestatic void
showCenterScreen(Window window)
Show in the center of the screen.static void
showCenterWindow(Window parent, Window window)
Position in center of the parent window.static void
showScreen(Window window, String position)
Show in the center of the screen.static void
showWindow(Window win)
static void
showZoomWindow(int AD_Window_ID, MQuery query)
open zoom window with querystatic void
startWorkflowProcess(int AD_Table_ID, int Record_ID)
Start Workflow Process Windowstatic void
zoom(int AD_Table_ID, int Record_ID)
Zoomstatic void
zoom(int AD_Table_ID, int Record_ID, MQuery query)
static void
zoom(int AD_Table_ID, int Record_ID, MQuery query, int windowNo)
Zoomstatic void
zoom(int AD_Window_ID, MQuery query)
static void
zoom(int AD_Window_ID, MQuery query, int windowNo)
Zoom to a window with the provided window id and filters according to the querystatic void
zoom(MQuery query)
Zoom
-
-
-
Field Detail
-
LOCALE
public static final String LOCALE
- See Also:
- Constant Field Values
-
-
Method Detail
-
showCenterScreen
public static void showCenterScreen(Window window)
Show in the center of the screen. (pack, set location and set visibility)- Parameters:
window
- Window to position
-
showScreen
public static void showScreen(Window window, String position)
Show in the center of the screen. (pack, set location and set visibility)- Parameters:
window
- Window to positionposition
-
-
showCenterWindow
public static void showCenterWindow(Window parent, Window window)
Position in center of the parent window. (pack, set location and set visibility)- Parameters:
parent
- Parent Windowwindow
- Window to position
-
getMnemonic
public static char getMnemonic(String text)
Get Mnemonic character from text.- Parameters:
text
- text with '&'- Returns:
- Mnemonic or 0
-
zoom
public static void zoom(int AD_Table_ID, int Record_ID)
Zoom- Parameters:
AD_Table_ID
-Record_ID
-
-
zoom
public static void zoom(int AD_Table_ID, int Record_ID, MQuery query, int windowNo)
Zoom- Parameters:
AD_Table_ID
-Record_ID
-query
-
-
zoom
public static void zoom(int AD_Table_ID, int Record_ID, MQuery query)
-
exit
public static void exit(int status)
Exit System- Parameters:
status
- System exit status (usually 0 for no error)
-
logout
public static void logout()
logout AD_Session
-
startWorkflowProcess
public static void startWorkflowProcess(int AD_Table_ID, int Record_ID)
Start Workflow Process Window- Parameters:
AD_Table_ID
- optional tableRecord_ID
- optional record
-
getMWindowVO
public static GridWindowVO getMWindowVO(int WindowNo, int AD_Window_ID, int AD_Menu_ID)
Get Window Model- Parameters:
WindowNo
- Window NoAD_Window_ID
- windowAD_Menu_ID
- menu- Returns:
- Model Window Value Obkect
-
postImmediate
public static String postImmediate(int WindowNo, int AD_Client_ID, int AD_Table_ID, int Record_ID, boolean force)
Post Immediate- Parameters:
WindowNo
- windowAD_Table_ID
- Table ID of DocumentAD_Client_ID
- Client ID of DocumentRecord_ID
- Record ID of this documentforce
- force posting- Returns:
- null if success, otherwise error
-
cacheReset
public static void cacheReset(String tableName, int Record_ID)
Cache Reset- Parameters:
tableName
- table nameRecord_ID
- record id
-
actionRefresh
public static void actionRefresh(Lookup lookup, Object value, boolean mandatory, boolean shortList)
-
showZoomWindow
public static void showZoomWindow(int AD_Window_ID, MQuery query)
open zoom window with query- Parameters:
AD_Window_ID
-query
-
-
zoom
public static void zoom(int AD_Window_ID, MQuery query, int windowNo)
Zoom to a window with the provided window id and filters according to the query- Parameters:
AD_Window_ID
- Window on which to zoomquery
- Filter to be applied on the records.
-
zoom
public static void zoom(int AD_Window_ID, MQuery query)
-
showWindow
public static void showWindow(Window win)
-
zoom
public static void zoom(MQuery query)
Zoom- Parameters:
query
- query
-
getImage
public static URI getImage(String fileNameInImageDir)
Get ImageIcon.- Parameters:
fileNameInImageDir
- full file name in imgaes folder (e.g. Bean16.png)- Returns:
- image
-
isFirefox2
public static boolean isFirefox2()
- Returns:
- boolean
-
isBrowserSupported
public static boolean isBrowserSupported()
Deprecated.See IDEMPIERE-1022- Returns:
- boolean
-
isInternetExplorer
public static boolean isInternetExplorer()
- Returns:
- true if user agent is internet explorer
-
contains
public static boolean contains(org.zkoss.zk.ui.Component parent, org.zkoss.zk.ui.Component child)
- Parameters:
parent
-child
-- Returns:
- boolean
-
mergePdf
public static void mergePdf(List<File> pdfList, File outFile) throws IOException, com.lowagie.text.DocumentException, FileNotFoundException
- Parameters:
pdfList
-outFile
-- Throws:
IOException
com.lowagie.text.DocumentException
FileNotFoundException
-
getWindowHeader
public static String getWindowHeader(Properties ctx, int WindowNo)
Get window title- Parameters:
ctx
- contextWindowNo
- window- Returns:
- Header String
-
getLanguage
public static Language getLanguage(Properties ctx)
- Parameters:
ctx
-- Returns:
- Language
-
getLocale
public static Locale getLocale(Properties ctx)
- Parameters:
ctx
-- Returns:
- Locale
-
getDialogHeader
public static String getDialogHeader(Properties ctx, int windowNo, String prefix)
Get title for dialog window- Parameters:
ctx
-windowNo
-prefix
-- Returns:
- dialog header
-
getDialogHeader
public static String getDialogHeader(Properties ctx, int windowNo)
-
executeDesktopTask
public static void executeDesktopTask(Runnable runnable)
Execute synchronous task in UI thread.- Parameters:
runnable
-
-
executeAsyncDesktopTask
public static void executeAsyncDesktopTask(Runnable runnable)
Execute asynchronous task in UI thread.- Parameters:
runnable
-
-
getDesktop
public static org.zkoss.zk.ui.Desktop getDesktop()
Get current desktop- Returns:
- Desktop
-
isTablet
public static boolean isTablet()
Deprecated.replace by ClientInfo.isMobile()- Returns:
- true if running on a tablet
-
getADWindowID
public static int getADWindowID(int windowNo)
Get adWindowId below gridField when field lie in window, it's id of this window when field lie in process parameter dialog it's ad_window_id of window open this process when field lie in process parameter open in a standalone window (run process from menu) return id of dummy window- Parameters:
windowNo
-- Returns:
-
getListDocumentLanguage
public static WTableDirEditor getListDocumentLanguage(MClient client) throws Exception
- Throws:
Exception
-
getApplicationUrl
public static String getApplicationUrl()
-
getZoomUrlTableID
public static String getZoomUrlTableID(PO po)
Return the link for direct access to the record using tableID
-
getZoomUrlTableName
public static String getZoomUrlTableName(PO po)
Return the link for direct access to the record using tablename
-
getOrSetExecutionAttribute
public static boolean getOrSetExecutionAttribute(String attribute)
- Parameters:
attribute
-- Returns:
- true if attribute have been set for current executions
-
-