de.mud.jta.plugin
Class ButtonBar
- ActionListener, FilterPlugin, ListSelectionListener, VisualPlugin
Implementation of a programmable button bar to be used as a plugin
in the Java(tm) Telnet Applet/Application. The button bar is configured
using a input file that contains the setup for the button bar.
A typical setup file may look like:
#
# Example for writing a button bar config file.
#
# The syntaxt for defining buttons, input fields and breaks is as follows:
#
# - defining a button:
# A button is defined by giving the keyword 'button' followed by the text
# of the button and the command that should be sent when pressing the
# button. If the command contains whitespace characters, enclode it in
# quote (") characters!
#
button Connect "\$connect(\@host@,\@port@)"
#
# - defining a label:
# A labvel is defined by giving the keyword 'label' followed by the text
# of the label. If the label contains whitespace characters, enclode it in
# quote (") characters!
#
label "Hello User"
#
# - defining an input field:
# An input field is defined just like the button above, but it has one more
# parameter, the size of the input field. So you define it, by giving the
# keyword 'input' followed by the name of the input field (for reference)
# followed by the size of the input field and optionally a third parameter
# which is the initial text to be displayed in that field.
#
input host 20 "tanis"
stretch
input port 4 "23"
#
# Now after the button and two input fields we define another button which
# will be shown last in the row. Order is significant for the order in
# which the buttons and fields appear.
#
button Disconnect "\\$disconnect()" break
#
# To implement an input line that is cleared and sends text use this:
# The following line send the text in the input field "send" and appends
# a newline.
input send 20 "\\@send@\n" "ls"
#
# - Defining a choice
# A choice is defined just like the button above, but it has multiple
# text/command pairs. If the text or command contain whitespace characters,
# enclose them in quote (") characters. The text and command data may be
# spread over several lines for better readability. Make the first command
# empty because it is initially selected, and choosing it will have no
# effect until some other item has been chosen.
#choice "- choose -" ""
# "Text 1" "Command 1"
# "Text 2" "Command 2"
# "Text 3" "Command 3"
# etc...
Other possible keywords are
break which does introduce a new
line so that buttons and input fields defined next will appear in a new
line below and
stretch to make the just defined button or input
field stretched as far as possible on the line. That last keyword is
useful to fill the space.
$Id: ButtonBar.java 499 2005-09-29 08:24:54Z leo $- Matthias L. Jugel, Marcus Mei???ner
protected JPanel | panel - the panel that contains the buttons and input fields
|
ButtonBar(PluginBus bus, String id) - Initialize the button bar and register plugin listeners
|
panel
protected JPanel panel
the panel that contains the buttons and input fields
ButtonBar
public ButtonBar(PluginBus bus,
String id)
Initialize the button bar and register plugin listeners
actionPerformed
public void actionPerformed(ActionEvent evt)
getPluginMenu
public JMenu getPluginMenu()
Get the menu entry for this component.
- getPluginMenu in interface VisualPlugin
- a menu that can be used to change the plugin state
getPluginVisual
public JComponent getPluginVisual()
Get the visible components from the plugin.
- getPluginVisual in interface VisualPlugin
- a component that represents the plugin
valueChanged
public void valueChanged(ListSelectionEvent evt)