diff --git a/src/com/webcodepro/applecommander/ui/swt/DiskInfoTab.java b/src/com/webcodepro/applecommander/ui/swt/DiskInfoTab.java index 0bf9121..a7d48e7 100644 --- a/src/com/webcodepro/applecommander/ui/swt/DiskInfoTab.java +++ b/src/com/webcodepro/applecommander/ui/swt/DiskInfoTab.java @@ -28,6 +28,8 @@ import org.eclipse.swt.SWT; import org.eclipse.swt.custom.CTabFolder; import org.eclipse.swt.custom.CTabItem; import org.eclipse.swt.custom.ScrolledComposite; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.layout.RowLayout; import org.eclipse.swt.widgets.Composite; @@ -43,20 +45,33 @@ import org.eclipse.swt.widgets.TableItem; * @author: Rob Greene */ public class DiskInfoTab { + private Table infoTable; + private Composite composite; + private FormattedDisk[] formattedDisks; /** * Create the DISK INFO tab. */ public DiskInfoTab(CTabFolder tabFolder, FormattedDisk[] disks) { + this.formattedDisks = disks; + CTabItem ctabitem = new CTabItem(tabFolder, SWT.NULL); ctabitem.setText("Disk Info"); + tabFolder.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent event) { + infoTable.removeAll(); + buildDiskInfoTable(formattedDisks[0]); // FIXME! + } + }); + ScrolledComposite scrolledComposite = new ScrolledComposite( tabFolder, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL); scrolledComposite.setExpandHorizontal(true); scrolledComposite.setExpandVertical(true); ctabitem.setControl(scrolledComposite); - Composite composite = new Composite(scrolledComposite, SWT.NONE); + composite = new Composite(scrolledComposite, SWT.NONE); + createDiskInfoTable(); if (disks.length > 1) { RowLayout layout = new RowLayout(SWT.VERTICAL); layout.wrap = false; @@ -64,11 +79,11 @@ public class DiskInfoTab { for (int i=0; i