11.1. Bean properties
Prev | 11. part | Next

### 11.1. Bean properties

Most Java™ Objects specified in `.xxe_gui` files may be parameterized using `property` child elements. A property child element specifies a Bean (that is, a Java™ Object) property.

Example:

    <property name="columns" type="int" value="40" />

implies that the bean to be parametrized has a public method which resembles:

    setColumns(int number)

Such properties are completely specific to the bean they parametrize and therefore, cannot be described in this manual.

`type` | Corresponding Java™ type | Syntax of `value` | Example
--- | --- | --- | ---
boolean | boolean | true, false | true
byte | byte | integer: -128 to 127 inclusive | 100
char | char | a single character | a
short | short | integer: -32768 to 32767 inclusive | 1000
int | int | integer: -2147483648 to 2147483647 inclusive | -1
long | long | integer: -9223372036854775808 to 9223372036854775807, inclusive | 255
float | float | single-precision 32-bit format IEEE 754 | -0.5
double | double | double-precision 64-bit format IEEE 754 | 1.0
String | java.lang.String | a string | Hello, world!

Color

java.awt.Color

- #`RR` `GG` `BB` where `RR`, `GG`, `BB` are hexadecimal numbers between 0 and 255 inclusive;

- or rbg(`R`, `G`, `B`) where `R`, `G`, `B` are decimal numbers between 0 and 255 inclusive;

- or standard HTML/CSS named colors: black, white, red, silver, etc.

- #FFFFFF

- rgb(255,255,255)

- white

Font

java.awt.Font

`fontfamily` [ -BOLD|BOLDITALIC|ITALIC ] [ -`pointsize` ]

Default `style` is PLAIN.

Default `pointsize` is 12.

- Monospaced

- Serif-14

- SansSerif-ITALIC

- Serif-BOLD-10

Example (a `StatusTool` is a kind of `JTextField`):

    <tool name="heavilyParametrizedStatusTool">
      <class>com.xmlmind.xmleditapp.kit.part.StatusTool</class>
      <property name="text" type="String" value="   Hello,   world!   " />
      <property name="editable" type="boolean" value="true" />
      <property name="focusable" type="boolean" value="true" />
      <property name="horizontalAlignment" type="int" value="RIGHT" />
      <property name="font" type="Font" value="Serif-BOLD-16" />
      <property name="foreground" type="Color" value="#000080" />
      <property name="background" type="Color" value="silver" />
      <property name="selectedTextColor" type="Color" value="rgb(255,0,0)" />
      <property name="caretPosition" type="int" value="5" />
      <property name="alignmentX" type="float" value="0.5" />
    </tool>

| Notice here the use of symbolic integer constant `javax.swing.JTextField.RIGHT`.

Prev | Up | Next
11. part | Home | 12. preferencesSheet