added option to show subtracted elements
diff --git a/plugins/org.eclipse.epf.library/src/org/eclipse/epf/library/configuration/ConfigurationHelper.java b/plugins/org.eclipse.epf.library/src/org/eclipse/epf/library/configuration/ConfigurationHelper.java
index d765ad2..23fa043 100755
--- a/plugins/org.eclipse.epf.library/src/org/eclipse/epf/library/configuration/ConfigurationHelper.java
+++ b/plugins/org.eclipse.epf.library/src/org/eclipse/epf/library/configuration/ConfigurationHelper.java
@@ -425,6 +425,11 @@
return items;
}
+ public static boolean canShow(MethodElement element,
+ MethodConfiguration config) {
+ return canShow(element,config, true);
+ }
+
/**
* element can't show in the configuration tree if 1. the element is not in
* the configuration 2. the element is a contribution to another element 3.
@@ -436,12 +441,12 @@
* @return boolean
*/
public static boolean canShow(MethodElement element,
- MethodConfiguration config) {
+ MethodConfiguration config, boolean checkSubtracted) {
if (element == null) {
return false;
}
- if (!inConfig(element, config)) {
+ if (!inConfig(element, config, checkSubtracted)) {
return false;
}
@@ -1197,7 +1202,12 @@
// note: don't use the current realizer
// use the default realizer since we need to realize the element in the default way
// 158924 - wrong categories in configuration view
- MethodElement oo = calc01FeatureValue(o, of, new DefaultElementRealizer(config));
+
+ // workaround to allow show/hide subtracted elements
+ DefaultElementRealizer r = new DefaultElementRealizer(config);
+ r.setShowSubtracted(realizer.showSubtracted());
+
+ MethodElement oo = calc01FeatureValue(o, of, r);
if (oo != element) {
values.remove(i);
} else {
diff --git a/plugins/org.eclipse.epf.library/src/org/eclipse/epf/library/configuration/ElementRealizer.java b/plugins/org.eclipse.epf.library/src/org/eclipse/epf/library/configuration/ElementRealizer.java
index 499d593..80bdc47 100755
--- a/plugins/org.eclipse.epf.library/src/org/eclipse/epf/library/configuration/ElementRealizer.java
+++ b/plugins/org.eclipse.epf.library/src/org/eclipse/epf/library/configuration/ElementRealizer.java
@@ -44,6 +44,8 @@
protected IFilter filter = null;
+ private boolean showSubtracted = false;
+
// this is the default setting based on the preference setting
// subclass should implement their own method the get the value
private static boolean defaultEnableExtendReplace = false;
@@ -111,6 +113,14 @@
this.resolveReplacer = resolveReplacer;
}
+ public boolean showSubtracted() {
+ return showSubtracted;
+ }
+
+ public void setShowSubtracted(boolean flag) {
+ this.showSubtracted = flag;
+ }
+
/**
* set a filter for this realizer
* @param filter IFilter
@@ -241,7 +251,7 @@
* @return boolean
*/
public boolean inConfig(MethodElement element) {
- return ConfigurationHelper.inConfig(element, config);
+ return ConfigurationHelper.inConfig(element, config, !showSubtracted());
}
/**
@@ -250,7 +260,7 @@
* @return boolean
*/
public boolean canShow(MethodElement element) {
- return ConfigurationHelper.canShow(element, config);
+ return ConfigurationHelper.canShow(element, config, !showSubtracted());
}
}