Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Jastram2012-04-28 18:49:30 +0000
committerMichael Jastram2012-04-28 18:49:30 +0000
commitd04bc132c9d3d8f42f9616f8c7abc8f3efe9f025 (patch)
treecaaa33351a8ed2b0a01a5a7b154826a8f2707e7d
parent9efbbd1e6f1de6fe9508cff8ffc369ce2c83c0a7 (diff)
downloadorg.eclipse.rmf-d04bc132c9d3d8f42f9616f8c7abc8f3efe9f025.tar.gz
org.eclipse.rmf-d04bc132c9d3d8f42f9616f8c7abc8f3efe9f025.tar.xz
org.eclipse.rmf-d04bc132c9d3d8f42f9616f8c7abc8f3efe9f025.zip
Fixed updating of labels in Column Config Dialog
-rw-r--r--org.eclipse.rmf.pror.reqif10.edit/src/org/eclipse/rmf/pror/reqif10/configuration/provider/ProrSpecViewConfigurationItemProvider.java5
-rw-r--r--org.eclipse.rmf.pror.reqif10.tests/tests/org/eclipse/rmf/reqif10/configuration/tests/ColumnTest.java27
2 files changed, 27 insertions, 5 deletions
diff --git a/org.eclipse.rmf.pror.reqif10.edit/src/org/eclipse/rmf/pror/reqif10/configuration/provider/ProrSpecViewConfigurationItemProvider.java b/org.eclipse.rmf.pror.reqif10.edit/src/org/eclipse/rmf/pror/reqif10/configuration/provider/ProrSpecViewConfigurationItemProvider.java
index 44bb5440..a45282b6 100644
--- a/org.eclipse.rmf.pror.reqif10.edit/src/org/eclipse/rmf/pror/reqif10/configuration/provider/ProrSpecViewConfigurationItemProvider.java
+++ b/org.eclipse.rmf.pror.reqif10.edit/src/org/eclipse/rmf/pror/reqif10/configuration/provider/ProrSpecViewConfigurationItemProvider.java
@@ -146,8 +146,9 @@ public class ProrSpecViewConfigurationItemProvider
* This handles model notifications by calling {@link #updateChildren} to update any cached
* children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
* <!-- begin-user-doc -->
+ * Changed triggering of label update as well if columns change.
* <!-- end-user-doc -->
- * @generated
+ * @generated NOT
*/
@Override
public void notifyChanged(Notification notification) {
@@ -158,7 +159,7 @@ public class ProrSpecViewConfigurationItemProvider
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
return;
case ConfigurationPackage.PROR_SPEC_VIEW_CONFIGURATION__COLUMNS:
- fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
+ fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, true));
return;
}
super.notifyChanged(notification);
diff --git a/org.eclipse.rmf.pror.reqif10.tests/tests/org/eclipse/rmf/reqif10/configuration/tests/ColumnTest.java b/org.eclipse.rmf.pror.reqif10.tests/tests/org/eclipse/rmf/reqif10/configuration/tests/ColumnTest.java
index 043af317..f15c6f9b 100644
--- a/org.eclipse.rmf.pror.reqif10.tests/tests/org/eclipse/rmf/reqif10/configuration/tests/ColumnTest.java
+++ b/org.eclipse.rmf.pror.reqif10.tests/tests/org/eclipse/rmf/reqif10/configuration/tests/ColumnTest.java
@@ -11,11 +11,19 @@
package org.eclipse.rmf.reqif10.configuration.tests;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.emf.edit.provider.ViewerNotification;
import org.eclipse.rmf.pror.reqif10.configuration.Column;
import org.eclipse.rmf.pror.reqif10.configuration.ConfigurationFactory;
+import org.eclipse.rmf.pror.reqif10.configuration.ConfigurationPackage;
+import org.eclipse.rmf.pror.reqif10.configuration.ProrSpecViewConfiguration;
import org.eclipse.rmf.pror.reqif10.testframework.AbstractItemProviderTest;
import org.junit.After;
import org.junit.Before;
+import org.junit.Test;
/**
* A test case for the model object '<em><b>Column</b></em>'.
@@ -45,7 +53,7 @@ public class ColumnTest extends AbstractItemProviderTest {
* @see junit.framework.TestCase#setUp()
*/
@Before
- protected void setUp() throws Exception {
+ public void setUp() throws Exception {
setFixture(ConfigurationFactory.eINSTANCE.createColumn());
}
@@ -53,8 +61,21 @@ public class ColumnTest extends AbstractItemProviderTest {
* @see junit.framework.TestCase#tearDown()
*/
@After
- protected void tearDown() throws Exception {
+ public void tearDown() throws Exception {
setFixture(null);
}
-
+
+ @Test
+ public void testLabelNotification() throws Exception {
+ ProrSpecViewConfiguration specViewConfig = ConfigurationFactory.eINSTANCE
+ .createProrSpecViewConfiguration();
+ specViewConfig.getColumns().add(fixture);
+ ItemProviderAdapter itemProvider = getItemProvider(specViewConfig);
+ itemProvider.addListener(listener);
+ setViaCommand(fixture, ConfigurationPackage.Literals.COLUMN__LABEL, "new label");
+ assertEquals(1, notifications.size());
+ assertTrue(notifications.get(0) instanceof ViewerNotification);
+ assertTrue(((ViewerNotification)notifications.get(0)).isLabelUpdate());
+ }
+
} //ColumnTest

Back to the top