summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/ClusterSummaryView.java21
-rw-r--r--src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/GlusterServersSummaryView.java35
-rw-r--r--src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/VolumesSummaryView.java35
3 files changed, 44 insertions, 47 deletions
diff --git a/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/ClusterSummaryView.java b/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/ClusterSummaryView.java
index e84957ec..4e1143d3 100644
--- a/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/ClusterSummaryView.java
+++ b/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/ClusterSummaryView.java
@@ -110,34 +110,29 @@ public class ClusterSummaryView extends ViewPart {
super.alertsGenerated();
guiHelper.clearSection(alertsSection);
populateAlerts();
- alertsSection.layout();
}
@Override
public void taskAdded(TaskInfo taskInfo) {
super.taskAdded(taskInfo);
- super.alertsGenerated();
- guiHelper.clearSection(tasksSection);
- populateTasksSection();
- tasksSection.layout();
+ updateTaskSection();
}
@Override
public void taskRemoved(TaskInfo taskInfo) {
super.taskRemoved(taskInfo);
- super.alertsGenerated();
- guiHelper.clearSection(tasksSection);
- populateTasksSection();
- tasksSection.layout();
+ updateTaskSection();
}
@Override
public void taskUpdated(TaskInfo taskInfo) {
super.taskUpdated(taskInfo);
- super.alertsGenerated();
+ updateTaskSection();
+ }
+
+ private void updateTaskSection() {
guiHelper.clearSection(tasksSection);
populateTasksSection();
- tasksSection.layout();
}
};
GlusterDataModelManager.getInstance().addClusterListener(clusterListener);
@@ -336,6 +331,8 @@ public class ClusterSummaryView extends ViewPart {
for (Alert alert : alerts) {
addAlertLabel(alertsSection, alert);
}
+ alertsSection.layout();
+ form.reflow(true);
}
private void addAlertLabel(Composite section, Alert alert) {
@@ -494,6 +491,8 @@ public class ClusterSummaryView extends ViewPart {
for (TaskInfo taskInfo : cluster.getTaskInfoList()) {
addTaskLabel(tasksSection, taskInfo);
}
+ tasksSection.layout();
+ form.reflow(true);
}
private void addTaskLabel(Composite section, TaskInfo taskInfo) {
diff --git a/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/GlusterServersSummaryView.java b/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/GlusterServersSummaryView.java
index f2cdaab3..3a2ff7e3 100644
--- a/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/GlusterServersSummaryView.java
+++ b/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/GlusterServersSummaryView.java
@@ -22,6 +22,7 @@ package com.gluster.storage.management.gui.views;
import java.util.List;
+import org.eclipse.core.internal.resources.projectvariables.ParentVariableResolver;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CLabel;
import org.eclipse.swt.graphics.Image;
@@ -77,25 +78,24 @@ public class GlusterServersSummaryView extends ViewPart {
@Override
public void serverAdded(GlusterServer server) {
super.serverAdded(server);
- guiHelper.clearSection(serversAvailabilitySection);
- populateAvailabilitySection();
- serversAvailabilitySection.layout();
+ updateServerAvailabilitySection();
}
@Override
public void serverRemoved(GlusterServer server) {
super.serverRemoved(server);
- guiHelper.clearSection(serversAvailabilitySection);
- populateAvailabilitySection();
- serversAvailabilitySection.layout();
+ updateServerAvailabilitySection();
}
@Override
public void serverChanged(GlusterServer server, Event event) {
super.serverChanged(server, event);
+ updateServerAvailabilitySection();
+ }
+
+ private void updateServerAvailabilitySection() {
guiHelper.clearSection(serversAvailabilitySection);
populateAvailabilitySection();
- serversAvailabilitySection.layout();
}
@Override
@@ -103,34 +103,29 @@ public class GlusterServersSummaryView extends ViewPart {
super.alertsGenerated();
guiHelper.clearSection(alertsSection);
populateAlertSection();
- alertsSection.layout();
}
@Override
public void taskAdded(TaskInfo taskInfo) {
super.taskAdded(taskInfo);
- super.alertsGenerated();
- guiHelper.clearSection(tasksSection);
- populateTasksSection();
- tasksSection.layout();
+ updateTasksSection();
}
@Override
public void taskRemoved(TaskInfo taskInfo) {
super.taskRemoved(taskInfo);
- super.alertsGenerated();
- guiHelper.clearSection(tasksSection);
- populateTasksSection();
- tasksSection.layout();
+ updateTasksSection();
}
@Override
public void taskUpdated(TaskInfo taskInfo) {
super.taskUpdated(taskInfo);
- super.alertsGenerated();
+ updateTasksSection();
+ }
+
+ private void updateTasksSection() {
guiHelper.clearSection(tasksSection);
populateTasksSection();
- tasksSection.layout();
}
};
GlusterDataModelManager.getInstance().addClusterListener(clusterListener);
@@ -205,6 +200,8 @@ public class GlusterServersSummaryView extends ViewPart {
addAlertLabel(alertsSection, alert);
}
}
+ alertsSection.pack(true);
+ form.reflow(true);
}
private void addAlertLabel(Composite section, Alert alert) {
@@ -245,6 +242,8 @@ public class GlusterServersSummaryView extends ViewPart {
addTaskLabel(tasksSection, taskInfo);
}
}
+ tasksSection.layout();
+ form.reflow(true);
}
private void addTaskLabel(Composite section, TaskInfo taskInfo) {
diff --git a/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/VolumesSummaryView.java b/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/VolumesSummaryView.java
index 4a0a9d8c..6281e7df 100644
--- a/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/VolumesSummaryView.java
+++ b/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/VolumesSummaryView.java
@@ -90,25 +90,25 @@ public class VolumesSummaryView extends ViewPart {
@Override
public void volumeCreated(Volume volume) {
super.volumeCreated(volume);
- guiHelper.clearSection(summarySection);
- populateSummarySection();
- summarySection.layout();
+ updateSummarySection();
}
@Override
public void volumeDeleted(Volume volume) {
super.volumeDeleted(volume);
- guiHelper.clearSection(summarySection);
- populateSummarySection();
- summarySection.layout();
+ updateSummarySection() ;
}
@Override
public void volumeChanged(Volume volume, Event event) {
super.volumeChanged(volume, event);
+ updateSummarySection();
+ }
+
+ private void updateSummarySection() {
guiHelper.clearSection(summarySection);
populateSummarySection();
- summarySection.layout();
+ summarySection.layout();
}
@Override
@@ -116,34 +116,29 @@ public class VolumesSummaryView extends ViewPart {
super.alertsGenerated();
guiHelper.clearSection(alertsSection);
populateAlertSection();
- alertsSection.layout();
}
@Override
public void taskAdded(TaskInfo taskInfo) {
super.taskAdded(taskInfo);
- super.alertsGenerated();
- guiHelper.clearSection(tasksSection);
- populateTasks();
- tasksSection.layout();
+ updateTasksSection();
}
@Override
public void taskRemoved(TaskInfo taskInfo) {
super.taskRemoved(taskInfo);
- super.alertsGenerated();
- guiHelper.clearSection(tasksSection);
- populateTasks();
- tasksSection.layout();
+ updateTasksSection();
}
@Override
public void taskUpdated(TaskInfo taskInfo) {
super.taskUpdated(taskInfo);
- super.alertsGenerated();
+ updateTasksSection();
+ }
+
+ private void updateTasksSection() {
guiHelper.clearSection(tasksSection);
populateTasks();
- tasksSection.layout();
}
};
GlusterDataModelManager.getInstance().addClusterListener(clusterListener);
@@ -175,6 +170,8 @@ public class VolumesSummaryView extends ViewPart {
addAlertLabel(alertsSection, alert);
}
}
+ alertsSection.pack(true);
+ form.reflow(true);
}
private void addAlertLabel(Composite section, Alert alert) {
@@ -195,6 +192,8 @@ public class VolumesSummaryView extends ViewPart {
if (taskInfo.getType() == TASK_TYPE.BRICK_MIGRATE || taskInfo.getType() == TASK_TYPE.VOLUME_REBALANCE)
addTaskLabel(tasksSection, taskInfo);
}
+ tasksSection.pack(true);
+ form.reflow(true);
}
private void addTaskLabel(Composite section, TaskInfo taskInfo) {