From a39858237c55ed4e28ee40f38edadae4e166c0a9 Mon Sep 17 00:00:00 2001 From: Robert Greene Date: Thu, 6 Mar 2003 13:53:49 +0000 Subject: [PATCH] Finished up progress bar for import operation and centered the window. --- .../ui/swt/DiskExplorerTab.java | 66 ++++++++++++------- 1 file changed, 41 insertions(+), 25 deletions(-) diff --git a/src/com/webcodepro/applecommander/ui/swt/DiskExplorerTab.java b/src/com/webcodepro/applecommander/ui/swt/DiskExplorerTab.java index c45194f..b2c862f 100644 --- a/src/com/webcodepro/applecommander/ui/swt/DiskExplorerTab.java +++ b/src/com/webcodepro/applecommander/ui/swt/DiskExplorerTab.java @@ -66,6 +66,7 @@ import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Menu; import org.eclipse.swt.widgets.MenuItem; import org.eclipse.swt.widgets.MessageBox; +import org.eclipse.swt.widgets.ProgressBar; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Table; import org.eclipse.swt.widgets.TableColumn; @@ -721,34 +722,49 @@ public class DiskExplorerTab { imageManager, directory.getFormattedDisk()); wizard.open(); if (wizard.isWizardCompleted()) { + Shell dialog = null; try { List specs = wizard.getImportSpecifications(); - -// Shell dialog = new Shell(shell, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL); -// dialog.setText("Importing files..."); -// GridLayout layout = new GridLayout(); -// layout.horizontalSpacing = 5; -// layout.makeColumnsEqualWidth = false; -// layout.marginHeight = 5; -// layout.marginWidth = 5; -// layout.numColumns = 2; -// layout.verticalSpacing = 5; -// dialog.setLayout(layout); -// Label label = new Label(dialog, SWT.NONE); -// label.setText("Processing:"); -// Label countLabel = new Label(dialog, SWT.NONE); -// countLabel.setText("0 of " + specs.size()); -// label = new Label(dialog, SWT.NONE); -// label.setText("Filename:"); -// Label nameLabel = new Label(dialog, SWT.NONE); -// dialog.setSize(200,-1); -// dialog.open(); - + // Progress meter for import wizard: + dialog = new Shell(shell, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL); + dialog.setText("Importing files..."); + GridLayout layout = new GridLayout(); + layout.horizontalSpacing = 5; + layout.makeColumnsEqualWidth = false; + layout.marginHeight = 5; + layout.marginWidth = 5; + layout.numColumns = 2; + layout.verticalSpacing = 5; + dialog.setLayout(layout); + Label label = new Label(dialog, SWT.NONE); + label.setText("Processing:"); + Label countLabel = new Label(dialog, SWT.NONE); + GridData gridData = new GridData(); + gridData.widthHint = 300; + countLabel.setLayoutData(gridData); + label = new Label(dialog, SWT.NONE); + label.setText("Filename:"); + Label nameLabel = new Label(dialog, SWT.NONE); + gridData = new GridData(); + gridData.widthHint = 300; + nameLabel.setLayoutData(gridData); + gridData = new GridData(GridData.FILL_HORIZONTAL); + gridData.horizontalSpan = 2; + gridData.grabExcessHorizontalSpace = true; + ProgressBar progressBar = new ProgressBar(dialog, SWT.NONE); + progressBar.setLayoutData(gridData); + progressBar.setMinimum(0); + progressBar.setMaximum(specs.size()); + dialog.pack(); + SwtUtil.center(shell, dialog); + dialog.open(); + // begin the import: for (int i=0; i