/** * Initializes the background color used for highlighting the document ranges * defining search scopes. * * @param viewer the viewer to initialize * @since 2.0 */ private void initializeFindScopeColor(ISourceViewer viewer) { IPreferenceStore store= getPreferenceStore(); if (store != null) { StyledText styledText= viewer.getTextWidget(); Color color= createColor(store, PREFERENCE_COLOR_FIND_SCOPE, styledText.getDisplay()); IFindReplaceTarget target= viewer.getFindReplaceTarget(); if (target != null && target instanceof IFindReplaceTargetExtension) ((IFindReplaceTargetExtension) target).setScopeHighlightColor(color); if (fFindScopeHighlightColor != null) fFindScopeHighlightColor.dispose(); fFindScopeHighlightColor= color; } }
: createColor(store, PREFERENCE_COLOR_FOREGROUND, styledText.getDisplay()); styledText.setForeground(color); : createColor(store, PREFERENCE_COLOR_BACKGROUND, styledText.getDisplay()); styledText.setBackground(color); : createColor(store, PREFERENCE_COLOR_SELECTION_FOREGROUND, styledText.getDisplay()); styledText.setSelectionForeground(color); : createColor(store, PREFERENCE_COLOR_SELECTION_BACKGROUND, styledText.getDisplay()); styledText.setSelectionBackground(color);
/** * Initializes the background color used for highlighting the document ranges * defining search scopes. * * @param viewer the viewer to initialize * @since 2.0 */ private void initializeFindScopeColor(ISourceViewer viewer) { IPreferenceStore store= getPreferenceStore(); if (store != null) { StyledText styledText= viewer.getTextWidget(); Color color= createColor(store, PREFERENCE_COLOR_FIND_SCOPE, styledText.getDisplay()); IFindReplaceTarget target= viewer.getFindReplaceTarget(); if (target != null && target instanceof IFindReplaceTargetExtension) ((IFindReplaceTargetExtension) target).setScopeHighlightColor(color); if (fFindScopeHighlightColor != null) fFindScopeHighlightColor.dispose(); fFindScopeHighlightColor= color; } }
/** * Initializes the background color used for highlighting the document ranges * defining search scopes. * * @param viewer the viewer to initialize * @since 2.0 */ private void initializeFindScopeColor(ISourceViewer viewer) { IPreferenceStore store= getPreferenceStore(); if (store != null) { StyledText styledText= viewer.getTextWidget(); Color color= createColor(store, PREFERENCE_COLOR_FIND_SCOPE, styledText.getDisplay()); IFindReplaceTarget target= viewer.getFindReplaceTarget(); if (target != null && target instanceof IFindReplaceTargetExtension) ((IFindReplaceTargetExtension) target).setScopeHighlightColor(color); if (fFindScopeHighlightColor != null) fFindScopeHighlightColor.dispose(); fFindScopeHighlightColor= color; } }
: createColor(store, PREFERENCE_COLOR_FOREGROUND, styledText.getDisplay()); styledText.setForeground(color); : createColor(store, PREFERENCE_COLOR_BACKGROUND, styledText.getDisplay()); styledText.setBackground(color); : createColor(store, PREFERENCE_COLOR_SELECTION_FOREGROUND, styledText.getDisplay()); styledText.setSelectionForeground(color); : createColor(store, PREFERENCE_COLOR_SELECTION_BACKGROUND, styledText.getDisplay()); styledText.setSelectionBackground(color);
: createColor(store, PREFERENCE_COLOR_FOREGROUND, styledText.getDisplay()); styledText.setForeground(color); : createColor(store, PREFERENCE_COLOR_BACKGROUND, styledText.getDisplay()); styledText.setBackground(color); : createColor(store, PREFERENCE_COLOR_SELECTION_FOREGROUND, styledText.getDisplay()); styledText.setSelectionForeground(color); : createColor(store, PREFERENCE_COLOR_SELECTION_BACKGROUND, styledText.getDisplay()); styledText.setSelectionBackground(color);