Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 238738 | Differences between
and this patch

Collapse All | Expand All

(-)Eclipse UI Tests/org/eclipse/ui/tests/statushandlers/StatusDialogManagerTest.java (+40 lines)
Lines 363-368 Link Here
363
			fail();
363
			fail();
364
		}
364
		}
365
	}
365
	}
366
	
367
	public void testNullInLabelProvider(){
368
		try {
369
			final boolean [] called = new boolean[]{false};
370
			wsdm.setStatusListLabelProvider(new ITableLabelProvider(){
371
372
				public Image getColumnImage(Object element, int columnIndex) {
373
					return null;
374
				}
375
376
				public String getColumnText(Object element, int columnIndex) {
377
					called[0] = true;
378
					// this is important for test
379
					return null;
380
				}
381
382
				public void addListener(ILabelProviderListener listener) {
383
					
384
				}
385
386
				public void dispose() {
387
					
388
				}
389
390
				public boolean isLabelProperty(Object element, String property) {
391
					return false;
392
				}
393
394
				public void removeListener(ILabelProviderListener listener) {
395
					
396
				}
397
				
398
			});
399
			wsdm.addStatusAdapter(createStatusAdapter(MESSAGE_1), true);
400
			assertTrue(called[0]);
401
		} catch (Exception e){
402
			e.printStackTrace();
403
			fail(e.getClass().getName());
404
		}
405
	}
366
406
367
	/**
407
	/**
368
	 * Verifies that correct status adapter is passed to the support area
408
	 * Verifies that correct status adapter is passed to the support area
(-)Eclipse UI/org/eclipse/ui/statushandlers/WorkbenchStatusDialogManager.java (-7 / +3 lines)
Lines 1272-1279 Link Here
1272
		labelLayoutData.widthHint = dialog.convertWidthInCharsToPixels(50);
1272
		labelLayoutData.widthHint = dialog.convertWidthInCharsToPixels(50);
1273
		singleStatusLabel.setLayoutData(labelLayoutData);
1273
		singleStatusLabel.setLayoutData(labelLayoutData);
1274
		// main message set up early, to address bug 222391
1274
		// main message set up early, to address bug 222391
1275
		singleStatusLabel.setText(statusListLabelProvider.getColumnText(
1275
		String message = statusListLabelProvider.getColumnText(
1276
				statusAdapter, 0));
1276
				statusAdapter, 0);
1277
		singleStatusLabel.setText(message != null ? message : ""); //$NON-NLS-1$
1277
1278
1278
		singleStatusLabel.addMouseListener(new MouseListener() {	
1279
		singleStatusLabel.addMouseListener(new MouseListener() {	
1279
			public void mouseDoubleClick(MouseEvent e) {
1280
			public void mouseDoubleClick(MouseEvent e) {
Lines 1924-1934 Link Here
1924
	 * only one error.
1925
	 * only one error.
1925
	 */
1926
	 */
1926
	private void refreshSingleStatusArea() {
1927
	private void refreshSingleStatusArea() {
1927
		String description = statusListLabelProvider.getColumnText(
1928
				statusAdapter, 0);
1929
		if (description.equals(singleStatusLabel.getText()))
1930
			singleStatusLabel.setText(" "); //$NON-NLS-1$
1931
		singleStatusLabel.setText(description);
1932
		singleStatusDisplayArea.layout();
1928
		singleStatusDisplayArea.layout();
1933
		getShell().setText(title);
1929
		getShell().setText(title);
1934
	}
1930
	}

Return to bug 238738