-
Notifications
You must be signed in to change notification settings - Fork 126
Update Color constructors to remove deprecated Device parameter #2288
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,6 @@ | |
|
|
||
| import org.eclipse.swt.graphics.Color; | ||
| import org.eclipse.swt.graphics.RGB; | ||
| import org.eclipse.swt.widgets.Display; | ||
|
|
||
| import org.eclipse.jface.text.IDocument; | ||
| import org.eclipse.jface.text.TextAttribute; | ||
|
|
@@ -15,8 +14,8 @@ | |
|
|
||
| public class $javaClassPrefix$PresentationReconciler extends PresentationReconciler { | ||
|
|
||
| private final TextAttribute tagAttribute = new TextAttribute(new Color(Display.getCurrent(), new RGB(0,0, 255))); | ||
| private final TextAttribute headerAttribute = new TextAttribute(new Color(Display.getCurrent(), new RGB(128,128,128))); | ||
| private final TextAttribute tagAttribute = new TextAttribute(new Color(new RGB(0,0, 255))); | ||
| private final TextAttribute headerAttribute = new TextAttribute(new Color(new RGB(128,128,128))); | ||
|
Comment on lines
+17
to
+18
|
||
|
|
||
| public $javaClassPrefix$PresentationReconciler() { | ||
| // TODO this is logic for .project file to color tags in blue. Replace with your language logic! | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -75,7 +75,7 @@ public void setErrorStatus(IStatus status) { | |
| setText(message); | ||
| setImage(findImage(status)); | ||
| if (fErrorMsgAreaBackground == null) { | ||
| fErrorMsgAreaBackground = new Color(getDisplay(), ERROR_BACKGROUND_RGB); | ||
| fErrorMsgAreaBackground = new Color(ERROR_BACKGROUND_RGB); | ||
| } | ||
| setBackground(fErrorMsgAreaBackground); | ||
|
Comment on lines
77
to
80
|
||
| return; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getColor(Display display, ...)now returnsnew Color(r, g, b), which ignores the provideddisplay. This can create theColoron the wrong SWTDevice(or fail if there is no current display), whileResourceServicepools resources by the passed-in display. Create the color on the supplied display’s UI thread (e.g., viadisplay.syncExec) so the resource is associated with the correct device.