Lines 100-105
Link Here
|
100 |
public static final String ABSTRACT_METHOD_INVOCATION="abstractMethodInvocation"; //$NON-NLS-1$ |
100 |
public static final String ABSTRACT_METHOD_INVOCATION="abstractMethodInvocation"; //$NON-NLS-1$ |
101 |
|
101 |
|
102 |
/** |
102 |
/** |
|
|
103 |
* A named preference part that controls the highlighting of effectively final local variables. |
104 |
*/ |
105 |
public static final String LOCAL_VARIABLE_EFFECTIVELY_FINAL="localVariableEffectivelyFinal"; //$NON-NLS-1$ |
106 |
|
107 |
/** |
103 |
* A named preference part that controls the highlighting of local variables. |
108 |
* A named preference part that controls the highlighting of local variables. |
104 |
*/ |
109 |
*/ |
105 |
public static final String LOCAL_VARIABLE_DECLARATION="localVariableDeclaration"; //$NON-NLS-1$ |
110 |
public static final String LOCAL_VARIABLE_DECLARATION="localVariableDeclaration"; //$NON-NLS-1$ |
Lines 913-918
Link Here
|
913 |
public boolean consumes(SemanticToken token) { |
918 |
public boolean consumes(SemanticToken token) { |
914 |
IBinding binding= getBinding(token); |
919 |
IBinding binding= getBinding(token); |
915 |
return binding != null && binding.getKind() == IBinding.METHOD; |
920 |
return binding != null && binding.getKind() == IBinding.METHOD; |
|
|
921 |
} |
922 |
} |
923 |
|
924 |
/** |
925 |
* Semantic highlighting for effectively final local variables. |
926 |
*/ |
927 |
private static final class LocalVariableEffectivelyFinalHighlighting extends SemanticHighlighting { |
928 |
|
929 |
/* |
930 |
* @see org.eclipse.jdt.internal.ui.javaeditor.SemanticHighlighting#getPreferenceKey() |
931 |
*/ |
932 |
@Override |
933 |
public String getPreferenceKey() { |
934 |
return LOCAL_VARIABLE_EFFECTIVELY_FINAL; |
935 |
} |
936 |
|
937 |
/* |
938 |
* @see org.eclipse.jdt.internal.ui.javaeditor.ISemanticHighlighting#getDefaultTextColor() |
939 |
*/ |
940 |
@Override |
941 |
public RGB getDefaultDefaultTextColor() { |
942 |
return new RGB(106, 62, 62); |
943 |
} |
944 |
|
945 |
/* |
946 |
* @see org.eclipse.jdt.internal.ui.javaeditor.ISemanticHighlighting#getDefaultTextStyleBold() |
947 |
*/ |
948 |
@Override |
949 |
public boolean isBoldByDefault() { |
950 |
return true; |
951 |
} |
952 |
|
953 |
/* |
954 |
* @see org.eclipse.jdt.internal.ui.javaeditor.SemanticHighlighting#isItalicByDefault() |
955 |
*/ |
956 |
@Override |
957 |
public boolean isItalicByDefault() { |
958 |
return false; |
959 |
} |
960 |
|
961 |
/* |
962 |
* @see org.eclipse.jdt.internal.ui.javaeditor.SemanticHighlighting#isEnabledByDefault() |
963 |
*/ |
964 |
@Override |
965 |
public boolean isEnabledByDefault() { |
966 |
return true; |
967 |
} |
968 |
|
969 |
/* |
970 |
* @see org.eclipse.jdt.internal.ui.javaeditor.ISemanticHighlighting#getDisplayName() |
971 |
*/ |
972 |
@Override |
973 |
public String getDisplayName() { |
974 |
//XXX return JavaEditorMessages.SemanticHighlighting_localVariableDeclaration; |
975 |
return "Effectively final local variable"; |
976 |
} |
977 |
|
978 |
/* |
979 |
* @see org.eclipse.jdt.internal.ui.javaeditor.SemanticHighlighting#consumes(org.eclipse.jdt.internal.ui.javaeditor.SemanticToken) |
980 |
*/ |
981 |
@Override |
982 |
public boolean consumes(SemanticToken token) { |
983 |
IBinding binding= token.getBinding(); |
984 |
if (binding != null && binding.getKind() == IBinding.VARIABLE && !((IVariableBinding) binding).isField()) { |
985 |
ASTNode decl= token.getRoot().findDeclaringNode(binding); |
986 |
return decl instanceof VariableDeclaration && ((IVariableBinding) binding).isEffectivelyFinal(); |
987 |
} |
988 |
return false; |
916 |
} |
989 |
} |
917 |
} |
990 |
} |
918 |
|
991 |
|
Lines 1992-1997
Link Here
|
1992 |
new AnnotationElementReferenceHighlighting(), |
2065 |
new AnnotationElementReferenceHighlighting(), |
1993 |
new InheritedMethodInvocationHighlighting(), |
2066 |
new InheritedMethodInvocationHighlighting(), |
1994 |
new ParameterVariableHighlighting(), |
2067 |
new ParameterVariableHighlighting(), |
|
|
2068 |
new LocalVariableEffectivelyFinalHighlighting(), |
1995 |
new LocalVariableDeclarationHighlighting(), |
2069 |
new LocalVariableDeclarationHighlighting(), |
1996 |
new LocalVariableHighlighting(), |
2070 |
new LocalVariableHighlighting(), |
1997 |
new TypeVariableHighlighting(), // before type arguments! |
2071 |
new TypeVariableHighlighting(), // before type arguments! |