Adempiere 3.5.2a

org.compiere.apps
Class AEnv

java.lang.Object
  extended by 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&aid=1966328&group_id=176962&atid=879335

Constructor Summary
AEnv()
           
 
Method Summary
static boolean actionPerformed(String actionCommand, int WindowNo, Container c)
          Perform action command for common menu items.
static JMenuItem addMenuItem(String actionName, String iconName, KeyStroke ks, JMenu menu, ActionListener al)
          Create Menu Item.
static void addToWindowManager(CFrame frame)
          Track open frame in window manager
static void cacheReset(String tableName, int Record_ID)
          Cache Reset
static boolean canAccessInfo(String infoWindowName)
          Validate permissions to access Info queries on the view menu
static void exit(int status)
          Exit System
static AMenu getAMenu(CFrame frame)
          FR [ 1966328 ] get AMenu
static CButton getButton(String iconName)
          Get Button
static JMenu getMenu(String AD_Message)
          Create Menu Title (translate it and set Mnemonics).
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 Model
static String getServerVersion()
          Get Server Version
static boolean isServerActive()
          Is AppsServer Active ?
static boolean isWorkflowProcess()
          Is Workflow Process view enabled.
static void logout()
           
static void positionCenterScreen(Window window)
          Position window in center of the screen
static void positionCenterWindow(Window parent, Window window)
          Position in center of the parent window
static void positionScreen(Window window, int position)
          Position window in center of the screen
static String postImmediate(int WindowNo, int AD_Client_ID, int AD_Table_ID, int Record_ID, boolean force)
          Post Immediate
static void setTextMnemonic(JButton b, String text)
          Set Text and Mnemonic for Button.
static 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 showMaximized(Frame frame)
          Show frame as maximized.
static void showScreen(Window window, int position)
          Show in the center of the screen.
static void showWindow(Window window)
          Show window: de-iconify and bring it to front
static void startWorkflowProcess(int AD_Table_ID, int Record_ID)
          Start Workflow Process Window
static void updateUI()
          Update all windows after look and feel changes.
static void zoom(int AD_Table_ID, int Record_ID)
          Zoom
static void zoom(MQuery query)
          Zoom
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AEnv

public AEnv()
Method Detail

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()

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

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

Adempiere 3.5.2a

Adempiere® is a registered trademark of ADempiere Business Inc. ©2004-2008 HumanFlash.com All rights reserved.