Skip to content

Commit 885a4e7

Browse files
committed
Update Color constructors to remove deprecated Device parameter and remove unused imports
1 parent 4808f71 commit 885a4e7

File tree

6 files changed

+7
-10
lines changed

6 files changed

+7
-10
lines changed

e4tools/bundles/org.eclipse.e4.tools.services/src/org/eclipse/e4/tools/services/BasicResourceProvider.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import org.eclipse.swt.graphics.Color;
1010
import org.eclipse.swt.graphics.Font;
1111
import org.eclipse.swt.graphics.Image;
12-
import org.eclipse.swt.graphics.RGB;
1312
import org.eclipse.swt.widgets.Display;
1413
import org.osgi.framework.BundleContext;
1514

@@ -53,7 +52,7 @@ public Color getColor(Display display, String key) {
5352
final int r = Integer.parseInt(cols[0].trim());
5453
final int g = Integer.parseInt(cols[1].trim());
5554
final int b = Integer.parseInt(cols[2].trim());
56-
return new Color(display, new RGB(r, g, b));
55+
return new Color(r, g, b);
5756
}
5857
return null;
5958
}

ui/org.eclipse.pde.spy.event/src/org/eclipse/pde/spy/event/internal/ui/CapturedEventTree.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ private void createTreeItemResources() {
152152

153153
treeItemCursor = new TreeItemCursor(getTree().getCursor(), display.getSystemCursor(SWT.CURSOR_HAND));
154154

155-
treeItemForeground = new TreeItemForeground(new Color(display, new RGB(0, 0, 120)),
155+
treeItemForeground = new TreeItemForeground(new Color(new RGB(0, 0, 120)),
156156
display.getSystemColor(SWT.COLOR_LIST_SELECTION_TEXT), display.getSystemColor(SWT.COLOR_BLACK));
157157

158158
treeItemBackground = new TreeItemBackground(display.getSystemColor(SWT.COLOR_LIST_SELECTION),

ui/org.eclipse.pde.ui.templates/templates_3.1/editor/java/ColorManager.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
import org.eclipse.swt.graphics.Color;
77
import org.eclipse.swt.graphics.RGB;
8-
import org.eclipse.swt.widgets.Display;
98

109
public class ColorManager {
1110

@@ -18,7 +17,7 @@ public void dispose() {
1817
public Color getColor(RGB rgb) {
1918
Color color = fColorTable.get(rgb);
2019
if (color == null) {
21-
color = new Color(Display.getCurrent(), rgb);
20+
color = new Color(rgb);
2221
fColorTable.put(rgb, color);
2322
}
2423
return color;

ui/org.eclipse.pde.ui.templates/templates_3.1/extensibleEditor/java/$javaClassPrefix$PresentationReconciler.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import org.eclipse.swt.graphics.Color;
44
import org.eclipse.swt.graphics.RGB;
5-
import org.eclipse.swt.widgets.Display;
65

76
import org.eclipse.jface.text.IDocument;
87
import org.eclipse.jface.text.TextAttribute;
@@ -15,8 +14,8 @@
1514

1615
public class $javaClassPrefix$PresentationReconciler extends PresentationReconciler {
1716

18-
private final TextAttribute tagAttribute = new TextAttribute(new Color(Display.getCurrent(), new RGB(0,0, 255)));
19-
private final TextAttribute headerAttribute = new TextAttribute(new Color(Display.getCurrent(), new RGB(128,128,128)));
17+
private final TextAttribute tagAttribute = new TextAttribute(new Color(new RGB(0,0, 255)));
18+
private final TextAttribute headerAttribute = new TextAttribute(new Color(new RGB(128,128,128)));
2019

2120
public $javaClassPrefix$PresentationReconciler() {
2221
// TODO this is logic for .project file to color tags in blue. Replace with your language logic!

ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/text/ColorManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ private void putColor(String property, RGB setting) {
123123
return;
124124
}
125125
}
126-
fColorTable.put(property, new Color(Display.getCurrent(), setting));
126+
fColorTable.put(property, new Color(setting));
127127
}
128128

129129
@Override

ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/parts/MessageLine.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public void setErrorStatus(IStatus status) {
7575
setText(message);
7676
setImage(findImage(status));
7777
if (fErrorMsgAreaBackground == null) {
78-
fErrorMsgAreaBackground = new Color(getDisplay(), ERROR_BACKGROUND_RGB);
78+
fErrorMsgAreaBackground = new Color(ERROR_BACKGROUND_RGB);
7979
}
8080
setBackground(fErrorMsgAreaBackground);
8181
return;

0 commit comments

Comments
 (0)