Java Code Examples for org.eclipse.jdt.ui.PreferenceConstants#EDITOR_SEMANTIC_HIGHLIGHTING_COLOR_SUFFIX

The following examples show how to use org.eclipse.jdt.ui.PreferenceConstants#EDITOR_SEMANTIC_HIGHLIGHTING_COLOR_SUFFIX . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SemanticHighlightings.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * In 3.0, methods were highlighted by a rule-based word matcher that
 * matched any identifier that was followed by possibly white space and a
 * left parenthesis.
 * <p>
 * With generics, this does not work any longer for constructors of generic
 * types, and the highlighting has been moved to be a semantic highlighting.
 * Because different preference key naming schemes are used, we have to
 * migrate the old settings to the new ones, which is done here. Nothing
 * needs to be done if the old settings were set to the default values.
 * </p>
 *
 * @param store the preference store to migrate
 * @since 3.1
 */
private static void convertMethodHighlightingPreferences(IPreferenceStore store) {
	String colorkey= PreferenceConstants.EDITOR_SEMANTIC_HIGHLIGHTING_PREFIX + METHOD + PreferenceConstants.EDITOR_SEMANTIC_HIGHLIGHTING_COLOR_SUFFIX;
	String boldkey= PreferenceConstants.EDITOR_SEMANTIC_HIGHLIGHTING_PREFIX + METHOD + PreferenceConstants.EDITOR_SEMANTIC_HIGHLIGHTING_BOLD_SUFFIX;
	String italickey= PreferenceConstants.EDITOR_SEMANTIC_HIGHLIGHTING_PREFIX + METHOD + PreferenceConstants.EDITOR_SEMANTIC_HIGHLIGHTING_ITALIC_SUFFIX;
	String enabledkey= PreferenceConstants.EDITOR_SEMANTIC_HIGHLIGHTING_PREFIX + METHOD + PreferenceConstants.EDITOR_SEMANTIC_HIGHLIGHTING_ENABLED_SUFFIX;

	@SuppressWarnings("deprecation") String oldColorkey= PreferenceConstants.EDITOR_JAVA_METHOD_NAME_COLOR;
	@SuppressWarnings("deprecation") String oldBoldkey= PreferenceConstants.EDITOR_JAVA_METHOD_NAME_BOLD;
	@SuppressWarnings("deprecation") String oldItalickey= PreferenceConstants.EDITOR_JAVA_METHOD_NAME_ITALIC;

	if (conditionalReset(store, oldColorkey, colorkey)
			|| conditionalReset(store, oldBoldkey, boldkey)
			|| conditionalReset(store, oldItalickey, italickey)) {
		store.setValue(enabledkey, true);
	}

}
 
Example 2
Source File: SemanticHighlightings.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * In 3.1, annotations were highlighted by a rule-based word matcher that matched any identifier
 * preceded by an '@' sign and possibly white space.
 * <p>
 * This does not work when there is a comment between the '@' and the annotation, results in
 * stale highlighting if there is a new line between the '@' and the annotation, and does not
 * work for highlighting annotation declarations. Because different preference key naming
 * schemes are used, we have to migrate the old settings to the new ones, which is done here.
 * Nothing needs to be done if the old settings were set to the default values.
 * </p>
 *
 * @param store the preference store to migrate
 * @since 3.2
 */
private static void convertAnnotationHighlightingPreferences(IPreferenceStore store) {
	String colorkey= PreferenceConstants.EDITOR_SEMANTIC_HIGHLIGHTING_PREFIX + ANNOTATION + PreferenceConstants.EDITOR_SEMANTIC_HIGHLIGHTING_COLOR_SUFFIX;
	String boldkey= PreferenceConstants.EDITOR_SEMANTIC_HIGHLIGHTING_PREFIX + ANNOTATION + PreferenceConstants.EDITOR_SEMANTIC_HIGHLIGHTING_BOLD_SUFFIX;
	String italickey= PreferenceConstants.EDITOR_SEMANTIC_HIGHLIGHTING_PREFIX + ANNOTATION + PreferenceConstants.EDITOR_SEMANTIC_HIGHLIGHTING_ITALIC_SUFFIX;
	String strikethroughKey= PreferenceConstants.EDITOR_SEMANTIC_HIGHLIGHTING_PREFIX + ANNOTATION + PreferenceConstants.EDITOR_SEMANTIC_HIGHLIGHTING_STRIKETHROUGH_SUFFIX;
	String underlineKey= PreferenceConstants.EDITOR_SEMANTIC_HIGHLIGHTING_PREFIX + ANNOTATION + PreferenceConstants.EDITOR_SEMANTIC_HIGHLIGHTING_UNDERLINE_SUFFIX;
	String enabledkey= PreferenceConstants.EDITOR_SEMANTIC_HIGHLIGHTING_PREFIX + ANNOTATION + PreferenceConstants.EDITOR_SEMANTIC_HIGHLIGHTING_ENABLED_SUFFIX;

	@SuppressWarnings("deprecation") String oldColorkey= PreferenceConstants.EDITOR_JAVA_ANNOTATION_COLOR;
	@SuppressWarnings("deprecation") String oldBoldkey= PreferenceConstants.EDITOR_JAVA_ANNOTATION_BOLD;
	@SuppressWarnings("deprecation") String oldItalickey= PreferenceConstants.EDITOR_JAVA_ANNOTATION_ITALIC;
	@SuppressWarnings("deprecation") String oldStrikethroughKey= PreferenceConstants.EDITOR_JAVA_ANNOTATION_STRIKETHROUGH;
	@SuppressWarnings("deprecation") String oldUnderlineKey= PreferenceConstants.EDITOR_JAVA_ANNOTATION_UNDERLINE;

	if (conditionalReset(store, oldColorkey, colorkey)
			|| conditionalReset(store, oldBoldkey, boldkey)
			|| conditionalReset(store, oldItalickey, italickey)
			|| conditionalReset(store, oldStrikethroughKey, strikethroughKey)
			|| conditionalReset(store, oldUnderlineKey, underlineKey)) {
		store.setValue(enabledkey, true);
	}

}
 
Example 3
Source File: SemanticHighlightings.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 2 votes vote down vote up
/**
 * A named preference that controls the given semantic highlighting's color.
 *
 * @param semanticHighlighting the semantic highlighting
 * @return the color preference key
 */
public static String getColorPreferenceKey(SemanticHighlighting semanticHighlighting) {
	return PreferenceConstants.EDITOR_SEMANTIC_HIGHLIGHTING_PREFIX + semanticHighlighting.getPreferenceKey() + PreferenceConstants.EDITOR_SEMANTIC_HIGHLIGHTING_COLOR_SUFFIX;
}