Class modules.ButtonBar
All Packages Class Hierarchy This Package Previous Next Index
Class modules.ButtonBar
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.Panel
|
+----modules.ButtonBar
- public class ButtonBar
- extends Panel
- implements Module
This class implements a programmable button bar.
You can add Buttons and Input
fields to trigger actions in the telnet
applet. On how to load a module, please refer to the
telnet documentation.
- Buttons:
- <PARAM NAME=number#Button VALUE="buttontext|buttonaction">
- number is the sequence number and determines the place
of the button on the row.
- buttontext is a string displayed on the button.
- buttonaction may be one
of the following functions or strings
(Note: the backslash character
in front of the dollar sign is mandatory!)
- simple text
to be sent to the remote host. Newline and/or carriage return
characters may be added in C syntax \n and \r.
To support unimplemented function keys the \e escape
character may be useful. The \b backspace character is
also supported.
The text may contain field
reference(s).
- \$connect(host[,port])
tries to initiate a connection to the host
at the port, if given. The standard port is
23. host and port may be hostname
and number or field
reference(s). If a connection already exists
nothing will happen.
(Note: It is not allowed to have
spaces anywhere inside the parenthesis!)
- \$disconnect()
terminates the current connection, but if there was no
connection nothing will happen.
- \$detach()
detaches the applet from the web browser window and
creates a new frame externally. This may be used to allow
users to use the applet while browsing the web with the
same browser window.
(Note: You need to load the applet via the
appWrapper class or
it will not work properly!)
- Examples:
(Note: It makes sense if you look at the
examples for input fields below.)
<PARAM NAME=1#Button VALUE="HELP!|help\r\n">
<PARAM NAME=2#Button VALUE="HELP:|help \@help@\r\n">
<PARAM NAME=4#Button VALUE="simple|\$connect(localhost)">
<PARAM NAME=5#Button VALUE="complete|\$connect(www,4711)">
<PARAM NAME=6#Button VALUE="connect|\$connect(\@address@)">
<PARAM NAME=8#Button VALUE="connect to port|\$connect(\@address@,\@port@)">
<PARAM NAME=10#Button VALUE="window|\$detach()">
- Input fields
- <PARAM NAME=number#Input VALUE="fieldname[#length]|initial text[|action]">
- number is the sequence number and determines the place
of the field on the row.
- fieldname is a
symbolic name to reference the input field. A reference may be used in
button actions and
is constructed as follows:
\@fieldname@
The \@fieldname@ macro will be replaced by the string entered in
the text field.
- length is the length of the input field in numbers of
characters.
- initial text is the text to be placed into the input
field on startup
- action may be used similar to a
button action. This action
will be used if the users presses Return in the inputfield. Leave
empty if you only want to use a button to send the text!
- Examples:
(Note: It makes sense if you look at the
examples for buttons before.)
<PARAM NAME=3#Input VALUE="help#10|">
<PARAM NAME=7#Input VALUE="address|www.first.gmd.de">
<PARAM NAME=8#Input VALUE="send#5|who|\@send@\r\n">
<PARAM NAME=9#Input VALUE="port#5|4711">
- Version:
- $Id: ButtonBar.java,v 1.21 1997/12/16 10:55:27 leo Exp $
- Author:
- Matthias L. Jugel, Marcus Meißner
- See Also:
- Module
-
ButtonBar()
-
-
addNotify()
- create the buttonbar from the parameter list.
-
connect(String, int)
- If the applet connects this method is called.
-
disconnect()
- Get notified of disconnection.
-
handleEvent(Event)
-
-
receive(String)
- This module does not take any input.
-
setLoader(Object)
- This method is called by our loader to notify us of it.
ButtonBar
public ButtonBar()
setLoader
public void setLoader(Object o)
- This method is called by our loader to notify us of it.
- Parameters:
- o - The object that has loaded this object.
- See Also:
- Module
connect
public void connect(String host,
int port)
- If the applet connects this method is called.
- Parameters:
- host - remote hostaddress - not used
- port - remote port - not used
disconnect
public void disconnect()
- Get notified of disconnection. Do nothing.
receive
public String receive(String s)
- This module does not take any input. It works passive.
- Returns:
- null to remove from the list of receiver modules.
- See Also:
- Module
addNotify
public void addNotify()
- create the buttonbar from the parameter list. We will know our parent,
when we have been added.
- Overrides:
- addNotify in class Panel
handleEvent
public boolean handleEvent(Event evt)
- Overrides:
- handleEvent in class Component
All Packages Class Hierarchy This Package Previous Next Index