View Javadoc

1   /*
2    *  soapUI, copyright (C) 2004-2010 eviware.com 
3    *
4    *  soapUI is free software; you can redistribute it and/or modify it under the 
5    *  terms of version 2.1 of the GNU Lesser General Public License as published by 
6    *  the Free Software Foundation.
7    *
8    *  soapUI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without 
9    *  even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
10   *  See the GNU Lesser General Public License for more details at gnu.org.
11   */
12  
13  package com.eviware.soapui.support.components;
14  
15  import java.awt.Color;
16  
17  import javax.swing.BorderFactory;
18  import javax.swing.JProgressBar;
19  
20  public class JEditorStatusBarWithProgress extends JEditorStatusBar
21  {
22  	private JProgressBar progressBar;
23  
24  	public JEditorStatusBarWithProgress()
25  	{
26  		super();
27  
28  		initProgressBar();
29  	}
30  
31  	private void initProgressBar()
32  	{
33  		progressBar = new JProgressBar();
34  		progressBar.setBackground( Color.WHITE );
35  		progressBar.setBorder( BorderFactory.createCompoundBorder( BorderFactory.createEmptyBorder( 2, 2, 2, 3 ),
36  				BorderFactory.createMatteBorder( 0, 0, 1, 1, Color.LIGHT_GRAY ) ) );
37  
38  		setStatusComponent( progressBar );
39  	}
40  
41  	public JEditorStatusBarWithProgress( JEditorStatusBarTarget target )
42  	{
43  		super( target );
44  
45  		initProgressBar();
46  	}
47  
48  	public JProgressBar getProgressBar()
49  	{
50  		return progressBar;
51  	}
52  
53  	public void setIndeterminate( boolean newValue )
54  	{
55  		progressBar.setIndeterminate( newValue );
56  	}
57  
58  	public void setValue( int n )
59  	{
60  		progressBar.setValue( n );
61  	}
62  }