### Eclipse Workspace Patch 1.0 #P org.eclipse.ui.workbench Index: Eclipse UI/org/eclipse/ui/statushandlers/AbstractStatusHandler.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/statushandlers/AbstractStatusHandler.java,v retrieving revision 1.9 diff -u -r1.9 AbstractStatusHandler.java --- Eclipse UI/org/eclipse/ui/statushandlers/AbstractStatusHandler.java 15 May 2007 12:38:58 -0000 1.9 +++ Eclipse UI/org/eclipse/ui/statushandlers/AbstractStatusHandler.java 27 Feb 2008 14:48:11 -0000 @@ -75,6 +75,9 @@ * @see StatusManager#LOG */ public abstract void handle(StatusAdapter statusAdapter, int style); + + public void handleDeffered() { + } /** * Returns all parameters of the handler. Index: Eclipse UI/org/eclipse/ui/statushandlers/WorkbenchErrorHandler.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/statushandlers/WorkbenchErrorHandler.java,v retrieving revision 1.15 diff -u -r1.15 WorkbenchErrorHandler.java --- Eclipse UI/org/eclipse/ui/statushandlers/WorkbenchErrorHandler.java 25 Feb 2008 13:41:54 -0000 1.15 +++ Eclipse UI/org/eclipse/ui/statushandlers/WorkbenchErrorHandler.java 27 Feb 2008 14:48:11 -0000 @@ -124,4 +124,11 @@ }); } } + + /* (non-Javadoc) + * @see org.eclipse.ui.statushandlers.AbstractStatusHandler#handleDeffered() + */ + public void handleDeffered() { + getStatusDialog().handleDeffered(); + } } Index: Eclipse UI/org/eclipse/ui/statushandlers/WorkbenchStatusDialog.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/statushandlers/WorkbenchStatusDialog.java,v retrieving revision 1.1 diff -u -r1.1 WorkbenchStatusDialog.java --- Eclipse UI/org/eclipse/ui/statushandlers/WorkbenchStatusDialog.java 25 Feb 2008 13:41:54 -0000 1.1 +++ Eclipse UI/org/eclipse/ui/statushandlers/WorkbenchStatusDialog.java 27 Feb 2008 14:48:12 -0000 @@ -521,12 +521,12 @@ return; } + errors.add(statusAdapter); + modals.put(statusAdapter, new Boolean(modal)); // Add the error in the UI thread to ensure thread safety in the // dialog if (dialog == null || dialog.getShell().isDisposed()) { - errors.add(statusAdapter); - modals.put(statusAdapter, new Boolean(modal)); // Delay prompting if the status adapter property is set if (shouldPrompt(statusAdapter)) { executeAsync(new Runnable() { @@ -835,6 +835,9 @@ statusAreaStackLayout = new StackLayout(); statusArea.setLayout(statusAreaStackLayout); singleStatusDisplayArea = createSingleStatusDisplayArea(statusArea); + if(errors.size() > 1){ + multipleStatusDisplayArea = createMultipleStatusesDisplayArea(statusArea); + } } /** @@ -2090,4 +2093,27 @@ this.statusDialog.initializeBounds(); } } + + /** + * + */ + public void handleDeffered() { + if(errors.size() == 0){ + return; + } + executeAsync(new Runnable() { + public void run() { + if (dialog == null) { + dialog = new InternalDialog(getParentShell(), + WorkbenchStatusDialog.this, shouldBeModal()); + setSelectedStatusAdapter((StatusAdapter) errors.toArray()[0]); + dialog.open(); + dialog.getShell().addDisposeListener( + disposeListener); + } + refresh(); + refreshDialogSize(); + } + }); + } } Index: Eclipse UI/org/eclipse/ui/statushandlers/StatusManager.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/statushandlers/StatusManager.java,v retrieving revision 1.23 diff -u -r1.23 StatusManager.java --- Eclipse UI/org/eclipse/ui/statushandlers/StatusManager.java 12 Feb 2008 20:19:48 -0000 1.23 +++ Eclipse UI/org/eclipse/ui/statushandlers/StatusManager.java 27 Feb 2008 14:48:11 -0000 @@ -26,7 +26,6 @@ import org.eclipse.ui.internal.WorkbenchPlugin; import org.eclipse.ui.internal.misc.StatusUtil; import org.eclipse.ui.internal.progress.FinishedJobs; -import org.eclipse.ui.internal.progress.StatusAdapterHelper; import org.eclipse.ui.internal.statushandlers.StatusHandlerRegistry; import org.eclipse.ui.progress.IProgressConstants; @@ -188,7 +187,6 @@ && statusAdapter .getProperty(IProgressConstants.NO_IMMEDIATE_ERROR_PROMPT_PROPERTY) != Boolean.TRUE) { FinishedJobs.getInstance().removeErrorJobs(); - StatusAdapterHelper.getInstance().clear(); } return; } catch (CoreException ex) { @@ -273,6 +271,11 @@ handle(new Status(IStatus.WARNING, pluginId, coreException .getLocalizedMessage(), coreException)); } + + public void handleDeffered(){ + AbstractStatusHandler ash = getWorkbenchHandler(); + ash.handleDeffered(); + } /** * This method informs the StatusManager that this IStatus is being handled Index: Eclipse UI/org/eclipse/ui/internal/WorkbenchErrorHandlerProxy.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchErrorHandlerProxy.java,v retrieving revision 1.8 diff -u -r1.8 WorkbenchErrorHandlerProxy.java --- Eclipse UI/org/eclipse/ui/internal/WorkbenchErrorHandlerProxy.java 16 Mar 2007 18:00:31 -0000 1.8 +++ Eclipse UI/org/eclipse/ui/internal/WorkbenchErrorHandlerProxy.java 27 Feb 2008 14:48:10 -0000 @@ -36,4 +36,13 @@ Workbench.getInstance().getAdvisor().getWorkbenchErrorHandler().handle( statusAdapter, style); } + + /* (non-Javadoc) + * @see org.eclipse.ui.statushandlers.AbstractStatusHandler#handleDeffered() + */ + public void handleDeffered() { + Workbench.getInstance().getAdvisor().getWorkbenchErrorHandler().handleDeffered(); + } + + } Index: Eclipse UI/org/eclipse/ui/internal/progress/ProgressManager.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/ProgressManager.java,v retrieving revision 1.134 diff -u -r1.134 ProgressManager.java --- Eclipse UI/org/eclipse/ui/internal/progress/ProgressManager.java 11 Oct 2007 12:52:32 -0000 1.134 +++ Eclipse UI/org/eclipse/ui/internal/progress/ProgressManager.java 27 Feb 2008 14:48:11 -0000 @@ -442,8 +442,6 @@ .setProperty( IProgressConstants.NO_IMMEDIATE_ERROR_PROMPT_PROPERTY, Boolean.TRUE); - StatusAdapterHelper.getInstance().putStatusAdapter( - info, statusAdapter); } StatusManager.getManager().handle(statusAdapter, Index: Eclipse UI/org/eclipse/ui/internal/progress/ProgressAnimationItem.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/ProgressAnimationItem.java,v retrieving revision 1.53 diff -u -r1.53 ProgressAnimationItem.java --- Eclipse UI/org/eclipse/ui/internal/progress/ProgressAnimationItem.java 11 Feb 2008 14:10:35 -0000 1.53 +++ Eclipse UI/org/eclipse/ui/internal/progress/ProgressAnimationItem.java 27 Feb 2008 14:48:10 -0000 @@ -37,7 +37,6 @@ import org.eclipse.ui.PlatformUI; import org.eclipse.ui.internal.WorkbenchImages; import org.eclipse.ui.progress.IProgressConstants; -import org.eclipse.ui.statushandlers.StatusAdapter; import org.eclipse.ui.statushandlers.StatusManager; /** @@ -99,14 +98,8 @@ IStatus status = job.getResult(); if (status != null && status.getSeverity() == IStatus.ERROR) { - StatusAdapter statusAdapter = StatusAdapterHelper - .getInstance().getStatusAdapter(ji); - if (statusAdapter == null) - statusAdapter = new StatusAdapter(status); - - StatusManager.getManager().handle(statusAdapter, - StatusManager.SHOW); + StatusManager.getManager().handleDeffered(); JobTreeElement topElement = (JobTreeElement) ji .getParent(); @@ -207,14 +200,14 @@ private void initButton(Image im, final String tt) { toolButton.setImage(im); toolButton.setToolTipText(tt); - toolbar.setVisible(true); + toolbar.setVisible(true); toolbar.getParent().layout(); // must layout - - toolbar.getAccessible().addAccessibleListener(new AccessibleAdapter() { - public void getName(AccessibleEvent e) { - e.result = tt; - } - }); + + toolbar.getAccessible().addAccessibleListener(new AccessibleAdapter() { + public void getName(AccessibleEvent e) { + e.result = tt; + } + }); } /* Index: Eclipse UI/org/eclipse/ui/internal/progress/StatusAdapterHelper.java =================================================================== RCS file: Eclipse UI/org/eclipse/ui/internal/progress/StatusAdapterHelper.java diff -N Eclipse UI/org/eclipse/ui/internal/progress/StatusAdapterHelper.java --- Eclipse UI/org/eclipse/ui/internal/progress/StatusAdapterHelper.java 17 May 2007 12:24:34 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,76 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 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 - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - ******************************************************************************/ - -package org.eclipse.ui.internal.progress; - -import java.util.HashMap; - -import org.eclipse.ui.progress.IProgressConstants; -import org.eclipse.ui.statushandlers.StatusAdapter; - -/** - * StatusAdapterHelper is a class for caching {@link StatusAdapter} instances to make sure - * they are not created twice within the progress service. - * @since 3.3 - */ -public class StatusAdapterHelper { - private static StatusAdapterHelper instance; - - private HashMap map; - - private StatusAdapterHelper() { - } - - /** - * Return the singleton. - * @return StatusAdapterHelper - */ - public static StatusAdapterHelper getInstance() { - if (instance == null) { - instance = new StatusAdapterHelper(); - } - return instance; - } - - /** - * Set the {@link StatusAdapter} for the {@link JobInfo} - * @param info - * @param statusAdapter - */ - public void putStatusAdapter(JobInfo info, StatusAdapter statusAdapter) { - if (map == null) { - map = new HashMap(); - } - map.put(info, statusAdapter); - } - - /** - * Return the adapter for this info. - * @param info - * @return - */ - public StatusAdapter getStatusAdapter(JobInfo info) { - if (map == null) { - return null; - } - StatusAdapter statusAdapter = (StatusAdapter) map.remove(info); - statusAdapter.setProperty( - IProgressConstants.NO_IMMEDIATE_ERROR_PROMPT_PROPERTY, - Boolean.FALSE); - return statusAdapter; - } - - public void clear() { - if (map != null) { - map.clear(); - } - } -}