Project: Eclipse_Platform_UI
Bug 58981 [Progress] ErrorNotificationDialog didn't find the detail information
Reported: 2004-04-17 09:41:10 | Status: closed fixed

I didn't find the detail error information for an error in the ErrorNotificationDialog. The support to get at this information is "hidden" in a context menu of the table. The patch below makes the action more easily accessible from a button. Changes: * adds a Show... button to show the currently selected error * adds a Clear button to clear the currently selected error * adds a border around the table. Index: ErrorNotificationDialog.java =================================================================== RCS file: /home/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/ErrorNotificationDialog.java,v retrieving revision 1.4 diff -u -r1.4 ErrorNotificationDialog.java --- ErrorNotificationDialog.java 18 Mar 2004 14:24:59 -0000 1.4 +++ ErrorNotificationDialog.java 17 Apr 2004 13:26:56 -0000 @@ -14,6 +14,7 @@ import org.eclipse.swt.events.DisposeListener; import org.eclipse.swt.events.MouseAdapter; import org.eclipse.swt.events.MouseEvent; +import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.graphics.Image; @@ -21,6 +22,7 @@ import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Menu; import org.eclipse.swt.widgets.Shell; @@ -34,9 +36,11 @@ import org.eclipse.jface.viewers.IContentProvider; import org.eclipse.jface.viewers.ILabelProviderListener; import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.ISelectionChangedListener; import org.eclipse.jface.viewers.IStructuredContentProvider; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.ITableLabelProvider; +import org.eclipse.jface.viewers.SelectionChangedEvent; import org.eclipse.jface.viewers.TableViewer; import org.eclipse.jface.viewers.Viewer; import org.eclipse.jface.viewers.ViewerSorter; @@ -51,6 +55,8 @@ Action clearAllErrorsAction; Action showErrorAction; TableViewer errorViewer; + Button showButton; + private Button clearButton; /** * Create a new instance of the receiver. * @param parentShell @@ -82,7 +88,9 @@ protected Control createDialogArea(Composite parent) { initializeDialogUnits(parent); Composite topArea = (Composite) super.createDialogArea(parent); - errorViewer = new TableViewer(topArea, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL); + Label label= new Label(topArea, SWT.NONE); + label.setText("&Errors:"); + errorViewer = new TableViewer(topArea, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER); errorViewer.setSorter(getViewerSorter()); errorViewer.getControl().addMouseListener(new MouseAdapter() { /* (non-Javadoc) @@ -92,10 +100,17 @@ openErrorDialog(); } }); + errorViewer.addSelectionChangedListener(new ISelectionChangedListener() { + public void selectionChanged(SelectionChangedEvent event) { + boolean enabled= !errorViewer.getSelection ().isEmpty(); + showButton.setEnabled(enabled); + clearButton.setEnabled(enabled); + } + }); Control control = errorViewer.getControl(); GridData data = new GridData(GridData.FILL_BOTH | GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL); - data.widthHint = convertWidthInCharsToPixels(50); + data.widthHint = convertWidthInCharsToPixels(60); data.heightHint = convertHeightInCharsToPixels(10); control.setLayoutData(data); initContentProvider(); @@ -108,6 +123,22 @@ * @see org.eclipse.jface.dialogs.Dialog#createButtonsForButtonBar (org.eclipse.swt.widgets.Composite) */ protected void createButtonsForButtonBar(Composite parent) { + showButton = createButton(parent, IDialogConstants.CLIENT_ID+1, "&Show...", false); + showButton.setEnabled(false); + showButton.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + openErrorDialog(); + } + }); + + clearButton = createButton(parent, IDialogConstants.CLIENT_ID+1, "C&lear", false); + clearButton.setEnabled(false); + clearButton.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + clearSelectionAction.run(); + } + }); + Button button = createButton(parent, IDialogConstants.CLOSE_ID, IDialogConstants.CLOSE_LABEL, true); button.addSelectionListener(new SelectionListener() { @@ -124,6 +155,8 @@ close(); } }); + + } /** * Create the clear all errors action for the receiver.

Files changed in fix:
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/progress/ErrorNotificationDialog.java