in src/org/pushingpixels/lightbeam/panels/ButtonsPanel.java [266:326]
public ButtonsPanel(ComponentsFactory factory) {
this.factory = factory;
this.setLayout(new BorderLayout());
FormLayout lm = new FormLayout(
"right:pref, 10dlu, left:pref:grow(1), 4dlu,"
+ "left:pref:grow(1), 4dlu, left:pref:grow(1), "
+ "4dlu, left:pref:grow(1)", "");
lm.setColumnGroups(new int[][] { { 3, 5, 7, 9 } });
DefaultFormBuilder builder = new DefaultFormBuilder(lm).border(Borders.DIALOG);
builder.append("");
JLabel bLabel = new JLabel("Buttons");
JLabel tbLabel = new JLabel("Toggle buttons");
JLabel cbLabel = new JLabel("Check boxes");
JLabel rbLabel = new JLabel("Radio buttons");
builder.append(bLabel, tbLabel);
builder.append(cbLabel, rbLabel);
builder.appendSeparator("Regular settings");
this.addRow(builder, "Regular", null, null);
this.addRow(builder, "HTML text", null, new TextCommand(
"<html>text <b>text</b> <font color='red'>text</font>"));
this.addRow(builder, "Long text", null, new TextCommand(
"Some long long text"));
this.addRow(builder, "With icon", IconManager.getRandomIcon(),
new IconCommand(IconManager.getRandomIcon()));
this.addRow(builder, "Custom margin", null, new MarginCommand());
builder.appendSeparator("Misc settings");
this.addRow(builder, "No content area", null,
new NoContentAreaFilledCommand());
this.addRow(builder, "No border", null, new NoBorderPaintedCommand());
this.addRow(builder, "No background", null,
new ChainCommand<AbstractButton>(
new NoContentAreaFilledCommand(),
new NoBorderPaintedCommand()));
builder.appendSeparator("Unicode texts");
this.addRow(builder, "Hebrew", null, new TextCommand(
"\u05D0\u05D1\u05D2"));
this.addRow(builder, "Chinese", null, new ChainCommand<AbstractButton>(
new FontCommand(new Font("Arial Unicode MS", Font.PLAIN, 11)),
new TextCommand("\u4E01\u4E02\u4E03")));
this.addRow(builder, "Cyrillic", null, new TextCommand(
"\u0430\u0431\u0432"));
this.addRow(builder, "Greek", null, new TextCommand(
"\u03B1\u03B2\u03B3"));
this.addRow(builder, "Latin", null, new TextCommand(
"\u00E6\u00F0\u0127\u2248"));
this.addRow(builder, "Fixed font", null, new FontCommand(new Font(
"Arial", Font.PLAIN, 12)));
this.addRow(builder, "Null text", null, new TextCommand(null));
this.addRow(builder, "Empty text", null, new TextCommand(""));
JScrollPane jsp = new JScrollPane(builder.getPanel());
this.add(jsp, BorderLayout.CENTER);
}