Legacy Communication Made Easy
[ start | index | login ]
start > Plugin ButtonBar

Plugin ButtonBar

Created by leo. Last edited by leo, 6 years and 86 days ago. Viewed 4,717 times. #1
[edit] [rdf]
labels
attachments
The button bar plugin is very useful to provide short cuts to common keystrokes and to define the unique look and feel of your installation.

To use this plugin simply set the property as defined below in the configuration file (applet.conf) and write a button definition file. How the buttons are defined is described in the lower part of this page.

PropertyDocumentation
ButtonBar.setupThe URL of the configuration file for the button bar. The file contains the definitions for look and function of the buttons and input fields.
ButtonBar.clearFieldsIf set to true the input fields will be cleared after return or pressing a button that reads the field.

ButtonBar Setup

The setup file contains definitions for buttons, input fields and keywords for the layout of the components. Possible keywords are:

KeywordDescription
button text commandCreate a new button with the displayed text that sends the command upon pressing that button. The command can be a simple piece of text or a function call as described below this table.
If the command contains whitespace characters enclose it in quotation characters (").
label textCreate a new textlabel with the displayed text. The text needs to be enclosed with quotation characters (") if it contains whitespace.
input name length command textCreate a new input field with the specified name and length. Optionally you can provide a command and an initial text that is used to initialize the input field. If the text contains whitespace characters enclose it in quotation characters ("). You can leave the command out. Then the input field will not allow pressing return to send its text!
breakIf that keyword appears just after a button or input field that field will stretch the rest of the line and the next button or input field will be placed in the next line.
stretchIf that keyword appears just after a button or input field it will cause that button or input field to take as much space in that line as it can get.
choice label1 value1 label2 value2 ...This keyword starts the definition of a choicebox selector. It is followed by label/value pairs where the label is put into the options list of the choicebox and the value will be sent as text (or executed as command) if the item is selected.
It is best if the first label / value pair is left, since you cannot easily select it.

Buttons may contain function calls as command to issue commands like, connect, __disconnect__ or to exit the application. A function call looks like:

To connect to the remote host on pressing a button you would define the following button

button Connect "\\$connect(\\@host@,\\@port@)"
input  host 20 "myhost.mydomain.com"
input  port 4  "23"
This will create a button labeled "Connect" which will call the function connect with the arguments taken from the input fields "host" and "port". If you do not encluse the command in quotation characters you do not have to type two backspaces (\\).

FunctionDocumentation
\\$connect(\\@host@,\\@port@)Connect the applet to host and port.
\\$disconnect()Disconnect the applet.
\\$exit()Exit the application. Applets cannot exit the application (due to security reasons).
\\$break()Send a TELNET IAC BREAK command. This is usually needed by telnet controllable embedded devices, like CISCO routers and similar.

If you want to have a look at an example, see buttonbar.conf.

no comments | post comment
Telnet+SSH+Terminal
legacy communication tools for JAVA(tm)

javassh.org | Copyright 1996-2009 Matthias L. Jugel and Marcus Meißner

JAVA is a trademark or registered trademark of Sun Microsystems, Inc. in the United States and other countries.
The JTA - Telnet/SSH Authors (Matthias L. Jugel and Marcus Meißner) are independent of Sun Microsystems, Inc.