1 package org.telscenter.pas.authortool.common.util;
2
3 import java.awt.BorderLayout;
4 import java.awt.Font;
5
6 import javax.swing.BorderFactory;
7 import javax.swing.JButton;
8 import javax.swing.JComponent;
9 import javax.swing.JLabel;
10 import javax.swing.JPanel;
11 import javax.swing.border.Border;
12
13 import org.telscenter.pas.authortool.common.colors.PasColors;
14
15 import com.l2fprod.common.swing.LookAndFeelTweaks;
16
17 public class BannerPanel extends JPanel {
18
19 /***
20 *
21 */
22 private static final long serialVersionUID = 1L;
23 private JLabel heading;
24
25 public BannerPanel(final String title, final JComponent parent) {
26
27 final JButton helpButton = CommonUI.createHelpButton();
28
29 setLayout(LookAndFeelTweaks.createBorderLayout());
30 final Border lineBorder = BorderFactory.createLineBorder(PasColors.bannerPanelLineBorderColor.darker(),1);
31
32 final Border emptyBorder = BorderFactory.createEmptyBorder(1,helpButton.getInsets().right,1,1);
33 setBorder(BorderFactory.createCompoundBorder(lineBorder,emptyBorder));
34 final JLabel heading = new JLabel(title);
35 heading.setFont(heading.getFont().deriveFont(Font.BOLD));
36 setBackground(parent.getBackground().brighter());
37 setOpaque(true);
38
39
40 this.add(heading,BorderLayout.WEST);
41
42 }
43 public JLabel getHeading() {
44 return heading;
45 }
46
47 public void setHeading(final JLabel heading) {
48 this.heading = heading;
49 }
50
51 }