Java Code Examples for org.eclipse.swt.SWT#INDETERMINATE

The following examples show how to use org.eclipse.swt.SWT#INDETERMINATE . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ProgressDialogEx.java    From SWET with MIT License 6 votes vote down vote up
private void setIndeterminate(boolean indeterminate) {
	if (!indeterminate) {

		if ((progressBar.getStyle() & SWT.INDETERMINATE) == 0)
			return;
		updateStyle(progressBar.getStyle() ^ SWT.INDETERMINATE);
		// parent.layout();
		updateValues();

	} else {

		if ((progressBar.getStyle() & SWT.INDETERMINATE) == SWT.INDETERMINATE)
			return;
		updateStyle(progressBar.getStyle() | SWT.INDETERMINATE);
		// parent.layout();

	}

}
 
Example 2
Source File: AZProgressBar.java    From BiglyBT with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 * @param parent
 * @param isIndeterminate
 * @param useInputButton determines whether the <code>inputButton</code> is available or not
 * @param image an <code>Image</code> to display; may be null
 */
public AZProgressBar(Composite parent, boolean isIndeterminate) {
	super(parent, SWT.NULL);

	incrementalProgressBar = new ProgressBar(this, SWT.HORIZONTAL);
	indeterminateProgressBar = new ProgressBar(this, SWT.HORIZONTAL
			| SWT.INDETERMINATE);

	stack = new StackLayout();
	setLayout(stack);
	pack();

	visible = super.isVisible();
	
	setIndeterminate(isIndeterminate);
}
 
Example 3
Source File: ProgressBarDemo.java    From slr-toolkit with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * Create contents of the dialog.
 * @param parent
 */
@Override
protected Control createDialogArea(Composite parent) {
	Composite container = (Composite) super.createDialogArea(parent);
	container.setLayout(new GridLayout(1, false));
       completedInfo = new Label(container, SWT.NONE);
       completedInfo.setAlignment(SWT.CENTER);
       GridData gd_completedInfo = new GridData(SWT.CENTER, SWT.CENTER, true, false, 1, 1);
       gd_completedInfo.minimumWidth = 250;
       completedInfo.setLayoutData(gd_completedInfo);
       completedInfo.setSize(250, 40);
       completedInfo.setText("Processing Data ...");
       new Label(container, SWT.NONE);
       
       progressBar = new ProgressBar(container, SWT.INDETERMINATE);
       GridData gd_progressBar = new GridData(SWT.CENTER, SWT.CENTER, true, false, 1, 1);
       gd_progressBar.minimumWidth = 250;
       progressBar.setLayoutData(gd_progressBar);
       progressBar.setBounds(10, 23, 400, 17);
       progressBar.setSelection(100);
       
	return container;
}
 
Example 4
Source File: ProgressIndicator.java    From offspring with MIT License 5 votes vote down vote up
/**
 * Create a ProgressIndicator as a child under the given parent.
 * 
 * @param parent
 *          The widgets parent
 * @param style
 *          the SWT style constants for progress monitors created by the
 *          receiver.
 * @since 3.4
 */
public ProgressIndicator(Composite parent, int style) {
  super(parent, SWT.NULL);

  // Enforce horizontal only if vertical isn't set
  if ((style & SWT.VERTICAL) == 0)
    style |= SWT.HORIZONTAL;

  determinateProgressBar = new ProgressBar(this, style);
  indeterminateProgressBar = new ProgressBar(this, style | SWT.INDETERMINATE);
  layout = new StackLayout();
  setLayout(layout);
}
 
Example 5
Source File: SWTIndeterminateProgressBar.java    From tuxguitar with GNU Lesser General Public License v2.1 4 votes vote down vote up
public SWTIndeterminateProgressBar(SWTContainer<? extends Composite> parent) {
	super(new ProgressBar(parent.getControl(), SWT.BORDER | SWT.HORIZONTAL | SWT.SMOOTH | SWT.INDETERMINATE), parent);
}
 
Example 6
Source File: StaticHTMLController.java    From birt with Eclipse Public License 1.0 4 votes vote down vote up
public void setViewer( IViewer viewer )
{
	this.viewer = viewer;

	if ( !( viewer instanceof AbstractViewer ) )
	{
		return;
	}

	Composite viewerUI = (Composite) ( (SWTAbstractViewer) viewer ).getUI( );

	if ( viewerUI == null )
	{
		return;
	}
	pane = new Composite( viewerUI, SWT.NONE );
	pane.setLayoutData( new GridData( GridData.HORIZONTAL_ALIGN_FILL ) );

	RowLayout rowLayout = new RowLayout( );
	rowLayout.type = SWT.HORIZONTAL;
	rowLayout.spacing = 5;
	pane.setLayout( rowLayout );

	for ( Iterator iter = buttons.iterator( ); iter.hasNext( ); )
	{
		ButtonInfo buttonInfo = (ButtonInfo) iter.next( );
		Button button = new Button( pane, SWT.PUSH );

		button.setText( buttonInfo.text );
		button.setToolTipText( buttonInfo.toolTip );
		if ( buttonInfo.selectionListener != null )
		{
			button.addSelectionListener( buttonInfo.selectionListener );
		}
	}

	GridData gd = new GridData( GridData.END, GridData.CENTER, false, false );
	gd.heightHint = 10;
	gd.widthHint = 100;
	progressBar = new ProgressBar( viewerUI, SWT.INDETERMINATE );
	progressBar.setLayoutData( gd );
	setBusy( true );
}