summaryrefslogtreecommitdiffstats
path: root/src/com.gluster.storage.management.console/src
diff options
context:
space:
mode:
Diffstat (limited to 'src/com.gluster.storage.management.console/src')
-rw-r--r--src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/actions/MigrateBrickAction.java6
-rw-r--r--src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/dialogs/MigrateBrickPage1.java16
2 files changed, 15 insertions, 7 deletions
diff --git a/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/actions/MigrateBrickAction.java b/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/actions/MigrateBrickAction.java
index db416c07..a8667c33 100644
--- a/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/actions/MigrateBrickAction.java
+++ b/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/actions/MigrateBrickAction.java
@@ -54,7 +54,11 @@ public class MigrateBrickAction extends AbstractActionDelegate {
action.setEnabled(false);
if (selectedEntity instanceof Brick) {
bricks = GUIHelper.getInstance().getSelectedEntities(getWindow(), Brick.class);
- brick = bricks.iterator().next();
+ if ( bricks.iterator().hasNext()) {
+ brick = bricks.iterator().next();
+ } else {
+ brick = null;
+ }
action.setEnabled(brick != null);
}
}
diff --git a/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/dialogs/MigrateBrickPage1.java b/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/dialogs/MigrateBrickPage1.java
index dfa0b352..e3d9d2bf 100644
--- a/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/dialogs/MigrateBrickPage1.java
+++ b/src/com.gluster.storage.management.console/src/com/gluster/storage/management/console/dialogs/MigrateBrickPage1.java
@@ -147,18 +147,18 @@ public class MigrateBrickPage1 extends WizardPage {
this.volume = volume;
this.fromBrick = brick;
setTitle("Migrate Brick [" + volume.getName() + "]");
- setPageDescription(null, null);
+ setPageDescription(fromBrick.getQualifiedName(), null);
setPageComplete(false);
}
private void setPageDescription(String source, String target) {
- if (source == null || source.equals("")) {
- source = "From Brick";
+ if (source == null) {
+ source = "";
}
- if (target == null || target.equals("")) {
- target = "To Brick";
+ if (target == null) {
+ target = "";
}
- setDescription("Migrate volume data from \"" + source + "\" to \"" + target + "\"");
+ setDescription("Migrate data from \"" + source + "\" to \"" + target + "\"");
}
private Object getSelectedItem(TableViewer tableViewer) {
@@ -194,6 +194,9 @@ public class MigrateBrickPage1 extends WizardPage {
public String getTargetBrickDir() {
Device targetDevice = (Device)getSelectedItem(tableViewerTo);
+ if (targetDevice == null) {
+ return "";
+ }
return targetDevice.getQualifiedBrickName(volume.getName());
}
@@ -290,6 +293,7 @@ public class MigrateBrickPage1 extends WizardPage {
@Override
public void selectionChanged(SelectionChangedEvent event) {
refreshButtonStatus();
+ setPageDescription(getSourceBrickDir(), getTargetBrickDir());
}
});
return tableViewer;