Package org.adempiere.webui.apps
Class AEnv
java.lang.Object
org.adempiere.webui.apps.AEnv
Static application environment and utilities methods.
- 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
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
actionDrill
(DrillEvent.DrillData data, int windowNo) Opens the Drill Assistantstatic void
actionDrill
(DrillEvent.DrillData data, int windowNo, int processID) Opens the Drill Assistantstatic void
actionRefresh
(Lookup lookup, Object value, boolean mandatory, boolean shortList) Refresh lookupstatic void
actionZoom
(Lookup lookup, Object value) zoom to AD Windowstatic void
cacheReset
(String tableName, int Record_ID) Cache Resetstatic boolean
contains
(org.zkoss.zk.ui.Component parent, org.zkoss.zk.ui.Component child) static void
detachInputElement
(org.zkoss.zk.ui.Component parent) Workaround for detached HTML input element leak.static void
executeAsyncDesktopTask
(Runnable runnable) Execute asynchronous task in UI thread.static void
executeDesktopTask
(Runnable runnable) Execute synchronous task in UI thread.static void
exit
(int status) Deprecated, for removal: This API element is subject to removal in a future version.static int
getADWindowID
(int windowNo) Get AD_Window_ID from windowNo.static String
static org.zkoss.zk.ui.Desktop
Get current desktopstatic String
getDialogHeader
(Properties ctx, int windowNo) static String
getDialogHeader
(Properties ctx, int windowNo, String prefix) Get title for dialog windowstatic URI
Get ImageIcon.static Language
getLanguage
(Properties ctx) static WTableDirEditor
getListDocumentLanguage
(MClient client) static Locale
getLocale
(Properties ctx) static char
getMnemonic
(String text) Get Mnemonic character from text.static GridWindowVO
getMWindowVO
(int WindowNo, int AD_Window_ID, int AD_Menu_ID) Get VO for AD_Windowstatic boolean
getOrSetExecutionAttribute
(String attribute) Set attribute value to Boolean.TRUE if attribute doesn't exists in current execution yet.static String
getWindowHeader
(Properties ctx, int WindowNo) Get window titlestatic String
getZoomUrlTableID
(PO po) static String
static String
getZoomUrlTableUU
(PO po) static boolean
Deprecated.See IDEMPIERE-1022static boolean
static boolean
static boolean
isTablet()
Deprecated, for removal: This API element is subject to removal in a future version.replace by ClientInfo.isMobile()static void
logout()
Logout AD_Session and clearwindowCache
.static void
Merge pdfList to outFilestatic String
postImmediate
(int WindowNo, int AD_Client_ID, int AD_Table_ID, int Record_ID, boolean force) Post Immediate.static void
showCenterScreen
(Window window) Show window in the center of screen.static void
showCenterWindow
(Window parent, Window window) Position window in center of the parent window.static void
showScreen
(Window window, String position) Set window position (Window.setPosition(String)
) and show it.static void
showWindow
(Window win) Show window in desktop.static void
showZoomWindow
(int AD_Window_ID, MQuery query) open zoom window with querystatic void
startWorkflowProcess
(int AD_Table_ID, int Record_ID) Open Workflow Process Window for AD_Table_ID and Record_IDstatic String
toPdfJsUrl
(String pdfUrl) Construct url to open pdfUrl with embedded pdf.js viewer from Mozillastatic void
zoom
(int AD_Table_ID, int Record_ID) Zoom to AD Window by AD_Table_ID and Record_ID.static void
static void
Zoom to AD Window by AD_Table_ID and Record_ID.static void
static void
Zoom to AD window with the provided window id and filters according to the querystatic void
Zoom to AD Window with details from querystatic void
Zoom to AD Window by AD_Table_ID and Record_UU.static void
Zoom to AD Window by AD_Table_ID and Record_UU.
-
Field Details
-
LOCALE
Environment context attribute for Locale- See Also:
-
-
Constructor Details
-
AEnv
public AEnv()
-
-
Method Details
-
showCenterScreen
Show window in the center of screen.- Parameters:
window
- Window to position
-
showScreen
Set window position (Window.setPosition(String)
) and show it.- Parameters:
window
- Window to positionposition
-
-
showCenterWindow
Position window in center of the parent window.- Parameters:
parent
- Parent Windowwindow
- Window to position
-
getMnemonic
Get Mnemonic character from text.- Parameters:
text
- text with '&'- Returns:
- Mnemonic character or 0
-
zoom
public static void zoom(int AD_Table_ID, int Record_ID) Zoom to AD Window by AD_Table_ID and Record_ID.- Parameters:
AD_Table_ID
-Record_ID
-
-
zoomUU
Zoom to AD Window by AD_Table_ID and Record_UU.- Parameters:
AD_Table_ID
-Record_UU
-
-
zoom
Zoom to AD Window by AD_Table_ID and Record_ID.- Parameters:
AD_Table_ID
-Record_ID
-query
- initial query for destination AD WindowwindowNo
-
-
zoomUU
Zoom to AD Window by AD_Table_ID and Record_UU.- Parameters:
AD_Table_ID
-Record_UU
-query
- initial query for destination AD WindowwindowNo
-
-
zoom
- Parameters:
AD_Table_ID
-Record_ID
-query
-
-
exit
Deprecated, for removal: This API element is subject to removal in a future version.Exit System.- Parameters:
status
- System exit status (usually 0 for no error)
-
logout
public static void logout()Logout AD_Session and clearwindowCache
. -
startWorkflowProcess
public static void startWorkflowProcess(int AD_Table_ID, int Record_ID) Open Workflow Process Window for AD_Table_ID and Record_ID- Parameters:
AD_Table_ID
-Record_ID
-
-
getMWindowVO
Get VO for AD_Window- Parameters:
WindowNo
- Window NoAD_Window_ID
- windowAD_Menu_ID
- menu- Returns:
GridWindowVO
instance for AD_Window_ID
-
postImmediate
public static String postImmediate(int WindowNo, int AD_Client_ID, int AD_Table_ID, int Record_ID, boolean force) Post Immediate. CallDoc.manualPosting(int, int, int, int, boolean)
.- Parameters:
WindowNo
- windowAD_Table_ID
- Table ID of DocumentAD_Client_ID
- Client ID of DocumentRecord_ID
- Record ID of Documentforce
- force posting. if false, only post if (Processing='N' OR Processing IS NULL)- Returns:
- null if success, otherwise error
-
cacheReset
Cache Reset- Parameters:
tableName
- table nameRecord_ID
- record id
-
actionRefresh
Refresh lookup- Parameters:
lookup
-value
-mandatory
-shortList
-
-
actionZoom
zoom to AD Window- Parameters:
lookup
- lookup for zoom destination tablevalue
- record key
-
actionDrill
Opens the Drill Assistant- Parameters:
data
- querywindowNo
-
-
actionDrill
Opens the Drill Assistant- Parameters:
data
- querywindowNo
-processID
- Source Report
-
showZoomWindow
open zoom window with query- Parameters:
AD_Window_ID
-query
-
-
zoom
Zoom to AD 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
- Parameters:
AD_Window_ID
-query
-
-
showWindow
Show window in desktop. CallIDesktop.showWindow(Window)
.- Parameters:
win
-
-
zoom
Zoom to AD Window with details from query- Parameters:
query
- query
-
getImage
Get ImageIcon.- Parameters:
fileNameInImageDir
- full file name in imgaes folder (e.g. Bean16.png)- Returns:
- image
URI
-
isFirefox2
public static boolean isFirefox2()- Returns:
- true if client browser is firefox 2+
-
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:
- true if parent == child or parent is ancestor of child.
-
mergePdf
public static void mergePdf(List<File> pdfList, File outFile) throws IOException, com.lowagie.text.DocumentException, FileNotFoundException Merge pdfList to outFile- Parameters:
pdfList
-outFile
-- Throws:
IOException
com.lowagie.text.DocumentException
FileNotFoundException
-
getWindowHeader
Get window title- Parameters:
ctx
- contextWindowNo
- window- Returns:
- Header String
-
getLanguage
- Parameters:
ctx
-- Returns:
Language
-
getLocale
- Parameters:
ctx
-- Returns:
Locale
-
getDialogHeader
Get title for dialog window- Parameters:
ctx
-windowNo
-prefix
-- Returns:
- dialog header
-
getDialogHeader
- Parameters:
ctx
-windowNo
-- Returns:
- dialog header
-
executeDesktopTask
Execute synchronous task in UI thread. UseExecutions.activate(Desktop)
andExecutions.deactivate(Desktop)
pair if current thread is not UI/Listener thread.- Parameters:
runnable
-
-
executeAsyncDesktopTask
Execute asynchronous task in UI thread.- Parameters:
runnable
-
-
getDesktop
public static org.zkoss.zk.ui.Desktop getDesktop()Get current desktop- Returns:
Desktop
-
isTablet
Deprecated, for removal: This API element is subject to removal in a future version.replace by ClientInfo.isMobile()- Returns:
- true if running on a tablet
-
getADWindowID
public static int getADWindowID(int windowNo) Get AD_Window_ID from windowNo.- Parameters:
windowNo
-- Returns:
- AD_Window_ID or
Env.adWindowDummyID
(if it is ProcessDialog of InfoWindow)
-
getListDocumentLanguage
- Parameters:
client
-- Returns:
WTableDirEditor
for Language if client is with IsMultiLingualDocument=Y- Throws:
Exception
-
getApplicationUrl
- Returns:
- URL to access application from browser
-
getZoomUrlTableUU
- Parameters:
po
-- Returns:
- URL link for direct access to the record using AD_Table_ID+Record_UUID
-
getZoomUrlTableID
- Parameters:
po
-- Returns:
- URL link for direct access to the record using AD_Table_ID+Record_ID
-
getZoomUrlTableName
- Parameters:
po
-- Returns:
- URL link for direct access to the record using TableName+Record_ID
-
getOrSetExecutionAttribute
Set attribute value to Boolean.TRUE if attribute doesn't exists in current execution yet.- Parameters:
attribute
-- Returns:
- true if attribute have been set for current executions
-
detachInputElement
public static void detachInputElement(org.zkoss.zk.ui.Component parent) Workaround for detached HTML input element leak.
Detach all InputElement and Button that's the immediate or not immediate child of parent.
Note that to remedy the detached HTML element leak issue, we must defer the detach of parent withExecutions.schedule(Desktop, EventListener, Event)
.- Parameters:
parent
-Component
-
toPdfJsUrl
Construct url to open pdfUrl with embedded pdf.js viewer from Mozilla- Parameters:
pdfUrl
-- Returns:
- pdf.js viewer url
-