use of org.eclipse.ui.texteditor.AnnotationPreference in project eclipse.platform.text by eclipse.
the class NextPreviousPulldownActionDelegate method getActionsFromDescriptors.
/**
* Creates actions using marker
* annotation preferences.
*
* @return the navigation enablement actions
*/
private IAction[] getActionsFromDescriptors() {
MarkerAnnotationPreferences fMarkerAnnotationPreferences = EditorsPlugin.getDefault().getMarkerAnnotationPreferences();
SortedSet<NavigationEnablementAction> containers = new TreeSet<>();
Iterator<AnnotationPreference> iter = fMarkerAnnotationPreferences.getAnnotationPreferences().iterator();
while (iter.hasNext()) {
AnnotationPreference preference = iter.next();
String key = preference.getShowInNextPrevDropdownToolbarActionKey();
if (key != null && fStore.getBoolean(key)) {
String preferenceKey = getPreferenceKey(preference);
/*
* Fixes bug 41689
* This code can be simplified if we decide that
* we don't allow to use different settings for go to
* previous and go to next annotation.
*/
preferenceKey = preference.getIsGoToNextNavigationTargetKey();
if (preferenceKey != null)
containers.add(new NavigationEnablementAction(preference.getPreferenceLabel(), fStore, preferenceKey));
}
}
return containers.toArray(new Action[containers.size()]);
}
use of org.eclipse.ui.texteditor.AnnotationPreference in project tmdm-studio-se by Talend.
the class ElementFKInfoFormatViewer method getSourceViewerDecorationSupport.
protected SourceViewerDecorationSupport getSourceViewerDecorationSupport(ISourceViewer viewer) {
if (fSourceViewerDecorationSupport == null) {
fSourceViewerDecorationSupport = new SourceViewerDecorationSupport(viewer, overviewRuler, XMLSourceViewerHelper.getInstance().getAnnotationAccess(), XMLSourceViewerHelper.getInstance().getSharedColors());
// patch see SourceViewerDecorationSupport
AnnotationPreference info = new AnnotationPreference();
info.setAnnotationType(TYPE);
// $NON-NLS-1$
info.setTextPreferenceKey("errorIndication");
// $NON-NLS-1$
info.setTextStylePreferenceKey("errorTextStyle");
// $NON-NLS-1$
info.setColorPreferenceKey("errorIndicationColor");
getPreferenceStore().setValue(info.getTextPreferenceKey(), true);
// $NON-NLS-1$
getPreferenceStore().setValue(info.getTextStylePreferenceKey(), "PROBLEM_UNDERLINE");
// $NON-NLS-1$
getPreferenceStore().setValue(info.getColorPreferenceKey(), "255, 0, 0");
configureSourceViewerDecorationSupport(fSourceViewerDecorationSupport);
}
return fSourceViewerDecorationSupport;
}
use of org.eclipse.ui.texteditor.AnnotationPreference in project tmdm-studio-se by Talend.
the class XMLSourceViewer method getSourceViewerDecorationSupport.
protected SourceViewerDecorationSupport getSourceViewerDecorationSupport(ISourceViewer viewer) {
if (fSourceViewerDecorationSupport == null) {
fSourceViewerDecorationSupport = new SourceViewerDecorationSupport(viewer, getOverviewRuler(), XMLSourceViewerHelper.getInstance().getAnnotationAccess(), XMLSourceViewerHelper.getInstance().getSharedColors());
// patch see SourceViewerDecorationSupport
AnnotationPreference info = new AnnotationPreference();
info.setAnnotationType(XMLValidator.TYPE);
// $NON-NLS-1$
info.setTextPreferenceKey("errorIndication");
// $NON-NLS-1$
info.setTextStylePreferenceKey("errorTextStyle");
// $NON-NLS-1$
info.setColorPreferenceKey("errorIndicationColor");
getPreferenceStore().setValue(info.getTextPreferenceKey(), true);
// $NON-NLS-1$
getPreferenceStore().setValue(info.getTextStylePreferenceKey(), "PROBLEM_UNDERLINE");
// $NON-NLS-1$
getPreferenceStore().setValue(info.getColorPreferenceKey(), "255, 0, 0");
configureSourceViewerDecorationSupport(fSourceViewerDecorationSupport);
}
return fSourceViewerDecorationSupport;
}
use of org.eclipse.ui.texteditor.AnnotationPreference in project webtools.sourceediting by eclipse.
the class AnnotationHoverProcessor method isAnnotationValid.
boolean isAnnotationValid(Annotation a) {
AnnotationPreference preference = getAnnotationPreference(a);
if (preference == null)
return false;
String textPreferenceKey = preference.getTextPreferenceKey();
String highlightPreferenceKey = preference.getHighlightPreferenceKey();
if (textPreferenceKey == null || !(getPreferenceStore().getBoolean(textPreferenceKey)) || highlightPreferenceKey == null || getPreferenceStore().getBoolean(highlightPreferenceKey))
return false;
return true;
}
use of org.eclipse.ui.texteditor.AnnotationPreference in project webtools.sourceediting by eclipse.
the class TemporaryAnnotation method computeLayer.
private static int computeLayer(String annotationType, AnnotationPreferenceLookup lookup) {
Annotation annotation = new Annotation(annotationType, false, null);
AnnotationPreference preference = lookup.getAnnotationPreference(annotation);
if (preference != null)
return preference.getPresentationLayer() + 1;
else
return IAnnotationAccessExtension.DEFAULT_LAYER + 1;
}
Aggregations