Lines 43-49
Link Here
|
43 |
package org.netbeans.modules.javadoc.highlighting; |
43 |
package org.netbeans.modules.javadoc.highlighting; |
44 |
|
44 |
|
45 |
import java.util.ArrayList; |
45 |
import java.util.ArrayList; |
|
|
46 |
import java.util.Collection; |
46 |
import java.util.ConcurrentModificationException; |
47 |
import java.util.ConcurrentModificationException; |
|
|
48 |
import java.util.Enumeration; |
49 |
import java.util.LinkedList; |
47 |
import java.util.List; |
50 |
import java.util.List; |
48 |
import java.util.NoSuchElementException; |
51 |
import java.util.NoSuchElementException; |
49 |
import java.util.logging.Level; |
52 |
import java.util.logging.Level; |
Lines 54-59
Link Here
|
54 |
import javax.swing.text.Element; |
57 |
import javax.swing.text.Element; |
55 |
import org.netbeans.api.editor.mimelookup.MimeLookup; |
58 |
import org.netbeans.api.editor.mimelookup.MimeLookup; |
56 |
import org.netbeans.api.editor.mimelookup.MimePath; |
59 |
import org.netbeans.api.editor.mimelookup.MimePath; |
|
|
60 |
import org.netbeans.api.editor.settings.AttributesUtilities; |
57 |
import org.netbeans.api.editor.settings.FontColorSettings; |
61 |
import org.netbeans.api.editor.settings.FontColorSettings; |
58 |
import org.netbeans.api.java.lexer.JavadocTokenId; |
62 |
import org.netbeans.api.java.lexer.JavadocTokenId; |
59 |
import org.netbeans.api.lexer.Token; |
63 |
import org.netbeans.api.lexer.Token; |
Lines 84-90
Link Here
|
84 |
|
88 |
|
85 |
/** Creates a new instance of Highlighting */ |
89 |
/** Creates a new instance of Highlighting */ |
86 |
public Highlighting(Document doc) { |
90 |
public Highlighting(Document doc) { |
87 |
this.fontColor = MimeLookup.getLookup(MimePath.get("text/x-java")).lookup(FontColorSettings.class).getTokenFontColors("javadoc-first-sentence"); |
91 |
AttributeSet firstLineFontColor = MimeLookup.getLookup(MimePath.get("text/x-java")).lookup(FontColorSettings.class).getTokenFontColors("javadoc-first-sentence"); |
|
|
92 |
AttributeSet commentFontColor = MimeLookup.getLookup(MimePath.get("text/x-java")).lookup(FontColorSettings.class).getTokenFontColors("comment"); |
93 |
// AttrSet flfontColor = new AttrSet() |
94 |
Collection<Object> attrs = new LinkedList<Object>(); |
95 |
for (Enumeration<?> e = firstLineFontColor.getAttributeNames(); e.hasMoreElements(); ) { |
96 |
Object key = e.nextElement(); |
97 |
Object value = firstLineFontColor.getAttribute(key); |
98 |
|
99 |
if (!commentFontColor.containsAttribute(key, value)) { |
100 |
attrs.add(key); |
101 |
attrs.add(value); |
102 |
} |
103 |
} |
104 |
fontColor = AttributesUtilities.createImmutable(attrs.toArray()); |
88 |
this.document = doc; |
105 |
this.document = doc; |
89 |
hierarchy = TokenHierarchy.get(document); |
106 |
hierarchy = TokenHierarchy.get(document); |
90 |
if (hierarchy != null) { |
107 |
if (hierarchy != null) { |