// Toolbar
JToolBar toolbar = new JToolBar(SwingConstants.HORIZONTAL);
toolbar.setFloatable(false);
JToggleButton toggle = null;
JCheckBox chk = null;
ColorButton button = null;
// Italic check box
toggle = Utilities.createJToggleButton(
"gnome-format-text-italic.png", EnumImageSize.SMALL,
GT._("Italic"), false);
toggle.setEnabled(italic);
chkItalic.add(toggle);
toolbar.add(toggle);
// Bold check box
toggle = Utilities.createJToggleButton(
"gnome-format-text-bold.png", EnumImageSize.SMALL,
GT._("Bold"), false);
toggle.setEnabled(bold);
chkBold.add(toggle);
toolbar.add(toggle);
// Underline check box
toggle = Utilities.createJToggleButton(
"gnome-format-text-underline.png", EnumImageSize.SMALL,
GT._("Underline"), false);
toggle.setEnabled(underline);
chkUnderline.add(toggle);
toolbar.add(toggle);
// Strike through check box
toggle = Utilities.createJToggleButton(
"gnome-format-text-strikethrough.png", EnumImageSize.SMALL,
GT._("Strike through"), false);
toggle.setEnabled(strike);
chkStrike.add(toggle);
toolbar.add(toggle);
// Foreground color check box and button
toolbar.add(new JSeparator());
chk = Utilities.createJCheckBox("", true);
chk.setToolTipText(GT._("Foreground color"));
chk.setEnabled(foreground);
chkForeground.add(chk);
toolbar.add(chk);
button = new ColorButton(Color.BLACK, GT._("Choose foreground color"));
button.setToolTipText(GT._("Foreground color"));
button.setEnabled(foreground && chk.isSelected());
btnForeground.add(button);
toolbar.add(button);
// Background color check box and button
toolbar.add(new JSeparator());
chk = Utilities.createJCheckBox("", true);
chk.setToolTipText(GT._("Background color"));
chk.setEnabled(background);
chkBackground.add(chk);
toolbar.add(chk);
button = new ColorButton(Color.WHITE, GT._("Choose background color"));
button.setToolTipText(GT._("Background color"));
button.setEnabled(background && chk.isEnabled());
btnBackground.add(button);
toolbar.add(button);
// End line
constraints.gridx = columnFormat;