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 voidactionRefresh(Lookup lookup, Object value, boolean mandatory, boolean shortList)static voidactionZoom(Lookup lookup, Object value)static voidcacheReset(String tableName, int Record_ID)Cache Resetstatic booleancontains(org.zkoss.zk.ui.Component parent, org.zkoss.zk.ui.Component child)static voidexecuteAsyncDesktopTask(Runnable runnable)Execute asynchronous task in UI thread.static voidexecuteDesktopTask(Runnable runnable)Execute synchronous task in UI thread.static voidexit(int status)Exit Systemstatic intgetADWindowID(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 StringgetApplicationUrl()static org.zkoss.zk.ui.DesktopgetDesktop()Get current desktopstatic StringgetDialogHeader(Properties ctx, int windowNo)static StringgetDialogHeader(Properties ctx, int windowNo, String prefix)Get title for dialog windowstatic URIgetImage(String fileNameInImageDir)Get ImageIcon.static LanguagegetLanguage(Properties ctx)static WTableDirEditorgetListDocumentLanguage(MClient client)static LocalegetLocale(Properties ctx)static chargetMnemonic(String text)Get Mnemonic character from text.static GridWindowVOgetMWindowVO(int WindowNo, int AD_Window_ID, int AD_Menu_ID)Get Window Modelstatic booleangetOrSetExecutionAttribute(String attribute)static StringgetWindowHeader(Properties ctx, int WindowNo)Get window titlestatic StringgetZoomUrlTableID(PO po)Return the link for direct access to the record using tableIDstatic StringgetZoomUrlTableName(PO po)Return the link for direct access to the record using tablenamestatic booleanisBrowserSupported()Deprecated.See IDEMPIERE-1022static booleanisFirefox2()static booleanisInternetExplorer()static booleanisTablet()Deprecated.replace by ClientInfo.isMobile()static voidlogout()logout AD_Sessionstatic voidmergePdf(List<File> pdfList, File outFile)static StringpostImmediate(int WindowNo, int AD_Client_ID, int AD_Table_ID, int Record_ID, boolean force)Post Immediatestatic voidshowCenterScreen(Window window)Show in the center of the screen.static voidshowCenterWindow(Window parent, Window window)Position in center of the parent window.static voidshowScreen(Window window, String position)Show in the center of the screen.static voidshowWindow(Window win)static voidshowZoomWindow(int AD_Window_ID, MQuery query)open zoom window with querystatic voidstartWorkflowProcess(int AD_Table_ID, int Record_ID)Start Workflow Process Windowstatic voidzoom(int AD_Table_ID, int Record_ID)Zoomstatic voidzoom(int AD_Table_ID, int Record_ID, MQuery query)static voidzoom(int AD_Table_ID, int Record_ID, MQuery query, int windowNo)Zoomstatic voidzoom(int AD_Window_ID, MQuery query)static voidzoom(int AD_Window_ID, MQuery query, int windowNo)Zoom to a window with the provided window id and filters according to the querystatic voidzoom(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:
IOExceptioncom.lowagie.text.DocumentExceptionFileNotFoundException
-
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
-
-