|
LEONARDI Application Composer - 8.9.0.40 by W4 S.A. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectleon.misc.LyEnvironment
public final class LyEnvironment
This class describes an execution environment. It gives an access to all properties like language, debug mode, strings, colors, fonts and also to the type of view manager used. An environment is linked to a session or an application. This means that several applications may be launched in the same Java Virtual Machine using different resources. It also means that each user session may have its own environment: this allows multi-lingualism in servlet mode. Each time a new http client connects itself on the servlet, a new session is created using a new environment if needed (to change the language for example).
An environment is described by:
LyApplication
,
LySession
Nested Class Summary | |
---|---|
static class |
LyEnvironment.ResourceType
Resource types. |
Field Summary | |
---|---|
static java.lang.String |
__VERSION
|
java.text.DateFormat[] |
_dateFormatTable
Optimization: keep dateFormat array association between TYPE_xxx and format. |
java.io.PrintStream |
_oldSystemErr
When the environment is closed, may restore former System.err. |
java.io.PrintStream |
_oldSystemOut
When the environment is closed, may restore former System.out. |
java.lang.String[] |
_stringDateFormatTable
Optimization: keep dateFormat array association between TYPE_xxx (e.g. |
java.lang.Throwable |
_throwable
|
static int |
DEBUG_ALL
Debug level: All = Writes information of the following levels: DEBUG_ERROR
DEBUG_WARNING
DEBUG_INFO or DEBUG_LOG
DEBUG_TRACE
DEBUG_DBMS
DEBUG_BUS
DEBUG_XML
|
static int |
DEBUG_BUS
Debug level: BUS = Writes information about the logical bus (messages between applications). |
static int |
DEBUG_DBMS
Debug level: DBMS = Writes information about DBMS connection and requests. |
static int |
DEBUG_DUMP_HTML
Debug level: DUMP HTML = Dump HTML pages to log directory. |
static int |
DEBUG_ERROR
Debug level: Error = writes only occurred errors. |
static int |
DEBUG_GRAPHICS
Debug level: GRAPHICS = Shows debug information about graphics (e.g. clipping area). |
static int |
DEBUG_HELP_FILES
Debug level: HELP FILES = Dump Help Files that the application is seeking. |
static int |
DEBUG_INFO
Debug level: Info = writes only information, i.e. normal operations such as saving a file. |
static int |
DEBUG_LOCKS
Debug level: LOCKS = Writes information about session locks. |
static int |
DEBUG_LOG
Debug level: Log = Debug level: Info . |
static int |
DEBUG_NONE
Debug level: None = No debug. |
static int |
DEBUG_PEER
Debug level: PEER = Writes information about peer layer. |
static int |
DEBUG_PERF
Debug level: PERF = Writes informations about performance. |
static int |
DEBUG_PRINT_PDF
Debug level: PRINT PDF = Writes information about generation of PDF files for printing. |
static int |
DEBUG_TRACE
Debug level: Trace = writes only Traces. |
static int |
DEBUG_TRANSACTION
Debug level: TRANSACTION = Writes information about generic hooks on transactions. |
static int |
DEBUG_WARNING
Debug level: Warning = writes only occurred warning. |
static int |
DEBUG_XML
Debug level: XML = Write information about XML (generation of views XML files). |
static java.lang.String |
DEFAULT_SKIN
Default skin name. |
static java.lang.String |
DELIMITERS
Delimiters : separators that may be encountered when translating keys used to split given key in sub-keys. |
java.io.PrintStream |
err
Output stream to display errors. |
static java.lang.String |
HOSTING_TEMPSPACE
Context key for JNDI temp dir |
static java.lang.String |
INTERNAL_DATE_FORMAT
Internal date format to store dates in ids or peer values default is in LyDateFormatter and is EEE MMM dd HH:mm:ss zzz yyyy. |
static java.lang.String |
NAMING_CONTEXT
Context key for JNDI Resources |
static short |
OS_AIX
AIX Os. |
static short |
OS_HPUX
HP-UX Os. |
static short |
OS_LINUX
Linux Os. |
static short |
OS_MACOS
Mac OS. |
static short |
OS_SOLARIS
Solaris Os. |
static short |
OS_UNIX
Unix Os : so far OS_UNIX = OS_SOLARIS || OS_LINUX || OS_HPUX || OS_AIX. |
static short |
OS_WINDOWS
Windows OS. |
java.io.PrintStream |
out
Output stream to display informations. |
static boolean |
TEST_MODE
Boolean indicating if the application is in test mode (record or replay). |
static boolean |
TEST_MODE_AUTO
Boolean indicating if the application is in automatic test mode (record or replay). |
static short |
TYPE_DATE
Date type : date (day+month+year). |
static short |
TYPE_DATE_HOUR_MIN
Date type : date (day+month+year) and hour (hour+min). |
static short |
TYPE_DATE_TIME
Date type : date (day+month+year) and time (hour+min+seconds). |
static short |
TYPE_HOUR_MIN
Date type : hour (hour+min). |
static short |
TYPE_TIME
Date type : time (hour+min+seconds). |
Constructor Summary | |
---|---|
LyEnvironment(LyEnvironment parent)
Constructor with a given parent environment. |
|
LyEnvironment(java.lang.String id,
LyEnvironment parent,
boolean hasViewManager)
Constructor with a given identifier, parent environment and indication about view manager building. |
|
LyEnvironment(java.lang.String id,
LyEnvironment parent,
boolean hasViewManager,
boolean isMobile)
Constructor with a given identifier, parent environment and indications about view manager building and type of platform used. |
Method Summary | |
---|---|
void |
beep()
Emits a brief sound signal. |
java.util.Calendar |
calendarFactory()
Creates a new Calendar instance for the specified or default timeZone Set the time zone parameter in .ini file with the user.timezone key. |
boolean |
checkEnv()
Checks all initialization environment parameters (data directories, images, files...) |
boolean |
checkFile(java.lang.String key,
boolean fatalError,
boolean required)
Checks if the specified path exists. |
boolean |
checkImage(java.lang.String key)
Checks if given key image corresponds to a known image. |
boolean |
checkPath(java.lang.String key,
java.lang.String extraPath,
boolean fatalError,
boolean required)
Checks if the specified directory exists. |
boolean |
checkResource(LyEnvironment.ResourceType type,
java.lang.String key,
boolean checkAll)
Check the existence of a resource in the resources bundles |
void |
clearResourceBundleCaches()
Clears all the resource bundle caches for this environment. |
java.text.DateFormat |
dateFormatFactory(int type)
Creates a new DateFormat instance of the given type. |
void |
execGui(java.lang.Runnable runnable)
Calls the #execGui(runnable, false) method of the given
runnable to be invoked by the user-interface thread asynchronously. |
void |
execGui(java.lang.Runnable runnable,
boolean synchronous)
If the view manager exist calls the view manager execGui(runnable, synchronous) method. |
void |
executeCommand(java.lang.String[] command,
boolean waiting)
Execute the given command in a separate process, capture its output and redirect it to the standard output. |
void |
executeCommand(java.lang.String command,
boolean waiting)
Execute the given command in a separate process, capture its output and redirect it to the standard output. |
void |
free()
Frees all resources used by this environment. |
static void |
freeRootEnvironment()
Free root environment. |
java.lang.String |
getCharset(java.lang.String lang,
boolean nullIfNotFound)
Gets the charset for the given language. |
java.lang.ClassLoader |
getClassLoader()
Gets the default class loader of this environment. |
java.lang.Object |
getColor(java.lang.String key)
Retrieves a Color from the application environment. |
java.util.Vector<java.lang.String> |
getColorCodes()
Gets the color codes list of the color_codes properties file. |
static LyEnvironment |
getCurrentEnvironment()
Gets environment for current thread. |
java.lang.String |
getDateLanguage()
Gets the environment date language. |
java.util.Locale |
getDateLocale()
Gets the default date locale for current context and current environment. |
static java.lang.Character |
getDecimalSeparator()
Gets the decimal separator for all environment. |
java.lang.String |
getDisabledImageUrl(java.lang.String key)
Retrieves a disabled image url from the application environment. |
java.text.DateFormat |
getDisplayDateFormat(java.lang.String pattern)
Gets the date format associated to the given pattern. |
java.lang.String |
getEnv(java.lang.String key)
Retrieves a value from the contextual environment. |
java.lang.String |
getFile(java.lang.String key)
Retrieves a File path from the application environment. |
java.lang.Object |
getFont(java.lang.String key)
Retrieves a Font from the application environment. |
static java.lang.Character |
getGroupingSeparator()
Gets the grouping separator for all environment. |
java.lang.String |
getHelpFile(java.lang.String actionId,
java.lang.String rootActionId,
java.lang.String classId)
Gets the help file for the specified context, or null if help file could not be found. |
java.lang.String |
getId()
Gets the environment identifier. |
java.lang.Object |
getImage(java.lang.String key)
Retrieves an image from the Application environment. |
java.lang.Object |
getImage(java.lang.String key,
java.lang.String sizeCode)
Retrieves an image from the Application environment. |
java.lang.Object |
getImage(java.lang.String key,
java.lang.String sizeCode,
boolean defaultImage)
Retrieves an image from the Application environment. |
java.lang.String |
getImageFileName(java.lang.String key)
Gets the image file name corresponding to the given key. |
java.lang.String |
getImagePath(java.lang.String key)
Retrieves an image path from the application environment. |
LyImages |
getImages()
Gets the Images bundle associated to this environment. |
int[] |
getImageSize(java.lang.String path)
Checks if a size is given in the path. |
int[] |
getImageSize(java.lang.String path,
boolean enableLoadImage)
Checks if a size is given in the path. |
java.lang.String |
getImageSizeInfo(int width,
int height)
Builds an image size description info (as a string). |
java.lang.String |
getImageUrl(java.lang.String key)
Retrieves an image url from the application environment. |
java.lang.String |
getImageUrl(java.lang.String key,
boolean disabled,
boolean defaultImage)
Gets the image url corresponding to the given key. |
java.io.InputStream |
getInputStream(java.lang.String path)
Retrieves an inputStream from a local address. |
java.io.InputStream |
getInputStream(java.lang.String path,
boolean showError)
Retrieves an inputStream from a local address. |
int |
getIntResource(java.lang.String key)
Retrieves an integer resource from the application environment. |
java.lang.String |
getLanguage()
Gets the environment language. |
java.lang.String |
getLeonDocExternalUrl()
Gets the path of the external leonardi documentation if exists (LY_LEON_EXTERNAL_URL), the Leonardi dicumentation otherwise (LY_LEON_DOC). |
java.util.Locale |
getLocale()
Gets the default locale for current context and current environment. |
LyLogger |
getLogger()
Gets the environment logger used to log application messages. |
LyColor |
getLyColor(java.lang.String key)
Retrieves a Color from the application environment. |
LyFont |
getLyFont(java.lang.String key)
Retrieves a Font from the application environment. |
int[] |
getMaxScreenSize()
Retrieves the viewport size available on the computer. |
java.lang.String |
getMessage(java.lang.String key)
Convenient routine to get a formated message without argument. |
java.lang.String |
getMessage(java.lang.String key,
java.lang.Object argument)
Convenient routine to get a formated message with only one argument. |
java.lang.String |
getMessage(java.lang.String key,
java.lang.Object[] arguments)
Constructs a message from a key and an array of arguments. |
java.lang.String |
getMessage(java.lang.String key,
java.lang.Object argument1,
java.lang.Object argument2)
Convenient routine to get a formated message with two arguments. |
java.lang.String |
getMessage(java.lang.String key,
java.lang.Object argument1,
java.lang.Object argument2,
java.lang.Object argument3)
Convenient routine to get a formated message with three arguments. |
java.lang.Character |
getMnemonic(java.lang.String key)
Gets the mnemonic for the string corresponding to the given key. |
java.text.NumberFormat |
getNumberFormat(java.lang.String pattern)
Gets the deciaml format associated to the given pattern. |
java.io.OutputStream |
getOutputStream(java.lang.String path,
boolean showError)
Retrieves an outputStream from a local address. |
java.lang.String |
getPathWithoutSize(java.lang.String path)
Retrieves the path of an image without the information about its size. |
LyPerfLogger |
getPerfLogger()
Gets the perfomance logger used to log perf messages. |
LyPlayer |
getPlayer()
Gets demand player. |
java.util.Properties |
getPropertiesFromContext(java.lang.String prefix)
Accessor to the properties file or parameter if specified in constructor. |
java.lang.String |
getResource(LyEnvironment.ResourceType type,
java.lang.String key)
Gets the resource identified with the given key and type. |
java.lang.String |
getResource(java.lang.String key)
Retrieves a resource from the application environment. |
java.io.InputStream |
getResourceAsStream(java.lang.String name,
java.lang.ClassLoader classLoader)
Retrieves an inputStream from a local address. |
java.util.HashMap<java.lang.String,java.lang.String> |
getResources(LyEnvironment.ResourceType type)
Gets resources identified with the given type. |
int[] |
getScreenSize(java.lang.Object component)
Retrieves the screen size. |
java.lang.String |
getSkin()
Gest the environment skin. |
LyString |
getString()
Retrieves the instance of LyString associated to this environment. |
java.lang.String |
getString(java.lang.String key)
Convenient routine to get a formated string without argument. |
java.lang.String |
getString(java.lang.String key,
java.lang.Object argument)
Convenient routine to get a formated string with one argument. |
java.lang.String |
getString(java.lang.String key,
java.lang.Object[] arguments)
Constructs a string from a key and an array of arguments. |
java.lang.String |
getStringDateFormat(int type)
Returns the string representing the date format of the given type. |
java.util.TimeZone |
getTimeZone()
Gets the default timezone for current context and current environment. |
java.lang.String |
getUrl(java.lang.String key)
Retrieves an url from the application environment. |
java.lang.String |
getViewAttValue(java.lang.String key)
Retrieves a value from this environment. |
LyViewManagerInterface |
getViewManager()
Retrieves the environment view manager. |
LyViewManagerInterface |
getViewManager(boolean isMobile)
Retrieves the environment view manager. |
boolean |
hasResource(LyEnvironment.ResourceType type,
java.lang.String key)
Checks if a resource if found for given key. |
void |
initResources()
Initialize the environment. |
boolean |
isDebugLevel(int level)
Checks if a debug level is set or not. |
boolean |
isImageAnimated(java.lang.String key)
Indicates if an image is animated. |
boolean |
isImageCached(java.lang.Object image)
Indicates whether given image may be cached. |
static boolean |
isOperatingSystem(short osType)
Checks the current Operating System. |
boolean |
isResourceDefined(java.lang.String key)
Test if the given key is declared in a resource file |
boolean |
isRoot()
Checks if this environment is the root environment. |
void |
load(java.lang.String applicationId)
Adds to the current environment resources of properties files corresponding to the given application id. |
void |
load(java.lang.String applicationId,
java.lang.ClassLoader classLoader)
Adds to the current environment resources of properties files corresponding to the given application id. |
void |
load(java.lang.String applicationId,
java.lang.ClassLoader classLoader,
boolean checkParentForBundle)
Adds to the current environment resources of properties files corresponding to the given application id. |
boolean |
loadEnv(java.lang.String path)
Loads the environment from the ".ini" file. |
boolean |
loadEnv(java.lang.String path,
java.lang.ClassLoader classLoader)
Deprecated. use loadEnv(String path, ClassLoader classLoader, true) instead of this one |
boolean |
loadEnv(java.lang.String path,
java.lang.ClassLoader classLoader,
boolean initialize)
Loads the environment from ini file. |
boolean |
loadEnv(java.lang.String path,
java.lang.ClassLoader classLoader,
boolean initialize,
java.lang.String lyAppDir)
Loads the environment from ini file. |
void |
loadInParentBundles(java.lang.String applicationId,
java.lang.ClassLoader classLoader)
Adds to the current environment resources of properties files corresponding to the given application id. |
void |
logErr(java.lang.String message)
This method logs error messages. |
void |
logError(java.lang.String message)
This method logs errors. |
void |
logFatal(java.lang.String message)
This method logs fatal errors. |
void |
logInfo(java.lang.String message)
This method logs info. |
void |
logOut(java.lang.String message)
This method logs output messages. |
void |
logTrace(java.lang.String message)
This method logs traces. |
void |
logWarning(java.lang.String message)
This method logs warnings. |
void |
parseEnv()
Gets general configuration parameters from property file (".ini" file). |
void |
putColor(java.lang.String key,
java.lang.String string)
Adds a specific color in this environment. |
java.lang.Object |
putEnv(java.lang.String key,
java.lang.Object value)
Adds a value in the contextual environment. |
void |
putFile(java.lang.String key,
java.lang.String string)
Adds a specific file in this environment. |
void |
putFont(java.lang.String key,
java.lang.String string)
Adds a specific font in this environment. |
void |
putImage(java.lang.String key,
java.lang.String string)
Adds a specific image in this environment. |
void |
putMessage(java.lang.String key,
java.lang.String string)
Adds a specific message in this environment. |
void |
putResource(LyEnvironment.ResourceType type,
java.lang.String key,
java.lang.String value)
Adds a non-persistent resource with the given type, key and value in this environment. |
void |
putResource(LyEnvironment.ResourceType type,
java.lang.String key,
java.lang.String value,
boolean persistent)
Adds a resource with the given type, key and value in this environment. |
void |
putResource(java.lang.String key,
java.lang.String string)
Adds a specific resource in this environment. |
void |
putString(java.lang.String key,
java.lang.String string)
Adds a string to the table of specific strings defined for one session. |
void |
raiseError(java.lang.String message)
Raises a warning message to the end-user. |
void |
removeResource(LyEnvironment.ResourceType type,
java.lang.String key)
Removes a resource with the given type and key from this environment. |
boolean |
repostGuiEvents()
Checks if events on data need to be reposted in GUI event queue. |
void |
setClassLoader(java.lang.ClassLoader loader)
Sets the default class loader for this environment. |
static LyEnvironment |
setCurrentEnvironment(LyEnvironment environment)
Sets environment for current thread. |
void |
setDateLanguage(java.lang.String language)
Sets the date language for this environment. |
void |
setDebugLevel(int level)
Sets current debug level for this environment. |
void |
setDebugLevel(int level,
boolean status)
Sets current debug level for this environment. |
static void |
setDecimalSeparator(java.lang.Character decimalSeparator)
Sets the decimal separator for all environment. |
void |
setErrorStream(java.io.PrintStream error)
Set the stream used to display errors. |
static void |
setGroupingSeparator(java.lang.Character groupingSeparator)
Set the grouping separator for all environment. |
void |
setLanguage(java.lang.String language)
Sets the language for this environment. |
void |
setLogger(LyLogger logger)
Sets environment logger. |
void |
setMobile(boolean isMobile)
|
void |
setOutputStream(java.io.PrintStream output)
Sets the stream used to display information. |
void |
setPlayer(LyPlayer player)
Sets the demand player. |
void |
setSkin(java.lang.String skin)
Set the skin for current environment. |
void |
setSkinAndLanguage(java.lang.String skin,
java.lang.String language)
Sets the skin and language for this environment. |
void |
setViewManager(LyViewManagerInterface viewManager)
Sets the application view manager. |
boolean |
testEnv(java.lang.String key)
Checks if an environment parameter is set. |
boolean |
testResource(java.lang.String key)
Checks if a resource is set to true or 1. |
java.lang.String |
translate(java.lang.String key)
Translates the given key to a String that may be shown to the user. |
void |
writeException(java.lang.Throwable t)
Writes an exception to the error stream. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String __VERSION
public static final int DEBUG_NONE
public static final int DEBUG_ALL
public static final int DEBUG_ERROR
public static final int DEBUG_WARNING
public static final int DEBUG_INFO
public static final int DEBUG_LOG
Info
.
public static final int DEBUG_TRACE
public static final int DEBUG_DBMS
public static final int DEBUG_BUS
public static final int DEBUG_XML
public static final int DEBUG_PERF
public static final int DEBUG_GRAPHICS
public static final int DEBUG_PEER
public static final int DEBUG_DUMP_HTML
public static final int DEBUG_HELP_FILES
public static final int DEBUG_TRANSACTION
public static final int DEBUG_PRINT_PDF
public static final int DEBUG_LOCKS
public static final short OS_WINDOWS
public static final short OS_UNIX
public static final short OS_SOLARIS
public static final short OS_LINUX
public static final short OS_HPUX
public static final short OS_AIX
public static final short OS_MACOS
public static java.lang.String INTERNAL_DATE_FORMAT
public static final java.lang.String DELIMITERS
public static boolean TEST_MODE
public static boolean TEST_MODE_AUTO
public static final short TYPE_DATE_TIME
public static final short TYPE_DATE_HOUR_MIN
public static final short TYPE_DATE
public static final short TYPE_TIME
public static final short TYPE_HOUR_MIN
public static final java.lang.String NAMING_CONTEXT
public static final java.lang.String HOSTING_TEMPSPACE
public static java.lang.String DEFAULT_SKIN
public java.io.PrintStream out
public java.io.PrintStream err
public java.lang.String[] _stringDateFormatTable
public java.text.DateFormat[] _dateFormatTable
public java.io.PrintStream _oldSystemOut
public java.io.PrintStream _oldSystemErr
public java.lang.Throwable _throwable
Constructor Detail |
---|
public LyEnvironment(java.lang.String id, LyEnvironment parent, boolean hasViewManager)
id
- The environment identifier.parent
- The parent environment.hasViewManager
- Indicates whether this environment may build a view manager or not.public LyEnvironment(java.lang.String id, LyEnvironment parent, boolean hasViewManager, boolean isMobile)
id
- The environment identifier.parent
- The parent environment.hasViewManager
- Indicates whether this environment may build a view manager or not.isMobile
- Indicates if the platform used is a mobile of not.public LyEnvironment(LyEnvironment parent)
parent
- The parent environment.Method Detail |
---|
public static LyEnvironment getCurrentEnvironment()
public static LyEnvironment setCurrentEnvironment(LyEnvironment environment)
environment
- Current environment, null to unset.public static void freeRootEnvironment()
public static boolean isOperatingSystem(short osType)
osType
- One of the OS_XXX defines.
public static void setDecimalSeparator(java.lang.Character decimalSeparator)
decimalSeparator
- the new decimal separator.public static void setGroupingSeparator(java.lang.Character groupingSeparator)
groupingSeparator
- the new grouping separator.public static java.lang.Character getDecimalSeparator()
public static java.lang.Character getGroupingSeparator()
public void free()
public boolean isRoot()
public void setOutputStream(java.io.PrintStream output)
output
- The new output streampublic void setErrorStream(java.io.PrintStream error)
error
- The new error streampublic void putResource(LyEnvironment.ResourceType type, java.lang.String key, java.lang.String value, boolean persistent)
type
- Type of the resource.key
- Key of the resource.value
- Value of the resource.persistent
- Indicates that resource survives to environment reload (language or skin changes).public final void putResource(LyEnvironment.ResourceType type, java.lang.String key, java.lang.String value)
public void removeResource(LyEnvironment.ResourceType type, java.lang.String key)
type
- Type of the removed resource.key
- Key of the removed resource.public boolean checkResource(LyEnvironment.ResourceType type, java.lang.String key, boolean checkAll)
type
- type of the resourcekey
- the keycheckAll
- if true, we check the existence in the application and in the AE properties. If false we only
look in the application
public java.lang.String getResource(LyEnvironment.ResourceType type, java.lang.String key)
type
- Type of the resource.key
- Key of the resource.
public java.util.HashMap<java.lang.String,java.lang.String> getResources(LyEnvironment.ResourceType type)
type
- Type of the resources.
public java.lang.String translate(java.lang.String key)
translate(key, true)
key
- The key to translate.
LyStrings
,
translate(String, boolean)
public java.lang.String getString(java.lang.String key)
key
- the string to find
getString(String, Object[])
public java.lang.String getString(java.lang.String key, java.lang.Object argument)
key
- the string keyargument
- the message argument
getString(String, Object[])
public java.lang.String getString(java.lang.String key, java.lang.Object[] arguments)
key
- the string key.arguments
- the array of arguments used to build the string.
LyStrings.getString(String,Object[])
public java.lang.Character getMnemonic(java.lang.String key)
key
- The key of the string.
public void putString(java.lang.String key, java.lang.String string)
key
- The key that defines the string.string
- The translated string as it appears in views.public java.lang.String getMessage(java.lang.String key)
key
- the message key
getMessage(String, Object[])
public java.lang.String getMessage(java.lang.String key, java.lang.Object argument)
key
- the message keyargument
- the message argument
getMessage(String, Object[])
public java.lang.String getMessage(java.lang.String key, java.lang.Object argument1, java.lang.Object argument2)
key
- the message keyargument1
- the first argumentargument2
- the second argument
getMessage(String, Object[])
public java.lang.String getMessage(java.lang.String key, java.lang.Object argument1, java.lang.Object argument2, java.lang.Object argument3)
key
- the message keyargument1
- the first argumentargument2
- the second argumentargument3
- the third argument
getMessage(String, Object[])
public java.lang.String getMessage(java.lang.String key, java.lang.Object[] arguments)
key
- The key of the message.arguments
- The array of arguments used to construct the message.
LyStrings.getString(String,Object[])
,
LyStrings
public void putMessage(java.lang.String key, java.lang.String string)
key
- The key that defines the message.string
- The message contentpublic java.lang.String getImageFileName(java.lang.String key)
key
- the image resource key
public java.lang.String getImagePath(java.lang.String key)
key
- The resource name (key) of the image.
LyImages.getImagePath(String)
public final java.lang.String getImageUrl(java.lang.String key)
key
- The resource name (key) of the image.
LyImages.getImageUrl(String)
public final java.lang.String getDisabledImageUrl(java.lang.String key)
key
- The resource name (key) of the image.
LyImages.getDisabledImageUrl(String)
public java.lang.String getImageUrl(java.lang.String key, boolean disabled, boolean defaultImage)
key
- the image resource keydisabled
- Indicates if disabled image should be searched.defaultImage
- If true, return default image if the URL is not found.
public java.lang.Object getImage(java.lang.String key)
key
- The resource name (key) of the image.
getImage(String,String)
,
LyImages
public java.lang.Object getImage(java.lang.String key, java.lang.String sizeCode)
key
- The resource name (key) of the imagesizeCode
- The size code of the image (see LyImages.loadImage())
getImage(String,String,boolean)
public java.lang.Object getImage(java.lang.String key, java.lang.String sizeCode, boolean defaultImage)
key
- The resource name (key) of the imagesizeCode
- The size code of the image (see LyImages.loadImage())defaultImage
- If true, return default image if not found.
LyImages.loadImage(Object,String)
,
getImageSizeInfo(int,int)
public boolean checkImage(java.lang.String key)
key
- The resource name (key) of the image
public boolean isImageCached(java.lang.Object image)
image
- The image that may be cached.
public boolean isImageAnimated(java.lang.String key)
key
- The resource name (key) of the image
public java.lang.String getImageSizeInfo(int width, int height)
width
- The desired width for the image.height
- The desired height for the image.
LyImages.getImageSizeInfo(int,int)
public int[] getImageSize(java.lang.String path)
path
- The path to check.
LyImages.getImageSize(String, boolean)
public int[] getImageSize(java.lang.String path, boolean enableLoadImage)
path
- The path to check.enableLoadImage
- indicates wether the application is allowed to load the image
LyImages.getImageSize(String, boolean)
public java.lang.String getPathWithoutSize(java.lang.String path)
path
- The path of the image.
LyImages.getPathWithoutSize(String)
public void putImage(java.lang.String key, java.lang.String string)
key
- The key that defines the image.string
- The specific image path.public java.lang.String getLeonDocExternalUrl()
getEnv(String)
public LyFont getLyFont(java.lang.String key)
key
- The resource name (key) of the font.
LyFonts
public java.lang.Object getFont(java.lang.String key)
key
- The resource name (key) of the font.
LyFonts
public void putFont(java.lang.String key, java.lang.String string)
key
- The key that defines the font.string
- The specific font.public LyColor getLyColor(java.lang.String key)
key
- The resource name (key) of the Color.
LyColors
public java.lang.Object getColor(java.lang.String key)
key
- The resource name (key) of the Color.
LyColors
public java.util.Vector<java.lang.String> getColorCodes()
public void putColor(java.lang.String key, java.lang.String string)
key
- The key that defines the color.string
- The specific color.public java.lang.String getFile(java.lang.String key)
key
- The resource name (key) of the File
LyFiles
public java.lang.String getUrl(java.lang.String key)
key
- The resource name (key) of the url
LyFiles
public void putFile(java.lang.String key, java.lang.String string)
key
- The key that defines the file.string
- The specific file.public boolean isResourceDefined(java.lang.String key)
key
- a key
public java.lang.String getResource(java.lang.String key)
key
- The resource name (key).
LyResources
public boolean hasResource(LyEnvironment.ResourceType type, java.lang.String key)
key
- Resource key.
public boolean testResource(java.lang.String key)
key
- The resource name (key).
getResource(String)
public void putResource(java.lang.String key, java.lang.String string)
key
- The key that defines the resource.string
- The specific resource.public int getIntResource(java.lang.String key)
key
- The resource name (key).
LyResources
public java.lang.String getEnv(java.lang.String key)
key
- The key associated with the environment parameter.
putEnv(String,Object)
public java.lang.Object putEnv(java.lang.String key, java.lang.Object value)
key
- The Id of the added property.value
- The value added in the environnment.
getEnv(String)
public boolean testEnv(java.lang.String key)
key
- The key that defines the parameter.
putEnv(String,Object)
public java.lang.String getViewAttValue(java.lang.String key)
key
- The resource name (key).
LyResources
public void initResources()
public boolean loadEnv(java.lang.String path)
path
- The full path to the environment file.
loadEnv(String, ClassLoader, boolean)
public boolean loadEnv(java.lang.String path, java.lang.ClassLoader classLoader)
path
- The full path to the environment file.classLoader
- optional classloader to look in CLASSPATH
public boolean loadEnv(java.lang.String path, java.lang.ClassLoader classLoader, boolean initialize)
path
- The full path to the environment file.classLoader
- optional classloader to look in CLASSPATHinitialize
- indicates if we call the endInitialize method (true) or just read ini
file (false)
public boolean loadEnv(java.lang.String path, java.lang.ClassLoader classLoader, boolean initialize, java.lang.String lyAppDir)
path
- The full path to the environment file.classLoader
- optional classloader to look in CLASSPATHinitialize
- indicates if we call the endInitialize method (true) or just read ini
file (false)lyAppDir
- new value of the LY_APP_DIR variable
public boolean checkEnv()
checkPath(String, String, boolean, boolean)
public boolean checkPath(java.lang.String key, java.lang.String extraPath, boolean fatalError, boolean required)
key
- the key associated to the path we want to checkextraPath
- additional path checked at the end of specified pathfatalError
- if an error occured, shall we log the error to the console or stop the
execution of the application (Exception).required
- indicates that the resource MUST be set.
public boolean checkFile(java.lang.String key, boolean fatalError, boolean required)
key
- the key associated to the path we want to checkfatalError
- if an error occured, shall we log the error to the console or stop the
execution of the application (Exception).required
- indicates that the resource MUST be set.
public java.util.TimeZone getTimeZone()
public java.io.InputStream getResourceAsStream(java.lang.String name, java.lang.ClassLoader classLoader)
name
- the address of the input stream to retrieveclassLoader
- the class loader that may retrieves the InputStream
public java.io.InputStream getInputStream(java.lang.String path)
path
- The path may be the access to a file or an URL.
public java.io.InputStream getInputStream(java.lang.String path, boolean showError)
path
- The path may be the access to a file or an URL.showError
- indicates if an error may be shown to the user
public java.io.OutputStream getOutputStream(java.lang.String path, boolean showError)
path
- The path may be the access to a file or an URL.showError
- indicates if an error may be shown to the user
public void parseEnv()
loadEnv(String)
public java.util.Calendar calendarFactory()
public java.lang.String getStringDateFormat(int type)
type
- The date type (use LyDateFieldInfo types constants).
LyDateFieldInfo
,
dateFormatFactory(int)
public java.text.DateFormat dateFormatFactory(int type)
type
- The type of date (use LyDateFieldInfo types constants).
LyDateFieldInfo
,
getStringDateFormat(int)
public java.text.DateFormat getDisplayDateFormat(java.lang.String pattern)
pattern
- The pattern used for the requested format.
public java.text.NumberFormat getNumberFormat(java.lang.String pattern)
pattern
- The pattern used for the requested format.
public java.lang.String getHelpFile(java.lang.String actionId, java.lang.String rootActionId, java.lang.String classId)
actionId
- Current action identifier (attempt to get help for the specific action)rootActionId
- Root action identifierclassId
- Class id identifier.
LyHelpFiles
public int[] getScreenSize(java.lang.Object component)
component
- The component used to retrieve the screen size.
LyViewManager.getScreenSize(Object)
public int[] getMaxScreenSize()
public java.lang.String getId()
public java.lang.String getLanguage()
setLanguage(String)
public java.lang.String getSkin()
setSkin(String)
public java.lang.String getDateLanguage()
setDateLanguage(String)
public boolean isDebugLevel(int level)
level
- The level that must be checked.
setDebugLevel(int,boolean)
public LyViewManagerInterface getViewManager()
LyViewManager
public LyViewManagerInterface getViewManager(boolean isMobile)
LyViewManager
public void setViewManager(LyViewManagerInterface viewManager)
viewManager
- a reference to the LyViewManager instance or to the view manager of the
parent.LyViewManager
public java.util.Locale getLocale()
public java.util.Locale getDateLocale()
public java.lang.String getCharset(java.lang.String lang, boolean nullIfNotFound)
lang
- the language whose charset is requirednullIfNotFound
- if true, return null if the charset is not found, else return the
default charset
public LyString getString()
LyString
public void beep()
public LyImages getImages()
LyImages
public void clearResourceBundleCaches()
public LyPlayer getPlayer()
public void setPlayer(LyPlayer player)
player
- new demand player valuepublic java.lang.ClassLoader getClassLoader()
public LyLogger getLogger()
public LyPerfLogger getPerfLogger()
public void setClassLoader(java.lang.ClassLoader loader)
loader
- The new default class loader.public void setLogger(LyLogger logger)
logger
- The logger used to log application messages.public void setSkinAndLanguage(java.lang.String skin, java.lang.String language)
skin
- The new skin.language
- The new language.LyEnvironment#setLanguage()
,
setSkin(String)
public void setLanguage(java.lang.String language)
language
- The new language.getLanguage()
public void setSkin(java.lang.String skin)
skin
- the name of the skin to be used.initialization
- indicates if we are in the initialization process.public void setDateLanguage(java.lang.String language)
language
- The new date language.getLanguage()
public void setDebugLevel(int level)
level
- The debug level that must be set.setDebugLevel(int,boolean)
public void setDebugLevel(int level, boolean status)
level
- The debug level that must be set.status
- true if the debugLevel is added, false if removed.setDebugLevel(int)
public void executeCommand(java.lang.String command, boolean waiting)
command
- system script that should be executedwaiting
- indicates whether the call is waiting for process completionLyProcessViewer
public void executeCommand(java.lang.String[] command, boolean waiting)
commands
- command list which should be executed.waiting
- indicates whether the call is waiting for process completionLyProcessViewer
public void logFatal(java.lang.String message)
message
- Message to log.public void logError(java.lang.String message)
message
- Message to log.public void logWarning(java.lang.String message)
message
- Message to log.public void logInfo(java.lang.String message)
message
- Message to log.public void logTrace(java.lang.String message)
message
- Message to log.public void logErr(java.lang.String message)
message
- Message to log.public void logOut(java.lang.String message)
message
- Message to log.public void writeException(java.lang.Throwable t)
public void load(java.lang.String applicationId)
applicationId
- The application id.public void load(java.lang.String applicationId, java.lang.ClassLoader classLoader)
applicationId
- The application id.classLoader
- The environment classLoader.public void load(java.lang.String applicationId, java.lang.ClassLoader classLoader, boolean checkParentForBundle)
applicationId
- The application id.classLoader
- The environment classLoader.checkParentForBundle
- indicates if parent bundles must be used during properties mergepublic void loadInParentBundles(java.lang.String applicationId, java.lang.ClassLoader classLoader)
applicationId
- The application id.classLoader
- The environment classLoader.public boolean repostGuiEvents()
public void raiseError(java.lang.String message)
message
- error messagepublic void execGui(java.lang.Runnable runnable)
#execGui(runnable, false)
method of the given
runnable to be invoked by the user-interface thread asynchronously. The caller of this method
continues to run in parallel, and is not notified when the runnable has completed.
runnable
- Code to run on the user-interface thread.public void execGui(java.lang.Runnable runnable, boolean synchronous)
execGui(runnable, synchronous)
method.
Else, calls the given runnable Runnable.run()
method to be invoked by the
user-interface thread either synchronously or asynchronously. If asynchronous, the caller of
this method continues to run in parallel, and is not notified when the runnable has
completed. Otherwise, the thread which calls this method is suspended until the runnable
completes.
runnable
- Code to run on the user-interface thread.synchronous
- True is synchronous, false if asynchronous.public java.util.Properties getPropertiesFromContext(java.lang.String prefix)
prefix
- Prefix used for properties files name.
public void setMobile(boolean isMobile)
|
(c) January 2013 - W4 S.A. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |