View Javadoc

1   package org.telscenter.pas.authortool.statusbar;
2   
3   import javax.swing.JComponent;
4   import javax.swing.JLabel;
5   import javax.swing.JProgressBar;
6   
7   import org.telscenter.pas.authortool.common.colors.PasColors;
8   
9   import com.l2fprod.common.swing.StatusBar;
10  
11  public class StatusBarProvider {
12  
13  	private static StatusBarProvider sbProviderInstance = null;
14  
15  	private StatusBar statusBar;
16  
17  	private JProgressBar progressBar;
18  
19  	private JLabel statusLabel;
20  
21  	public static StatusBarProvider getInstance() {
22  		if (StatusBarProvider.sbProviderInstance == null)
23  			StatusBarProvider.sbProviderInstance = new StatusBarProvider();
24  		return StatusBarProvider.sbProviderInstance;
25  	}// getInstance()
26  
27  	private StatusBarProvider() {
28  		statusBar = new StatusBar();
29  		progressBar = new JProgressBar();
30  		statusLabel = new JLabel();
31  
32  		// progressBar.setValue(45);
33  		statusBar.setZones(new String[] { "A", "B" }, new JComponent[] {
34  				statusLabel, progressBar }, new String[] { "75%", "*" });
35  		statusLabel.setBackground(PasColors.statusBarBackgroundColor);
36  		statusLabel.setOpaque(true);
37  		setStatusMessage("Ready......");
38  	}// StatusBarProvider
39  
40  	public void setStatusMessage(final String message) {
41  		final JLabel statusMessage = (JLabel) statusBar.getZone("A");
42  		statusMessage.setText(message);
43  	}// setStatusMessage
44  
45  	public StatusBar getStatusBar() {
46  		return statusBar;
47  	}// getStatusBar
48  
49  }// StatusBarProvider