import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
dialog.setRGB(colorSetting.getForegroundRGB());
dialog.setText(Messages.ColorsView_ForegroundDialogText);
dialog.open();
- colorSetting.setForegroundRGB(dialog.getRGB());
- ColorSettingsManager.setColorSettings(fColorSettings.toArray(new ColorSetting[0]));
- label.setForeground(colorSetting.getForegroundColor());
+ RGB rgb = dialog.getRGB();
+ if (rgb != null) {
+ colorSetting.setForegroundRGB(rgb);
+ ColorSettingsManager.setColorSettings(fColorSettings.toArray(new ColorSetting[0]));
+ label.setForeground(colorSetting.getForegroundColor());
+ }
}});
bgButton.addSelectionListener(new SelectionAdapter() {
dialog.setRGB(colorSetting.getBackgroundRGB());
dialog.setText(Messages.ColorsView_BackgroundDialogText);
dialog.open();
- colorSetting.setBackgroundRGB(dialog.getRGB());
- ColorSettingsManager.setColorSettings(fColorSettings.toArray(new ColorSetting[0]));
- labelComposite.setBackground(colorSetting.getBackgroundColor());
- label.setBackground(colorSetting.getBackgroundColor());
+ RGB rgb = dialog.getRGB();
+ if (rgb != null) {
+ colorSetting.setBackgroundRGB(rgb);
+ ColorSettingsManager.setColorSettings(fColorSettings.toArray(new ColorSetting[0]));
+ labelComposite.setBackground(colorSetting.getBackgroundColor());
+ label.setBackground(colorSetting.getBackgroundColor());
+ }
}});
final Button tickButton = new Button(this, SWT.PUSH);
dialog.setRGB(colorSetting.getTickColorRGB());
dialog.setText(Messages.TickColorDialog_TickColorDialogTitle);
dialog.open();
- colorSetting.setTickColorRGB(dialog.getRGB());
- ColorSettingsManager.setColorSettings(fColorSettings.toArray(new ColorSetting[0]));
- refresh();
+ RGB rgb = dialog.getRGB();
+ if (rgb != null) {
+ colorSetting.setTickColorRGB(rgb);
+ ColorSettingsManager.setColorSettings(fColorSettings.toArray(new ColorSetting[0]));
+ refresh();
+ }
}});
final Button filterButton = new Button(this, SWT.PUSH);