Wrong source control state in Dynamic View
diff --git a/plugins/org.eclipse.epf.authoring.ui/src/org/eclipse/epf/authoring/ui/actions/NewPluginAction.java b/plugins/org.eclipse.epf.authoring.ui/src/org/eclipse/epf/authoring/ui/actions/NewPluginAction.java
index fe6f0e3..9db81a4 100755
--- a/plugins/org.eclipse.epf.authoring.ui/src/org/eclipse/epf/authoring/ui/actions/NewPluginAction.java
+++ b/plugins/org.eclipse.epf.authoring.ui/src/org/eclipse/epf/authoring/ui/actions/NewPluginAction.java
@@ -42,6 +42,7 @@
  * user selects the Finish button.
  * 
  * @author Kelvin Low
+ * @author Phong Nguyen Le
  * @since 1.0
  */
 public class NewPluginAction extends Action implements
@@ -75,44 +76,13 @@
 	 * @see org.eclipse.ui.IActionDelegate#run(IAction)
 	 */
 	public void run(IAction action) {
-		execute(window.getWorkbench(), null);
+		run();
 	}
 
 	/**
 	 * @see org.eclipse.jface.action.Action#run()
 	 */
 	public void run() {
-		LibraryLockingOperationRunner runner = new LibraryLockingOperationRunner();
-		runner.run(new IRunnableWithProgress() {
-
-			public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
-				execute(PlatformUI.getWorkbench(), null);		
-			}
-			
-		});
-	}
-
-	/**
-	 * @see IWorkbenchWindowActionDelegate#selectionChanged(IAction, ISelection)
-	 */
-	public void selectionChanged(IAction action, ISelection selection) {
-	}
-
-	/**
-	 * @see IWorkbenchWindowActionDelegate#dispose()
-	 */
-	public void dispose() {
-	}
-
-	/**
-	 * Executes the action.
-	 * 
-	 * @param workbench
-	 *            The active workbench.
-	 * @param selection
-	 *            The active selection.
-	 */
-	public static void execute(IWorkbench workbench, ISelection selection) {
 		MethodLibrary targetLib = LibraryService.getInstance().getCurrentMethodLibrary();
 		if (targetLib == null) {
 			AuthoringUIPlugin.getDefault().getMsgDialog().displayError(
@@ -134,12 +104,46 @@
 			return;
 		}
 
+		final IWorkbench workbench = window != null ? 
+				(window.getWorkbench() == null ?  PlatformUI.getWorkbench() : window.getWorkbench())
+				: PlatformUI.getWorkbench(); 
+		LibraryLockingOperationRunner runner = new LibraryLockingOperationRunner();
+		runner.run(new IRunnableWithProgress() {
+
+			public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
+				execute(workbench, null);		
+			}
+			
+		});
+	}
+	
+	/**
+	 * @see IWorkbenchWindowActionDelegate#selectionChanged(IAction, ISelection)
+	 */
+	public void selectionChanged(IAction action, ISelection selection) {
+	}
+
+	/**
+	 * @see IWorkbenchWindowActionDelegate#dispose()
+	 */
+	public void dispose() {
+	}
+
+	/**
+	 * Executes the action.
+	 * 
+	 * @param workbench
+	 *            The active workbench.
+	 * @param selection
+	 *            The active selection.
+	 */
+	public static void execute(IWorkbench workbench, ISelection selection) {
 		NewMethodPluginWizard wizard = new NewMethodPluginWizard();
 		if (selection instanceof IStructuredSelection || selection == null) {
 			wizard.init(workbench, (IStructuredSelection) selection);
 		}
 
-		WizardDialog dialog = new WizardDialog(shell, wizard);
+		WizardDialog dialog = new WizardDialog(Display.getCurrent().getActiveShell(), wizard);
 		dialog.create();
 		dialog.open();
 
diff --git a/plugins/org.eclipse.epf.authoring.ui/src/org/eclipse/epf/authoring/ui/wizards/NewMethodPluginWizard.java b/plugins/org.eclipse.epf.authoring.ui/src/org/eclipse/epf/authoring/ui/wizards/NewMethodPluginWizard.java
index 4f7d50f..2ee5e95 100755
--- a/plugins/org.eclipse.epf.authoring.ui/src/org/eclipse/epf/authoring/ui/wizards/NewMethodPluginWizard.java
+++ b/plugins/org.eclipse.epf.authoring.ui/src/org/eclipse/epf/authoring/ui/wizards/NewMethodPluginWizard.java
@@ -112,13 +112,14 @@
 
 				return true;
 			} catch (Exception e) {
+				String reason = e.getMessage() != null ? e.getMessage() : AuthoringUIResources.newPluginError_reason;
 				AuthoringUIPlugin
 						.getDefault()
 						.getMsgDialog()
 						.displayError(
 								AuthoringUIResources.newPluginWizard_title, //$NON-NLS-1$
 								AuthoringUIResources.newPluginError_msg, //$NON-NLS-1$
-								AuthoringUIResources.newPluginError_reason, //$NON-NLS-1$					
+								reason,
 								e);
 			}
 		}
diff --git a/plugins/org.eclipse.epf.library/src/org/eclipse/epf/library/LibraryServiceException.java b/plugins/org.eclipse.epf.library/src/org/eclipse/epf/library/LibraryServiceException.java
index a2dfe79..acd1b75 100755
--- a/plugins/org.eclipse.epf.library/src/org/eclipse/epf/library/LibraryServiceException.java
+++ b/plugins/org.eclipse.epf.library/src/org/eclipse/epf/library/LibraryServiceException.java
@@ -80,5 +80,18 @@
 	public Throwable getRootCause() {
 		return rootCause;
 	}
-
+	
+	/* (non-Javadoc)
+	 * @see java.lang.Throwable#getMessage()
+	 */
+	public String getMessage() {
+		return errorMsg;
+	}
+	
+	/* (non-Javadoc)
+	 * @see java.lang.Throwable#getCause()
+	 */
+	public Throwable getCause() {
+		return getRootCause();
+	}
 }
\ No newline at end of file