1 /*******************************************************************************
2 * Copyright (c) 2000, 2009 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
9 * IBM Corporation - initial API and implementation
10 * Anton Leherbauer (Wind River Systems) - Adapted for CDT
11 * Markus Schorn (Wind River Systems)
12 *******************************************************************************/
14 package org.eclipse.cdt.internal.ui.editor;
16 import org.eclipse.swt.graphics.RGB;
19 * Semantic highlighting.
24 public abstract class SemanticHighlighting {
27 * @return the preference key, will be augmented by a prefix and a suffix for each preference
29 public abstract String getPreferenceKey();
32 * @return the default text color
34 public RGB getDefaultTextColor() {
35 return new RGB(0, 0, 0);
39 * @return <code>true</code> if the text attribute bold is set by default
41 public boolean isBoldByDefault() {
46 * @return <code>true</code> if the text attribute italic is set by default
48 public boolean isItalicByDefault() {
53 * @return <code>true</code> if the text attribute strikethrough is set by default
55 public boolean isStrikethroughByDefault() {
60 * @return <code>true</code> if the text attribute underline is set by default
63 public boolean isUnderlineByDefault() {
68 * @return <code>true</code> if the text attribute italic is enabled by default
70 public abstract boolean isEnabledByDefault();
73 * @return the display name
75 public abstract String getDisplayName();
78 * Indicates that the highlighting needs to visit implicit names
79 * (e.g. overloaded operators)
81 public boolean requiresImplicitNames() {
86 * Returns <code>true</code> iff the semantic highlighting consumes the semantic token.
88 * NOTE: Implementors are not allowed to keep a reference on the token or on any object
89 * retrieved from the token.
92 * @param token the semantic token for a {@link org.eclipse.cdt.core.dom.ast.IASTName}
93 * @return <code>true</code> iff the semantic highlighting consumes the semantic token
95 public abstract boolean consumes(SemanticToken token);