public class PhantomRuntime extends Object implements NetPhantomConstants, IReloadable
There are a number of access functions to get the host file ".PHE", the application file ".PHA".
All the other files that are incorporated into the runtime file can also be accessed.
| Modifier and Type | Class and Description |
|---|---|
static class |
PhantomRuntime.FileErrors
A class containing file errors (files not found and their references).
|
static class |
PhantomRuntime.FilePositionAndLength
The class that holds the file table information.
|
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
doReplaceProgramText
How files (text and translation tables are loaded), with or without program name conversion.
|
protected PhantomFile |
file
The runtime file instance.
|
static int |
FILE_INI
The INI file type.
|
static int |
FILE_JAR
The JAR file type.
|
static int |
FILE_OTHER
File type for all other files, e.g.
|
static int |
FILE_PHA
The application file type.
|
static int |
FILE_PHE
The host file type.
|
static int |
FILE_PHR
The runtime file type (NPR/PHR).
|
static int |
FILE_PHW
The panel file type.
|
static int |
FILE_SIZEMASK
The mask to get the real size of the file.
|
static int |
FILE_UNDEFINED
The undefined file type.
|
String |
fileName
The name of the runtime file.
|
ACTION_CLOSEWINDOW, ACTION_CONTROL, ACTION_HOSTKEY, ACTION_MENU, ACTION_NONE, ACTION_NOTEBOOKPAGE, ACTION_POPUPMENU, CC_BACKGROUND, CC_BOTH, CC_FOREGROUND, CC_NONE, CLIPBOARD_GET, CLIPBOARD_SET, DATEF_DMY, DATEF_MDY, DATEF_SYSTEM, DATEF_YMD, DDE_ADVISE, DDE_EXECUTE, DDE_INITIATE, DDE_POKE, DDE_REQUEST, DDE_TERMINATE, DDE_UNADVISE, DDE_UPDATE, DDEVAR_DISABLE, DDEVAR_ENABLE, DDEVAR_REQUEST, DDEVAR_SET, DDEVAR_VALIDATE, EFT_AMOUNT, EFT_DATE, EFT_DATEAMOUNT, EFT_NORMAL, EFT_PASSWORD, EVENT_CHAR, EVENT_CHECK, EVENT_CLICK, EVENT_COMMAND, EVENT_DBLCLICK, EVENT_DDECONNECTION, EVENT_DDEDATA, EVENT_DDEERROR, EVENT_DDEEXECUTE, EVENT_DDEINVALIDATE, EVENT_DDEPOKE, EVENT_DDEREQUEST, EVENT_DEFOCUS, EVENT_FOCUS, EVENT_PAGEDOWN, EVENT_PAGEUP, EVENT_SELECT, EVENT_UNKNOWN, EVENT_USERCHANGE, EXTENDEDINFO_IDS_TO_CLIENT, fillerByte, FOCUSTYPE_CLIENTTARGET, FOCUSTYPE_CONTROL, FOCUSTYPE_NONE, ICON_CRITICAL, ICON_INFORMATION, ICON_NOICON, ICON_QUERY, ICON_WARNING, J_AUTO, J_BOTTOM, J_BOTTOMLEFT, J_BOTTOMRIGHT, J_CENTER, J_LEFT, J_RIGHT, J_TOP, J_TOPLEFT, J_TOPRIGHT, MAX_PANELS_PER_SESSION, MAX_SESSIONS, MB_ABORTRETRYIGNORE, MB_CANCEL, MB_ENTER, MB_ENTERCANCEL, MB_OK, MB_OKCANCEL, MB_RETRYCANCEL, MB_YESNO, MB_YESNOCANCEL, MBID_CANCEL, MBID_DEFAULT, MBID_ENTER, MBID_IGNORE, MBID_NO, MBID_OK, MBID_RETRY, MBID_YES, MS_MOVE, MS_NONE, MS_SIZE, NETPHANTOM_VERSION, OBJEVENT_CHECK, OBJEVENT_CLICK, OBJEVENT_DBLCLICK, OBJEVENT_DEFOCUS, OBJEVENT_FOCUS, OBJEVENT_SELECT, OBJEVENT_USERCHANGE, PANELCREATE_APPPANEL, PANELCREATE_DANGLINGPANEL, PANELCREATE_DLGFRAME, PANELCREATE_EXTENDEDINFO, PANELCREATE_ICON, PANELCREATE_INDIVIDUALSIZE, PANELCREATE_POPUP, REPLYTYPE_CLIENTEXECUTE, REPLYTYPE_CLIPBOARD, REPLYTYPE_DDE, REPLYTYPE_FFONTLIST, REPLYTYPE_MESSAGEBOX, REPLYTYPE_REPORT, REPLYTYPE_SAVEPROPS, REPLYTYPE_TERMMARK, RPRT_CANCELPRINTJOB, RPRT_CLOSEPRINTJOB, RPRT_CONTPRINTJOB, RPRT_OPENPRINTJOB, RPRT_PRINTJOBCANCLD, RPRT_PRINTJOBCLOSED, RPRT_PRINTJOBCONT, RPRT_PRINTJOBOPENED, RPRT_PRINTJOBSTARTED, RPRT_STARTPRINTJOB, SEGMENT_SIZE, SELMODE_NORMAL, SELMODE_NOTALLOWED, SELMODE_REQUIRED, SELTYPE_MULTIPLE, SELTYPE_SINGLE, SEPARATOR, SEPARATORCHAR, TRANS_APPLICATIONCHANGE, TRANS_CALLOBJECT, TRANS_CANCELEXIT, TRANS_CLEARLOCK, TRANS_CLIENTEXECUTE, TRANS_CLIENTJARS, TRANS_CLIENTTEXTTABLE, TRANS_CLIENTUPDATED, TRANS_CLIENTUPDATEDNOLOCK, TRANS_CLIPBOARD, TRANS_CLIPBOARDCOMPONENT, TRANS_CLOSETERMINALWINDOW, TRANS_CONNECTIONREFUSED, TRANS_COUNTRYINFO, TRANS_CREATEPANEL, TRANS_CREATESESSION, TRANS_DDE, TRANS_DDEEVENT, TRANS_DDEEVENTREPLY, TRANS_DDEVAREVENT, TRANS_DISPLAYHELP, TRANS_DISPLAYTERMINAL, TRANS_DISPLAYTOOLTIPS, TRANS_ENDCONVERSATION, TRANS_EXIT, TRANS_FONTSUBSTITUTION, TRANS_HOSTCOLORTABLE, TRANS_HOSTPRINT, TRANS_INACTIVESESSION, TRANS_INITIATE, TRANS_KEEPALIVE, TRANS_LOCALE, TRANS_LOGEVENT, TRANS_MESSAGEBOX, TRANS_MESSAGEBOXWITHREPLY, TRANS_MODALREPLY, TRANS_MULTTERM, TRANS_PING, TRANS_PRINTCOMPONENT, TRANS_PRINTPANEL, TRANS_PRINTREPORT, TRANS_PRTWINKEY, TRANS_RECONNECT, TRANS_REDIRECTION, TRANS_REMOVEPANELATLEVEL, TRANS_REMOVETERMINAL, TRANS_RENEGOTIATESSL, TRANS_REQUESTHELP, TRANS_RESOURCEURL, TRANS_SELECTSESSION, TRANS_SESSIONACTIVE, TRANS_SESSIONSELECTED, TRANS_SETCOLORS, TRANS_SETFOCUS, TRANS_SETLOCK, TRANS_SETPANELNESTLEVEL, TRANS_SETUPPARAMS, TRANS_SHOWDOCUMENT, TRANS_SOCKET, TRANS_SOUNDALARM, TRANS_STARTUPINFO, TRANS_STOPSESSION, TRANS_TERMINALDATA, TRANS_TERMINALUPDATE, TRANS_TERMINALWINDOW, TRANS_TERMWINTEXT, TRANS_UPDATEAPPLICATION, TRANS_UPDATEPANEL, TRANS_USEREXITPRTKEY, TRANSACTION_VERSION, TS_CLOSE, TS_DATA, TS_ERROR, TS_OPEN, VSIGN_MINUS, VSIGN_NONE, VSIGN_PLUSMINUS, YEARF_6DIG, YEARF_8DIG, YEARF_EXP8FAILURE, NOTHING_DONE, SUCCESS| Constructor and Description |
|---|
PhantomRuntime()
For conversion purpose and should otherwise not be used!
|
PhantomRuntime(String fileName)
Opens the specified runtime file.
|
PhantomRuntime(String fileName,
boolean doLoadObjects) |
PhantomRuntime(String fileName,
boolean doLoadObjects,
boolean doValidateUser)
Opens the specified runtime file with option for user authentication.
|
PhantomRuntime(String fileName,
boolean doLoadObjects,
boolean doValidateUser,
LoadProgress nrx,
boolean ignore)
Opens the specified runtime file with option for user authentication.
|
PhantomRuntime(String fileName,
boolean doLoadObjects,
boolean doValidateUser,
LoadProgress nrx,
boolean ignore,
boolean doReplaceProgramText)
Opens the specified runtime file with option for user authentication.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addFileError(String fileNameNotFound,
String reference)
Adds a file error.
|
void |
createClassLoader()
(Re-)create class loader.
|
boolean |
doIgnoreNonFatalErrors()
Checks if non-fatal errors are not thrown as IOException's
but rather logged for later processing.
|
boolean |
doValidateUser()
Checks if a user needs authentication for this application.
|
String |
getApplicationBaseName()
Gets the application base name, i.e.
|
PhantomApplicationData |
getApplicationData()
Gets the application data for the runtime file.
|
String |
getApplicationDirectory()
Gets the application directory path without the application name.
|
String |
getBinaryDirectory()
Gets the binary directory for e.g.
|
ClassLoader |
getClassLoader()
Gets the class loader for this application.
|
String[] |
getClienExternalFileEntries()
Gets the array of external file entries that are used for client jars.
|
String[] |
getClientJarEntries()
Gets the array of JarEntry's that are used for client jars.
|
String |
getComboboxFileName(String fileName)
Gets the file name used for combobox files.
|
String |
getComboboxFileName2(String fileName)
Gets the file name used for combobox files relative the runtime file
(or the PHA file when not inside a PHR).
|
PhantomFile |
getCurrentFile()
Gets the current runtime file.
|
int |
getErrorCount()
Gets the error count at load when non-fatal errors are set to be ignored.
|
String |
getExistingHelpDocumentForID(String id)
Gets an existing help document for a help ID.
|
PhantomFile |
getFile(String fileName,
boolean externalAllowedIfNPR)
Gets a file from the runtime file.
|
List<PhantomRuntime.FileErrors> |
getFileErrors()
Gets the file errors table list.
|
HashMap<String,PhantomRuntime.FilePositionAndLength> |
getFileTable()
Get's file table of files for this runtime
|
String |
getHelpDocument(String controlID,
String panelID)
Map a help ID entry to a HTML help document when an application
uses the help ID file.
|
Hashtable<String,String> |
getHelpIDTable()
Gets the Help ID table for the application.
|
PhantomHostData |
getHostData()
Gets the host data for the runtime file.
|
IniFile |
getIniFile()
Gets the INI file associated with the runtime file.
|
JarFile |
getJarFile()
Gets the JAR file associated with the runtime file, null for none.
|
PhantomFile |
getPhantomFileFromJar(String fn)
Gets a PhantomFile from inside the JAR file.
|
LoadProgress |
getProgressListener()
Get the progress listener.
|
NetRexxConversion |
getREXXCompiler()
Gets the REXX compiler associated with the runtime file.
|
Hashtable<String,String> |
getTextfileTable()
Get's table of text files
|
String |
getTextID(String id)
Gets a text ID from the text file.
|
Hashtable<String,String> |
getTooltipTextTable()
Gets the tooltip text table.
|
Hashtable<String,String> |
getTranslationTable()
Get's table of translation files
|
boolean |
hasClientExternalFiles()
Checks if this runtime has client external files.
|
boolean |
hasFileErrors()
Checks for file errors.
|
boolean |
hasRuntimeFileChanged()
Checks if the runtime file has changed and therefore needs a new copy (new reference)
for the Server.
|
boolean |
isEnabled()
Checks if the runtime application is enabled.
|
boolean |
isExternalComboboxFilesAllowed()
Flag indicating external combobox files are allowed.
|
boolean |
isLoadedFromINI()
Checks if this application is loaded using an INI file using without use of PHR/NPR/JAR files.
|
boolean |
isLoadedFromJAR()
Checks if this application is loaded from a self-contained JAR file.
|
static boolean |
isSeeminglyValid(String fileName)
Checks if a runtime file seems to be valid, it is either a JAR, INI or a valid
(readable [i.e.
|
Class<?> |
loadClass(String name)
Loads a class using the runtime application class loader.
|
void |
loadHelpIDFile(String fn)
Loads the help ID file (.PHH) for the runtime application.
|
static void |
loadTextFile(JarFile jarFile,
String fileName,
Hashtable<String,String> t,
boolean isTextFile,
PhantomFile file)
Loads a text file into a hash table.
|
static void |
loadTextFile(JarFile jarFile,
String fileName,
Hashtable<String,String> t,
boolean isTextFile,
PhantomFile file,
CodepageConverter converter)
Loads a text file into a hash table.
|
static void |
loadTextFile(JarFile jarFile,
String fileName,
Hashtable<String,String> t,
boolean isTextFile,
PhantomFile file,
CodepageConverter converter,
boolean doConvertProgramText)
Loads a text file into a hash table.
|
static void |
loadTextFile(String fileName,
Hashtable<String,String> t,
boolean isTextFile,
PhantomFile file)
Loads a text file into a hash table.
|
static void |
loadTextFile(String fileName,
Hashtable<String,String> t,
boolean isTextFile,
PhantomFile file,
CodepageConverter converter)
Loads a text file into a hash table.
|
Hashtable<String,String> |
loadTooltipTextFile(String fn)
Load a tool tip text file in ISO-8859-1 code page.
|
void |
maybeThrowIOException(String msg)
Throws an IOException with the message specified if the runtime file is loaded
normally and doesn't have the flag doIgnoreNonFatalErrors set.
|
boolean |
needsReload()
Check if this file needs to be reloaded.
|
boolean |
postponeJava()
Gets the java compilation flag.
|
int |
reload(boolean force)
Reload internal state from external sources.
|
int |
reload(boolean force,
boolean overrideLoadObjects)
Reload internal state from external sources.
|
void |
resetErrorCount()
Resets the error count to zero.
|
void |
setComboboxFileName(String fileName)
Sets the relative filename in which directory combobox files are loaded from.
|
void |
setDoIgnoreNonFatalErrors(boolean ignore)
Sets a flag so that non-fatal errors are not thrown as IOException's
but rather logged for later processing.
|
void |
setEnabled(boolean enabledFlag)
Sets the enabled state of a runtime.
|
void |
setExternalComboboxFilesAllowed(boolean on)
Sets whether or not external combobox files (outside the JAR) is allowed or not.
|
void |
setPostponeJava(boolean postpone)
Sets the java compilation flag.
|
void |
setProgressListener(LoadProgress nrx)
The NetRexx conversion progress listener.
|
void |
setTextFile(Hashtable<String,String> t)
Sets the text file for the runtime.
|
void |
setTooltipTextTable(Hashtable<String,String> t)
Sets the tooltip text table.
|
void |
setTranslationTable(Hashtable<String,String> t)
Sets the translation table for the runtime.
|
String |
translateText(String text)
Translates a text using the translation table.
|
public static final int FILE_PHE
public static final int FILE_PHA
public static final int FILE_PHW
public static final int FILE_OTHER
public static final int FILE_PHR
public static final int FILE_INI
public static final int FILE_JAR
public static final int FILE_UNDEFINED
public static final int FILE_SIZEMASK
public final String fileName
protected PhantomFile file
protected boolean doReplaceProgramText
public PhantomRuntime(String fileName) throws IOException
Checks version, if it's backwards compatible, i.e. not compressed and that it is completely compiled.
All the file names compiled into the runtime file, their sizes and position within the runtime file are then loaded.
Base: - Version of the file: "PhantomRunTm02". [ 15 ]
- State of file (0=not ready, 1=OK). [ 1 ]
- Count of files ( = X). [ 2 ]
- Reserved space 64 bytes. [ 64 ]
[= 82 ]
.
Then, the following is read (note: it's non-compressed):
.
Compressed:
X ! - File offset (ULONG)
times! - File length (ULONG)
then:
X ! - File name length
times! - File name with null-term.
.
Non-compressed:
! - File name length (USHORT)
X ! - File name with null-term.
times! - File offset (ULONG)
! - File length (ULONG)
IOException - if an I/O error occurs.public PhantomRuntime(String fileName, boolean doLoadObjects) throws IOException
IOExceptionpublic PhantomRuntime()
public PhantomRuntime(String fileName, boolean doLoadObjects, boolean doValidateUser) throws IOException
IOExceptionpublic PhantomRuntime(String fileName, boolean doLoadObjects, boolean doValidateUser, LoadProgress nrx, boolean ignore) throws IOException
IOExceptionpublic PhantomRuntime(String fileName, boolean doLoadObjects, boolean doValidateUser, LoadProgress nrx, boolean ignore, boolean doReplaceProgramText) throws IOException
IOExceptionpublic String getComboboxFileName(String fileName)
public String getComboboxFileName2(String fileName)
public void setComboboxFileName(String fileName) throws FileNotFoundException
FileNotFoundExceptionpublic JarFile getJarFile()
public LoadProgress getProgressListener()
public PhantomFile getPhantomFileFromJar(String fn) throws IOException
IOException - for file errors.public String[] getClientJarEntries()
public String[] getClienExternalFileEntries()
public boolean hasClientExternalFiles()
public void setProgressListener(LoadProgress nrx)
public void createClassLoader()
throws IOException,
MalformedURLException
IOExceptionMalformedURLExceptionpublic Hashtable<String,String> loadTooltipTextFile(String fn) throws IOException
IOException - for file errors.public boolean isLoadedFromINI()
public boolean isLoadedFromJAR()
public static boolean isSeeminglyValid(String fileName)
public Class<?> loadClass(String name) throws ClassNotFoundException
ClassNotFoundException - if class cannot be found or loaded.public ClassLoader getClassLoader()
public IniFile getIniFile()
public NetRexxConversion getREXXCompiler()
public boolean doValidateUser()
public boolean isEnabled()
public void setEnabled(boolean enabledFlag)
public void setPostponeJava(boolean postpone)
public boolean postponeJava()
public PhantomFile getFile(String fileName, boolean externalAllowedIfNPR) throws IOException
IOException - if an I/O error occurs.public final String getApplicationBaseName()
public final String getApplicationDirectory()
public PhantomApplicationData getApplicationData()
public PhantomHostData getHostData()
public void setTranslationTable(Hashtable<String,String> t)
public String getTextID(String id)
public String translateText(String text)
public static void loadTextFile(String fileName, Hashtable<String,String> t, boolean isTextFile, PhantomFile file) throws IOException
IOException - if an I/O error occurs.public static void loadTextFile(JarFile jarFile, String fileName, Hashtable<String,String> t, boolean isTextFile, PhantomFile file) throws IOException
IOException - if an I/O error occurs.public static void loadTextFile(String fileName, Hashtable<String,String> t, boolean isTextFile, PhantomFile file, CodepageConverter converter) throws IOException
The parameter file may be set to null, in which case the filename
must exist in relation to the current directory.
IOException - if an I/O error occurs.public static void loadTextFile(JarFile jarFile, String fileName, Hashtable<String,String> t, boolean isTextFile, PhantomFile file, CodepageConverter converter) throws IOException
The file will first be opened in the case specified, and if it fails, the upper case file name is tried.
The parameter file may be set to null, in which case the filename
must exist in relation to the current directory.
IOException - if an I/O error occurs.public static void loadTextFile(JarFile jarFile, String fileName, Hashtable<String,String> t, boolean isTextFile, PhantomFile file, CodepageConverter converter, boolean doConvertProgramText) throws IOException
The file will first be opened in the case specified, and if it fails, the upper case file name is tried.
The parameter file may be set to null, in which case the filename
must exist in relation to the current directory.
The parameter doConvertProgramText is set to true if text conversion
should be done as @**PROGSHORT@, @**PROGSERVER@, @**PROGCLIENT@ and @**PROGEDITOR@ with
the corresponding text "NetPhantom", "NetPhantom Server", "NetPhantom Client" and "NetPhantom Editor"
when running NetPhantom and for fxtool with "fxtool", "fxtool server", "fxtool client" and
"fxtool editor".
IOException - if an I/O error occurs.public void loadHelpIDFile(String fn) throws IOException
IOException - if an I/O error occurs.public String getHelpDocument(String controlID, String panelID)
The help ID that is searched is:
- PANELID_CONTROLID (may be PANELID_MENUnn for main menus, if panelID!=null). - __CONTROLID (when a control ID exist, if panelID!=null) - PANELID (if panelID!=null) - APPLICATION_HELP (if panelID!=null)
The help document has the name: "applicationName\HELP_ID.html". For .PHH files, the HELP_ID is the item specified in the file (and after the equal sign if specified).
controlID - the Control ID or specific help ID.panelID - set to null for specific IDs (e.g. APPLICATION_HELPKEY).public Hashtable<String,String> getHelpIDTable()
public Hashtable<String,String> getTooltipTextTable()
public void setTooltipTextTable(Hashtable<String,String> t)
public String getExistingHelpDocumentForID(String id)
This method will return null if the help ID file (if used) doesn't have the entry specified.
public Hashtable<String,String> getTranslationTable()
public Hashtable<String,String> getTextfileTable()
public HashMap<String,PhantomRuntime.FilePositionAndLength> getFileTable()
public int reload(boolean force,
boolean overrideLoadObjects)
throws IOException
force - - force the reload.overrideLoadObjects - - override the load object state.IOExceptionpublic int reload(boolean force)
throws IOException
reload in interface IReloadableforce - - force the reload.IOExceptionpublic boolean needsReload()
throws IOException
needsReload in interface IReloadableIOExceptionpublic boolean doIgnoreNonFatalErrors()
public void setDoIgnoreNonFatalErrors(boolean ignore)
public void maybeThrowIOException(String msg) throws IOException
IOExceptionpublic int getErrorCount()
public void resetErrorCount()
public String getBinaryDirectory()
The directory (and possibly drive specification) ends with "/" file name separator character (could be "\" for a Windows NT system, i.e. it's system dependent).
public void setExternalComboboxFilesAllowed(boolean on)
public boolean isExternalComboboxFilesAllowed()
public boolean hasFileErrors()
public List<PhantomRuntime.FileErrors> getFileErrors()
public boolean hasRuntimeFileChanged()
public PhantomFile getCurrentFile()
Phantom® and NetPhantom® are registered trademarks of Nexum Technologies SARL.
© Copyright Nexum Technologies SARL, 2011. All rights reserved.