diff options
| author | Dhandapani <dhandapani@gluster.com> | 2011-07-25 21:58:39 +0530 |
|---|---|---|
| committer | Dhandapani <dhandapani@gluster.com> | 2011-07-25 21:58:39 +0530 |
| commit | 2c0409e7809aec2398526cfccbea88528952694d (patch) | |
| tree | 800e6be6f6c02b065215302a9ded07916031ea84 /src/com.gluster.storage.management.gui | |
| parent | 483500a2f159e29a9304a659c327b6be56f44cd3 (diff) | |
| parent | 93cd7eb0184797e8e4a799c763cec3c6648c7382 (diff) | |
Merge branch 'master' of git@github.com:gluster/console
Diffstat (limited to 'src/com.gluster.storage.management.gui')
| -rw-r--r-- | src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/pages/AbstractDisksPage.java | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/pages/AbstractDisksPage.java b/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/pages/AbstractDisksPage.java index a28fd90f..3d77e026 100644 --- a/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/pages/AbstractDisksPage.java +++ b/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/pages/AbstractDisksPage.java @@ -122,6 +122,8 @@ public abstract class AbstractDisksPage extends AbstractTableTreeViewerPage<Disk Device device = null; int rowNum1 = -1; TreeItem item1 = null; + + mainloop: for (int i = 0; i < itemCount; i++) { item1 = tree.getItem(i); @@ -141,8 +143,9 @@ public abstract class AbstractDisksPage extends AbstractTableTreeViewerPage<Disk // this is an uninitialized "partition" rowNum1 = i + j; item1 = partitionItem; - device = (Device) partitionItem.getData(); - break; + device = partition; + // found the uninitialized device. break out. + break mainloop; } } } @@ -174,20 +177,24 @@ public abstract class AbstractDisksPage extends AbstractTableTreeViewerPage<Disk private void setupStatusCellEditor() { final TreeViewer viewer = treeViewer; final Tree tree = viewer.getTree(); - for (int i = 0; i < tree.getItemCount(); i++) { + int rowNum = 0; + for (int i = 0; i < tree.getItemCount(); i++, rowNum++) { final TreeItem item = tree.getItem(i); if (item.isDisposed() || item.getData() == null) { continue; } final Disk disk = (Disk) item.getData(); if (disk.isUninitialized()) { - createInitializeLink(item, i, disk); + createInitializeLink(item, rowNum, disk); } if (disk.hasPartitions()) { - for (Partition partition : disk.getPartitions()) { - if(partition.isUninitialized()) { - createInitializeLink(item, i, partition); + for(int j = 0; j < disk.getPartitions().size(); j++, rowNum++) { + TreeItem partitionItem = item.getItem(j); + // check each partition + Device partition = (Device)partitionItem.getData(); + if (partition.isUninitialized()) { + createInitializeLink(partitionItem, rowNum, partition); } } } |
