Alex: continue work on filter dialog for config-free process
diff --git a/1.5/plugins/org.eclipse.epf.authoring.ui/src/org/eclipse/epf/authoring/ui/AuthoringUIResources.java b/1.5/plugins/org.eclipse.epf.authoring.ui/src/org/eclipse/epf/authoring/ui/AuthoringUIResources.java
index 570b048..c835432 100644
--- a/1.5/plugins/org.eclipse.epf.authoring.ui/src/org/eclipse/epf/authoring/ui/AuthoringUIResources.java
+++ b/1.5/plugins/org.eclipse.epf.authoring.ui/src/org/eclipse/epf/authoring/ui/AuthoringUIResources.java
@@ -1359,6 +1359,12 @@
 	public static String FilterDialog_Process_Scope_Grp_viewBtn;
 	
 	public static String FilterDialog_Process_Scope_Grp_editBtn;
+	
+	public static String PluginListDialog_title;
+	
+	public static String PluginListDialog_button_add;
+	
+	public static String PluginListDialog_button_remove;
 
 	public static String ConfigurationPage_TreeTitleLabel;
 
diff --git a/1.5/plugins/org.eclipse.epf.authoring.ui/src/org/eclipse/epf/authoring/ui/Resources.properties b/1.5/plugins/org.eclipse.epf.authoring.ui/src/org/eclipse/epf/authoring/ui/Resources.properties
index 1e569de..286a67c 100644
--- a/1.5/plugins/org.eclipse.epf.authoring.ui/src/org/eclipse/epf/authoring/ui/Resources.properties
+++ b/1.5/plugins/org.eclipse.epf.authoring.ui/src/org/eclipse/epf/authoring/ui/Resources.properties
@@ -883,6 +883,9 @@
 FilterDialog_Process_Scope_Grp_configBtn=Current selected configuration
 FilterDialog_Process_Scope_Grp_viewBtn=View
 FilterDialog_Process_Scope_Grp_editBtn=Edit
+PluginListDialog_title=Plug-ins
+PluginListDialog_button_add=Add
+PluginListDialog_button_remove=Remove
 ConfigurationPage_TreeTitleLabel=Content:
 ConfigurationPage_LoadingMessage=Loading configuration, please wait ...
 ConfigurationPage_AddCategoriesTitleLabel=Add these Categories:
diff --git a/1.5/plugins/org.eclipse.epf.authoring.ui/src/org/eclipse/epf/authoring/ui/dialogs/ItemsFilterDialog.java b/1.5/plugins/org.eclipse.epf.authoring.ui/src/org/eclipse/epf/authoring/ui/dialogs/ItemsFilterDialog.java
index 16606e5..bc4e780 100644
--- a/1.5/plugins/org.eclipse.epf.authoring.ui/src/org/eclipse/epf/authoring/ui/dialogs/ItemsFilterDialog.java
+++ b/1.5/plugins/org.eclipse.epf.authoring.ui/src/org/eclipse/epf/authoring/ui/dialogs/ItemsFilterDialog.java
@@ -131,6 +131,8 @@
 	
 	private AbstractSection section;
 	
+	private Process configFreeProcess;
+	
 	/*
 	 * Treeviewer for ContentElements to display.
 	 */
@@ -1037,12 +1039,12 @@
 			});
 			viewBtn.addSelectionListener(new SelectionAdapter() {
 				public void widgetSelected(SelectionEvent e) {
-				
+					showPluginListDialog(true);
 				}
 			});
 			editBtn.addSelectionListener(new SelectionAdapter() {
 				public void widgetSelected(SelectionEvent e) {
-				
+					showPluginListDialog(false);
 				}
 			});
 		}
@@ -1257,6 +1259,9 @@
 			} else if (inputElement instanceof BreakdownElement) {
 				Process process = getProcess((BreakdownElement)inputElement);
 				result = processUtil.isConfigFree(process);
+				if (result) {
+					configFreeProcess = process;
+				}
 			}			
 		}	
 		
@@ -1322,4 +1327,17 @@
 		}	
 	}
 	
+	private void showPluginListDialog(boolean readOnly) {
+		List methodPlugins = processUtil.getScope(configFreeProcess).getMethodPluginSelection();
+		PluginListDialog dialog = new PluginListDialog(this.getShell(), readOnly, methodPlugins);
+		dialog.open();
+		
+		
+		
+		
+		
+		
+		
+	}
+	
 }
diff --git a/1.5/plugins/org.eclipse.epf.authoring.ui/src/org/eclipse/epf/authoring/ui/dialogs/PluginListDialog.java b/1.5/plugins/org.eclipse.epf.authoring.ui/src/org/eclipse/epf/authoring/ui/dialogs/PluginListDialog.java
new file mode 100644
index 0000000..a6fe09e
--- /dev/null
+++ b/1.5/plugins/org.eclipse.epf.authoring.ui/src/org/eclipse/epf/authoring/ui/dialogs/PluginListDialog.java
@@ -0,0 +1,124 @@
+/*******************************************************************************
+* Licensed Materials - Property of IBM
+* (c) Copyright IBM Corporation 2007,2009. All Rights Reserved.
+*
+* Note to U.S. Government Users Restricted Rights:
+* Use, duplication or disclosure restricted by GSA ADP Schedule
+* Contract with IBM Corp. 
+*******************************************************************************/
+
+/**
+ * @author achen
+ */
+package org.eclipse.epf.authoring.ui.dialogs;
+
+import java.util.List;
+
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
+import org.eclipse.epf.authoring.ui.AuthoringUIResources;
+import org.eclipse.epf.library.edit.TngAdapterFactory;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Shell;
+
+
+public class PluginListDialog extends Dialog {
+	private boolean readOnly;
+	private List methodPlugins;
+	
+	private TreeViewer viewer;
+	private ComposedAdapterFactory adapterFactory = TngAdapterFactory.INSTANCE.createLibraryComposedAdapterFactory();
+	private ITreeContentProvider pluginsContentProvider = new PluginListContentProvider();
+	private AdapterFactoryLabelProvider pluginsLabelProvider = new AdapterFactoryLabelProvider(adapterFactory);
+	private Button addBtn;
+	private Button removeBtn;
+	
+	public PluginListDialog(Shell shell, boolean readOnly, List methodPlugins) {
+		super(shell);
+		this.readOnly = readOnly;
+		this.methodPlugins = methodPlugins;
+	}
+	
+	protected void configureShell(Shell shell) {
+		super.configureShell(shell);
+		shell.setText(AuthoringUIResources.PluginListDialog_title);
+	}
+	
+	protected Control createDialogArea(Composite parent) {
+		Composite composite = (Composite) super.createDialogArea(parent);
+		GridLayout layout = (GridLayout) composite.getLayout();
+		layout.numColumns = 2;
+		
+		Composite viewComp = new Composite(composite, SWT.NONE);
+		viewComp.setLayoutData(new GridData(GridData.FILL_BOTH));
+		viewComp.setLayout(new GridLayout());
+		viewer = new TreeViewer(viewComp, SWT.SINGLE | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
+		viewer.setLabelProvider(pluginsLabelProvider);
+		viewer.setContentProvider(pluginsContentProvider);
+		GridData viewerGd = new GridData(GridData.FILL_BOTH);
+		viewerGd.heightHint = 250;
+		viewerGd.widthHint = 200;
+		viewer.getTree().setLayoutData(viewerGd);
+				
+		Composite btnComp = new Composite(composite, SWT.NONE);
+		btnComp.setLayoutData(new GridData(GridData.FILL_BOTH));
+		btnComp.setLayout(new GridLayout());
+		addBtn = new Button(btnComp, SWT.PUSH);
+		addBtn.setText(AuthoringUIResources.PluginListDialog_button_add);
+		addBtn.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+		removeBtn = new Button(btnComp, SWT.PUSH);
+		removeBtn.setText(AuthoringUIResources.PluginListDialog_button_remove);
+		removeBtn.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+		
+		updateControls();
+		
+		return composite;
+	}
+	
+	protected void updateControls() {
+		if (readOnly) {
+			viewer.setInput(methodPlugins);
+			viewer.refresh();
+			addBtn.setEnabled(false);
+			removeBtn.setEnabled(false);
+		}
+	}
+	
+	private class PluginListContentProvider implements ITreeContentProvider {
+		public Object[] getChildren(Object parentElement) {
+			return null;
+		}
+
+		public Object getParent(Object element) {
+			return null;
+		}
+
+		public boolean hasChildren(Object element) {
+			return false;
+		}
+
+		public Object[] getElements(Object inputElement) {
+			if (inputElement instanceof List) {
+				return ((List)inputElement).toArray();
+			}
+			
+			return new Object[0];
+		}
+
+		public void dispose() {			
+		}
+		
+		public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {			
+		}	
+	}
+
+}
diff --git a/1.5/plugins/org.eclipse.epf.library.edit/src/org/eclipse/epf/library/edit/LibraryEditResources.java b/1.5/plugins/org.eclipse.epf.library.edit/src/org/eclipse/epf/library/edit/LibraryEditResources.java
index 0201d1c..06f2a71 100644
--- a/1.5/plugins/org.eclipse.epf.library.edit/src/org/eclipse/epf/library/edit/LibraryEditResources.java
+++ b/1.5/plugins/org.eclipse.epf.library.edit/src/org/eclipse/epf/library/edit/LibraryEditResources.java
@@ -417,6 +417,8 @@
 	
 	public static String scope_defualtName;
 	
+	public static String scope_PluginsName;
+	
 	public static String WorkOrderTypeAbbreviation_FINISH_TO_START;
 	public static String WorkOrderTypeAbbreviation_FINISH_TO_FINISH;
 	public static String WorkOrderTypeAbbreviation_START_TO_FINISH;
diff --git a/1.5/plugins/org.eclipse.epf.library.edit/src/org/eclipse/epf/library/edit/Resources.properties b/1.5/plugins/org.eclipse.epf.library.edit/src/org/eclipse/epf/library/edit/Resources.properties
index 5bfd701..4dae67c 100644
--- a/1.5/plugins/org.eclipse.epf.library.edit/src/org/eclipse/epf/library/edit/Resources.properties
+++ b/1.5/plugins/org.eclipse.epf.library.edit/src/org/eclipse/epf/library/edit/Resources.properties
@@ -110,6 +110,7 @@
 savingFileTask_name=Saving file ''{0}''...
 savingResources_msg=Saving resources
 scope_defualtName=-- None --
+scope_PluginsName=Selected plug-ins
 
 # UI Text
 element_text=element
diff --git a/1.5/plugins/org.eclipse.epf.library.edit/src/org/eclipse/epf/library/edit/process/command/CreateProcessComponentCommand.java b/1.5/plugins/org.eclipse.epf.library.edit/src/org/eclipse/epf/library/edit/process/command/CreateProcessComponentCommand.java
index f4a0bbe..f49760b 100644
--- a/1.5/plugins/org.eclipse.epf.library.edit/src/org/eclipse/epf/library/edit/process/command/CreateProcessComponentCommand.java
+++ b/1.5/plugins/org.eclipse.epf.library.edit/src/org/eclipse/epf/library/edit/process/command/CreateProcessComponentCommand.java
@@ -146,7 +146,7 @@
 		List configs = lib.getPredefinedConfigurations();
 		List methodConfigs = new ArrayList();
 		
-		Scope scope = ScopeFactory.getInstance().newProcessScope();
+		Scope scope = ScopeFactory.getInstance().newProcessScope(null);
 		methodConfigs.add(scope);
 		
 		for (Iterator iter = configs.iterator(); iter.hasNext();) {
diff --git a/1.5/plugins/org.eclipse.epf.library.edit/src/org/eclipse/epf/library/edit/uma/ScopeFactory.java b/1.5/plugins/org.eclipse.epf.library.edit/src/org/eclipse/epf/library/edit/uma/ScopeFactory.java
index 5a79ec4..c541ad9 100644
--- a/1.5/plugins/org.eclipse.epf.library.edit/src/org/eclipse/epf/library/edit/uma/ScopeFactory.java
+++ b/1.5/plugins/org.eclipse.epf.library.edit/src/org/eclipse/epf/library/edit/uma/ScopeFactory.java
@@ -2,6 +2,7 @@
 
 import org.eclipse.epf.library.edit.uma.impl.LibraryScopeImpl;
 import org.eclipse.epf.library.edit.uma.impl.ScopeImpl;
+import org.eclipse.epf.library.edit.util.LibraryEditUtil;
 import org.eclipse.epf.uma.Process;
 
 public class ScopeFactory {
@@ -14,12 +15,21 @@
 	private ScopeFactory() {		
 	}
 	
-	public Scope newProcessScope() {
-		return new ScopeImpl();
+	public Scope newProcessScope(String name) {
+		Scope scope = new ScopeImpl(); 
+		
+		if (name != null) {
+			scope.setName(name);
+		}
+		
+		return scope;
 	}
 	
 	public Scope newLibraryScope() {
-		return new LibraryScopeImpl();
+		Scope libScope = new LibraryScopeImpl();
+		libScope.setName(LibraryEditUtil.getInstance().getCurrentMethodLibrary().getName());
+		
+		return libScope;
 	}
 	
 }
diff --git a/1.5/plugins/org.eclipse.epf.library.edit/src/org/eclipse/epf/library/edit/util/ProcessScopeUtil.java b/1.5/plugins/org.eclipse.epf.library.edit/src/org/eclipse/epf/library/edit/util/ProcessScopeUtil.java
index fd2a11c..31f4de5 100644
--- a/1.5/plugins/org.eclipse.epf.library.edit/src/org/eclipse/epf/library/edit/util/ProcessScopeUtil.java
+++ b/1.5/plugins/org.eclipse.epf.library.edit/src/org/eclipse/epf/library/edit/util/ProcessScopeUtil.java
@@ -6,6 +6,7 @@
 
 import org.eclipse.emf.ecore.EReference;
 import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.epf.library.edit.LibraryEditResources;
 import org.eclipse.epf.library.edit.uma.Scope;
 import org.eclipse.epf.library.edit.uma.ScopeFactory;
 import org.eclipse.epf.uma.ContentElement;
@@ -20,7 +21,7 @@
 	private static ProcessScopeUtil instance = new ProcessScopeUtil();
 	
 	private Scope libraryScope = ScopeFactory.getInstance().newLibraryScope();
-	private Scope pluginScope = ScopeFactory.getInstance().newProcessScope();
+	private Scope pluginScope = ScopeFactory.getInstance().newProcessScope(LibraryEditResources.scope_PluginsName);
 
 	private Set<Scope> scopeInEditdSet = new HashSet<Scope>();
 
@@ -60,7 +61,7 @@
 			return scope;
 		}
 			
-		scope =	ScopeFactory.getInstance().newProcessScope();
+		scope =	ScopeFactory.getInstance().newProcessScope(null);
 
 		addReferenceToScope(scope, proc, new HashSet<MethodElement>());
 		proc.setDefaultContext(scope);
@@ -151,8 +152,9 @@
 			if (!same) {
 				oldPlugins.clear();
 				oldPlugins.addAll(newPlugins);
-			}
+			}			
 		}
+		
 		return libraryScope;
 	}
 	
@@ -162,10 +164,14 @@
 	
 	public void beginProcessEdit(Scope scope) {
 		scopeInEditdSet.add(scope);
+		scopeInEditdSet.add(libraryScope);
+		scopeInEditdSet.add(pluginScope);
 	}
 	
 	public void endProcesEdit(Scope scope) {
 		scopeInEditdSet.remove(scope);
+		scopeInEditdSet.remove(libraryScope);
+		scopeInEditdSet.remove(pluginScope);
 	}
 
 	public Set<Scope> getScopeInEditdSet() {
diff --git a/1.5/releng/maps/epf_en.map b/1.5/releng/maps/epf_en.map
index 5b442e2..c26ec16 100644
--- a/1.5/releng/maps/epf_en.map
+++ b/1.5/releng/maps/epf_en.map
@@ -8,7 +8,7 @@
 feature@org.eclipse.epf.rte.feature=v20090824-2116,:pserver:anonymous@dev.eclipse.org:/cvsroot/technology,,org.eclipse.epf/composer/1.5/features/org.eclipse.epf.rte.feature
 feature@org.eclipse.epf.product.feature=v20090805-1616,:pserver:anonymous@dev.eclipse.org:/cvsroot/technology,,org.eclipse.epf/composer/1.5/features/org.eclipse.epf.product.feature
 feature@org.eclipse.epf.product.win32.feature=v20080820-1636,:pserver:anonymous@dev.eclipse.org:/cvsroot/technology,,org.eclipse.epf/composer/1.5/features/org.eclipse.epf.product.win32.feature
-plugin@org.eclipse.epf.authoring.ui=v20100422-1824,:pserver:anonymous@dev.eclipse.org:/cvsroot/technology,,org.eclipse.epf/composer/1.5/plugins/org.eclipse.epf.authoring.ui
+plugin@org.eclipse.epf.authoring.ui=v20100423-1811,:pserver:anonymous@dev.eclipse.org:/cvsroot/technology,,org.eclipse.epf/composer/1.5/plugins/org.eclipse.epf.authoring.ui
 plugin@org.eclipse.epf.base=v20090903-1438,:pserver:anonymous@dev.eclipse.org:/cvsroot/technology,,org.eclipse.epf/composer/1.5/plugins/org.eclipse.epf.base
 plugin@org.eclipse.epf.common=v20100421-1828,:pserver:anonymous@dev.eclipse.org:/cvsroot/technology,,org.eclipse.epf/composer/1.5/plugins/org.eclipse.epf.common
 plugin@org.eclipse.epf.common.html=v20090824-1457,:pserver:anonymous@dev.eclipse.org:/cvsroot/technology,,org.eclipse.epf/composer/1.5/plugins/org.eclipse.epf.common.html
@@ -32,7 +32,7 @@
 plugin@org.eclipse.epf.import=v20100420-1547,:pserver:anonymous@dev.eclipse.org:/cvsroot/technology,,org.eclipse.epf/composer/1.5/plugins/org.eclipse.epf.import
 plugin@org.eclipse.epf.import.xml=v20100407-1346,:pserver:anonymous@dev.eclipse.org:/cvsroot/technology,,org.eclipse.epf/composer/1.5/plugins/org.eclipse.epf.import.xml
 plugin@org.eclipse.epf.library=v20100422-1810,:pserver:anonymous@dev.eclipse.org:/cvsroot/technology,,org.eclipse.epf/composer/1.5/plugins/org.eclipse.epf.library
-plugin@org.eclipse.epf.library.edit=v20100422-1842,:pserver:anonymous@dev.eclipse.org:/cvsroot/technology,,org.eclipse.epf/composer/1.5/plugins/org.eclipse.epf.library.edit
+plugin@org.eclipse.epf.library.edit=v20100423-1811,:pserver:anonymous@dev.eclipse.org:/cvsroot/technology,,org.eclipse.epf/composer/1.5/plugins/org.eclipse.epf.library.edit
 plugin@org.eclipse.epf.library.edit.ui=v20090827-1350,:pserver:anonymous@dev.eclipse.org:/cvsroot/technology,,org.eclipse.epf/composer/1.5/plugins/org.eclipse.epf.library.edit.ui
 plugin@org.eclipse.epf.library.persistence=v20100413-1815,:pserver:anonymous@dev.eclipse.org:/cvsroot/technology,,org.eclipse.epf/composer/1.5/plugins/org.eclipse.epf.library.persistence
 plugin@org.eclipse.epf.library.ui=v20100330-1346,:pserver:anonymous@dev.eclipse.org:/cvsroot/technology,,org.eclipse.epf/composer/1.5/plugins/org.eclipse.epf.library.ui