Merge branch 'master' of ssh://amergey@git.eclipse.org/gitroot/rap/incubator/org.eclipse.rap.incubator.pde.git
diff --git a/bundles/org.eclipse.rap.pde.runtime/src/org/eclipse/pde/internal/runtime/spy/handlers/MenuSpyHandler.java b/bundles/org.eclipse.rap.pde.runtime/src/org/eclipse/pde/internal/runtime/spy/handlers/MenuSpyHandler.java
index 27ef93c..88b5ec6 100644
--- a/bundles/org.eclipse.rap.pde.runtime/src/org/eclipse/pde/internal/runtime/spy/handlers/MenuSpyHandler.java
+++ b/bundles/org.eclipse.rap.pde.runtime/src/org/eclipse/pde/internal/runtime/spy/handlers/MenuSpyHandler.java
@@ -1,5 +1,5 @@
 /*******************************************************************************

- * Copyright (c) 2009 EclipseSource Corporation and others.

+ * Copyright (c) 2009, 2014 EclipseSource Corporation and others.

  * All rights reserved. This program and the accompanying materials

  * are made available under the terms of the Eclipse Public License v1.0

  * which accompanies this distribution, and is available at

@@ -7,6 +7,7 @@
  *

  * Contributors:

  *     EclipseSource Corporation - initial API and implementation

+ *     Mickael Istria (Red Hat Inc.) - 434317

  *******************************************************************************/

 package org.eclipse.pde.internal.runtime.spy.handlers;

 

@@ -16,10 +17,7 @@
 import org.eclipse.pde.internal.runtime.spy.dialogs.MenuSpyDialog;

 import org.eclipse.swt.SWT;

 import org.eclipse.swt.graphics.Cursor;

-import org.eclipse.swt.widgets.Display;

-import org.eclipse.swt.widgets.Event;

-import org.eclipse.swt.widgets.Listener;

-import org.eclipse.swt.widgets.Shell;

+import org.eclipse.swt.widgets.*;

 import org.eclipse.ui.handlers.HandlerUtil;

 

 

@@ -88,6 +86,13 @@
     }

     if( event.type == SWT.Selection ) {

       Shell shell = display.getActiveShell();

+      if( shell == null ) { // see bug 434317

+        if( event.widget instanceof Menu ) {

+          shell = ( ( Menu )event.widget ).getShell();

+        } else if( event.widget instanceof MenuItem ) {

+          shell = ( ( MenuItem )event.widget ).getParent().getShell();

+        }

+      }

       MenuSpyDialog dialog = new MenuSpyDialog( shell, event, shell.getDisplay()

         .getCursorLocation() );

       INSTANCE = dialog;

diff --git a/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/LogEntry.java b/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/LogEntry.java
index fed5c85..f4d10e9 100644
--- a/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/LogEntry.java
+++ b/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/LogEntry.java
@@ -49,7 +49,15 @@
 	 * @param status an existing status to create a new entry from
 	 */
 	public LogEntry(IStatus status) {
-		processStatus(status);
+		this(status, null);
+	}
+
+	/**
+	 * Constructor - creates a new entry from the given status
+	 * @param status an existing status to create a new entry from
+	 */
+	public LogEntry(IStatus status, LogSession session) {
+		processStatus(status, session);
 	}
 
 	/**
@@ -332,7 +340,7 @@
 	 * Process the given status and sub-statuses to fill this entry
 	 * @param status
 	 */
-	private void processStatus(IStatus status) {
+	private void processStatus(IStatus status, LogSession session) {
 		pluginId = status.getPlugin();
 		severity = status.getSeverity();
 		code = status.getCode();
@@ -340,6 +348,7 @@
 		fDateString = LOCAL_SDF.format(fDate);
 		message = status.getMessage();
 		Throwable throwable = status.getException();
+		this.session = session;
 		if (throwable != null) {
 			StringWriter swriter = new StringWriter();
 			PrintWriter pwriter = new PrintWriter(swriter);
@@ -351,7 +360,7 @@
 		IStatus[] schildren = status.getChildren();
 		if (schildren.length > 0) {
 			for (int i = 0; i < schildren.length; i++) {
-				addChild(new LogEntry(schildren[i]));
+				addChild(new LogEntry(schildren[i], session));
 			}
 		}
 	}
diff --git a/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/LogView.java b/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/LogView.java
index 0540338..b5cb245 100644
--- a/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/LogView.java
+++ b/bundles/org.eclipse.rap.ui.views.log/src/org/eclipse/ui/internal/views/log/LogView.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2014 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -13,6 +13,7 @@
  *     Benjamin Cabe <benjamin.cabe@anyware-tech.com> - bug 218648 
  *     Tuukka Lehtonen <tuukka.lehtonen@semantum.fi>  - bug 247907
  *     Arnaud Mergey <a_mergey@yahoo.fr> 			  - RAP port
+ *     Eike Stepper <stepper@esc-net.de>			  - bug 429372
  *******************************************************************************/
 
 package org.eclipse.ui.internal.views.log;
@@ -1038,24 +1039,13 @@
 	}
 
 	private LogEntry createLogEntry(IStatus status) {
-		LogEntry entry = new LogEntry(status);
-		entry.setSession(currentSession);
+		LogEntry entry = new LogEntry(status, currentSession);
 
 		if (status.getException() instanceof CoreException) {
 			IStatus coreStatus = ((CoreException) status.getException()).getStatus();
 			if (coreStatus != null) {
 				LogEntry childEntry = createLogEntry(coreStatus);
 				entry.addChild(childEntry);
-				childEntry.setSession(currentSession);
-			}
-		}
-
-		if (status.isMultiStatus()) {
-			IStatus[] children = status.getChildren();
-			for (int i = 0; i < children.length; i++) {
-				LogEntry childEntry = createLogEntry(children[i]);
-				entry.addChild(childEntry);
-				childEntry.setSession(currentSession);
 			}
 		}