+ "." + String.valueOf(colorID + 1);
AnnotationPreferenceLookup lookup = EditorsUI
.getAnnotationPreferenceLookup();
final AnnotationPreference ap = lookup
.getAnnotationPreference(annotationType);
final AnnotationPreference apForViewPort = lookup
.getAnnotationPreference(annotationTypeForViewPort);
final AnnotationPreference apForContribution = lookup
.getAnnotationPreference(annotationTypeForContribution);
if (ap == null) {
return;
}
if (apForViewPort == null) {
return;
}
if (apForContribution == null) {
return;
}
try {
Utils.runSafeSWTSync(log, new Runnable() {
public void run() {
int r = userRGB.red;
int g = userRGB.green;
int b = userRGB.blue;
log.info("Set new User Color: " + userRGB);
// Highlighting color of buddy
EditorsUI.getPreferenceStore().setValue(
ap.getColorPreferenceKey(), r + "," + g + "," + b);
// viewport color (side bar, displays what buddy is looking
// at)
EditorsUI.getPreferenceStore().setValue(
apForViewPort.getColorPreferenceKey(),
r + "," + g + "," + b);
// color for things, that the buddy writes
// make a small different color for selection and
// contribution color
EditorsUI.getPreferenceStore().setValue(
apForContribution.getColorPreferenceKey(),
(int) (r * 0.9) + "," + (int) (g * 0.9) + ","
+ (int) (b * 0.9));
}
});