FileDocCategorySizeDatePackage
StartStopButtonUtil.javaAPI DocAzureus 3.0.3.42285Thu May 17 12:19:48 BST 2007com.aelitis.azureus.ui.swt.views.skin

StartStopButtonUtil

public class StartStopButtonUtil extends Object
author
TuxPaper
created
Sep 30, 2006

Fields Summary
Constructors Summary
Methods Summary
public static voidupdateStopButton(com.aelitis.azureus.ui.swt.views.TorrentListView view, com.aelitis.azureus.ui.swt.skin.SWTSkinButtonUtility button)

		if (button == null) {
			return;
		}

		try {
			TableRowCore[] selectedRows = view.getSelectedRows();

			if (selectedRows.length == 0) {
				return;
			}
			boolean bResume = true;
			for (int i = 0; i < selectedRows.length; i++) {
				TableRowCore row = selectedRows[i];
				DownloadManager dm = (DownloadManager) row.getDataSource(true);
				if (dm != null) {
					int state = dm.getState();
					boolean bNotRunning = state == DownloadManager.STATE_QUEUED
							|| state == DownloadManager.STATE_STOPPED
							|| state == DownloadManager.STATE_STOPPING
							|| state == DownloadManager.STATE_ERROR;
					if (!bNotRunning) {
						bResume = false;
						break;
					}
				}
			}

			if (bResume) {
				button.setTextID("v3.MainWindow.button.resume");
			} else {
				button.setTextID("v3.MainWindow.button.pause");
			}
		} catch (Exception e) {
			Debug.out(e);
		}