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!)
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

Constructor Index

 o ButtonBar()

Method Index

 o addNotify()
create the buttonbar from the parameter list.
 o connect(String, int)
If the applet connects this method is called.
 o disconnect()
Get notified of disconnection.
 o handleEvent(Event)
 o receive(String)
This module does not take any input.
 o setLoader(Object)
This method is called by our loader to notify us of it.

Constructors

 o ButtonBar
  public ButtonBar()

Methods

 o 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
 o 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
 o disconnect
  public void disconnect()
Get notified of disconnection. Do nothing.
 o 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
 o 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
 o handleEvent
  public boolean handleEvent(Event evt)
Overrides:
handleEvent in class Component

All Packages  Class Hierarchy  This Package  Previous  Next  Index