Class AEnv


  • public final class AEnv
    extends Object
    Windows Application Environment and utilities
    Version:
    $Id: AEnv.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $
    Author:
    Jorg Janke, Colin Rooney (croo) & kstan_79 RFE#1670185, victor.perez@e-evolution.com
    See Also:
    [ 1966328 ] New Window Info to MRP and CRP into View http://sourceforge.net/tracker/index.php?func=detail=1966328=176962=879335
    • Constructor Detail

      • AEnv

        public AEnv()
    • Method Detail

      • hideWindow

        public static boolean hideWindow​(CFrame window)
        Hide Window
        Parameters:
        window - window
        Returns:
        true if window is hidden, otherwise close it
      • showWindow

        public static CFrame showWindow​(int AD_Window_ID)
        Show Window
        Parameters:
        AD_Window_ID - window
        Returns:
        true if window re-displayed
      • showWindow

        public static void showWindow​(Window window)
        Show window: de-iconify and bring it to front
      • 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
      • showMaximized

        public static void showMaximized​(Frame frame)
        Show frame as maximized.
        Parameters:
        frame -
      • positionCenterScreen

        public static void positionCenterScreen​(Window window)
        Position window in center of the screen
        Parameters:
        window - Window to position
      • showScreen

        public static void showScreen​(Window window,
                                      int position)
        Show in the center of the screen. (pack, set location and set visibility)
        Parameters:
        window - Window to position
        position - SwingConstants
      • positionScreen

        public static void positionScreen​(Window window,
                                          int position)
        Position window in center of the screen
        Parameters:
        window - Window to position
        position - SwingConstants
      • 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
      • positionCenterWindow

        public static void positionCenterWindow​(Window parent,
                                                Window window)
        Position in center of the parent window
        Parameters:
        parent - Parent Window
        window - Window to position
      • getButton

        public static CButton getButton​(String iconName)
        Get Button
        Parameters:
        iconName -
        Returns:
        button
      • getMenu

        public static JMenu getMenu​(String AD_Message)
        Create Menu Title (translate it and set Mnemonics). Based on MS notation of &Help => H is Mnemonics
        Parameters:
        AD_Message - message
        Returns:
        JMenu
      • addMenuItem

        public static JMenuItem addMenuItem​(String actionName,
                                            String iconName,
                                            KeyStroke ks,
                                            JMenu menu,
                                            ActionListener al)
        Create Menu Item.
        Parameters:
        actionName - action command
        iconName - optional name of the icon, defaults to action if null
        ks - optional key stroke
        menu - menu to add menu item to
        al - action listener to register
        Returns:
        MenuItem
      • actionPerformed

        public static boolean actionPerformed​(String actionCommand,
                                              int WindowNo,
                                              Container c)
        Perform action command for common menu items. Created in AMenu.createMenu(), APanel.createMenu(), FormFrame.createMenu()
        Parameters:
        actionCommand - known action command
        WindowNo - window no
        c - Container parent
        Returns:
        true if actionCommand was found and performed
      • setTextMnemonic

        public static void setTextMnemonic​(JButton b,
                                           String text)
        Set Text and Mnemonic for Button. Create Mnemonics of text containing '&'. Based on MS notation of &Help => H is Mnemonics
        Parameters:
        b - The button
        text - The text with optional Mnemonics
      • 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​(MQuery query)
        Zoom
        Parameters:
        query - query
      • addToWindowManager

        public static void addToWindowManager​(CFrame frame)
        Track open frame in window manager
        Parameters:
        frame -
      • getAMenu

        public static AMenu getAMenu​(CFrame frame)
        FR [ 1966328 ] get AMenu
        Parameters:
        frame -
      • exit

        public static void exit​(int status)
        Exit System
        Parameters:
        status - System exit status (usually 0 for no error)
      • logout

        public static void logout()
      • isWorkflowProcess

        public static boolean isWorkflowProcess()
        Is Workflow Process view enabled.
        Returns:
        true if enabled
      • 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
      • isServerActive

        public static boolean isServerActive()
        Is AppsServer Active ?
        Returns:
        true if active
      • getServerVersion

        public static String getServerVersion()
        Get Server Version
        Returns:
        Apps Server Version
        See Also:
        ALogin.checkVersion()
      • 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
      • updateUI

        public static void updateUI()
        Update all windows after look and feel changes.
        Since:
        2006-11-27
      • canAccessInfo

        public static boolean canAccessInfo​(String infoWindowName)
        Validate permissions to access Info queries on the view menu
        Returns:
        true if access is allowed
      • updateUI0

        public static Set<Window> updateUI0()
        Update all windows after look and feel changes.
        Since:
        2006-11-27
      • createWindowNo

        public static int createWindowNo​(Container win)
        Add Container and return WindowNo. The container is a APanel, AWindow or JFrame/JDialog
        Parameters:
        win - window
        Returns:
        WindowNo used for context
      • getWindowNo

        public static int getWindowNo​(Container container)
        Search Window by comparing the Frames
        Parameters:
        container - container
        Returns:
        WindowNo of container or 0
      • getWindow

        public static JFrame getWindow​(int WindowNo)
        Return the JFrame pointer of WindowNo - or null
        Parameters:
        WindowNo - window
        Returns:
        JFrame of WindowNo
      • removeWindow

        public static void removeWindow​(int WindowNo)
        Remove window from active list
        Parameters:
        WindowNo - window
      • getFrame

        public static JFrame getFrame​(Container container)
        Get Frame of Window
        Parameters:
        container - Container
        Returns:
        JFrame of container or null
      • reset

        public static void reset​(boolean finalCall)