Source:
<code>private void updateActionAvailability() { boolean allowRestore = false; boolean allowDelete = true; boolean allowDeleteAll = true; boolean allowActivate = false; boolean allowDeactivate = false; boolean allowCreateSnapshot = true; boolean allowEditSnapshotSchedule = false; if (getSelectedItems() == null || getSelectedItems().size() == 0) { allowDelete = false; } else { List<GlusterVolumeSnapshotEntity> snapshots = Linq.<GlusterVolumeSnapshotEntity> cast(getSelectedItems()); if (snapshots.size() == 1) { allowRestore = true; allowActivate = snapshots.get(0).getStatus() == GlusterSnapshotStatus.DEACTIVATED; allowDeactivate = snapshots.get(0).getStatus() == GlusterSnapshotStatus.ACTIVATED; } } <START> if (getEntity() == null || getEntity().getStatus() != GlusterStatus.UP) { <END> allowCreateSnapshot = false; } if (getEntity() != null && getEntity().getStatus() == GlusterStatus.UP && getEntity().getSnapshotScheduled()) { allowEditSnapshotSchedule = true; } getRestoreSnapshotCommand().setIsExecutionAllowed(allowRestore); getDeleteSnapshotCommand().setIsExecutionAllowed(allowDelete); getDeleteAllSnapshotsCommand().setIsExecutionAllowed(allowDeleteAll); getActivateSnapshotCommand().setIsExecutionAllowed(allowActivate); getDeactivateSnapshotCommand().setIsExecutionAllowed(allowDeactivate); getCreateSnapshotCommand().setIsExecutionAllowed(allowCreateSnapshot); getEditSnapshotScheduleCommand().setIsExecutionAllowed(allowEditSnapshotSchedule); }</code><technical_language>required as, changes impact instance in VolumeListModel is actual command linked in MainTabVolumeView. Command is a proxy(out of vocabulary of a word ;) ) maintained relieve VolumeListModel of additional code(already bulky :)) ) discussed need explore possibility of uniting(changes in SnapshotListModel relected in VolumeListModel) proxy actual command in VolumeListModel. This is out of scope of this patch considering purpose of this patch. I feel nice in a follow patch</technical_language>

Target:
private void updateActionAvailability() { boolean allowRestore = false; boolean allowDelete = true; boolean allowDeleteAll = true; boolean allowActivate = false; boolean allowDeactivate = false; boolean allowCreateSnapshot = true; boolean allowEditSnapshotSchedule = false; if (getSelectedItems() == null || getSelectedItems().size() == 0) { allowDelete = false; } else { List<GlusterVolumeSnapshotEntity> snapshots = Linq.<GlusterVolumeSnapshotEntity> cast(getSelectedItems()); if (snapshots.size() == 1) { allowRestore = true; allowActivate = snapshots.get(0).getStatus() == GlusterSnapshotStatus.DEACTIVATED; allowDeactivate = snapshots.get(0).getStatus() == GlusterSnapshotStatus.ACTIVATED; } } if (getEntity() == null || getEntity().getStatus() == GlusterStatus.DOWN) { allowCreateSnapshot = false; } if (getEntity() != null && getEntity().getStatus() == GlusterStatus.UP && getEntity().getSnapshotScheduled()) { allowEditSnapshotSchedule = true; } getRestoreSnapshotCommand().setIsExecutionAllowed(allowRestore); getDeleteSnapshotCommand().setIsExecutionAllowed(allowDelete); getDeleteAllSnapshotsCommand().setIsExecutionAllowed(allowDeleteAll); getActivateSnapshotCommand().setIsExecutionAllowed(allowActivate); getDeactivateSnapshotCommand().setIsExecutionAllowed(allowDeactivate); getCreateSnapshotCommand().setIsExecutionAllowed(allowCreateSnapshot); getEditSnapshotScheduleCommand().setIsExecutionAllowed(allowEditSnapshotSchedule); }