public class PhantomApplicationData extends Object implements Cloneable, INPObjects, IENPObjectOwner
Modifier and Type | Class and Description |
---|---|
static class |
PhantomApplicationData.Directory
This class contains the connection between screens and panels.
|
Modifier and Type | Field and Description |
---|---|
static int |
APPFLAG_ESCNOTF12
Escape not mapped to F12.
|
static int |
APPFLAG_FIELDIDHELP
Host ID, no control ID (help).
|
static int |
APPFLAG_INDSIZE
Individual main panel size.
|
static int |
APPFLAG_INHIBITTRANSFORM
Inhibit transform (font substitution and ratioX/ratioY).
|
static int |
APPFLAG_MAXIMIZE
Maximize main panels.
|
static int |
APPFLAG_MERGEPOPMENU
Merge all pop-up menus.
|
static int |
APPFLAG_MSGDISALL
Both flags for disable system message boxes.
|
static int |
APPFLAG_MSGDISBASE
Disable msg box base.
|
static int |
APPFLAG_MSGDISMAIN
Disable msg box for main.
|
static int |
APPFLAG_MSGDISPOPUP
Disable msg box for popup.
|
static int |
APPFLAG_NEWGROUP
New drawing of group boxes and frames.
|
static int |
APPFLAG_NOMNEMONIC
No mnemonics Check/Radio.
|
static int |
APPFLAG_OUTPUTTEXTFOCUS
Enable focus to all output fields.
|
static int |
APPFLAG_PASSFKEYS
Pass through function keys to the host.
|
static int |
APPFLAG_PHH
Use help ID file.
|
static int |
APPFLAG_PROCESSLOCK
Process panels at lock.
|
static int |
APPFLAG_SYSMENU
Menu in system menu.
|
PhantomObject |
appObject
The application object reference.
|
static byte[] |
defaultColorConvBack |
static byte[] |
defaultColorConvFore |
protected boolean |
doReplaceProgramText
How files (text and translation tables are loaded), with or without program name conversion.
|
static PhantomPanelData[] |
EMPTY_PANELS
Empty panels array.
|
Hashtable<String,PhantomObject> |
objects
The table of Phantom Objects.
|
String |
phaFileName
The file name of the PHA file when not inside a runtime file, should otherwise
not be used.
|
String |
textFile
The application text file or null if none.
|
String |
xlateFile
The application translation file or null if none.
|
Constructor and Description |
---|
PhantomApplicationData()
Creates a default empty by initiated instance of the application data.
|
Modifier and Type | Method and Description |
---|---|
void |
addBarFile(String id,
PhantomCBar bar)
Adds a new bar file object.
|
boolean |
addHiddenPanel(PhantomApplicationData.Directory dir,
String descr,
boolean doReplace)
Adds a directory entry (hidden panel).
|
boolean |
addObject(PhantomObject po,
boolean doReplace)
Adds an object.
|
boolean |
addPanel(PhantomPanelData panel,
PhantomApplicationData.Directory dir,
boolean doReplace)
Adds a panel to the application.
|
void |
addPopupMenuControlID(String id,
PhantomPopupMenu popupMenu)
Adds a control ID reference to a pop-up menu (if the control ID is not
already in the table.
|
boolean |
areHostChangesProcessedDuringLock()
Checks if host changes are processed during session lock.
|
boolean |
areOutputFieldsFocusable()
Checks if the output fields are focusable.
|
boolean |
arePanelsMaximized()
Checks if main panels are maximized when created.
|
boolean |
arePFKeysPassedToHost()
Checks if the functions keys are passed to host.
|
void |
assignHelpIDTable(Hashtable<String,String> table)
Assigns a Help ID table to the application.
|
void |
copyApplicationData(PhantomApplicationData source)
Copy application data.
|
PhantomPanelData |
copyApplicationPanel(PhantomApplicationData source)
Copy application panel and settings.
|
void |
copyColorConversion(PhantomApplicationData source)
Copy color conversion tables.
|
void |
createDefaultColorConversionTables()
Creates the default color conversion tables.
|
boolean |
doApplicationChildrenInset()
Checks if the panels of a panel session are children of the application
panel.
|
boolean |
doMapEscapeToF12()
Checks if the application maps Escape key to F12 or not.
|
boolean |
doUseHelpIDTable()
Checks if the application uses a help ID file or not.
|
Hashtable<String,PhantomObject> |
getAllObjects()
Gets all the objects in the application.
|
Enumeration<PhantomPanelData> |
getAllPanels()
Gets all panels in the application.
|
PhantomPanelData |
getApplicationPanel()
Gets the loaded application panel.
|
ApplicationReferences |
getApplicationReferences()
Gets the Application References for the entire application.
|
PhantomCBar |
getBarFile(PhantomControl control,
String id)
Gets a bar file object.
|
PhantomCBar |
getBarFile(PhantomControl control,
String id,
boolean loadIfRequired)
Gets a bar file object.
|
Hashtable<String,PhantomCBar> |
getBarObjects()
Gets all the barObjects in the application.
|
PhantomCBar[] |
getBars()
Gets the Bar files.
|
ApplicationReferences |
getCachedApplicationReferences()
Gets a cached instance of the references.
|
ENPRootObject |
getCachedNPObject()
Gets the cached NPObject root.
|
String |
getCloseID()
Checks if the application uses a close ID for pop-up panels.
|
void |
getColorConversionTables(byte[] fore,
byte[] back)
Returns the foreground and background color conversion tables into the arrays specified.
|
static se.entra.phantom.geditor.NPPColorItemManager |
getColorItemManager()
Shortcut to get color item manager from property worker.
|
Hashtable<String,Vector<String>> |
getConnectionsForPopupMenu()
Gets hash table of connections for pop-up menus (key name of pop-up menu)
(value vector of connections(String))
|
se.entra.phantom.geditor.NPPColor |
getControlBackgroundColor(VirtualControl vCtl,
boolean isDisable,
boolean doDisableBackground,
se.entra.phantom.geditor.NPPColor originalBackground)
Set the control background color.
|
int[] |
getControlColor(int vioClr,
boolean isFore,
boolean isBack)
Gets the control colors from host VIO color and color conversion.
|
int[] |
getControlColor(VirtualControl vCtl,
int vioClr,
boolean isFore,
boolean isBack)
Gets the control colors from host VIO color and color conversion.
|
PhantomApplicationData.Directory[] |
getDirectories()
Gets the application directory array of panels and screens.
|
String |
getExistingHelpDocumentForID(String id)
Gets an existing help document for a help ID.
|
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.
|
String |
getHiddenPanelDescription(PhantomApplicationData.Directory dir)
Gets the description for a hidden panel.
|
String |
getIconFile()
Gets a iconFile
|
int |
getIconID()
Gets a iconID
|
ENPRootObject |
getNPObject()
Gets the NPObjects for the application data.
|
String |
getNPObjectName()
Gets the NP Object file name in the project application directory.
|
PhantomObject |
getObject(String name)
Gets an object from its name.
|
PhantomObject |
getObject(String objectName,
String referer,
String location)
Gets the object associated with the object name, may be null if
the object name is empty.
|
Iterator<PhantomObject> |
getObjectIterator()
Gets all objects as an Iterator that is always defined.
|
Enumeration<PhantomObject> |
getObjects()
Gets all the objects in the application.
|
Collection<PhantomObject> |
getObjectsCollection()
Gets all objects as a Collection that is always defined.
|
PhantomPanelData |
getPanel(String name)
Gets a loaded panel in the application.
|
PhantomApplicationData.Directory |
getPanelFromScreen(String name)
Gets a panel or hidden panel from a screen.
|
Hashtable<String,PhantomPanelData> |
getPanels()
Gets all panels in the application - returns a hash table
|
PhantomPanelData[] |
getPanelsArray()
Gets the panels array (thread-safe) in the application.
|
Hashtable<String,PhantomApplicationData.Directory> |
getPanelToScreens()
Gets panelToScreen hash table in the application.
|
PhantomObject |
getPhantomMacro(String macroName)
Finds an object that used to be a Phantom Macro, now converted to a REXX macro that
is executed in the appropriate thread with locking of the host session from interaction
with the panels.
|
int |
getPopupMenuCount()
Gets the count of pop-up menus in the application.
|
PhantomPopupMenu |
getPopupMenuForControlID(String id)
Gets a pop-up menu reference from a control ID.
|
Hashtable<String,PhantomPopupMenu> |
getPopupMenuIDs()
Gets all the popupMenuIDs in the application.
|
PhantomPopupMenu[] |
getPopupMenus()
Gets all the pop-up menus in the application.
|
static se.entra.phantom.geditor.PropertyWorker |
getPropertyWorker()
Get property worker reference.
|
void |
getReferencedFiles(ArrayList<String> files)
Get all the files that are referenced by this panel.
|
PhantomRuntime |
getRuntime()
Get the runtime data.
|
PhantomApplicationData.Directory |
getScreenFromPanel(String name)
Gets the screen that corresponds to a panel.
|
int |
getStdHeight()
Gets the application default panel height in dialog coordinates (multiplied
by 10).
|
int |
getStdWidth()
Gets the application default panel width in dialog coordinates (multiplied
by 10).
|
String |
getTextFile()
Gets the text file in the application - returns a String
|
String |
getTitle()
Gets the title of the application.
|
Hashtable<String,String> |
getTooltipTextTable()
Gets the tooltip text table.
|
String |
getTranslationFile()
Gets the translation file in the application - returns a String
|
int |
getWaitStableDelay()
Gets the wait-stable delay for host screens.
|
boolean |
hasApplicationPanel()
Application has application panel?
|
boolean |
hasBarFile(String barFile)
Checks if the bar file could potentially be loaded if not already.
|
boolean |
hasCloseID()
Checks if the application uses a close ID for pop-up panels.
|
boolean |
hasIndividualSize()
Checks if the panel has individual size.
|
boolean |
hasMenuInSystemMenu()
Checks if panels display the menu bar or if they use the pop-up menu (as in
the system menu).
|
boolean |
inhibitTransform()
Checks if the application should inhibit resize (font substitution
and ratioX/ratioY).
|
boolean |
isApplicationMaximized()
Checks if the application is maximized.
|
boolean |
isSystemMessageBoxEnabled(boolean isPopup)
Checks if system message boxes are enabled.
|
void |
load(PhantomRuntime runtime,
PhantomFile file,
boolean doLoadObjects,
boolean doLoadOtherExternalFiles,
boolean doConvertProgramText)
Loads the host definitions from the application file.
|
int |
loadObjectClasses()
Loads the class files for REXX/DLL objects.
|
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 |
needsHelpIDLoad()
Does helpID file needs to be loaded for the first time or reloaded?
|
boolean |
needsReload(boolean allFiles)
Check if this file needs to be reloaded.
|
boolean |
needsReloadPHA()
Check if the .PHA file needs to be reloaded.
|
boolean |
needsTextLoad()
Does message file needs to be loaded for the first time or reloaded?
|
boolean |
needsTooltipLoad()
Does tooltip file needs to be loaded for the first time or reloaded?
|
boolean |
needsXlateLoad()
Does translation file needs to be loaded for the first time or reloaded?
|
void |
onENPObjectInvalidated()
Invalidates the chain of objects up to the owner in order to get it sent to Eclipse.
|
void |
processTooltipText(Hashtable<String,String> t)
Sets the tool-tip texts for all ID's in the hash table for control ID's and
menu ID's.
|
int |
reload(PhantomHostData hostData,
IProgressMonitor monitor,
IReloadListener listener,
boolean allFiles)
Reload internal state from external sources.
|
boolean |
reloadTextFile(boolean always)
Reloads the text file immediately if it is required.
|
void |
resolveCachedImageReferences()
Re-checks the cached NPObjects for referenced image changes.
|
void |
save(PhantomOutputFile file)
Saves the file to the output file.
|
void |
save(String fileName)
Saves the host definitions to the application file.
|
void |
save(String fileName,
boolean isNetPhantom5)
Saves the host definitions to the application file.
|
void |
setColorConversionTables(byte[] fore,
byte[] back)
Replaces a color conversion tables.
|
void |
setControlColor(VirtualControl vCtl,
int vioClr,
boolean isFore,
boolean isBack)
Set the control color from host VIO color and color conversion.
|
void |
setControlColor(VirtualControl vCtl,
int vioClr,
boolean isFore,
boolean isBack,
boolean doForegroundColor,
boolean doKeepBackgroundAtNoConversion)
Set the control color from host VIO color and color conversion.
|
void |
setTooltipTextTable(Hashtable<String,String> t)
Sets the tooltip text table.
|
void |
updateReferences(ApplicationReferences refs)
Updates the Applications References instance.
|
boolean |
useHelpIDFromHost()
Checks if the application uses a the help ID from host field name whenever
a control doesn't have any ID.
|
public static final int APPFLAG_MAXIMIZE
public static final int APPFLAG_SYSMENU
public static final int APPFLAG_NEWGROUP
public static final int APPFLAG_INDSIZE
public static final int APPFLAG_PASSFKEYS
public static final int APPFLAG_MSGDISBASE
public static final int APPFLAG_MSGDISMAIN
public static final int APPFLAG_MSGDISPOPUP
public static final int APPFLAG_MSGDISALL
public static final int APPFLAG_PROCESSLOCK
public static final int APPFLAG_PHH
public static final int APPFLAG_FIELDIDHELP
public static final int APPFLAG_ESCNOTF12
public static final int APPFLAG_NOMNEMONIC
public static final int APPFLAG_MERGEPOPMENU
public static final int APPFLAG_INHIBITTRANSFORM
public static final int APPFLAG_OUTPUTTEXTFOCUS
public static final byte[] defaultColorConvFore
public static final byte[] defaultColorConvBack
protected boolean doReplaceProgramText
public Hashtable<String,PhantomObject> objects
public String textFile
public String xlateFile
public String phaFileName
public PhantomObject appObject
public static final PhantomPanelData[] EMPTY_PANELS
public PhantomApplicationData()
public void load(PhantomRuntime runtime, PhantomFile file, boolean doLoadObjects, boolean doLoadOtherExternalFiles, boolean doConvertProgramText) throws IOException
runtime
- The runtime.file
- The application (.PHA) file.doLoadObjects
- Flag to load and instantiate the objects.doLoadOtherExternalFiles
- Flag indicating external files (PHW PHO PHM PHX TT) should be loaded.doConvertProgramText
- If texts in the text file and translation table should be converted, (e.g. for @*PROGNAME@).IOException
- If an I/O error occurs.public void save(String fileName) throws IOException
fileName
- IOException
- if an I/O error occurs.public void save(String fileName, boolean isNetPhantom5) throws IOException
fileName
- File name.isNetPhantom5
- Flag for NetPhantom 5 compatibility.IOException
- if an I/O error occurs.public void save(PhantomOutputFile file) throws IOException
IOException
- if an I/O error occurs.public PhantomObject getObject(String name)
public int loadObjectClasses() throws IOException
IOException
- if an I/O error occurs.public Enumeration<PhantomObject> getObjects()
public Iterator<PhantomObject> getObjectIterator()
public Collection<PhantomObject> getObjectsCollection()
public Hashtable<String,PhantomPopupMenu> getPopupMenuIDs()
public PhantomPopupMenu[] getPopupMenus()
public Hashtable<String,PhantomCBar> getBarObjects()
public PhantomCBar[] getBars()
public Hashtable<String,PhantomObject> getAllObjects()
public Hashtable<String,PhantomApplicationData.Directory> getPanelToScreens()
public void addPopupMenuControlID(String id, PhantomPopupMenu popupMenu)
public PhantomPopupMenu getPopupMenuForControlID(String id)
public PhantomApplicationData.Directory getPanelFromScreen(String name)
public PhantomApplicationData.Directory getScreenFromPanel(String name)
public String getHiddenPanelDescription(PhantomApplicationData.Directory dir)
public boolean addHiddenPanel(PhantomApplicationData.Directory dir, String descr, boolean doReplace)
public boolean addObject(PhantomObject po, boolean doReplace)
public boolean addPanel(PhantomPanelData panel, PhantomApplicationData.Directory dir, boolean doReplace)
public void maybeThrowIOException(MaybeIOException exception) throws IOException
IOException
public PhantomPanelData getPanel(String name)
public String getIconFile()
public Hashtable<String,Vector<String>> getConnectionsForPopupMenu()
public int getIconID()
public Enumeration<PhantomPanelData> getAllPanels()
public PhantomPanelData[] getPanelsArray()
public int getStdWidth()
public int getStdHeight()
public PhantomApplicationData.Directory[] getDirectories()
public Hashtable<String,PhantomPanelData> getPanels()
public String getTranslationFile()
public String getTextFile()
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 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 PhantomPanelData getApplicationPanel()
public boolean areHostChangesProcessedDuringLock()
public String getTitle()
public boolean arePanelsMaximized()
public boolean hasMenuInSystemMenu()
public boolean isApplicationMaximized()
public boolean doApplicationChildrenInset()
public boolean arePFKeysPassedToHost()
public boolean hasCloseID()
public String getCloseID()
public boolean hasIndividualSize()
public boolean doUseHelpIDTable()
public void assignHelpIDTable(Hashtable<String,String> table)
public boolean doMapEscapeToF12()
public boolean inhibitTransform()
public boolean useHelpIDFromHost()
public int getWaitStableDelay()
public void copyApplicationData(PhantomApplicationData source)
source
- The source PhantomApplicationData to copy into this instance.public PhantomPanelData copyApplicationPanel(PhantomApplicationData source)
source
- The PhantomApplicationData to copy to the application panel and
some size settings for main panels.public void copyColorConversion(PhantomApplicationData source)
source
- Copy color conversion tables from the source PhantomApplicationData
into this instance.public boolean hasApplicationPanel()
public void processTooltipText(Hashtable<String,String> t)
public void setControlColor(VirtualControl vCtl, int vioClr, boolean isFore, boolean isBack)
public void setControlColor(VirtualControl vCtl, int vioClr, boolean isFore, boolean isBack, boolean doForegroundColor, boolean doKeepBackgroundAtNoConversion)
public int[] getControlColor(VirtualControl vCtl, int vioClr, boolean isFore, boolean isBack)
public int[] getControlColor(int vioClr, boolean isFore, boolean isBack)
public se.entra.phantom.geditor.NPPColor getControlBackgroundColor(VirtualControl vCtl, boolean isDisable, boolean doDisableBackground, se.entra.phantom.geditor.NPPColor originalBackground)
public void getReferencedFiles(ArrayList<String> files)
public PhantomRuntime getRuntime()
public boolean isSystemMessageBoxEnabled(boolean isPopup)
public static se.entra.phantom.geditor.PropertyWorker getPropertyWorker()
public static se.entra.phantom.geditor.NPPColorItemManager getColorItemManager()
public boolean needsReloadPHA()
public boolean needsReload(boolean allFiles)
public boolean needsTextLoad()
public boolean needsXlateLoad()
public boolean needsTooltipLoad()
public boolean needsHelpIDLoad()
public int reload(PhantomHostData hostData, IProgressMonitor monitor, IReloadListener listener, boolean allFiles) throws IOException
listener
- The reload listener, or null for none.allFiles
- Flag indicating just the PHA file when allFiles=false, not the others.IOException
public boolean reloadTextFile(boolean always) throws IOException
IOException
public void createDefaultColorConversionTables()
public void setColorConversionTables(byte[] fore, byte[] back)
public void getColorConversionTables(byte[] fore, byte[] back)
public PhantomObject getObject(String objectName, String referer, String location) throws IOException
IOException
- if the object is not found in the applicationpublic void addBarFile(String id, PhantomCBar bar)
public PhantomCBar getBarFile(PhantomControl control, String id)
public PhantomCBar getBarFile(PhantomControl control, String id, boolean loadIfRequired) throws IOException
IOException
- If bar file cannot be loaded.public boolean hasBarFile(String barFile)
public PhantomObject getPhantomMacro(String macroName)
public boolean areOutputFieldsFocusable()
public int getPopupMenuCount()
public ApplicationReferences getApplicationReferences()
public ApplicationReferences getCachedApplicationReferences()
public void updateReferences(ApplicationReferences refs)
public String getNPObjectName()
getNPObjectName
in interface INPObjects
public void onENPObjectInvalidated()
onENPObjectInvalidated
in interface IENPObjectOwner
public ENPRootObject getCachedNPObject()
getCachedNPObject
in interface INPObjects
public ENPRootObject getNPObject()
getNPObject
in interface INPObjects
public void resolveCachedImageReferences()
Phantom® and NetPhantom® are registered trademarks of Mindus SARL.
© © Mindus SARL, 2024. All rights reserved.