View Javadoc

1   package org.telscenter.pas.authortool.buttonbar;
2   
3   import java.awt.Dimension;
4   
5   import javax.swing.BorderFactory;
6   import javax.swing.ButtonGroup;
7   import javax.swing.JToggleButton;
8   import javax.swing.SwingConstants;
9   
10  import org.telscenter.pas.authortool.actions.AboutAction;
11  import org.telscenter.pas.authortool.actions.PasCustomizerAction;
12  import org.telscenter.pas.authortool.common.colors.PasColors;
13  import org.telscenter.pas.authortool.context.CurnitAuthoringContext;
14  
15  import com.l2fprod.common.swing.JButtonBar;
16  import com.l2fprod.common.swing.plaf.blue.BlueishButtonBarUI;
17  
18  
19  public class ButtonBarProvider {
20  
21  	private JButtonBar buttonBar;
22  	private ButtonGroup buttonGroup;
23  	private CurnitAuthoringContext curnitAuthoringContext;
24  	
25  	public ButtonBarProvider(final CurnitAuthoringContext curnitAuthoringContext) {
26  		this.curnitAuthoringContext = curnitAuthoringContext;
27  		
28  		buttonBar = new JButtonBar(SwingConstants.VERTICAL);
29  		buttonBar.setUI(new BlueishButtonBarUI());	
30  		buttonBar.setPreferredSize( new Dimension(85, 200));
31  		buttonBar.setBorder(BorderFactory.createLineBorder(PasColors.buttonBarBackgroundColor.darker(), 1));
32  		buttonGroup = new ButtonGroup();
33  		
34  		//createWelcomeButton();
35  		createCustomizerButton();
36  		//createHelpButton();
37  		createAboutButton();
38  	}// CardProvider
39  
40  	private void createCustomizerButton() {
41  		final JToggleButton customizerButton = new JToggleButton(new PasCustomizerAction(curnitAuthoringContext));
42  		buttonBar.add(customizerButton);
43  		buttonGroup.add(customizerButton);		
44  	}
45  
46  	private void createAboutButton() {
47  		final JToggleButton aboutButton = new JToggleButton(new AboutAction(curnitAuthoringContext));
48  		buttonBar.add(aboutButton);
49  		buttonGroup.add(aboutButton);
50  	}// createAboutButton
51  
52  	public JButtonBar getButtonBar() {
53  		return buttonBar;
54  	}// getButtonBar
55  	
56  }// ButtonBarProvider