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.
| Property | Documentation |
|---|
| ButtonBar.setup | The 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.clearFields | If set to true the input fields will be cleared after return or pressing a button that reads the field. |
ButtonBar SetupThe setup file contains definitions for buttons, input fields and keywords for the layout of the components. Possible keywords are:
| Keyword | Description |
|---|
| button text command | Create 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 text | Create a new textlabel with the displayed text. The text needs to be enclosed with quotation characters (") if it contains whitespace. |
| input name length command text | Create 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! |
| break | If 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. |
| stretch | If 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 (\\).
| Function | Documentation |
|---|
| \\$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.