|
Added
Link Here
|
| 1 |
/******************************************************************************* |
| 2 |
* Copyright (c) 2000, 2006 IBM Corporation and others. |
| 3 |
* All rights reserved. This program and the accompanying materials |
| 4 |
* are made available under the terms of the Eclipse Public License v1.0 |
| 5 |
* which accompanies this distribution, and is available at |
| 6 |
* http://www.eclipse.org/legal/epl-v10.html |
| 7 |
* |
| 8 |
* Contributors: |
| 9 |
* IBM Corporation - initial API and implementation |
| 10 |
*******************************************************************************/ |
| 11 |
package org.eclipse.ui.internal.statushandlers; |
| 12 |
|
| 13 |
import java.net.URL; |
| 14 |
import java.util.HashMap; |
| 15 |
import java.util.Iterator; |
| 16 |
import java.util.Map; |
| 17 |
|
| 18 |
import org.eclipse.core.runtime.jobs.Job; |
| 19 |
import org.eclipse.jface.action.IAction; |
| 20 |
import org.eclipse.jface.dialogs.ErrorDialog; |
| 21 |
import org.eclipse.jface.dialogs.IDialogConstants; |
| 22 |
import org.eclipse.jface.dialogs.MessageDialogWithToggle; |
| 23 |
import org.eclipse.jface.preference.IPreferenceStore; |
| 24 |
import org.eclipse.jface.resource.ImageDescriptor; |
| 25 |
import org.eclipse.jface.viewers.IContentProvider; |
| 26 |
import org.eclipse.jface.viewers.ILabelProviderListener; |
| 27 |
import org.eclipse.jface.viewers.ISelection; |
| 28 |
import org.eclipse.jface.viewers.ISelectionChangedListener; |
| 29 |
import org.eclipse.jface.viewers.IStructuredContentProvider; |
| 30 |
import org.eclipse.jface.viewers.IStructuredSelection; |
| 31 |
import org.eclipse.jface.viewers.ITableLabelProvider; |
| 32 |
import org.eclipse.jface.viewers.SelectionChangedEvent; |
| 33 |
import org.eclipse.jface.viewers.StructuredSelection; |
| 34 |
import org.eclipse.jface.viewers.TableViewer; |
| 35 |
import org.eclipse.jface.viewers.Viewer; |
| 36 |
import org.eclipse.jface.viewers.ViewerComparator; |
| 37 |
import org.eclipse.swt.SWT; |
| 38 |
import org.eclipse.swt.events.DisposeListener; |
| 39 |
import org.eclipse.swt.graphics.Image; |
| 40 |
import org.eclipse.swt.graphics.Point; |
| 41 |
import org.eclipse.swt.graphics.Rectangle; |
| 42 |
import org.eclipse.swt.layout.GridData; |
| 43 |
import org.eclipse.swt.widgets.Button; |
| 44 |
import org.eclipse.swt.widgets.Composite; |
| 45 |
import org.eclipse.swt.widgets.Control; |
| 46 |
import org.eclipse.swt.widgets.Display; |
| 47 |
import org.eclipse.swt.widgets.Shell; |
| 48 |
import org.eclipse.ui.internal.WorkbenchPlugin; |
| 49 |
import org.eclipse.ui.internal.progress.ProgressManager; |
| 50 |
import org.eclipse.ui.internal.progress.ProgressManagerUtil; |
| 51 |
import org.eclipse.ui.internal.progress.ProgressMessages; |
| 52 |
import org.eclipse.ui.internal.statushandlers.StatusNotificationManager.StatusInfo; |
| 53 |
import org.eclipse.ui.progress.IProgressConstants; |
| 54 |
|
| 55 |
/** |
| 56 |
* A dialog for displaying |
| 57 |
* |
| 58 |
*/ |
| 59 |
public class StatusDialog extends ErrorDialog { |
| 60 |
|
| 61 |
/* |
| 62 |
* Preference used to indicate whether the user should be prompted to |
| 63 |
* confirm the execution of the job's goto action |
| 64 |
*/ |
| 65 |
private static final String PREF_SKIP_GOTO_ACTION_PROMPT = "pref_skip_goto_action_prompt"; //$NON-NLS-1$ |
| 66 |
|
| 67 |
/* |
| 68 |
* The id of the goto action button |
| 69 |
*/ |
| 70 |
private static final int GOTO_ACTION_ID = IDialogConstants.CLIENT_ID + 1; |
| 71 |
|
| 72 |
private TableViewer statusListViewer; |
| 73 |
|
| 74 |
private StatusInfo selectedStatus; |
| 75 |
|
| 76 |
/** |
| 77 |
* Create a new instance of the receiver. |
| 78 |
* |
| 79 |
* @param parentShell |
| 80 |
* @param title |
| 81 |
* @param msg |
| 82 |
* @param statusInfo |
| 83 |
* @param displayMask |
| 84 |
*/ |
| 85 |
public StatusDialog(Shell parentShell, String title, String msg, |
| 86 |
StatusInfo statusInfo, int displayMask) { |
| 87 |
super(parentShell, (title == null ? statusInfo.getStatus().getMessage() |
| 88 |
: title), msg, statusInfo.getStatus(), displayMask); |
| 89 |
setShellStyle(SWT.RESIZE | SWT.MIN | getShellStyle()); |
| 90 |
this.selectedStatus = statusInfo; |
| 91 |
setBlockOnOpen(false); |
| 92 |
} |
| 93 |
|
| 94 |
/** |
| 95 |
* Method which should be invoked when new errors become available for |
| 96 |
* display |
| 97 |
*/ |
| 98 |
void refresh() { |
| 99 |
|
| 100 |
if (AUTOMATED_MODE) { |
| 101 |
return; |
| 102 |
} |
| 103 |
|
| 104 |
// Do not refresh if we are in the process of |
| 105 |
// opening or shutting down |
| 106 |
if (dialogArea == null || dialogArea.isDisposed()) { |
| 107 |
return; |
| 108 |
} |
| 109 |
|
| 110 |
if (isMultipleStatusDialog()) { |
| 111 |
if (statusListViewer == null) { |
| 112 |
// The job list doesn't exist so create it. |
| 113 |
setMessage(ProgressMessages.JobErrorDialog_MultipleErrorsMessage); |
| 114 |
getShell().setText( |
| 115 |
ProgressMessages.JobErrorDialog_MultipleErrorsTitle); |
| 116 |
createStatusListArea((Composite) dialogArea); |
| 117 |
showDetailsArea(); |
| 118 |
} |
| 119 |
refreshStatusList(); |
| 120 |
} |
| 121 |
updateEnablements(); |
| 122 |
} |
| 123 |
|
| 124 |
/* |
| 125 |
* (non-Javadoc) |
| 126 |
* |
| 127 |
* @see org.eclipse.jface.dialogs.ErrorDialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite) |
| 128 |
*/ |
| 129 |
protected void createButtonsForButtonBar(Composite parent) { |
| 130 |
IAction gotoAction = getGotoAction(); |
| 131 |
String text = null; |
| 132 |
if (gotoAction != null) { |
| 133 |
text = gotoAction.getText(); |
| 134 |
} |
| 135 |
if (text == null) { |
| 136 |
// Text is set to this initiallybut will be changed for active job |
| 137 |
text = ProgressMessages.JobErrorDialog_CustomJobText; |
| 138 |
} |
| 139 |
createButton(parent, GOTO_ACTION_ID, text, false); |
| 140 |
super.createButtonsForButtonBar(parent); |
| 141 |
} |
| 142 |
|
| 143 |
/* |
| 144 |
* Update the button enablements |
| 145 |
*/ |
| 146 |
private void updateEnablements() { |
| 147 |
Button details = getButton(IDialogConstants.DETAILS_ID); |
| 148 |
if (details != null) { |
| 149 |
details.setEnabled(selectedStatus.getStatus().isMultiStatus() |
| 150 |
|| isMultipleStatusDialog()); |
| 151 |
} |
| 152 |
Button gotoButton = getButton(GOTO_ACTION_ID); |
| 153 |
if (gotoButton != null) { |
| 154 |
IAction gotoAction = getGotoAction(); |
| 155 |
boolean hasValidGotoAction = gotoAction != null; |
| 156 |
String text = gotoButton.getText(); |
| 157 |
String newText = null; |
| 158 |
if (hasValidGotoAction) { |
| 159 |
newText = gotoAction.getText(); |
| 160 |
} |
| 161 |
if (newText == null) { |
| 162 |
hasValidGotoAction = false; |
| 163 |
newText = ProgressMessages.JobErrorDialog_CustomJobText; |
| 164 |
} |
| 165 |
if (!newText.equals(text)) { |
| 166 |
gotoButton.setText(newText); |
| 167 |
} |
| 168 |
gotoButton.setEnabled(hasValidGotoAction); |
| 169 |
gotoButton.setVisible(hasValidGotoAction); |
| 170 |
} |
| 171 |
} |
| 172 |
|
| 173 |
/* |
| 174 |
* (non-Javadoc) |
| 175 |
* |
| 176 |
* @see org.eclipse.jface.dialogs.ErrorDialog#buttonPressed(int) |
| 177 |
*/ |
| 178 |
protected void buttonPressed(int id) { |
| 179 |
if (id == GOTO_ACTION_ID) { |
| 180 |
IAction gotoAction = getGotoAction(); |
| 181 |
if (gotoAction != null) { |
| 182 |
if (!isMultipleStatusDialog() || isPromptToClose()) { |
| 183 |
okPressed(); // close the dialog |
| 184 |
gotoAction.run(); // run the goto action |
| 185 |
} |
| 186 |
} |
| 187 |
} |
| 188 |
super.buttonPressed(id); |
| 189 |
} |
| 190 |
|
| 191 |
/* |
| 192 |
* Prompt to inform the user that the dialog will close and the errors |
| 193 |
* cleared. |
| 194 |
*/ |
| 195 |
private boolean isPromptToClose() { |
| 196 |
IPreferenceStore store = WorkbenchPlugin.getDefault() |
| 197 |
.getPreferenceStore(); |
| 198 |
if (!store.contains(PREF_SKIP_GOTO_ACTION_PROMPT) |
| 199 |
|| !store.getString(PREF_SKIP_GOTO_ACTION_PROMPT).equals( |
| 200 |
MessageDialogWithToggle.ALWAYS)) { |
| 201 |
MessageDialogWithToggle dialog = MessageDialogWithToggle |
| 202 |
.openOkCancelConfirm( |
| 203 |
getShell(), |
| 204 |
ProgressMessages.JobErrorDialog_CloseDialogTitle, |
| 205 |
ProgressMessages.JobErrorDialog_CloseDialogMessage, |
| 206 |
ProgressMessages.JobErrorDialog_DoNotShowAgainMessage, |
| 207 |
false, store, PREF_SKIP_GOTO_ACTION_PROMPT); |
| 208 |
return dialog.getReturnCode() == OK; |
| 209 |
} |
| 210 |
return true; |
| 211 |
} |
| 212 |
|
| 213 |
private IAction getGotoAction() { |
| 214 |
|
| 215 |
Object extension = selectedStatus.getExtension(); |
| 216 |
Object property = null; |
| 217 |
|
| 218 |
if (extension != null && extension instanceof Job) { |
| 219 |
property = ((Job) extension) |
| 220 |
.getProperty(IProgressConstants.ACTION_PROPERTY); |
| 221 |
} |
| 222 |
|
| 223 |
if (property instanceof IAction) { |
| 224 |
return (IAction) property; |
| 225 |
} |
| 226 |
return null; |
| 227 |
} |
| 228 |
|
| 229 |
/** |
| 230 |
* This method sets the message in the message label. |
| 231 |
* |
| 232 |
* @param messageString - |
| 233 |
* the String for the message area |
| 234 |
*/ |
| 235 |
private void setMessage(String messageString) { |
| 236 |
// must not set null text in a label |
| 237 |
message = messageString == null ? "" : messageString; //$NON-NLS-1$ |
| 238 |
if (messageLabel == null || messageLabel.isDisposed()) { |
| 239 |
return; |
| 240 |
} |
| 241 |
messageLabel.setText(message); |
| 242 |
} |
| 243 |
|
| 244 |
/** |
| 245 |
* Create an area that allow the user to select one of multiple jobs that |
| 246 |
* have reported errors |
| 247 |
* |
| 248 |
* @param parent - |
| 249 |
* the parent of the area |
| 250 |
*/ |
| 251 |
private void createStatusListArea(Composite parent) { |
| 252 |
// Display a list of jobs that have reported errors |
| 253 |
statusListViewer = new TableViewer(parent, SWT.SINGLE | SWT.H_SCROLL |
| 254 |
| SWT.V_SCROLL | SWT.BORDER); |
| 255 |
statusListViewer.setComparator(getViewerComparator()); |
| 256 |
Control control = statusListViewer.getControl(); |
| 257 |
GridData data = new GridData(GridData.FILL_BOTH |
| 258 |
| GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL); |
| 259 |
data.heightHint = convertHeightInCharsToPixels(10); |
| 260 |
control.setLayoutData(data); |
| 261 |
initContentProvider(); |
| 262 |
initLabelProvider(); |
| 263 |
statusListViewer |
| 264 |
.addSelectionChangedListener(new ISelectionChangedListener() { |
| 265 |
public void selectionChanged(SelectionChangedEvent event) { |
| 266 |
handleSelectionChange(); |
| 267 |
} |
| 268 |
}); |
| 269 |
applyDialogFont(parent); |
| 270 |
} |
| 271 |
|
| 272 |
/* |
| 273 |
* Return whether there are multiple errors to be displayed |
| 274 |
*/ |
| 275 |
private boolean isMultipleStatusDialog() { |
| 276 |
return getManager().getErrors().size() > 1; |
| 277 |
} |
| 278 |
|
| 279 |
/* |
| 280 |
* Get the notificationManager that this is being created for. |
| 281 |
*/ |
| 282 |
private StatusNotificationManager getManager() { |
| 283 |
return StatusNotificationManager.getInstance(); |
| 284 |
} |
| 285 |
|
| 286 |
/** |
| 287 |
* Return the selected error info. |
| 288 |
* |
| 289 |
* @return ErrorInfo |
| 290 |
*/ |
| 291 |
public StatusInfo getSelectedError() { |
| 292 |
return selectedStatus; |
| 293 |
} |
| 294 |
|
| 295 |
/** |
| 296 |
* Return a viewer sorter for looking at the jobs. |
| 297 |
* |
| 298 |
* @return ViewerSorter |
| 299 |
*/ |
| 300 |
private ViewerComparator getViewerComparator() { |
| 301 |
return new ViewerComparator() { |
| 302 |
/* |
| 303 |
* (non-Javadoc) |
| 304 |
* |
| 305 |
* @see org.eclipse.jface.viewers.ViewerComparator#compare(org.eclipse.jface.viewers.Viewer, |
| 306 |
* java.lang.Object, java.lang.Object) |
| 307 |
*/ |
| 308 |
public int compare(Viewer testViewer, Object e1, Object e2) { |
| 309 |
return ((Comparable) e1).compareTo(e2); |
| 310 |
} |
| 311 |
}; |
| 312 |
} |
| 313 |
|
| 314 |
/** |
| 315 |
* Sets the content provider for the viewer. |
| 316 |
*/ |
| 317 |
protected void initContentProvider() { |
| 318 |
IContentProvider provider = new IStructuredContentProvider() { |
| 319 |
/* |
| 320 |
* (non-Javadoc) |
| 321 |
* |
| 322 |
* @see org.eclipse.jface.viewers.IContentProvider#dispose() |
| 323 |
*/ |
| 324 |
public void dispose() { |
| 325 |
// Nothing of interest here |
| 326 |
} |
| 327 |
|
| 328 |
/* |
| 329 |
* (non-Javadoc) |
| 330 |
* |
| 331 |
* @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object) |
| 332 |
*/ |
| 333 |
public Object[] getElements(Object inputElement) { |
| 334 |
return getManager().getErrors().toArray(); |
| 335 |
} |
| 336 |
|
| 337 |
/* |
| 338 |
* (non-Javadoc) |
| 339 |
* |
| 340 |
* @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, |
| 341 |
* java.lang.Object, java.lang.Object) |
| 342 |
*/ |
| 343 |
public void inputChanged(Viewer viewer, Object oldInput, |
| 344 |
Object newInput) { |
| 345 |
if (newInput != null) { |
| 346 |
refreshStatusList(); |
| 347 |
} |
| 348 |
} |
| 349 |
}; |
| 350 |
statusListViewer.setContentProvider(provider); |
| 351 |
statusListViewer.setInput(getManager()); |
| 352 |
statusListViewer.setSelection(new StructuredSelection(selectedStatus)); |
| 353 |
} |
| 354 |
|
| 355 |
/** |
| 356 |
* Refresh the contents of the viewer. |
| 357 |
*/ |
| 358 |
void refreshStatusList() { |
| 359 |
if (statusListViewer != null |
| 360 |
&& !statusListViewer.getControl().isDisposed()) { |
| 361 |
statusListViewer.refresh(); |
| 362 |
Point newSize = getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT); |
| 363 |
getShell().setSize(newSize); |
| 364 |
} |
| 365 |
setStatus(selectedStatus.getStatus()); |
| 366 |
} |
| 367 |
|
| 368 |
private void initLabelProvider() { |
| 369 |
ITableLabelProvider provider = new ITableLabelProvider() { |
| 370 |
Map imageTable = new HashMap(); |
| 371 |
|
| 372 |
/* |
| 373 |
* (non-Javadoc) |
| 374 |
* |
| 375 |
* @see org.eclipse.jface.viewers.IBaseLabelProvider#addListener(org.eclipse.jface.viewers.ILabelProviderListener) |
| 376 |
*/ |
| 377 |
public void addListener(ILabelProviderListener listener) { |
| 378 |
// Do nothing |
| 379 |
} |
| 380 |
|
| 381 |
/* |
| 382 |
* (non-Javadoc) |
| 383 |
* |
| 384 |
* @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose() |
| 385 |
*/ |
| 386 |
public void dispose() { |
| 387 |
if (!imageTable.isEmpty()) { |
| 388 |
for (Iterator iter = imageTable.values().iterator(); iter |
| 389 |
.hasNext();) { |
| 390 |
Image image = (Image) iter.next(); |
| 391 |
image.dispose(); |
| 392 |
} |
| 393 |
} |
| 394 |
} |
| 395 |
|
| 396 |
/* |
| 397 |
* (non-Javadoc) |
| 398 |
* |
| 399 |
* @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object, |
| 400 |
* int) |
| 401 |
*/ |
| 402 |
public Image getColumnImage(Object element, int columnIndex) { |
| 403 |
if (element != null) { |
| 404 |
Object extension = ((StatusInfo) element).getExtension(); |
| 405 |
if (extension != null && extension instanceof Job) { |
| 406 |
return getIcon((Job) extension); |
| 407 |
} |
| 408 |
} |
| 409 |
return null; |
| 410 |
} |
| 411 |
|
| 412 |
/* |
| 413 |
* Get the icon for the job. Code copied from NewProgressViewer |
| 414 |
*/ |
| 415 |
private Image getIcon(Job job) { |
| 416 |
if (job != null) { |
| 417 |
|
| 418 |
Object property = job |
| 419 |
.getProperty(IProgressConstants.ICON_PROPERTY); |
| 420 |
|
| 421 |
// If we already have an image cached, return it |
| 422 |
Image im = (Image) imageTable.get(property); |
| 423 |
if (im != null) { |
| 424 |
return im; |
| 425 |
} |
| 426 |
|
| 427 |
// Create an image from the job's icon property or family |
| 428 |
Display display = getShell().getDisplay(); |
| 429 |
if (property instanceof ImageDescriptor) { |
| 430 |
im = ((ImageDescriptor) property).createImage(display); |
| 431 |
imageTable.put(property, im); // Cache for disposal |
| 432 |
} else if (property instanceof URL) { |
| 433 |
im = ImageDescriptor.createFromURL((URL) property) |
| 434 |
.createImage(display); |
| 435 |
imageTable.put(property, im); // Cache for disposal |
| 436 |
} else { |
| 437 |
im = ProgressManager.getInstance().getIconFor(job); |
| 438 |
// No need to cache since the progress manager will |
| 439 |
} |
| 440 |
return im; |
| 441 |
} |
| 442 |
return null; |
| 443 |
} |
| 444 |
|
| 445 |
/* |
| 446 |
* (non-Javadoc) |
| 447 |
* |
| 448 |
* @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, |
| 449 |
* int) |
| 450 |
*/ |
| 451 |
public String getColumnText(Object element, int columnIndex) { |
| 452 |
return ((StatusInfo) element).getDisplayString(); |
| 453 |
} |
| 454 |
|
| 455 |
/* |
| 456 |
* (non-Javadoc) |
| 457 |
* |
| 458 |
* @see org.eclipse.jface.viewers.IBaseLabelProvider#isLabelProperty(java.lang.Object, |
| 459 |
* java.lang.String) |
| 460 |
*/ |
| 461 |
public boolean isLabelProperty(Object element, String property) { |
| 462 |
return false; |
| 463 |
} |
| 464 |
|
| 465 |
/* |
| 466 |
* (non-Javadoc) |
| 467 |
* |
| 468 |
* @see org.eclipse.jface.viewers.IBaseLabelProvider#removeListener(org.eclipse.jface.viewers.ILabelProviderListener) |
| 469 |
*/ |
| 470 |
public void removeListener(ILabelProviderListener listener) { |
| 471 |
// Do nothing |
| 472 |
} |
| 473 |
}; |
| 474 |
statusListViewer.setLabelProvider(provider); |
| 475 |
} |
| 476 |
|
| 477 |
/** |
| 478 |
* Get the single selection. Return null if the selection is not just one |
| 479 |
* element. |
| 480 |
* |
| 481 |
* @return ErrorInfo or <code>null</code>. |
| 482 |
*/ |
| 483 |
private StatusInfo getSingleSelection() { |
| 484 |
ISelection rawSelection = statusListViewer.getSelection(); |
| 485 |
if (rawSelection != null |
| 486 |
&& rawSelection instanceof IStructuredSelection) { |
| 487 |
IStructuredSelection selection = (IStructuredSelection) rawSelection; |
| 488 |
if (selection.size() == 1) { |
| 489 |
return (StatusInfo) selection.getFirstElement(); |
| 490 |
} |
| 491 |
} |
| 492 |
return null; |
| 493 |
} |
| 494 |
|
| 495 |
public boolean close() { |
| 496 |
Rectangle shellPosition = getShell().getBounds(); |
| 497 |
boolean result = super.close(); |
| 498 |
ProgressManagerUtil.animateDown(shellPosition); |
| 499 |
return result; |
| 500 |
} |
| 501 |
|
| 502 |
/* |
| 503 |
* (non-Javadoc) |
| 504 |
* |
| 505 |
* @see org.eclipse.jface.dialogs.Dialog#initializeBounds() |
| 506 |
*/ |
| 507 |
protected void initializeBounds() { |
| 508 |
// We need to refesh here instead of in createContents |
| 509 |
// because the showDetailsArea requires that the content |
| 510 |
// composite be set |
| 511 |
refresh(); |
| 512 |
super.initializeBounds(); |
| 513 |
Rectangle shellPosition = getShell().getBounds(); |
| 514 |
ProgressManagerUtil.animateUp(shellPosition); |
| 515 |
} |
| 516 |
|
| 517 |
/** |
| 518 |
* The selection in the multiple job list has changed. Update widget |
| 519 |
* enablements and repopulate the list. |
| 520 |
*/ |
| 521 |
void handleSelectionChange() { |
| 522 |
StatusInfo newSelection = getSingleSelection(); |
| 523 |
if (newSelection != null && newSelection != selectedStatus) { |
| 524 |
selectedStatus = newSelection; |
| 525 |
setStatus(selectedStatus.getStatus()); |
| 526 |
updateEnablements(); |
| 527 |
showDetailsArea(); |
| 528 |
} |
| 529 |
} |
| 530 |
|
| 531 |
/* |
| 532 |
* (non-Javadoc) |
| 533 |
* |
| 534 |
* @see org.eclipse.jface.dialogs.ErrorDialog#shouldShowDetailsButton() |
| 535 |
*/ |
| 536 |
protected boolean shouldShowDetailsButton() { |
| 537 |
return true; |
| 538 |
} |
| 539 |
|
| 540 |
/* |
| 541 |
* (non-Javadoc) |
| 542 |
* |
| 543 |
* @see org.eclipse.jface.dialogs.ErrorDialog#configureShell(org.eclipse.swt.widgets.Shell) |
| 544 |
*/ |
| 545 |
protected void configureShell(Shell shell) { |
| 546 |
super.configureShell(shell); |
| 547 |
shell.addDisposeListener(new DisposeListener() { |
| 548 |
/* |
| 549 |
* (non-Javadoc) |
| 550 |
* |
| 551 |
* @see org.eclipse.swt.events.DisposeListener#widgetDisposed(org.eclipse.swt.events.DisposeEvent) |
| 552 |
*/ |
| 553 |
public void widgetDisposed(org.eclipse.swt.events.DisposeEvent e) { |
| 554 |
StatusNotificationManager.getInstance().dialogClosed(); |
| 555 |
} |
| 556 |
|
| 557 |
}); |
| 558 |
} |
| 559 |
|
| 560 |
} |