public class PhantomRuntime extends Object implements NetPhantomConstants, Cloneable
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).
|
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_UNDEFINED
The undefined file type.
|
String |
fileName
The name of the runtime file.
|
File |
inputFile
The input runtime file, either the "NetPhantom.project", the ".ini", the ".jar" or the ".NPR" 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, 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_COPYRIGHT, NETPHANTOM_COPYRIGHT2, 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, 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_HWND, 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_EXP8
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,
boolean ignore,
boolean doReplaceProgramText,
IBackgroundLoader backgroundLoader)
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 |
cleanOutputFolder()
Cleans the application output folder from ALL files, recursively.
|
PhantomRuntime |
clone()
Creates an instance of the runtime that is used for parallel run at launch time of a client.
|
void |
compileDistribution_setIniFile(IniFile ini)
Sets the INI file for the runtime, only when compiling a distribution.
|
void |
createClassLoader()
(Re-)create class loader.
|
static PhantomRuntime |
createRuntime(File projectDirectory)
Creates a new PhantomRuntime for Compile Distribution.
|
static PhantomRuntime |
createRuntime(File projectDirectory,
PhantomRuntime source)
Creates a new PhantomRuntime for Compile Distribution.
|
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.
|
File |
getApplicationDirectoryFile()
Gets the application directory File without the application name.
|
AutoClientJar |
getAutoClientJar()
Gets the auto-client Jar file instance.
|
IBackgroundLoader |
getBackgroundLoader()
Gets the background loader of the runtime.
|
String |
getBinaryDirectory()
Gets the binary directory for e.g.
|
File |
getBinaryDirectoryFile()
Gets the binary directory File 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.
|
CodepageConverter |
getCodepageConverter()
Gets the code page mapper for this runtime.
|
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.
|
String |
getEncoding()
Gets the default codepage encoding, never null.
|
LinkedHashMap<String,ArrayList<FileError>> |
getErrorsMap()
For the Editor, checks for a change in the error list of this instance.
|
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.
|
PhantomFile |
getFile(String fileName,
boolean externalAllowedIfNPR,
boolean doThrowIfNotFound)
Gets a file from the runtime file.
|
List<PhantomRuntime.FileErrors> |
getFileErrors()
Gets the file errors table list.
|
HashMap<String,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.
|
ImageReferencesValidator |
getImageReferencesValidator()
Creates or gets the instance of the Image Reference Validator.
|
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.
|
int |
getMonitorCount()
Gets the number of operations required for a load/reload, i.e.
|
PhantomFile |
getPhantomFileFromJar(String fn)
Gets a PhantomFile from inside the JAR file.
|
File |
getProjectDirectoryFile()
Gets the project directory File for INI-based projects (or NetPhantom 6+ development projects).
|
String |
getProjectName()
Gets the project name, i.e.
|
PhantomApplicationData |
getReloadedApplicationData(IProgressMonitor monitor,
IReloadListener listener,
boolean allFiles)
Reloads just the application data if required and returns the instance.
|
String |
getSourceDirectory()
Gets the source directory for e.g.
|
File |
getSourceDirectoryFile()
Gets the source directory File for e.g.
|
int |
getTargetServerVersion()
Gets the target Java version for the application.
|
Hashtable<String,String> |
getTextfileTable()
Gets table of text files
|
String |
getTextID(String id)
Get the text ID.
|
String |
getTooltipFileName()
Gets the tooltip file name.
|
Hashtable<String,String> |
getTooltipTextTable()
Gets the tooltip text table.
|
Hashtable<String,String> |
getTranslationTable()
Gets 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 |
isApplicationContainingJavaSources()
Checks if the application contains a Java source file.
|
boolean |
isBusyLoading()
Checks if the runtime is busy being loaded or reloaded in the background for the Editor.
|
boolean |
isEnabled()
Checks if the runtime application is enabled.
|
boolean |
isExternalComboboxFilesAllowed()
Flag indicating external combobox files are allowed.
|
boolean |
isLoadedForEditor()
Flag for project loaded for the Editor.
|
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.
|
boolean |
isVersion6()
Checks if this is a version 6 runtime file.
|
void |
listUnresolvedFileErrors()
Method that lists errors of unresolved files.
|
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.
|
void |
loadTextFile(JarFile jarFile,
String fileName,
Hashtable<String,String> t,
boolean isTextFile,
PhantomFile file)
Loads a text file into a hash table.
|
void |
loadTextFile(JarFile jarFile,
String fileName,
Hashtable<String,String> t,
boolean isTextFile,
PhantomFile file,
boolean doConvertProgramText)
Loads a text file into a hash table.
|
void |
loadTextFile(String fileName,
Hashtable<String,String> t,
boolean isTextFile,
PhantomFile file)
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(File file,
IOException exception)
Throws an IOException with the message specified if the runtime file is loaded
normally and doesn't have the flag doIgnoreNonFatalErrors set.
|
void |
maybeThrowIOException(MaybeIOException exception)
Throws an IOException with the message specified if the runtime file is loaded
normally and doesn't have the flag doIgnoreNonFatalErrors set.
|
boolean |
needsReload(boolean allFiles)
Check if this file needs to be reloaded.
|
int |
reload(IProgressMonitor monitor,
IReloadListener listener)
Reload internal state from external sources.
|
boolean |
reportPotentialErroredFiles()
Reports potential files that were errored, typically not found.
|
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 |
setEclipseWorkspace(String wsRoot)
Sets the Eclipse workspace.
|
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 |
setLoadedForEditor()
Flags the project as loaded for Editor.
|
void |
setTextFile(Hashtable<String,String> t)
Set 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)
Get the translated text.
|
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 final File inputFile
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
IOException
public PhantomRuntime()
public PhantomRuntime(String fileName, boolean doLoadObjects, boolean doValidateUser) throws IOException
IOException
public PhantomRuntime(String _fileName, boolean doLoadObjects, boolean doValidateUser, boolean ignore, boolean doReplaceProgramText, IBackgroundLoader backgroundLoader) throws IOException
IOException
public static PhantomRuntime createRuntime(File projectDirectory) throws IOException
IOException
public static PhantomRuntime createRuntime(File projectDirectory, PhantomRuntime source) throws IOException
IOException
public boolean isBusyLoading()
public boolean isLoadedForEditor()
public void setLoadedForEditor()
public String getComboboxFileName(String fileName)
public String getComboboxFileName2(String fileName)
public void setComboboxFileName(String fileName) throws FileNotFoundException
FileNotFoundException
- If the specified file name refers to a directory
that doesn't exist.public JarFile getJarFile()
public PhantomFile getPhantomFileFromJar(String fn) throws IOException
IOException
- for file errors.public String[] getClientJarEntries()
public String[] getClienExternalFileEntries()
public boolean hasClientExternalFiles()
public void listUnresolvedFileErrors()
public void createClassLoader() throws IOException, MalformedURLException
IOException
MalformedURLException
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 boolean doValidateUser()
public boolean isEnabled()
public void setEnabled(boolean enabledFlag)
public PhantomFile getFile(String fileName, boolean externalAllowedIfNPR) throws IOException
IOException
- if an I/O error occurs.public PhantomFile getFile(String fileName, boolean externalAllowedIfNPR, boolean doThrowIfNotFound) throws IOException
notFoundExceptionText
is non-null, a file not found
exception is thrown instead, when loaded from an INI file.IOException
- if an I/O error occurs.public final String getApplicationBaseName()
public final String getApplicationDirectory()
public final File getApplicationDirectoryFile()
public PhantomApplicationData getApplicationData()
public PhantomHostData getHostData()
public void loadTextFile(String fileName, Hashtable<String,String> t, boolean isTextFile, PhantomFile file) throws IOException
IOException
- if an I/O error occurs.public void loadTextFile(JarFile jarFile, String fileName, Hashtable<String,String> t, boolean isTextFile, PhantomFile file) throws IOException
IOException
- if an I/O error occurs.public void loadTextFile(JarFile jarFile, String fileName, Hashtable<String,String> t, boolean isTextFile, PhantomFile file, boolean doConvertProgramText) 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 HashMap<String,FilePositionAndLength> getFileTable()
public Hashtable<String,String> loadTooltipTextFile(String fn) throws IOException
IOException
- for file errors.public void loadHelpIDFile(String fn) throws IOException
IOException
- if an I/O error occurs.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 void setTranslationTable(Hashtable<String,String> t)
public Hashtable<String,String> getTextfileTable()
public String translateText(String text)
public int reload(IProgressMonitor monitor, IReloadListener listener) throws IOException
IOException
public PhantomApplicationData getReloadedApplicationData(IProgressMonitor monitor, IReloadListener listener, boolean allFiles) throws IOException
IOException
- For I/O errors.public boolean needsReload(boolean allFiles)
public boolean doIgnoreNonFatalErrors()
public void setDoIgnoreNonFatalErrors(boolean ignore)
public void maybeThrowIOException(MaybeIOException exception) throws IOException
IOException
public void maybeThrowIOException(File file, IOException exception) throws IOException
IOException
public boolean reportPotentialErroredFiles()
public final 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 final File getBinaryDirectoryFile()
public final String getSourceDirectory()
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 final File getSourceDirectoryFile()
public final File getProjectDirectoryFile()
public void setExternalComboboxFilesAllowed(boolean on)
public boolean isExternalComboboxFilesAllowed()
public boolean hasFileErrors()
public List<PhantomRuntime.FileErrors> getFileErrors()
public boolean hasRuntimeFileChanged()
public PhantomFile getCurrentFile()
public boolean isApplicationContainingJavaSources()
public void cleanOutputFolder()
public IBackgroundLoader getBackgroundLoader()
public String getProjectName()
public PhantomRuntime clone()
public void setEclipseWorkspace(String wsRoot)
public int getMonitorCount()
public String getEncoding()
public CodepageConverter getCodepageConverter()
public boolean isVersion6()
public LinkedHashMap<String,ArrayList<FileError>> getErrorsMap()
public ImageReferencesValidator getImageReferencesValidator()
public String getTooltipFileName()
public void compileDistribution_setIniFile(IniFile ini)
public int getTargetServerVersion()
public AutoClientJar getAutoClientJar()
Phantom® and NetPhantom® are registered trademarks of Mindus SARL.
© © Mindus SARL, 2024. All rights reserved.