Package org.compiere.apps
Class AEnv
- java.lang.Object
-
- org.compiere.apps.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 Summary
Constructors Constructor Description AEnv()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanactionPerformed(String actionCommand, int WindowNo, Container c)Perform action command for common menu items.static JMenuItemaddMenuItem(String actionName, String iconName, KeyStroke ks, JMenu menu, ActionListener al)Create Menu Item.static voidaddToWindowManager(CFrame frame)Track open frame in window managerstatic voidcacheReset(String tableName, int Record_ID)Cache Resetstatic booleancanAccessInfo(String infoWindowName)Validate permissions to access Info queries on the view menustatic intcreateWindowNo(Container win)Add Container and return WindowNo.static voidexit(int status)Exit Systemstatic AMenugetAMenu(CFrame frame)FR [ 1966328 ] get AMenustatic CButtongetButton(String iconName)Get Buttonstatic JFramegetFrame(Container container)Get Frame of Windowstatic JMenugetMenu(String AD_Message)Create Menu Title (translate it and set Mnemonics).static chargetMnemonic(String text)Get Mnemonic character from text.static StringgetServerVersion()Get Server Versionstatic JFramegetWindow(int WindowNo)Return the JFrame pointer of WindowNo - or nullstatic intgetWindowNo(Container container)Search Window by comparing the Framesstatic booleanhideWindow(CFrame window)Hide Windowstatic booleanisServerActive()Is AppsServer Active ?static booleanisWorkflowProcess()Is Workflow Process view enabled.static voidlogout()static voidpositionCenterScreen(Window window)Position window in center of the screenstatic voidpositionCenterWindow(Window parent, Window window)Position in center of the parent windowstatic voidpositionScreen(Window window, int position)Position window in center of the screenstatic StringpostImmediate(int WindowNo, int AD_Client_ID, int AD_Table_ID, int Record_ID, boolean force)Post Immediatestatic voidremoveWindow(int WindowNo)Remove window from active liststatic voidreset(boolean finalCall)static voidsetTextMnemonic(JButton b, String text)Set Text and Mnemonic for Button.static voidshowCenterScreen(Window window)Show in the center of the screen.static voidshowCenterWindow(Window parent, Window window)Position in center of the parent window.static voidshowMaximized(Frame frame)Show frame as maximized.static voidshowScreen(Window window, int position)Show in the center of the screen.static CFrameshowWindow(int AD_Window_ID)Show Windowstatic voidshowWindow(Window window)Show window: de-iconify and bring it to frontstatic voidstartWorkflowProcess(int AD_Table_ID, int Record_ID)Start Workflow Process Windowstatic voidupdateUI()Update all windows after look and feel changes.static Set<Window>updateUI0()Update all windows after look and feel changes.static voidzoom(int AD_Table_ID, int Record_ID)Zoomstatic voidzoom(MQuery query)Zoom
-
-
-
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 positionposition- SwingConstants
-
positionScreen
public static void positionScreen(Window window, int position)
Position window in center of the screen- Parameters:
window- Window to positionposition- 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 Windowwindow- Window to position
-
positionCenterWindow
public static void positionCenterWindow(Window parent, Window window)
Position in center of the parent window- Parameters:
parent- Parent Windowwindow- 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 commandiconName- optional name of the icon, defaults to action if nullks- optional key strokemenu- menu to add menu item toal- 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 commandWindowNo- window noc- 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 buttontext- 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-
-
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 tableRecord_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- 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
-
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)
-
-