Extending NetPhantom Terminal Application
The terminal application is a Phantom Runtime application located in the terminal directory on the server side and is called
TERMINAL.PHR. This file is compiled with Phantom Editor with the option "Backwards compatible".
If you need another language for this application, just translate the TERMINAL.PHM file
as all texts are externalized.
Special requirements for TERMINAL.PHR
There are a number of special requirements for the terminal application described below:
- Only one main panel may exist and has to be named TERMINAL.
- All other panels must be of pop-up type.
- No panel can or should be host-connected.
- Push buttons or menu items may not use the entry "Next panel".
- No Phantom Object connections may exist, and absolutely no REXX code.
- All interaction with the panels must be done from Java code.
- Extending application must extend from se.entra.phantom.server.TerminalApplication.
Another requirement is that panels must be created with the following code:
VirtualSessionManager vsm=panel.getVirtualSessionManager();
VirtualPanelSession vps=vsm.getCurrentTerminalSession();
VirtualPanel newPanel=null;
if ( vps!=null )
{
VirtualPanelListener ll=new YourVirtualComponentAdapter();
newPanel=vps.createTerminalPanel("PANELID",ll);
}
Default implementation in TerminalApplication
The class se.entra.phantom.server.TerminalApplication that all extending
classes for the terminal application should use performs some default operation that can be overridden by the extending
class.
- Upon onPanelCreate the title bar text in the main panel (TERMINAL) is updated
from e.g. "Terminal Application - ?" to "Terminal Application - Session V - Description", where the "V" is the current
host session ID and the "Descritpion" is the text specified in "server.ini" [base] section as "V.description=Description".
- Upon onPanelCreate the host sessions that the user can change to is stored
the the variable allowedSessions and the menu item with the Control ID "CHGSESS"
is disabled if the "V.allowedSessions" entry in "server.ini" [host] section (or "defaultAllowedSessions") is not found or
empty.
- The following Control IDs perform actions in the onAction method:
| EXIT |
performExit |
| PROPS |
performProperties |
| CHGSESS |
performChangeSession |
| CUT |
performCut |
| COPY |
performCopy |
| PASTE |
performPaste |
| APPEND |
performAppend |
| SELALL |
performSelectAll |
| CONNECT |
performConnect |
| PRINT |
performPrint |
| PRTWIN |
performPrintWindow |
| ABOUT |
performAbout |
- Upon changes in the selection rectangle in the terminal part the menu items
and pop-up menu items CUT, COPY
and APPEND are enabled or disabled.
For a detailed description of the terminal application, see the
Java documentation
or the source listings.