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 332482
Collapse All | Expand All

(-)src/org/eclipse/ui/forms/widgets/FormText.java (-5 / +21 lines)
Lines 8-14 Link Here
8
 * Contributors:
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
9
 *     IBM Corporation - initial API and implementation
10
 *     Martin Donnelly (m2a3@eircom.net) - patch (see Bugzilla #145997) 
10
 *     Martin Donnelly (m2a3@eircom.net) - patch (see Bugzilla #145997) 
11
 *     Ling Hao - Fix for Bug 284393
12
 *******************************************************************************/
11
 *******************************************************************************/
13
package org.eclipse.ui.forms.widgets;
12
package org.eclipse.ui.forms.widgets;
14
13
Lines 18-23 Link Here
18
import java.util.Hashtable;
17
import java.util.Hashtable;
19
18
20
import org.eclipse.core.runtime.ListenerList;
19
import org.eclipse.core.runtime.ListenerList;
20
21
import org.eclipse.swt.SWT;
21
import org.eclipse.swt.SWT;
22
import org.eclipse.swt.SWTException;
22
import org.eclipse.swt.SWTException;
23
import org.eclipse.swt.accessibility.ACC;
23
import org.eclipse.swt.accessibility.ACC;
Lines 61-66 Link Here
61
import org.eclipse.swt.widgets.Menu;
61
import org.eclipse.swt.widgets.Menu;
62
import org.eclipse.swt.widgets.MenuItem;
62
import org.eclipse.swt.widgets.MenuItem;
63
import org.eclipse.swt.widgets.TypedListener;
63
import org.eclipse.swt.widgets.TypedListener;
64
64
import org.eclipse.ui.forms.HyperlinkSettings;
65
import org.eclipse.ui.forms.HyperlinkSettings;
65
import org.eclipse.ui.forms.events.HyperlinkEvent;
66
import org.eclipse.ui.forms.events.HyperlinkEvent;
66
import org.eclipse.ui.forms.events.IHyperlinkListener;
67
import org.eclipse.ui.forms.events.IHyperlinkListener;
Lines 363-369 Link Here
363
	 *            the widget style
364
	 *            the widget style
364
	 */
365
	 */
365
	public FormText(Composite parent, int style) {
366
	public FormText(Composite parent, int style) {
366
		super(parent, SWT.DOUBLE_BUFFERED | SWT.WRAP | style);
367
		super(parent, SWT.NO_BACKGROUND | SWT.WRAP | style);
367
		setLayout(new FormTextLayout());
368
		setLayout(new FormTextLayout());
368
		model = new FormTextModel();
369
		model = new FormTextModel();
369
		addDisposeListener(new DisposeListener() {
370
		addDisposeListener(new DisposeListener() {
Lines 1574-1580 Link Here
1574
	}
1575
	}
1575
1576
1576
	private void repaint(GC gc, int x, int y, int width, int height) {
1577
	private void repaint(GC gc, int x, int y, int width, int height) {
1577
		Rectangle repaintRegion = new Rectangle(0, 0, getSize().x, getSize().y);
1578
		Image textBuffer = new Image(getDisplay(), width, height);
1579
		Color bg = getBackground();
1580
		Color fg = getForeground();
1581
		if (!getEnabled()) {
1582
			bg = getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND);
1583
			fg = getDisplay().getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW);
1584
		}
1585
		GC textGC = new GC(textBuffer, gc.getStyle());
1586
		textGC.setForeground(fg);
1587
		textGC.setBackground(bg);
1588
		textGC.setFont(getFont());
1589
		textGC.fillRectangle(0, 0, width, height);
1590
		Rectangle repaintRegion = new Rectangle(x, y, width, height);
1578
1591
1579
		Paragraph[] paragraphs = model.getParagraphs();
1592
		Paragraph[] paragraphs = model.getParagraphs();
1580
		IHyperlinkSegment selectedLink = getSelectedLink();
1593
		IHyperlinkSegment selectedLink = getSelectedLink();
Lines 1583-1593 Link Here
1583
		for (int i = 0; i < paragraphs.length; i++) {
1596
		for (int i = 0; i < paragraphs.length; i++) {
1584
			Paragraph p = paragraphs[i];
1597
			Paragraph p = paragraphs[i];
1585
			p
1598
			p
1586
					.paint(gc, repaintRegion, resourceTable, selectedLink,
1599
					.paint(textGC, repaintRegion, resourceTable, selectedLink,
1587
							selData);
1600
							selData);
1588
		}
1601
		}
1589
		if (hasFocus && !model.hasFocusSegments())
1602
		if (hasFocus && !model.hasFocusSegments())
1590
			gc.drawFocus(x, y, width, height);
1603
			textGC.drawFocus(x, y, width, height);
1604
		textGC.dispose();
1605
		gc.drawImage(textBuffer, x, y);
1606
		textBuffer.dispose();
1591
	}
1607
	}
1592
1608
1593
	private int getParagraphSpacing(int lineHeight) {
1609
	private int getParagraphSpacing(int lineHeight) {
(-)src/org/eclipse/ui/internal/forms/widgets/BulletParagraph.java (-3 / +2 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2010 IBM Corporation and others.
2
 * Copyright (c) 2000, 2005 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 7-13 Link Here
7
 *
7
 *
8
 * Contributors:
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
9
 *     IBM Corporation - initial API and implementation
10
 *     Ling Hao - Fix for Bug 284393
11
 *******************************************************************************/
10
 *******************************************************************************/
12
package org.eclipse.ui.internal.forms.widgets;
11
package org.eclipse.ui.internal.forms.widgets;
13
12
Lines 153-159 Link Here
153
			gc.fillRectangle(x + 1, y, 3, 5);
152
			gc.fillRectangle(x + 1, y, 3, 5);
154
			gc.setBackground(bg);
153
			gc.setBackground(bg);
155
		} else if (style == TEXT && text != null) {
154
		} else if (style == TEXT && text != null) {
156
			gc.drawText(text, x, y, true);
155
			gc.drawText(text, x, y);
157
		} else if (style == IMAGE && text != null) {
156
		} else if (style == IMAGE && text != null) {
158
			Image image = (Image) resourceTable.get(text);
157
			Image image = (Image) resourceTable.get(text);
159
			if (image != null)
158
			if (image != null)
(-)src/org/eclipse/ui/internal/forms/widgets/TextHyperlinkSegment.java (-2 / +1 lines)
Lines 7-13 Link Here
7
 *
7
 *
8
 * Contributors:
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
9
 *     IBM Corporation - initial API and implementation
10
 *     Ling Hao - Fix for Bug 284393
11
 *******************************************************************************/
10
 *******************************************************************************/
12
package org.eclipse.ui.internal.forms.widgets;
11
package org.eclipse.ui.internal.forms.widgets;
13
12
Lines 68-74 Link Here
68
	}
67
	}
69
	
68
	
70
	protected void drawText(GC gc, String s, int clipX, int clipY) {
69
	protected void drawText(GC gc, String s, int clipX, int clipY) {
71
		gc.drawText(s, clipX, clipY, true);
70
		gc.drawText(s, clipX, clipY, false);
72
	}
71
	}
73
72
74
	public String getTooltipText() {
73
	public String getTooltipText() {

Return to bug 332482