Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 81613 Details for
Bug 207921
[syntax highlighting] number syntax highlighting should contain type suffixes
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Semantic syntax highlight support for numbers
highlight_numbers_sem.patch (text/plain), 8.72 KB, created by
André Søreng
on 2007-10-30 14:16:14 EDT
(
hide
)
Description:
Semantic syntax highlight support for numbers
Filename:
MIME Type:
Creator:
André Søreng
Created:
2007-10-30 14:16:14 EDT
Size:
8.72 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.ui >Index: ui/org/eclipse/jdt/internal/ui/javaeditor/JavaEditorMessages.properties >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaEditorMessages.properties,v >retrieving revision 1.147 >diff -u -r1.147 JavaEditorMessages.properties >--- ui/org/eclipse/jdt/internal/ui/javaeditor/JavaEditorMessages.properties 3 Apr 2007 10:23:41 -0000 1.147 >+++ ui/org/eclipse/jdt/internal/ui/javaeditor/JavaEditorMessages.properties 30 Oct 2007 18:00:42 -0000 >@@ -7,6 +7,7 @@ > # > # Contributors: > # IBM Corporation - initial API and implementation >+# Andre Soereng <andreis@fast.no> [syntax highlighting] highlight numbers - https://bugs.eclipse.org/bugs/show_bug.cgi?id=63573 > ############################################################################### > > AddImportOnSelection_label=A&dd Import >@@ -140,6 +141,7 @@ > SemanticHighlighting_interfaces= Interfaces > SemanticHighlighting_annotations= Annotations > SemanticHighlighting_typeArguments= Type arguments >+SemanticHighlighting_numbers= Numbers > > JavaEditor_markOccurrences_job_name= Occurrences Marker > >Index: ui/org/eclipse/jdt/internal/ui/javaeditor/JavaEditorMessages.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaEditorMessages.java,v >retrieving revision 1.21 >diff -u -r1.21 JavaEditorMessages.java >--- ui/org/eclipse/jdt/internal/ui/javaeditor/JavaEditorMessages.java 3 Apr 2007 09:56:05 -0000 1.21 >+++ ui/org/eclipse/jdt/internal/ui/javaeditor/JavaEditorMessages.java 30 Oct 2007 18:00:41 -0000 >@@ -7,6 +7,7 @@ > * > * Contributors: > * IBM Corporation - initial API and implementation >+ * Andre Soereng <andreis@fast.no> [syntax highlighting] highlight numbers - https://bugs.eclipse.org/bugs/show_bug.cgi?id=63573 > *******************************************************************************/ > package org.eclipse.jdt.internal.ui.javaeditor; > >@@ -145,6 +146,7 @@ > public static String SemanticHighlighting_interfaces; > public static String SemanticHighlighting_annotations; > public static String SemanticHighlighting_typeArguments; >+ public static String SemanticHighlighting_numbers; > public static String JavaEditor_markOccurrences_job_name; > public static String Editor_OpenPropertiesFile_error_keyNotFound; > public static String Editor_OpenPropertiesFile_error_fileNotFound_dialogMessage; >Index: ui/org/eclipse/jdt/internal/ui/javaeditor/SemanticHighlightings.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/SemanticHighlightings.java,v >retrieving revision 1.48 >diff -u -r1.48 SemanticHighlightings.java >--- ui/org/eclipse/jdt/internal/ui/javaeditor/SemanticHighlightings.java 29 May 2007 18:41:46 -0000 1.48 >+++ ui/org/eclipse/jdt/internal/ui/javaeditor/SemanticHighlightings.java 30 Oct 2007 18:00:42 -0000 >@@ -7,6 +7,7 @@ > * > * Contributors: > * IBM Corporation - initial API and implementation >+ * Andre Soereng <andreis@fast.no> [syntax highlighting] highlight numbers - https://bugs.eclipse.org/bugs/show_bug.cgi?id=63573 > *******************************************************************************/ > > package org.eclipse.jdt.internal.ui.javaeditor; >@@ -176,6 +177,13 @@ > public static final String TYPE_ARGUMENT="typeArgument"; //$NON-NLS-1$ > > /** >+ * A named preference part that controls the highlighting of numbers >+ * >+ * @since 3.4 >+ */ >+ public static final String NUMBER="number"; //$NON-NLS-1$ >+ >+ /** > * Semantic highlightings > */ > private static SemanticHighlighting[] fgSemanticHighlightings; >@@ -1582,6 +1590,70 @@ > } > > /** >+ * Semantic highlighting for numbers >+ * @since 3.4 >+ */ >+ private static final class NumberHighlighting extends SemanticHighlighting { >+ >+ /* >+ * @see org.eclipse.jdt.internal.ui.javaeditor.SemanticHighlighting#getPreferenceKey() >+ */ >+ public String getPreferenceKey() { >+ return NUMBER; >+ } >+ >+ /* >+ * @see org.eclipse.jdt.internal.ui.javaeditor.ISemanticHighlighting#getDefaultTextColor() >+ */ >+ public RGB getDefaultDefaultTextColor() { >+ return new RGB(42, 0, 255); >+ } >+ >+ /* >+ * @see org.eclipse.jdt.internal.ui.javaeditor.ISemanticHighlighting#getDefaultTextStyleBold() >+ */ >+ public boolean isBoldByDefault() { >+ return false; >+ } >+ >+ /* >+ * @see org.eclipse.jdt.internal.ui.javaeditor.SemanticHighlighting#isItalicByDefault() >+ */ >+ public boolean isItalicByDefault() { >+ return false; >+ } >+ >+ /* >+ * @see org.eclipse.jdt.internal.ui.javaeditor.SemanticHighlighting#isEnabledByDefault() >+ */ >+ public boolean isEnabledByDefault() { >+ return true; >+ } >+ >+ /* >+ * @see org.eclipse.jdt.internal.ui.javaeditor.ISemanticHighlighting#getDisplayName() >+ */ >+ public String getDisplayName() { >+ return JavaEditorMessages.SemanticHighlighting_numbers; >+ } >+ >+ /* >+ * @see org.eclipse.jdt.internal.ui.javaeditor.SemanticHighlighting#consumes(org.eclipse.jdt.internal.ui.javaeditor.SemanticToken) >+ */ >+ public boolean consumes(SemanticToken token) { >+ return false; >+ } >+ >+ /* >+ * @see org.eclipse.jdt.internal.ui.javaeditor.SemanticHighlighting#consumesLiteral(org.eclipse.jdt.internal.ui.javaeditor.SemanticToken) >+ */ >+ public boolean consumesLiteral(SemanticToken token) { >+ Expression expr= token.getLiteral(); >+ return expr != null && expr.getNodeType() == ASTNode.NUMBER_LITERAL; >+ } >+ } >+ >+ /** > * A named preference that controls the given semantic highlighting's color. > * > * @param semanticHighlighting the semantic highlighting >@@ -1669,6 +1741,7 @@ > new EnumHighlighting(), > new AnnotationHighlighting(), // before interfaces > new InterfaceHighlighting(), >+ new NumberHighlighting(), > }; > return fgSemanticHighlightings; > } >Index: plugin.xml >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.ui/plugin.xml,v >retrieving revision 1.742 >diff -u -r1.742 plugin.xml >--- plugin.xml 23 May 2007 12:05:49 -0000 1.742 >+++ plugin.xml 30 Oct 2007 18:00:41 -0000 >@@ -5818,6 +5818,12 @@ > value="100,70,50"> > </colorDefinition> > <colorDefinition >+ id="org.eclipse.jdt.ui.numberHighlighting" >+ isEditable="false" >+ label="%Dummy.label" >+ value="42,0,255"> >+ </colorDefinition> >+ <colorDefinition > id="org.eclipse.jdt.ui.interfaceHighlighting" > isEditable="false" > label="%Dummy.label" >@@ -5834,7 +5840,7 @@ > isEditable="false" > label="%Dummy.label" > value="13,100,0"> >- </colorDefinition> >+ </colorDefinition> > <colorDefinition > id="org.eclipse.jdt.ui.typeParameterHighlighting" > isEditable="false" >@@ -6025,6 +6031,10 @@ > value="COLOR_WIDGET_DARK_SHADOW"> > </colorOverride> > <colorOverride >+ id="org.eclipse.jdt.ui.numberHighlighting" >+ value="COLOR_LIST_FOREGROUND"> >+ </colorOverride> >+ <colorOverride > id="org.eclipse.jdt.ui.interfaceHighlighting" > value="COLOR_LIST_SELECTION"> > </colorOverride> >Index: ui/org/eclipse/jdt/internal/ui/preferences/JavaEditorColoringConfigurationBlock.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/JavaEditorColoringConfigurationBlock.java,v >retrieving revision 1.30 >diff -u -r1.30 JavaEditorColoringConfigurationBlock.java >--- ui/org/eclipse/jdt/internal/ui/preferences/JavaEditorColoringConfigurationBlock.java 29 May 2007 18:41:46 -0000 1.30 >+++ ui/org/eclipse/jdt/internal/ui/preferences/JavaEditorColoringConfigurationBlock.java 30 Oct 2007 18:00:43 -0000 >@@ -7,6 +7,7 @@ > * > * Contributors: > * IBM Corporation - initial API and implementation >+ * Andre Soereng <andreis@fast.no> [syntax highlighting] highlight numbers - https://bugs.eclipse.org/bugs/show_bug.cgi?id=63573 > *******************************************************************************/ > > package org.eclipse.jdt.internal.ui.preferences; >@@ -884,6 +885,7 @@ > { createHighlightedRange(18, 9, 3, SemanticHighlightings.METHOD) }, > { createHighlightedRange(18, 13, 5, SemanticHighlightings.LOCAL_VARIABLE) }, > { createHighlightedRange(18, 22, 9, SemanticHighlightings.AUTOBOXING) }, >+ { createHighlightedRange(16, 13, 2, SemanticHighlightings.NUMBER) }, > }; > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 207921
: 81613