View Javadoc

    1   /*
    2    *  soapUI, copyright (C) 2004-2007 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(
    36  				BorderFactory.createCompoundBorder(
    37  						BorderFactory.createEmptyBorder( 2, 2, 2, 3 ),
    38  						BorderFactory.createMatteBorder( 0, 0, 1, 1, Color.LIGHT_GRAY ) ));
    39
    40  		setStatusComponent( progressBar );
    41  	}
    42
    43  	public JEditorStatusBarWithProgress(JEditorStatusBarTarget target)
    44  	{
    45  		super(target);
    46
    47  		initProgressBar();
    48  	}
    49
    50  	public JProgressBar getProgressBar()
    51  	{
    52  		return progressBar;
    53  	}
    54
    55  	public void setIndeterminate(boolean newValue)
    56  	{
    57  		progressBar.setIndeterminate(newValue);
    58  	}
    59
    60  	public void setValue(int n)
    61  	{
    62  		progressBar.setValue(n);
    63  	}
    64  }