jh: fix bug 178457 - Category-based config UI
diff --git a/plugins/org.eclipse.epf.authoring.ui/src/org/eclipse/epf/authoring/ui/forms/ConfigurationPage.java b/plugins/org.eclipse.epf.authoring.ui/src/org/eclipse/epf/authoring/ui/forms/ConfigurationPage.java
index fa75473..77a237e 100755
--- a/plugins/org.eclipse.epf.authoring.ui/src/org/eclipse/epf/authoring/ui/forms/ConfigurationPage.java
+++ b/plugins/org.eclipse.epf.authoring.ui/src/org/eclipse/epf/authoring/ui/forms/ConfigurationPage.java
@@ -37,11 +37,11 @@
 import org.eclipse.epf.authoring.ui.AuthoringUIResources;
 import org.eclipse.epf.authoring.ui.editors.ConfigurationEditor;
 import org.eclipse.epf.authoring.ui.editors.ConfigurationEditorInput;
-import org.eclipse.epf.authoring.ui.providers.CustomCategoryContentProvider;
-import org.eclipse.epf.authoring.ui.providers.CustomCategoryLabelProvider;
-import org.eclipse.epf.authoring.ui.providers.CustomCategoryTreeFilter;
+import org.eclipse.epf.authoring.ui.providers.CategoryContentProvider;
+import org.eclipse.epf.authoring.ui.providers.CategoryLabelProvider;
+import org.eclipse.epf.authoring.ui.providers.CategoryTreeFilter;
 import org.eclipse.epf.authoring.ui.views.ConfigurationViewer;
-import org.eclipse.epf.authoring.ui.views.CustomCategoryTreeViewerWrapper;
+import org.eclipse.epf.authoring.ui.views.CategoryTreeViewerWrapper;
 import org.eclipse.epf.authoring.ui.views.MessageView;
 import org.eclipse.epf.library.ILibraryManager;
 import org.eclipse.epf.library.LibraryService;
@@ -137,13 +137,13 @@
 
 	ISelectionChangedListener selectionChangedListener = null;
 	
-	protected CustomCategoryTreeViewerWrapper addCCViewer;
+	protected CategoryTreeViewerWrapper addCategoryViewer;
 	
-	protected CustomCategoryTreeViewerWrapper subCCViewer;
+	protected CategoryTreeViewerWrapper subCategoryViewer;
 	
-	protected CustomCategoryTreeFilter addCCTreeFilter;
+	protected CategoryTreeFilter addCategoryTreeFilter;
 
-	protected CustomCategoryTreeFilter subCCTreeFilter;
+	protected CategoryTreeFilter subCategoryTreeFilter;
 
 	ScrolledForm form = null;
 
@@ -265,17 +265,17 @@
 	 */
 	public void setInput(Object input) {
 		treeViewer.setInput(input);
-		addCCViewer.setRoot(input);
-		subCCViewer.setRoot(input);
+		addCategoryViewer.setRoot(input);
+		subCategoryViewer.setRoot(input);
 
 		// initially expand the whole tree before updating the tree
 		// this is a workaround for the content provider to build the child -
 		// parent lookup map
 		treeViewer.expandAll();
-		addCCViewer.expandAll();
-		addCCViewer.collapseAll();
-		subCCViewer.expandAll();
-		subCCViewer.collapseAll();
+		addCategoryViewer.expandAll();
+		addCategoryViewer.collapseAll();
+		subCategoryViewer.expandAll();
+		subCategoryViewer.collapseAll();
 
 		// update the tree with the default closure selection
 		updateCheckStates();
@@ -395,9 +395,9 @@
 		toolkit.paintBordersFor(buttonComposite);
 		elemDespContentText.setLayoutData(gd2);
 		
-		// set text widget to CC viewers so they can update description field
-		addCCViewer.setTextWidget(elemDespContentText);
-		subCCViewer.setTextWidget(elemDespContentText);
+		// set text widget to Category viewers so they can update description field
+		addCategoryViewer.setTextWidget(elemDespContentText);
+		subCategoryViewer.setTextWidget(elemDespContentText);
 
 		hideButton.setEnabled(true);
 		hideButton.setVisible(true);
@@ -451,10 +451,10 @@
 		configFilter = new ConfigTreeFilter(closure);
 		treeViewer.addFilter(configFilter);
 		
-		addCCTreeFilter = new CustomCategoryTreeFilter(addCCViewer);
-		addCCViewer.addTreeFilter(addCCTreeFilter);
-		subCCTreeFilter = new CustomCategoryTreeFilter(subCCViewer);
-		subCCViewer.addTreeFilter(subCCTreeFilter);
+		addCategoryTreeFilter = new CategoryTreeFilter(addCategoryViewer);
+		addCategoryViewer.addTreeFilter(addCategoryTreeFilter);
+		subCategoryTreeFilter = new CategoryTreeFilter(subCategoryViewer);
+		subCategoryViewer.addTreeFilter(subCategoryTreeFilter);
 		
 		// show the message view if there is error
 		updateMessage();
@@ -463,15 +463,15 @@
 	private void initializeCCViewers() {
 		// read from config and check the appropriate items in the CC viewers
     	List addCCs = new ArrayList(config.getAddedCategory());
-    	initializeCCViewer(addCCViewer, addCCs);
+    	initializeCCViewer(addCategoryViewer, addCCs);
     	List subCCs = new ArrayList(config.getSubtractedCategory());
-    	initializeCCViewer(subCCViewer, subCCs);
+    	initializeCCViewer(subCategoryViewer, subCCs);
     	
-		addCCViewer.aboutToOpen();
-		subCCViewer.aboutToOpen();
+		addCategoryViewer.aboutToOpen();
+		subCategoryViewer.aboutToOpen();
 	}
 	
-	private void initializeCCViewer(CustomCategoryTreeViewerWrapper viewer, List elements) {
+	private void initializeCCViewer(CategoryTreeViewerWrapper viewer, List elements) {
 		if (!elements.isEmpty())
 			viewer.updateSelections(elements);
 	}
@@ -508,11 +508,11 @@
 			treeViewer.getTree().setLayoutData(gridData);
 		}
 
-		addCCViewer = new CustomCategoryTreeViewerWrapper(sectionClient, 200,
+		addCategoryViewer = new CategoryTreeViewerWrapper(sectionClient, 200,
 				LibraryService.getInstance().getCurrentMethodLibrary(),
-				new CustomCategoryContentProvider(TngAdapterFactory.INSTANCE
+				new CategoryContentProvider(TngAdapterFactory.INSTANCE
 						.getNavigatorView_ComposedAdapterFactory()),
-				new CustomCategoryLabelProvider(TngAdapterFactory.INSTANCE
+				new CategoryLabelProvider(TngAdapterFactory.INSTANCE
 						.getNavigatorView_ComposedAdapterFactory()));
 
 		Label subCCTitleLabel = toolkit.createLabel(sectionClient,
@@ -523,35 +523,35 @@
 			subCCTitleLabel.setLayoutData(gd);
 			gd.horizontalSpan = 1;
 		}
-		subCCViewer = new CustomCategoryTreeViewerWrapper(sectionClient, 200,
+		subCategoryViewer = new CategoryTreeViewerWrapper(sectionClient, 200,
 				LibraryService.getInstance().getCurrentMethodLibrary(),
-				new CustomCategoryContentProvider(TngAdapterFactory.INSTANCE
+				new CategoryContentProvider(TngAdapterFactory.INSTANCE
 						.getNavigatorView_ComposedAdapterFactory()),
-				new CustomCategoryLabelProvider(TngAdapterFactory.INSTANCE
+				new CategoryLabelProvider(TngAdapterFactory.INSTANCE
 						.getNavigatorView_ComposedAdapterFactory()));
 
 		
 		// add listener so the 2 CC viewers are in sync
 		// that is, when an item is checked in one, it is unchecked in the other
-		addCCViewer.addCheckStateListener(new ICheckStateListener() {
+		addCategoryViewer.addCheckStateListener(new ICheckStateListener() {
 			public void checkStateChanged(final CheckStateChangedEvent event) {
 				//Potentially long operation - show a busy cursor
-				BusyIndicator.showWhile(subCCViewer.getTree().getDisplay(), new Runnable() {
+				BusyIndicator.showWhile(subCategoryViewer.getTree().getDisplay(), new Runnable() {
 					public void run() {
 						if (event.getChecked())
-							subCCViewer.selectTreeCheck(event.getElement(), false);
+							subCategoryViewer.selectTreeCheck(event.getElement(), false);
 					}
 				});
 			}
 		});
 
-		subCCViewer.addCheckStateListener(new ICheckStateListener() {
+		subCategoryViewer.addCheckStateListener(new ICheckStateListener() {
 			public void checkStateChanged(final CheckStateChangedEvent event) {
 				//Potentially long operation - show a busy cursor
-				BusyIndicator.showWhile(addCCViewer.getTree().getDisplay(), new Runnable() {
+				BusyIndicator.showWhile(addCategoryViewer.getTree().getDisplay(), new Runnable() {
 					public void run() {
 						if (event.getChecked())
-							addCCViewer.selectTreeCheck(event.getElement(), false);
+							addCategoryViewer.selectTreeCheck(event.getElement(), false);
 					}
 				});
 			}
@@ -738,8 +738,8 @@
 			}
 		};
 		
-		addCCViewer.addCheckStateListener(CCCheckStateListener);
-		subCCViewer.addCheckStateListener(CCCheckStateListener);
+		addCategoryViewer.addCheckStateListener(CCCheckStateListener);
+		subCategoryViewer.addCheckStateListener(CCCheckStateListener);
 
 		// treeViewer.addTreeListener(new ITreeViewerListener(){
 		//
@@ -823,8 +823,8 @@
 
 	protected void showHideElements() {
 		configFilter.setHide();
-		addCCTreeFilter.toggleHideUnchecked();
-		subCCTreeFilter.toggleHideUnchecked();
+		addCategoryTreeFilter.toggleHideUnchecked();
+		subCategoryTreeFilter.toggleHideUnchecked();
 //		initializeCCViewers();
 		refreshViewers();
 		updateCheckStates(); // neded to have this to update the check status
@@ -1622,8 +1622,8 @@
     	List oldAddCCs = new ArrayList(config.getAddedCategory());
     	List oldSubCCs = new ArrayList(config.getSubtractedCategory());
     	
-    	Set<CustomCategory> newAddCCs = addCCViewer.getCheckedCustomCategories();
-    	Set<CustomCategory> newSubCCs = subCCViewer.getCheckedCustomCategories();
+    	Set<CustomCategory> newAddCCs = addCategoryViewer.getCheckedCustomCategories();
+    	Set<CustomCategory> newSubCCs = subCategoryViewer.getCheckedCustomCategories();
     	
     	oldAddCCs.removeAll(newAddCCs);
     	oldSubCCs.removeAll(newSubCCs);
@@ -1795,7 +1795,7 @@
 	
 	private void refreshViewers() {
 		treeViewer.refresh();
-		addCCViewer.refresh();
-		subCCViewer.refresh();
+		addCategoryViewer.refresh();
+		subCategoryViewer.refresh();
 	}
 }
\ No newline at end of file
diff --git a/plugins/org.eclipse.epf.authoring.ui/src/org/eclipse/epf/authoring/ui/providers/CustomCategoryContentProvider.java b/plugins/org.eclipse.epf.authoring.ui/src/org/eclipse/epf/authoring/ui/providers/CategoryContentProvider.java
similarity index 83%
rename from plugins/org.eclipse.epf.authoring.ui/src/org/eclipse/epf/authoring/ui/providers/CustomCategoryContentProvider.java
rename to plugins/org.eclipse.epf.authoring.ui/src/org/eclipse/epf/authoring/ui/providers/CategoryContentProvider.java
index e5dc439..11e0e4e 100755
--- a/plugins/org.eclipse.epf.authoring.ui/src/org/eclipse/epf/authoring/ui/providers/CustomCategoryContentProvider.java
+++ b/plugins/org.eclipse.epf.authoring.ui/src/org/eclipse/epf/authoring/ui/providers/CategoryContentProvider.java
@@ -15,6 +15,7 @@
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.Iterator;
+import java.util.List;
 import java.util.Map;
 
 import org.eclipse.emf.common.notify.AdapterFactory;
@@ -29,10 +30,14 @@
 import org.eclipse.epf.library.edit.util.TngUtil;
 import org.eclipse.epf.library.services.SafeUpdateController;
 import org.eclipse.epf.library.util.LibraryUtil;
+import org.eclipse.epf.uma.ContentCategory;
 import org.eclipse.epf.uma.ContentPackage;
 import org.eclipse.epf.uma.CustomCategory;
+import org.eclipse.epf.uma.Discipline;
 import org.eclipse.epf.uma.MethodLibrary;
 import org.eclipse.epf.uma.MethodPlugin;
+import org.eclipse.epf.uma.RoleSet;
+import org.eclipse.epf.uma.util.AssociationHelper;
 import org.eclipse.jface.viewers.CheckboxTreeViewer;
 import org.eclipse.jface.viewers.Viewer;
 
@@ -42,7 +47,7 @@
  * @author Jeff Hardy
  */
 
-public class CustomCategoryContentProvider extends AdapterFactoryContentProvider {
+public class CategoryContentProvider extends AdapterFactoryContentProvider {
 
 	// there is a problem in the passed in AdapterFactory
 	// it can't find the correct parent from the child
@@ -55,7 +60,7 @@
 	 * Create an instance
 	 * @param adapterFactory
 	 */
-	public CustomCategoryContentProvider(AdapterFactory adapterFactory) {
+	public CategoryContentProvider(AdapterFactory adapterFactory) {
 		super(adapterFactory);
 	}
 
@@ -68,19 +73,20 @@
 			// get root CC of plugin
 			CustomCategory rootCC = (TngUtil.getRootCustomCategory((MethodPlugin)parentElement));
 			children.addAll(Arrays.asList(super.getChildren(rootCC)));
+			children.addAll(TngUtil.getStandardCategories((MethodPlugin)parentElement));
 			children = unwrapFVWIPs(children);
-			children = filterCCElements(children);
+			children = filterCategoryElements(parentElement, children);
 		} else if (parentElement instanceof PluginUIPackagesItemProvider) {
 			children.addAll(Arrays.asList(super.getChildren(parentElement)));
 			children = filterPlugin(children);
-		} else if (parentElement instanceof CustomCategory) {
+		} else if (parentElement instanceof ContentCategory) {
 			children.addAll(Arrays.asList(super.getChildren(parentElement)));
 			children = unwrapFVWIPs(children);
-			children = filterCCElements(children);
+			children = filterCategoryElements(parentElement, children);
 		} else if (parentElement instanceof FeatureValueWrapperItemProvider) {
 			children.addAll(Arrays.asList(super.getChildren(parentElement)));
 			children = unwrapFVWIPs(children);
-			children = filterCCElements(children);
+			children = filterCategoryElements(parentElement, children);
 		} else if (parentElement instanceof MethodLibrary) {
 			children.addAll(Arrays.asList(getElements(parentElement)));
 		}
@@ -117,12 +123,12 @@
 			Object element = iter.next();
 			if (element instanceof MethodPlugin) {
 				// filter out plugins that have no CC's
-				if (!hasCCs((MethodPlugin)element)) {
+				if (!hasCategories((MethodPlugin)element)) {
 					iter.remove();
 				}
 			} else if (element instanceof PluginUIPackagesItemProvider) {
 				// filter out plugin packages that have no plugins with CC's
-				if (!hasCCs((PluginUIPackagesItemProvider)element)) {
+				if (!hasCategories((PluginUIPackagesItemProvider)element)) {
 					iter.remove();
 				}
 			} else if (element instanceof ConfigurationsItemProvider) {
@@ -133,12 +139,23 @@
 		return elements;
 	}
 	
-	private Collection<Object> filterCCElements(Collection<Object> elements) {
+	private Collection<Object> filterCategoryElements(Object parent, Collection<Object> elements) {
 		for (Iterator iter = elements.iterator();iter.hasNext();) {
 			Object element = iter.next();
 			element = TngUtil.unwrap(element);
-			if (!(element instanceof CustomCategory)) {
-				// filter out non CC's
+			if (element instanceof ContentCategory) {
+				// check for groupings
+				if (parent instanceof MethodPlugin && element instanceof Discipline) {
+					if (!AssociationHelper.getDisciplineGroups((Discipline) element).isEmpty()) {
+						iter.remove();
+					} 
+				} else if (parent instanceof MethodPlugin && element instanceof RoleSet) {
+					if (!AssociationHelper.getRoleSetGroups((RoleSet) element).isEmpty()) {
+						iter.remove();
+					} 
+				}
+			} else {
+				// filter out non Categories
 				iter.remove();
 			}
 		}
@@ -152,6 +169,8 @@
 			element = TngUtil.unwrap(element);
 			if (element instanceof CustomCategory) {
 				result.add(getTreeItemForCC((CustomCategory)element));
+			} else if (element instanceof ContentCategory) {
+				result.add(element);
 			}
 		}
 		return result;
@@ -159,28 +178,29 @@
 	}
 
 
-	private boolean hasCCs(MethodPlugin plugin) {
+	private boolean hasCategories(MethodPlugin plugin) {
 		CustomCategory rootCC = TngUtil.getRootCustomCategory(plugin);
 		if (rootCC.getCategorizedElements().isEmpty()) {
-			return false;
-		} else {
-			return true;
+			// check ContentCategories
+			List cats = TngUtil.getStandardCategories(plugin);
+			if (cats.isEmpty()) {
+				return false;
+			}
 		}
+		return true;
 	}
 	
-	private boolean hasCCs(PluginUIPackagesItemProvider pluginPackage) {
+	private boolean hasCategories(PluginUIPackagesItemProvider pluginPackage) {
 		Collection<MethodPlugin> plugins = pluginPackage.getPlugins();
-		boolean hasPluginsWithCCs = false;
+		boolean hasPluginsWithCats = false;
 		for (Iterator<MethodPlugin> pluginIter = plugins.iterator();pluginIter.hasNext();) {
 			MethodPlugin plugin = pluginIter.next();
-			// get root CC of plugin
-			CustomCategory rootCC = (TngUtil.getRootCustomCategory(plugin));
-			if (!rootCC.getCategorizedElements().isEmpty()) {
-				hasPluginsWithCCs = true;
+			if (hasCategories(plugin)) {
+				hasPluginsWithCats = true;
 				break;
 			}
 		}
-		if (hasPluginsWithCCs) {
+		if (hasPluginsWithCats) {
 			return true;
 		} else {
 			return false;
@@ -255,8 +275,8 @@
 			// try to determine parent
 			Object parent = super.getParent(element);
 			if (parent instanceof ContentPackage && 
-					element instanceof CustomCategory) {
-				return LibraryUtil.getMethodPlugin((CustomCategory)element);
+					element instanceof ContentCategory) {
+				return LibraryUtil.getMethodPlugin((ContentCategory)element);
 			} else if (parent instanceof CustomCategory) {
 				parent = getTreeItemForCC((CustomCategory)parent);
 			}
diff --git a/plugins/org.eclipse.epf.authoring.ui/src/org/eclipse/epf/authoring/ui/providers/CustomCategoryLabelProvider.java b/plugins/org.eclipse.epf.authoring.ui/src/org/eclipse/epf/authoring/ui/providers/CategoryLabelProvider.java
similarity index 92%
rename from plugins/org.eclipse.epf.authoring.ui/src/org/eclipse/epf/authoring/ui/providers/CustomCategoryLabelProvider.java
rename to plugins/org.eclipse.epf.authoring.ui/src/org/eclipse/epf/authoring/ui/providers/CategoryLabelProvider.java
index 5c2e047..ac4f674 100755
--- a/plugins/org.eclipse.epf.authoring.ui/src/org/eclipse/epf/authoring/ui/providers/CustomCategoryLabelProvider.java
+++ b/plugins/org.eclipse.epf.authoring.ui/src/org/eclipse/epf/authoring/ui/providers/CategoryLabelProvider.java
@@ -26,13 +26,13 @@
  * @author Jeff Hardy
  */
 
-public class CustomCategoryLabelProvider extends AdapterFactoryLabelProvider {
+public class CategoryLabelProvider extends AdapterFactoryLabelProvider {
 
 	/**
 	 * Creates an instance
 	 * @param contentProvider
 	 */
-	public CustomCategoryLabelProvider(AdapterFactory adapterFactory) {
+	public CategoryLabelProvider(AdapterFactory adapterFactory) {
 		super(adapterFactory);
 	}
 
diff --git a/plugins/org.eclipse.epf.authoring.ui/src/org/eclipse/epf/authoring/ui/providers/CustomCategoryTreeFilter.java b/plugins/org.eclipse.epf.authoring.ui/src/org/eclipse/epf/authoring/ui/providers/CategoryTreeFilter.java
similarity index 83%
rename from plugins/org.eclipse.epf.authoring.ui/src/org/eclipse/epf/authoring/ui/providers/CustomCategoryTreeFilter.java
rename to plugins/org.eclipse.epf.authoring.ui/src/org/eclipse/epf/authoring/ui/providers/CategoryTreeFilter.java
index 0cb547d..93bc1fe 100755
--- a/plugins/org.eclipse.epf.authoring.ui/src/org/eclipse/epf/authoring/ui/providers/CustomCategoryTreeFilter.java
+++ b/plugins/org.eclipse.epf.authoring.ui/src/org/eclipse/epf/authoring/ui/providers/CategoryTreeFilter.java
@@ -12,7 +12,7 @@
 
 import java.util.Set;
 
-import org.eclipse.epf.authoring.ui.views.CustomCategoryTreeViewerWrapper;
+import org.eclipse.epf.authoring.ui.views.CategoryTreeViewerWrapper;
 import org.eclipse.jface.viewers.Viewer;
 import org.eclipse.jface.viewers.ViewerFilter;
 
@@ -21,13 +21,13 @@
  * 
  * @author Jeff Hardy
  */
-public class CustomCategoryTreeFilter extends ViewerFilter {
+public class CategoryTreeFilter extends ViewerFilter {
 	
-	CustomCategoryTreeViewerWrapper CCViewer;
+	CategoryTreeViewerWrapper CCViewer;
 	
 	private boolean hideUnchecked = false;
 	
-	public CustomCategoryTreeFilter(CustomCategoryTreeViewerWrapper CCViewer) {
+	public CategoryTreeFilter(CategoryTreeViewerWrapper CCViewer) {
 		this.CCViewer = CCViewer;
 	}
 
diff --git a/plugins/org.eclipse.epf.authoring.ui/src/org/eclipse/epf/authoring/ui/views/CustomCategoryTreeViewerWrapper.java b/plugins/org.eclipse.epf.authoring.ui/src/org/eclipse/epf/authoring/ui/views/CategoryTreeViewerWrapper.java
similarity index 94%
rename from plugins/org.eclipse.epf.authoring.ui/src/org/eclipse/epf/authoring/ui/views/CustomCategoryTreeViewerWrapper.java
rename to plugins/org.eclipse.epf.authoring.ui/src/org/eclipse/epf/authoring/ui/views/CategoryTreeViewerWrapper.java
index 200efb5..9d00b7a 100755
--- a/plugins/org.eclipse.epf.authoring.ui/src/org/eclipse/epf/authoring/ui/views/CustomCategoryTreeViewerWrapper.java
+++ b/plugins/org.eclipse.epf.authoring.ui/src/org/eclipse/epf/authoring/ui/views/CategoryTreeViewerWrapper.java
@@ -18,7 +18,7 @@
 
 import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;
 import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
-import org.eclipse.epf.authoring.ui.providers.CustomCategoryContentProvider;
+import org.eclipse.epf.authoring.ui.providers.CategoryContentProvider;
 import org.eclipse.epf.library.edit.util.TngUtil;
 import org.eclipse.epf.uma.CustomCategory;
 import org.eclipse.epf.uma.MethodElement;
@@ -34,7 +34,7 @@
  * @author Jeff Hardy
  *
  */
-public class CustomCategoryTreeViewerWrapper extends
+public class CategoryTreeViewerWrapper extends
 		GrayingCheckboxTreeViewerWrapper {
 	
 	protected List<Object> fUserCheckedStateStore= new ArrayList<Object>();
@@ -44,7 +44,7 @@
 	/**
 	 * Creates a new instance.
 	 */
-	public CustomCategoryTreeViewerWrapper(Composite parent, int height,
+	public CategoryTreeViewerWrapper(Composite parent, int height,
 			Object rootObject,
 			AdapterFactoryContentProvider treeContentProvider,
 			AdapterFactoryLabelProvider treeLabelProvider) {
@@ -139,8 +139,8 @@
 	}
 	
 	private Object getTreeItemForCC(CustomCategory cc) {
-		if (fTreeContentProvider instanceof CustomCategoryContentProvider) {
-			return ((CustomCategoryContentProvider)fTreeContentProvider).getTreeItemForCC(cc);
+		if (fTreeContentProvider instanceof CategoryContentProvider) {
+			return ((CategoryContentProvider)fTreeContentProvider).getTreeItemForCC(cc);
 		} else {
 			return cc;
 		}
diff --git a/plugins/org.eclipse.epf.library.edit/src/org/eclipse/epf/library/edit/util/TngUtil.java b/plugins/org.eclipse.epf.library.edit/src/org/eclipse/epf/library/edit/util/TngUtil.java
index d8a4281..051d730 100755
--- a/plugins/org.eclipse.epf.library.edit/src/org/eclipse/epf/library/edit/util/TngUtil.java
+++ b/plugins/org.eclipse.epf.library.edit/src/org/eclipse/epf/library/edit/util/TngUtil.java
@@ -1047,6 +1047,38 @@
 
 		return packages;
 	}
+		
+	public static List<ContentCategory> getStandardCategories(MethodPlugin plugin) {
+		List<ContentCategory> result = new ArrayList<ContentCategory>();
+		List<ContentElement> temp = new ArrayList<ContentElement>();
+		// add disciplines
+		ContentPackage pkg = UmaUtil.findContentPackage(plugin, ModelStructure.DEFAULT.disciplineDefinitionPath);
+		temp.addAll(pkg.getContentElements());
+
+		// add domains
+		pkg = UmaUtil.findContentPackage(plugin, ModelStructure.DEFAULT.domainPath);
+		temp.addAll(pkg.getContentElements());
+
+		// add work product types
+		pkg = UmaUtil.findContentPackage(plugin, ModelStructure.DEFAULT.workProductTypePath);
+		temp.addAll(pkg.getContentElements());
+
+		// add rolesets
+		pkg = UmaUtil.findContentPackage(plugin, ModelStructure.DEFAULT.roleSetPath);
+		temp.addAll(pkg.getContentElements());
+
+		// add tools
+		pkg = UmaUtil.findContentPackage(plugin, ModelStructure.DEFAULT.toolPath);
+		temp.addAll(pkg.getContentElements());
+
+		for (Iterator<ContentElement> iter = temp.iterator(); iter.hasNext();) {
+			ContentElement element = iter.next();
+			if (element instanceof ContentCategory) {
+				result.add((ContentCategory)element);
+			}
+		}
+		return result;
+	}
 
 	public static List getAllProcesses(MethodPlugin plugin) {
 		List processes = new ArrayList();