|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectewex.registry.Registry
This allows access to keys in the local system registry. It will be extended soon to cover accessing keys in a mobile pc registry.
| Field Summary | |
static int |
ASSOCIATE_EWE_APPLICATION
An option for associateFile(). |
static int |
ASSOCIATE_ICON_IS_RESOURCE
An option for associateFile(). |
static int |
FOLDER_BITBUCKET
|
static int |
FOLDER_CONTROLS
|
static int |
FOLDER_DESKTOP
|
static int |
FOLDER_DESKTOPDIRECTORY
|
static int |
FOLDER_DRIVES
|
static int |
FOLDER_FAVORITES
|
static int |
FOLDER_FONTS
|
static int |
FOLDER_NETHOOD
|
static int |
FOLDER_NETWORK
|
static int |
FOLDER_PERSONAL
|
static int |
FOLDER_PRINTERS
|
static int |
FOLDER_PROGRAMS
|
static int |
FOLDER_RECENT
|
static int |
FOLDER_SENDTO
|
static int |
FOLDER_STARTMENU
|
static int |
FOLDER_STARTUP
|
static int |
FOLDER_TEMPLATES
|
static int |
FOLDER_WINDOWS
|
static int |
HKEY_CLASSES_ROOT
|
static int |
HKEY_CURRENT_CONFIG
|
static int |
HKEY_CURRENT_USER
|
static int |
HKEY_DYN_DATA
|
static int |
HKEY_LOCAL_MACHINE
|
static int |
HKEY_USERS
|
static int |
NOT_INITIALIZED_ERROR
|
static int |
PLATFORM_WIN32_NT
|
static int |
PLATFORM_WIN32_WINDOWS
|
static int |
PLATFORM_WIN32s
|
static String[] |
roots
|
static double |
testValue
|
| Constructor Summary | |
Registry()
|
|
| Method Summary | |
static void |
associateFile(String extension,
String shortFileDescription,
String fileDescription,
String commandLine,
String icon,
int options)
This associates files with a certain extension to a particular application. |
static void |
associateFileWithMe(String extension,
String shortFileDescription,
String fileDescription,
String icon)
This associates files with a certain extension to the running Ewe application. |
static void |
associateFileWithMe(String extension,
String shortFileDescription,
String fileDescription,
String arguments,
String icon,
int options)
This associates files with a certain extension to the running Ewe application. |
static boolean |
createShortcut(String target,
String arguments,
String shortcutPath)
|
static String |
getEweCommandLine(String myEweFile,
String extraArguments,
String vmArguments,
boolean includePathToVM)
Create an absolute command line to execute the Ewe VM on my Ewe file. |
static String |
getEweCommandLineToMe(String extraArguments,
String vmArguments,
boolean includePathToVM)
Create an absolute command line to execute the Ewe VM on my Ewe file. |
static RegistryKey |
getLocalKey(int root,
String path,
boolean fullAccess,
boolean createIfDoesntExist)
Get a key in the local registry. |
static int |
getPlatform()
|
static RegistryKey |
getRemoteKey(int root,
String path,
boolean fullAccess,
boolean createIfDoesntExist)
Gets a remote key. |
static String |
getSpecialFolder(int folder)
|
static boolean |
isInitialized(boolean forRemote)
|
static boolean |
isNativeInitialized()
Returns true if a TRUE native registry is available. |
protected static boolean |
loadLibrary(String libraryName)
|
static int |
toRootAndPath(String path,
StringBuffer pathWithoutRoot)
This converts a path that starts with a string representation of one of the roots to an int value which is one of the HKEY_ values. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, toString |
| Field Detail |
public static double testValue
public static final int HKEY_CLASSES_ROOT
public static final int HKEY_CURRENT_USER
public static final int HKEY_LOCAL_MACHINE
public static final int HKEY_USERS
public static final int HKEY_CURRENT_CONFIG
public static final int HKEY_DYN_DATA
public static String[] roots
public static final int PLATFORM_WIN32s
public static final int PLATFORM_WIN32_WINDOWS
public static final int PLATFORM_WIN32_NT
public static final int NOT_INITIALIZED_ERROR
public static final int FOLDER_WINDOWS
public static final int FOLDER_DESKTOP
public static final int FOLDER_PROGRAMS
public static final int FOLDER_CONTROLS
public static final int FOLDER_PRINTERS
public static final int FOLDER_PERSONAL
public static final int FOLDER_FAVORITES
public static final int FOLDER_STARTUP
public static final int FOLDER_RECENT
public static final int FOLDER_SENDTO
public static final int FOLDER_BITBUCKET
public static final int FOLDER_STARTMENU
public static final int FOLDER_DESKTOPDIRECTORY
public static final int FOLDER_DRIVES
public static final int FOLDER_NETWORK
public static final int FOLDER_NETHOOD
public static final int FOLDER_FONTS
public static final int FOLDER_TEMPLATES
public static final int ASSOCIATE_EWE_APPLICATION
public static final int ASSOCIATE_ICON_IS_RESOURCE
| Constructor Detail |
public Registry()
| Method Detail |
protected static boolean loadLibrary(String libraryName)
public static int toRootAndPath(String path,
StringBuffer pathWithoutRoot)
public static RegistryKey getLocalKey(int root,
String path,
boolean fullAccess,
boolean createIfDoesntExist)
Note that the path MUST be separated by '\' characters and NOT '/' characters.
If a root of 0 is used, it will be assumed that the path will start with "HKEY_CLASSES_ROOT\..."
or one of the other text representation of the roots. These roots are:
"HKEY_CLASSES_ROOT","HKEY_CURRENT_USER","HKEY_LOCAL_MACHINE","HKEY_USERS","HKEY_CURRENT_CONFIG","HKEY_DYN_DATA"
public static RegistryKey getRemoteKey(int root,
String path,
boolean fullAccess,
boolean createIfDoesntExist)
If the path or root specified is invalid for any reason, it will return null. If the ewex_registry.dll could not be loaded, it will return null.
Note that the path MUST be separated by '\' characters and NOT '/' characters.
If a root of 0 is used, it will be assumed that the path will start with "HKEY_CLASSES_ROOT\..."
or one of the other text representation of the roots. These roots are:
"HKEY_CLASSES_ROOT","HKEY_CURRENT_USER","HKEY_LOCAL_MACHINE","HKEY_USERS","HKEY_CURRENT_CONFIG","HKEY_DYN_DATA"
public static boolean isInitialized(boolean forRemote)
public static boolean isNativeInitialized()
public static int getPlatform()
public static String getSpecialFolder(int folder)
public static boolean createShortcut(String target,
String arguments,
String shortcutPath)
public static void associateFile(String extension,
String shortFileDescription,
String fileDescription,
String commandLine,
String icon,
int options)
throws IOException
extension - This is the file extension (e.g. ".pnf")shortFileDescription - This is a mandatory short file description (e.g. "JewelFile");fileDescription - This is an optional long file description (e.g. "Jewel Program Specs")commandLine - This is the command line to execute - it will usually include "%1" (including the quotes)
within it to indicate where the file name gets inserted into the command line passed to the application. If you want to execute a .ewe file,
then set the command line to point to the .ewe file (in quotes) and then set options to
be ASSOCIATE_EWE_APPLICATION.icon - The file name of an optional icon to associate with files of this extension.options - Can be any of the following values ORed together: IOException - If an error occurs saving the registry information.
public static void associateFileWithMe(String extension,
String shortFileDescription,
String fileDescription,
String arguments,
String icon,
int options)
throws IOException
extension - This is the file extension (e.g. ".pnf")shortFileDescription - This is a mandatory short file description (e.g. "JewelFile");fileDescription - This is an optional long file description (e.g. "Jewel Program Specs")arguments - These are the arguments to pass to the application - it will usually include "%1" (including the quotes)
within it to indicate where the file name gets inserted into the command line passed to the application.icon - The file name of an optional icon to associate with files of this extension.options - Can be any of the following values ORed together: IOException - If an error occurs saving the registry information.
public static void associateFileWithMe(String extension,
String shortFileDescription,
String fileDescription,
String icon)
throws IOException
extension - This is the file extension (e.g. ".pnf")shortFileDescription - This is a mandatory short file description (e.g. "JewelFile");fileDescription - This is an optional long file description (e.g. "Jewel Program Specs")icon - The file name of an optional icon to associate with files of this extension.
IOException - If an error occurs saving the registry information.
public static String getEweCommandLine(String myEweFile,
String extraArguments,
String vmArguments,
boolean includePathToVM)
throws IOException
myEweFile - the name (without a path specification) of the Ewe file this application
is packaged in. If it is null the VM will attempt to lookup the name of the currently running
.ewe file.extraArguments - Additional application arguments - can be null.vmArguments - Additional VM arguments - can be null.includePathToVM - Set this true to include the path to the Ewe VM.
IOException - if there is a problem with any of the data.
public static String getEweCommandLineToMe(String extraArguments,
String vmArguments,
boolean includePathToVM)
throws IOException
extraArguments - Additional application arguments - can be null.vmArguments - Additional VM arguments - can be null.includePathToVM - Set this true to include the path to the Ewe VM.
IOException - if there is a problem with any of the data.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||