Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,17 @@ public ASTViewLabelProvider() {
fDarkGreen= display.getSystemColor(SWT.COLOR_DARK_GREEN);
fDarkRed= display.getSystemColor(SWT.COLOR_DARK_RED);

fSelectedElemBGColor= new Color(display, 232, 242, 254);
fSelectedElemBGColor= new Color(232, 242, 254);
String currLineColor= EditorsUI.getPreferenceStore().getString(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_CURRENT_LINE_COLOR);
String[] rgb= currLineColor.split(","); //$NON-NLS-1$
if (rgb.length == 3) {
try {
fSelectedElemBGColor= new Color(display, Integer.parseInt(rgb[0]), Integer.parseInt(rgb[1]), Integer.parseInt(rgb[2]));
fSelectedElemBGColor= new Color(Integer.parseInt(rgb[0]), Integer.parseInt(rgb[1]), Integer.parseInt(rgb[2]));
} catch (NumberFormatException e) {
// do nothing, colour would remain the backup value
}
}
fLightRed= new Color(display, 255, 190, 190);
fLightRed= new Color(255, 190, 190);

fBold= PlatformUI.getWorkbench().getThemeManager().getCurrentTheme().getFontRegistry().getBold(JFaceResources.DEFAULT_FONT);
FontData[] fontData= fBold.getFontData();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,9 @@ public void controlResized(ControlEvent e) {
}
});
addPaintListener(this::paint);
Display display= parent.getDisplay();
fFailureColor= new Color(display, 159, 63, 63);
fOKColor= new Color(display, 95, 191, 95);
fStoppedColor= new Color(display, 120, 120, 120);
fFailureColor= new Color(159, 63, 63);
fOKColor= new Color(95, 191, 95);
fStoppedColor= new Color(120, 120, 120);
}

public void setMaximum(int max) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;

import org.eclipse.core.runtime.IAdaptable;

Expand Down Expand Up @@ -149,7 +148,7 @@ private void setColor(StyledText styledText, IPreferenceStore store,
String key, boolean useDefault) {
Color newColor= useDefault
? null
: createColor(styledText.getDisplay(), store, key);
: createColor(store, key);
switch (key) {
case AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND:
styledText.setForeground(newColor);
Expand All @@ -170,7 +169,7 @@ private void setColor(StyledText styledText, IPreferenceStore store,
customColors.put(key, newColor);
}

private static Color createColor(Display display, IPreferenceStore store,
private static Color createColor(IPreferenceStore store,
String key) {
RGB rgb= null;
if (store.contains(key)) {
Expand All @@ -180,7 +179,7 @@ private static Color createColor(Display display, IPreferenceStore store,
rgb= PreferenceConverter.getColor(store, key);
}
if (rgb != null) {
return new Color(display, rgb);
return new Color(rgb);
}
}
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ public Control createControl(Composite parent) {
Display display= parent.getDisplay();
fBackgroundColor= display.getSystemColor(SWT.COLOR_LIST_BACKGROUND);
fForegroundColor= display.getSystemColor(SWT.COLOR_LIST_FOREGROUND);
fSeparatorColor= new Color(display, 152, 170, 203);
fSeparatorColor= new Color(152, 170, 203);

JFaceResources.getFontRegistry().addListener(this);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;

import org.eclipse.core.runtime.Assert;

Expand Down Expand Up @@ -255,25 +254,25 @@ protected void initializeViewerColors() {
// ----------- foreground color --------------------
Color color= fPreferenceStore.getBoolean(AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND_SYSTEM_DEFAULT)
? null
: createColor(fPreferenceStore, AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND, styledText.getDisplay());
: createColor(fPreferenceStore, AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND);
styledText.setForeground(color);

// ---------- background color ----------------------
color= fPreferenceStore.getBoolean(AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND_SYSTEM_DEFAULT)
? null
: createColor(fPreferenceStore, AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND, styledText.getDisplay());
: createColor(fPreferenceStore, AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND);
styledText.setBackground(color);

// ----------- selection foreground color --------------------
color= fPreferenceStore.getBoolean(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_FOREGROUND_DEFAULT_COLOR)
? null
: createColor(fPreferenceStore, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_FOREGROUND_COLOR, styledText.getDisplay());
: createColor(fPreferenceStore, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_FOREGROUND_COLOR);
styledText.setSelectionForeground(color);

// ---------- selection background color ----------------------
color= fPreferenceStore.getBoolean(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_BACKGROUND_DEFAULT_COLOR)
? null
: createColor(fPreferenceStore, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_BACKGROUND_COLOR, styledText.getDisplay());
: createColor(fPreferenceStore, AbstractDecoratedTextEditorPreferenceConstants.EDITOR_SELECTION_BACKGROUND_COLOR);
styledText.setSelectionBackground(color);

}
Expand All @@ -285,11 +284,10 @@ protected void initializeViewerColors() {
*
* @param store the store to read from
* @param key the key used for the lookup in the preference store
* @param display the display used create the color
* @return the created color according to the specification in the preference store
* @since 3.0
*/
private Color createColor(IPreferenceStore store, String key, Display display) {
private Color createColor(IPreferenceStore store, String key) {

RGB rgb= null;

Expand All @@ -301,7 +299,7 @@ private Color createColor(IPreferenceStore store, String key, Display display) {
rgb= PreferenceConverter.getColor(store, key);

if (rgb != null)
return new Color(display, rgb);
return new Color(rgb);
}

return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ private Color createColor(int color1, int color2, int ratio, Display display) {

RGB blend= FormColors.blend(rgb2, rgb1, ratio);

return new Color(display, blend);
return new Color(blend);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public Color getColor(RGB rgb) {

Color color= colorTable.get(rgb);
if (color == null) {
color= new Color(Display.getCurrent(), rgb);
color= new Color(rgb);
colorTable.put(rgb, color);
}

Expand Down
Loading