lblMinimized = new JLabel(ImageProvider.get("misc", "normal"));
add(lblMinimized);
// scale down the dialog icon
lblTitle = new JLabel("", new ImageProvider("dialogs", iconName).setWidth(16).get(), JLabel.TRAILING);
lblTitle.setIconTextGap(8);
JPanel conceal = new JPanel();
conceal.add(lblTitle);
conceal.setVisible(false);
add(conceal, GBC.std());
// Cannot add the label directly since it would displace other elements on resize
lblTitle_weak = new JComponent() {
@Override
public void paintComponent(Graphics g) {
lblTitle.paint(g);
}
};
lblTitle_weak.setPreferredSize(new Dimension(Integer.MAX_VALUE,20));
lblTitle_weak.setMinimumSize(new Dimension(0,20));
add(lblTitle_weak, GBC.std().fill(GBC.HORIZONTAL));
buttonsHide = new JButton(ImageProvider.get("misc", buttonHiding != ButtonHidingType.ALWAYS_SHOWN ? "buttonhide" : "buttonshow"));
buttonsHide.setToolTipText(tr("Toggle dynamic buttons"));
buttonsHide.setBorder(BorderFactory.createEmptyBorder());
buttonsHide.addActionListener(
new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
JRadioButtonMenuItem item = (buttonHiding == ButtonHidingType.DYNAMIC) ? alwaysShown : dynamic;
item.setSelected(true);
item.getAction().actionPerformed(null);
}
}
);
add(buttonsHide);
// show the pref button if applicable
if (preferenceClass != null) {
JButton pref = new JButton(new ImageProvider("preference").setWidth(16).get());
pref.setToolTipText(tr("Open preferences for this panel"));
pref.setBorder(BorderFactory.createEmptyBorder());
pref.addActionListener(
new ActionListener(){
@Override