Class 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 Detail

      • AEnv

        public AEnv()
    • 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 position
        position -
      • 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 Window
        window - 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 table
        Record_ID - optional record
      • getMWindowVO

        public static GridWindowVO getMWindowVO​(int WindowNo,
                                                int AD_Window_ID,
                                                int AD_Menu_ID)
        Get Window Model
        Parameters:
        WindowNo - Window No
        AD_Window_ID - window
        AD_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 - window
        AD_Table_ID - Table ID of Document
        AD_Client_ID - Client ID of Document
        Record_ID - Record ID of this document
        force - force posting
        Returns:
        null if success, otherwise error
      • cacheReset

        public static void cacheReset​(String tableName,
                                      int Record_ID)
        Cache Reset
        Parameters:
        tableName - table name
        Record_ID - record id
      • actionRefresh

        public static void actionRefresh​(Lookup lookup,
                                         Object value,
                                         boolean mandatory,
                                         boolean shortList)
      • actionZoom

        public static void actionZoom​(Lookup lookup,
                                      Object value)
        Parameters:
        lookup -
        value -
      • 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 zoom
        query - 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
      • getWindowHeader

        public static String getWindowHeader​(Properties ctx,
                                             int WindowNo)
        Get window title
        Parameters:
        ctx - context
        WindowNo - 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:
      • 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