This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 134281
Collapse All | Expand All

(-)a/cnd.completion/nbproject/project.xml (+8 lines)
Lines 181-186 Link Here
181
                    </run-dependency>
181
                    </run-dependency>
182
                </dependency>
182
                </dependency>
183
                <dependency>
183
                <dependency>
184
                    <code-name-base>org.netbeans.swing.plaf</code-name-base>
185
                    <build-prerequisite/>
186
                    <compile-dependency/>
187
                    <run-dependency>
188
                        <specification-version>1.23.1</specification-version>
189
                    </run-dependency>
190
                </dependency>
191
                <dependency>
184
                    <code-name-base>org.openide.awt</code-name-base>
192
                    <code-name-base>org.openide.awt</code-name-base>
185
                    <build-prerequisite/>
193
                    <build-prerequisite/>
186
                    <compile-dependency/>
194
                    <compile-dependency/>
(-)a/cnd.completion/src/org/netbeans/modules/cnd/completion/cplusplus/ext/CsmResultItem.java (-6 / +5 lines)
Lines 101-107 import org.netbeans.modules.cnd.modelutil.ParamStr; Link Here
101
import org.netbeans.spi.editor.completion.CompletionItem;
101
import org.netbeans.spi.editor.completion.CompletionItem;
102
import org.netbeans.spi.editor.completion.CompletionTask;
102
import org.netbeans.spi.editor.completion.CompletionTask;
103
import org.openide.util.Lookup;
103
import org.openide.util.Lookup;
104
104
import org.netbeans.swing.plaf.LFCustoms;
105
/**
105
/**
106
 *
106
 *
107
 * @author  Vladimir Voskresensky
107
 * @author  Vladimir Voskresensky
Lines 120-127 public abstract class CsmResultItem implements CompletionItem { Link Here
120
    protected int selectionEndOffset = -1;
120
    protected int selectionEndOffset = -1;
121
    protected int substituteOffset = -1;
121
    protected int substituteOffset = -1;
122
    CsmObject associatedObject;
122
    CsmObject associatedObject;
123
    private static final Color KEYWORD_COLOR = Color.gray;
123
    private static final Color KEYWORD_COLOR = Color.lightGray;
124
    private static final Color TYPE_COLOR = Color.black;
125
    private int priority;
124
    private int priority;
126
    private SubstitutionHint hint;
125
    private SubstitutionHint hint;
127
126
Lines 145-151 public abstract class CsmResultItem implements CompletionItem { Link Here
145
    }
144
    }
146
    
145
    
147
    protected static Color getTypeColor(CsmType type) {
146
    protected static Color getTypeColor(CsmType type) {
148
        return type.isBuiltInBased(false) ? KEYWORD_COLOR : TYPE_COLOR;
147
        return type.isBuiltInBased(false) ? LFCustoms.shiftColor(KEYWORD_COLOR) : LFCustoms.getTextFgColor();
149
    }
148
    }
150
149
151
    public void setSubstituteOffset(int substituteOffset) {
150
    public void setSubstituteOffset(int substituteOffset) {
Lines 976-986 public abstract class CsmResultItem implements CompletionItem { Link Here
976
                if (type == null) {
975
                if (type == null) {
977
                    // only var args parameters could have null types
976
                    // only var args parameters could have null types
978
                    assert (((CsmParameter) prm).isVarArgs()) : " non var arg " + prm + " of class " + prm.getClass().getName();
977
                    assert (((CsmParameter) prm).isVarArgs()) : " non var arg " + prm + " of class " + prm.getClass().getName();
979
                    params.add(new ParamStr("", "", ((CsmParameter) prm).getName().toString(), true, KEYWORD_COLOR)); //NOI18N
978
                    params.add(new ParamStr("", "", ((CsmParameter) prm).getName().toString(), true,  LFCustoms.shiftColor(KEYWORD_COLOR))); //NOI18N
980
                    varArgIndex = i;
979
                    varArgIndex = i;
981
                } else {
980
                } else {
982
                    String typeName = getTypeName(type, instantiateTypes);
981
                    String typeName = getTypeName(type, instantiateTypes);
983
                    params.add(new ParamStr(typeName, typeName, ((CsmParameter) prm).getName().toString(), false, TYPE_COLOR /*getTypeColor(type.getClassifier())*/));
982
                    params.add(new ParamStr(typeName, typeName, ((CsmParameter) prm).getName().toString(), false, LFCustoms.getTextFgColor() /*getTypeColor(type.getClassifier())*/));
984
                }
983
                }
985
                i++;
984
                i++;
986
            }
985
            }
(-)a/cnd.modelutil/nbproject/project.xml (+8 lines)
Lines 86-91 Link Here
86
                    </run-dependency>
86
                    </run-dependency>
87
                </dependency>
87
                </dependency>
88
                <dependency>
88
                <dependency>
89
                    <code-name-base>org.netbeans.swing.plaf</code-name-base>
90
                    <build-prerequisite/>
91
                    <compile-dependency/>
92
                    <run-dependency>
93
                        <specification-version>1.23.1</specification-version>
94
                    </run-dependency>
95
                </dependency>
96
                <dependency>
89
                    <code-name-base>org.openide.awt</code-name-base>
97
                    <code-name-base>org.openide.awt</code-name-base>
90
                    <build-prerequisite/>
98
                    <build-prerequisite/>
91
                    <compile-dependency/>
99
                    <compile-dependency/>
(-)a/cnd.modelutil/src/org/netbeans/modules/cnd/modelutil/CsmPaintComponent.java (-31 / +31 lines)
Lines 63-69 import java.util.List; Link Here
63
import javax.swing.BorderFactory;
63
import javax.swing.BorderFactory;
64
import javax.swing.Icon;
64
import javax.swing.Icon;
65
import javax.swing.JPanel;
65
import javax.swing.JPanel;
66
66
import org.netbeans.swing.plaf.LFCustoms;
67
67
68
/**
68
/**
69
 *
69
 *
Lines 101-109 public abstract class CsmPaintComponent extends JPanel { Link Here
101
        "", " ", "[]", "(", ")", ", ", "String", THROWS // NOI18N
101
        "", " ", "[]", "(", ")", ", ", "String", THROWS // NOI18N
102
    };
102
    };
103
    
103
    
104
    private static final Color KEYWORD_COLOR = Color.darkGray;
104
    private final static Color KEYWORD_COLOR = Color.gray;
105
    private static final Color TYPE_COLOR = Color.black;
105
    private final static Color POSTFIX_COLOR = Color.lightGray;
106
    private static final Color POSTFIX_COLOR = Color.gray;
107
    
106
    
108
    private Icon icon;
107
    private Icon icon;
109
    
108
    
Lines 128-148 public abstract class CsmPaintComponent extends JPanel { Link Here
128
    @Override
127
    @Override
129
    public void paintComponent(Graphics g) {
128
    public void paintComponent(Graphics g) {
130
        // clear background
129
        // clear background
130
        Color postfixColor = LFCustoms.shiftColor(POSTFIX_COLOR);
131
        g.setColor(getBackground());
131
        g.setColor(getBackground());
132
        java.awt.Rectangle r = g.getClipBounds();
132
        java.awt.Rectangle r = g.getClipBounds();
133
        g.fillRect(r.x, r.y, r.width, r.height);
133
        g.fillRect(r.x, r.y, r.width, r.height);
134
        draw(g);
134
        draw(g);
135
        
135
        
136
        if(!postfixes.isEmpty()) {
136
        if(!postfixes.isEmpty()) {
137
            drawString(g, " (", POSTFIX_COLOR); // NOI18N
137
            drawString(g, " (", postfixColor); // NOI18N
138
            Iterator iter = postfixes.iterator();
138
            Iterator iter = postfixes.iterator();
139
            while(iter.hasNext()) {
139
            while(iter.hasNext()) {
140
                ((PostfixString) iter.next()).Draw(g);
140
                ((PostfixString) iter.next()).Draw(g);
141
                if(iter.hasNext()) {
141
                if(iter.hasNext()) {
142
                    drawString(g, ",  ", POSTFIX_COLOR); // NOI18N
142
                    drawString(g, ",  ", postfixColor); // NOI18N
143
                }
143
                }
144
            } 
144
            } 
145
            drawString(g, ")", POSTFIX_COLOR); // NOI18N
145
            drawString(g, ")", postfixColor); // NOI18N
146
        }        
146
        }        
147
    }
147
    }
148
    
148
    
Lines 372-378 public abstract class CsmPaintComponent extends JPanel { Link Here
372
        }
372
        }
373
        
373
        
374
        public PostfixString(String text, int fontStyle) {
374
        public PostfixString(String text, int fontStyle) {
375
            this(text, CsmPaintComponent.POSTFIX_COLOR, fontStyle);            
375
            this(text, LFCustoms.shiftColor(CsmPaintComponent.POSTFIX_COLOR), fontStyle);            
376
        }
376
        }
377
        
377
        
378
        void Draw(Graphics g) {            
378
        void Draw(Graphics g) {            
Lines 397-403 public abstract class CsmPaintComponent extends JPanel { Link Here
397
397
398
        private String pkgName;
398
        private String pkgName;
399
        private boolean displayFullNamespacePath;
399
        private boolean displayFullNamespacePath;
400
        private Color NAMESPACE_COLOR = Color.green.darker().darker().darker();
400
        private Color NAMESPACE_COLOR = LFCustoms.shiftColor(new Color(64,255,64));
401
        
401
        
402
        public NamespacePaintComponent(){
402
        public NamespacePaintComponent(){
403
            super();
403
            super();
Lines 436-442 public abstract class CsmPaintComponent extends JPanel { Link Here
436
    public static class NamespaceAliasPaintComponent extends CsmPaintComponent{
436
    public static class NamespaceAliasPaintComponent extends CsmPaintComponent{
437
437
438
        private String aliasName;
438
        private String aliasName;
439
        private Color NAMESPACE_COLOR = Color.green.darker().darker().darker();
439
        private Color NAMESPACE_COLOR = LFCustoms.shiftColor(new Color(64,255,64));
440
        
440
        
441
        public NamespaceAliasPaintComponent(){
441
        public NamespaceAliasPaintComponent(){
442
            super();
442
            super();
Lines 467-473 public abstract class CsmPaintComponent extends JPanel { Link Here
467
    public static class EnumPaintComponent extends CsmPaintComponent {
467
    public static class EnumPaintComponent extends CsmPaintComponent {
468
        
468
        
469
        String formatEnumName;
469
        String formatEnumName;
470
        private Color ENUM_COLOR = Color.red.darker().darker().darker().darker();
470
        private Color ENUM_COLOR = LFCustoms.shiftColor(new Color(255,64,64));
471
        private boolean displayFQN;
471
        private boolean displayFQN;
472
        
472
        
473
        public void EnumPaintComponent(String formatEnumName){
473
        public void EnumPaintComponent(String formatEnumName){
Lines 504-510 public abstract class CsmPaintComponent extends JPanel { Link Here
504
    public static class EnumeratorPaintComponent extends CsmPaintComponent {
504
    public static class EnumeratorPaintComponent extends CsmPaintComponent {
505
        
505
        
506
        String formatEnumeratorName;
506
        String formatEnumeratorName;
507
        private Color ENUMERATOR_COLOR = Color.blue.darker().darker().darker().darker();
507
        private Color ENUMERATOR_COLOR = LFCustoms.shiftColor(new Color(64,64,255));
508
        private boolean displayFQN;
508
        private boolean displayFQN;
509
        
509
        
510
        public void EnumeratorPaintComponent(String formatEnumeratorName){
510
        public void EnumeratorPaintComponent(String formatEnumeratorName){
Lines 542-548 public abstract class CsmPaintComponent extends JPanel { Link Here
542
    public static class ClassPaintComponent extends CsmPaintComponent{
542
    public static class ClassPaintComponent extends CsmPaintComponent{
543
        
543
        
544
        String formatClassName;
544
        String formatClassName;
545
        private Color CLASS_COLOR = Color.red.darker().darker().darker();
545
        private Color CLASS_COLOR = LFCustoms.shiftColor(new Color(255,64,64));
546
        private boolean displayFQN;
546
        private boolean displayFQN;
547
        
547
        
548
        public void setFormatClassName(String formatClassName){
548
        public void setFormatClassName(String formatClassName){
Lines 576-582 public abstract class CsmPaintComponent extends JPanel { Link Here
576
    public static class TypedefPaintComponent extends CsmPaintComponent{
576
    public static class TypedefPaintComponent extends CsmPaintComponent{
577
        
577
        
578
        String formatTypedefName;
578
        String formatTypedefName;
579
        private final Color TYPEDEF_COLOR = CsmFontColorManager.instance().getColor(FontColorProvider.Entity.TYPEDEF); //Color.blue.darker().darker().darker();
579
        private final Color TYPEDEF_COLOR = CsmFontColorManager.instance().getColor(FontColorProvider.Entity.TYPEDEF); //new Color(64,64,255).darker().darker().darker();
580
        //private boolean displayFQN;
580
        //private boolean displayFQN;
581
        
581
        
582
        public void setFormatTypedefName(String formatTypedefName){
582
        public void setFormatTypedefName(String formatTypedefName){
Lines 609-615 public abstract class CsmPaintComponent extends JPanel { Link Here
609
609
610
    public static class StructPaintComponent extends ClassPaintComponent{
610
    public static class StructPaintComponent extends ClassPaintComponent{
611
        
611
        
612
        private Color STRUCT_COLOR = Color.red.darker().darker();
612
        private Color STRUCT_COLOR = LFCustoms.shiftColor(new Color(255,64,64));
613
        
613
        
614
        @Override
614
        @Override
615
        protected Color getColor(){
615
        protected Color getColor(){
Lines 623-629 public abstract class CsmPaintComponent extends JPanel { Link Here
623
    
623
    
624
    public static class UnionPaintComponent extends ClassPaintComponent{
624
    public static class UnionPaintComponent extends ClassPaintComponent{
625
        
625
        
626
        private Color UNION_COLOR = Color.red.darker();
626
        private Color UNION_COLOR = LFCustoms.shiftColor(new Color(255,64,64));
627
        
627
        
628
        @Override
628
        @Override
629
        protected Color getColor(){
629
        protected Color getColor(){
Lines 636-642 public abstract class CsmPaintComponent extends JPanel { Link Here
636
    }
636
    }
637
    
637
    
638
    public static class FieldPaintComponent extends CsmPaintComponent{
638
    public static class FieldPaintComponent extends CsmPaintComponent{
639
        private Color FIELD_COLOR = CsmFontColorManager.instance().getColor(FontColorProvider.Entity.CLASS_FIELD);//Color.blue.darker();
639
        private Color FIELD_COLOR = CsmFontColorManager.instance().getColor(FontColorProvider.Entity.CLASS_FIELD);//new Color(64,64,255).darker();
640
        protected String typeName;
640
        protected String typeName;
641
        protected Color typeColor;
641
        protected Color typeColor;
642
        protected String fldName;
642
        protected String fldName;
Lines 720-726 public abstract class CsmPaintComponent extends JPanel { Link Here
720
    }
720
    }
721
    
721
    
722
    public static class LocalVariablePaintComponent extends FieldPaintComponent {
722
    public static class LocalVariablePaintComponent extends FieldPaintComponent {
723
        private Color VARIABLE_COLOR = Color.red.darker().darker().darker();
723
        private Color VARIABLE_COLOR = LFCustoms.shiftColor(new Color(255,64,64));
724
        
724
        
725
        public LocalVariablePaintComponent(){
725
        public LocalVariablePaintComponent(){
726
            super();
726
            super();
Lines 739-745 public abstract class CsmPaintComponent extends JPanel { Link Here
739
    }
739
    }
740
    
740
    
741
    public static class FileLocalVariablePaintComponent extends FieldPaintComponent {
741
    public static class FileLocalVariablePaintComponent extends FieldPaintComponent {
742
        private Color VARIABLE_COLOR = Color.blue.darker().darker().darker();
742
        private Color VARIABLE_COLOR = LFCustoms.shiftColor(new Color(64,64,255));
743
        
743
        
744
        public FileLocalVariablePaintComponent(){
744
        public FileLocalVariablePaintComponent(){
745
            super();
745
            super();
Lines 752-758 public abstract class CsmPaintComponent extends JPanel { Link Here
752
    }
752
    }
753
    
753
    
754
    public static class GlobalVariablePaintComponent extends FieldPaintComponent {
754
    public static class GlobalVariablePaintComponent extends FieldPaintComponent {
755
        private Color VARIABLE_COLOR = Color.blue.darker().darker().darker();
755
        private Color VARIABLE_COLOR = LFCustoms.shiftColor(new Color(64,64,255));
756
        
756
        
757
        public GlobalVariablePaintComponent(){
757
        public GlobalVariablePaintComponent(){
758
            super();
758
            super();
Lines 765-772 public abstract class CsmPaintComponent extends JPanel { Link Here
765
    }
765
    }
766
    
766
    
767
    public static class MacroPaintComponent extends CsmPaintComponent{
767
    public static class MacroPaintComponent extends CsmPaintComponent{
768
        private Color MACRO_NAME_COLOR = CsmFontColorManager.instance().getColor(FontColorProvider.Entity.DEFINED_MACRO);//Color.green.darker().darker();
768
        private Color MACRO_NAME_COLOR = CsmFontColorManager.instance().getColor(FontColorProvider.Entity.DEFINED_MACRO);//new Color(64,255,64).darker().darker();
769
        private Color MACRO_PARAMETER_NAME_COLOR = new Color(163, 102, 10);//Color.magenta.darker();
769
        private Color MACRO_PARAMETER_NAME_COLOR = LFCustoms.shiftColor(new Color(227, 166, 74));//Color.magenta.darker();
770
        private List params = null;
770
        private List params = null;
771
        private String name;
771
        private String name;
772
772
Lines 848-854 public abstract class CsmPaintComponent extends JPanel { Link Here
848
    }
848
    }
849
    
849
    
850
    public static class TemplateParameterPaintComponent extends CsmPaintComponent{
850
    public static class TemplateParameterPaintComponent extends CsmPaintComponent{
851
        private Color PARAMETER_NAME_COLOR = Color.BLACK.darker().darker();
851
        private Color PARAMETER_NAME_COLOR = LFCustoms.getTextFgColor();
852
        private List params = null;
852
        private List params = null;
853
        private String name;
853
        private String name;
854
854
Lines 897-903 public abstract class CsmPaintComponent extends JPanel { Link Here
897
    }
897
    }
898
898
899
    public static class LabelPaintComponent extends  CsmPaintComponent {
899
    public static class LabelPaintComponent extends  CsmPaintComponent {
900
        private Color LABEL_NAME_COLOR = Color.BLACK.darker().darker();
900
        private Color LABEL_NAME_COLOR = LFCustoms.getTextFgColor();
901
        private List params = null;
901
        private List params = null;
902
        private String name;
902
        private String name;
903
903
Lines 947-954 public abstract class CsmPaintComponent extends JPanel { Link Here
947
    
947
    
948
    public static class ConstructorPaintComponent extends CsmPaintComponent{
948
    public static class ConstructorPaintComponent extends CsmPaintComponent{
949
        
949
        
950
        private Color CONSTRUCTOR_COLOR = Color.orange.darker().darker();
950
        private Color CONSTRUCTOR_COLOR = LFCustoms.shiftColor(Color.orange);
951
        private Color PARAMETER_NAME_COLOR = new Color(163, 102, 10);//Color.magenta.darker();
951
        private Color PARAMETER_NAME_COLOR = LFCustoms.shiftColor(new Color(227, 166, 74));//Color.magenta.darker();
952
        private List params = new ArrayList();
952
        private List params = new ArrayList();
953
        private List excs = new ArrayList();
953
        private List excs = new ArrayList();
954
        private String name;
954
        private String name;
Lines 1020-1026 public abstract class CsmPaintComponent extends JPanel { Link Here
1020
        
1020
        
1021
        protected void drawExceptions(Graphics g, List exc, boolean strike) {
1021
        protected void drawExceptions(Graphics g, List exc, boolean strike) {
1022
            if (exc.size() > 0) {
1022
            if (exc.size() > 0) {
1023
                drawString(g, THROWS, KEYWORD_COLOR, null, strike);
1023
                drawString(g, THROWS, LFCustoms.shiftColor(KEYWORD_COLOR), null, strike);
1024
                for (Iterator it = exc.iterator(); it.hasNext();) {
1024
                for (Iterator it = exc.iterator(); it.hasNext();) {
1025
                    ExceptionStr ex = (ExceptionStr) it.next();
1025
                    ExceptionStr ex = (ExceptionStr) it.next();
1026
                    drawString(g, ex.getName(), ex.getTypeColor(), null, strike);
1026
                    drawString(g, ex.getName(), ex.getTypeColor(), null, strike);
Lines 1106-1112 public abstract class CsmPaintComponent extends JPanel { Link Here
1106
    public static class MethodPaintComponent extends ConstructorPaintComponent {
1106
    public static class MethodPaintComponent extends ConstructorPaintComponent {
1107
        
1107
        
1108
        //private Color PARAMETER_NAME_COLOR = Color.magenta.darker();
1108
        //private Color PARAMETER_NAME_COLOR = Color.magenta.darker();
1109
        private Color METHOD_COLOR = Color.black;//red.darker().darker();
1109
        private Color METHOD_COLOR = LFCustoms.getTextFgColor();
1110
        private String typeName;
1110
        private String typeName;
1111
        private Color typeColor;
1111
        private Color typeColor;
1112
        private boolean drawTypeAsPrefix = false;
1112
        private boolean drawTypeAsPrefix = false;
Lines 1191-1197 public abstract class CsmPaintComponent extends JPanel { Link Here
1191
    }
1191
    }
1192
1192
1193
    public static class FileLocalFunctionPaintComponent extends MethodPaintComponent {
1193
    public static class FileLocalFunctionPaintComponent extends MethodPaintComponent {
1194
        private Color FUN_COLOR = Color.black;//red.darker().darker();
1194
        private Color FUN_COLOR = LFCustoms.getTextFgColor();
1195
        
1195
        
1196
        public FileLocalFunctionPaintComponent(){
1196
        public FileLocalFunctionPaintComponent(){
1197
            super();
1197
            super();
Lines 1204-1210 public abstract class CsmPaintComponent extends JPanel { Link Here
1204
    }
1204
    }
1205
    
1205
    
1206
    public static class GlobalFunctionPaintComponent extends MethodPaintComponent {
1206
    public static class GlobalFunctionPaintComponent extends MethodPaintComponent {
1207
        private Color FUN_COLOR = Color.black;//.red.darker().darker();
1207
        private Color FUN_COLOR = LFCustoms.getTextFgColor();
1208
        
1208
        
1209
        public GlobalFunctionPaintComponent(){
1209
        public GlobalFunctionPaintComponent(){
1210
            super();
1210
            super();
Lines 1278-1284 public abstract class CsmPaintComponent extends JPanel { Link Here
1278
        @Override
1278
        @Override
1279
        protected void draw(Graphics g){
1279
        protected void draw(Graphics g){
1280
            drawIcon(g, null);
1280
            drawIcon(g, null);
1281
            drawString(g, str, TYPE_COLOR);
1281
            drawString(g, str, LFCustoms.getTextFgColor());
1282
        }
1282
        }
1283
1283
1284
        @Override
1284
        @Override
(-)a/java.editor/nbproject/project.xml (+8 lines)
Lines 337-342 made subject to such option by the copyright holder. Link Here
337
                    </run-dependency>
337
                    </run-dependency>
338
                </dependency>
338
                </dependency>
339
                <dependency>
339
                <dependency>
340
                    <code-name-base>org.netbeans.swing.plaf</code-name-base>
341
                    <build-prerequisite/>
342
                    <compile-dependency/>
343
                    <run-dependency>
344
                        <specification-version>1.23.1</specification-version>
345
                    </run-dependency>
346
                </dependency>
347
                <dependency>
340
                    <code-name-base>org.openide.awt</code-name-base>
348
                    <code-name-base>org.openide.awt</code-name-base>
341
                    <build-prerequisite/>
349
                    <build-prerequisite/>
342
                    <compile-dependency/>
350
                    <compile-dependency/>
(-)a/java.editor/src/org/netbeans/modules/editor/java/JavaCompletionItem.java (-9 / +6 lines)
Lines 95-100 import org.openide.util.Exceptions; Link Here
95
import org.openide.util.ImageUtilities;
95
import org.openide.util.ImageUtilities;
96
import org.openide.util.NbBundle;
96
import org.openide.util.NbBundle;
97
import org.openide.xml.XMLUtil;
97
import org.openide.xml.XMLUtil;
98
import org.netbeans.swing.plaf.LFCustoms;
98
99
99
/**
100
/**
100
 *
101
 *
Lines 1059-1065 public abstract class JavaCompletionItem implements CompletionItem { Link Here
1059
    
1060
    
1060
    static class TypeParameterItem extends JavaCompletionItem {
1061
    static class TypeParameterItem extends JavaCompletionItem {
1061
        
1062
        
1062
        private static final String TYPE_PARAMETER_COLOR = "<font color=#000000>"; //NOI18N
1063
1063
1064
        private String simpleName;
1064
        private String simpleName;
1065
        private String leftText;
1065
        private String leftText;
Lines 1083-1089 public abstract class JavaCompletionItem implements CompletionItem { Link Here
1083
        
1083
        
1084
        protected String getLeftHtmlText() {
1084
        protected String getLeftHtmlText() {
1085
            if (leftText == null)
1085
            if (leftText == null)
1086
                leftText = TYPE_PARAMETER_COLOR + simpleName + COLOR_END;
1086
                leftText = LFCustoms.getTextFgColorHTML() + simpleName + COLOR_END;
1087
            return leftText;
1087
            return leftText;
1088
        }
1088
        }
1089
        
1089
        
Lines 1386-1392 public abstract class JavaCompletionItem implements CompletionItem { Link Here
1386
        private static final String METHOD_ST_PROTECTED = "org/netbeans/modules/editor/resources/completion/method_static_protected_16.png"; //NOI18N
1386
        private static final String METHOD_ST_PROTECTED = "org/netbeans/modules/editor/resources/completion/method_static_protected_16.png"; //NOI18N
1387
        private static final String METHOD_ST_PRIVATE = "org/netbeans/modules/editor/resources/completion/method_static_private_16.png"; //NOI18N
1387
        private static final String METHOD_ST_PRIVATE = "org/netbeans/modules/editor/resources/completion/method_static_private_16.png"; //NOI18N
1388
        private static final String METHOD_ST_PACKAGE = "org/netbeans/modules/editor/resources/completion/method_static_package_private_16.png"; //NOI18N
1388
        private static final String METHOD_ST_PACKAGE = "org/netbeans/modules/editor/resources/completion/method_static_package_private_16.png"; //NOI18N
1389
        private static final String METHOD_COLOR = "<font color=#000000>"; //NOI18N
1390
        private static final String PARAMETER_NAME_COLOR = "<font color=#a06001>"; //NOI18N
1389
        private static final String PARAMETER_NAME_COLOR = "<font color=#a06001>"; //NOI18N
1391
        private static ImageIcon icon[][] = new ImageIcon[2][4];
1390
        private static ImageIcon icon[][] = new ImageIcon[2][4];
1392
1391
Lines 1467-1473 public abstract class JavaCompletionItem implements CompletionItem { Link Here
1467
        protected String getLeftHtmlText() {
1466
        protected String getLeftHtmlText() {
1468
            if (leftText == null) {
1467
            if (leftText == null) {
1469
                StringBuilder lText = new StringBuilder();
1468
                StringBuilder lText = new StringBuilder();
1470
                lText.append(METHOD_COLOR);
1469
                lText.append(LFCustoms.getTextFgColorHTML());
1471
                if (!isInherited)
1470
                if (!isInherited)
1472
                    lText.append(BOLD);
1471
                    lText.append(BOLD);
1473
                if (isDeprecated || isBlackListed())
1472
                if (isDeprecated || isBlackListed())
Lines 1750-1756 public abstract class JavaCompletionItem implements CompletionItem { Link Here
1750
            return sb.toString();
1749
            return sb.toString();
1751
        }
1750
        }
1752
    }    
1751
    }    
1753
1752
    
1754
    static class OverrideMethodItem extends MethodItem {
1753
    static class OverrideMethodItem extends MethodItem {
1755
        
1754
        
1756
        private static final String IMPL_BADGE_PATH = "org/netbeans/modules/java/editor/resources/implement_badge.png";
1755
        private static final String IMPL_BADGE_PATH = "org/netbeans/modules/java/editor/resources/implement_badge.png";
Lines 1871-1877 public abstract class JavaCompletionItem implements CompletionItem { Link Here
1871
        private static final String METHOD_PUBLIC = "org/netbeans/modules/editor/resources/completion/method_16.png"; //NOI18N
1870
        private static final String METHOD_PUBLIC = "org/netbeans/modules/editor/resources/completion/method_16.png"; //NOI18N
1872
        private static final String GETTER_BADGE_PATH = "org/netbeans/modules/java/editor/resources/getter_badge.png"; //NOI18N
1871
        private static final String GETTER_BADGE_PATH = "org/netbeans/modules/java/editor/resources/getter_badge.png"; //NOI18N
1873
        private static final String SETTER_BADGE_PATH = "org/netbeans/modules/java/editor/resources/setter_badge.png"; //NOI18N
1872
        private static final String SETTER_BADGE_PATH = "org/netbeans/modules/java/editor/resources/setter_badge.png"; //NOI18N
1874
        private static final String METHOD_COLOR = "<font color=#000000>"; //NOI18N
1875
        private static final String PARAMETER_NAME_COLOR = "<font color=#a06001>"; //NOI18N
1873
        private static final String PARAMETER_NAME_COLOR = "<font color=#a06001>"; //NOI18N
1876
        
1874
        
1877
        private static ImageIcon superIcon;
1875
        private static ImageIcon superIcon;
Lines 1922-1928 public abstract class JavaCompletionItem implements CompletionItem { Link Here
1922
        protected String getLeftHtmlText() {
1920
        protected String getLeftHtmlText() {
1923
            if (leftText == null) {
1921
            if (leftText == null) {
1924
                StringBuilder lText = new StringBuilder();
1922
                StringBuilder lText = new StringBuilder();
1925
                lText.append(METHOD_COLOR);
1923
                lText.append(LFCustoms.getTextFgColorHTML());
1926
                lText.append(BOLD);
1924
                lText.append(BOLD);
1927
                lText.append(name);
1925
                lText.append(name);
1928
                lText.append(BOLD_END);
1926
                lText.append(BOLD_END);
Lines 2496-2502 public abstract class JavaCompletionItem implements CompletionItem { Link Here
2496
    static class ParametersItem extends JavaCompletionItem {
2494
    static class ParametersItem extends JavaCompletionItem {
2497
        
2495
        
2498
        private static final String PARAMETERS_COLOR = "<font color=#808080>"; //NOI18N
2496
        private static final String PARAMETERS_COLOR = "<font color=#808080>"; //NOI18N
2499
        private static final String ACTIVE_PARAMETER_COLOR = "<font color=#000000>"; //NOI18N
2500
2497
2501
        protected ElementHandle<ExecutableElement> elementHandle;
2498
        protected ElementHandle<ExecutableElement> elementHandle;
2502
        private boolean isDeprecated;
2499
        private boolean isDeprecated;
Lines 2567-2573 public abstract class JavaCompletionItem implements CompletionItem { Link Here
2567
                for (int i = 0; i < params.size(); i++) {
2564
                for (int i = 0; i < params.size(); i++) {
2568
                    ParamDesc paramDesc = params.get(i);
2565
                    ParamDesc paramDesc = params.get(i);
2569
                    if (i == activeParamsIndex)
2566
                    if (i == activeParamsIndex)
2570
                        lText.append(COLOR_END).append(ACTIVE_PARAMETER_COLOR).append(BOLD);
2567
                        lText.append(COLOR_END).append(LFCustoms.getTextFgColorHTML()).append(BOLD);
2571
                    lText.append(escape(paramDesc.typeName));
2568
                    lText.append(escape(paramDesc.typeName));
2572
                    lText.append(' ');
2569
                    lText.append(' ');
2573
                    lText.append(paramDesc.name);
2570
                    lText.append(paramDesc.name);
(-)a/o.n.swing.plaf/src/org/netbeans/swing/plaf/LFCustoms.java (+64 lines)
Lines 44-49 Link Here
44
44
45
package org.netbeans.swing.plaf;
45
package org.netbeans.swing.plaf;
46
46
47
import java.awt.Color;
48
import javax.swing.UIManager;
49
import javax.swing.plaf.ColorUIResource;
50
47
/** Look and feel customizations interface.
51
/** Look and feel customizations interface.
48
 * For various look and feels, there is a need to customize colors,
52
 * For various look and feels, there is a need to customize colors,
49
 * borders etc. to provide 'native-like' UI.
53
 * borders etc. to provide 'native-like' UI.
Lines 78-83 public abstract class LFCustoms { Link Here
78
    private Object[] guaranteedKeysAndValues = null;
82
    private Object[] guaranteedKeysAndValues = null;
79
    protected static final String WORKPLACE_FILL = "nb_workplace_fill"; //NOI18N
83
    protected static final String WORKPLACE_FILL = "nb_workplace_fill"; //NOI18N
80
84
85
    public static String getHexString(int color) {
86
            String result = Integer.toHexString(color).toUpperCase();
87
            if (result.length() == 1) {
88
                    return '0'+result;
89
            }
90
            return result;
91
    }
92
    private static String textFgColorHTML = "";
93
    public static String getTextFgColorHTML() {
94
        synchronized(LFCustoms.class) {
95
            if (textFgColorHTML.isEmpty()) {
96
                    Object o = UIManager.getLookAndFeel().getDefaults().get("windowText");
97
                    if (o instanceof ColorUIResource) {
98
                            ColorUIResource resource = (ColorUIResource)o;
99
                            textFgColorHTML = "<font color=#" + getHexString(resource.getRed()) + getHexString(resource.getGreen())+getHexString(resource.getBlue())+">";
100
                    } else {
101
                            textFgColorHTML = "<font color=#000000>";
102
                    }
103
            }
104
            return textFgColorHTML;
105
        }
106
    }
107
    private static Color textFgColor = null;
108
    public static Color getTextFgColor() {
109
        synchronized(LFCustoms.class) {
110
            if (textFgColor == null) {
111
                Object o = UIManager.getLookAndFeel().getDefaults().get("windowText");
112
                if (o instanceof ColorUIResource) {
113
                    textFgColor = (Color) o;
114
                } else {
115
                    textFgColor = Color.BLACK;
116
                }
117
            }
118
            return textFgColor;
119
        }
120
    }
121
    public static final int shiftValue = 64;
122
    static int brighter (int color) {
123
            int result = color + shiftValue;
124
            if (result > 255) {
125
                    return 255;
126
            } else {
127
                    return result;
128
            }
129
    }
130
    static int darker(int color) {
131
            int result = color - shiftValue;
132
            if (result < 0) {
133
                    return 0;
134
            } else {
135
                    return result;
136
            }
137
    }
138
    public static Color shiftColor(Color color) {
139
        Color textFgColor = getTextFgColor();
140
        if ((textFgColor.getRed() > 127) || (textFgColor.getGreen() > 127) || (textFgColor.getBlue() > 127)) {
141
            return new Color(brighter(color.getRed()), brighter(color.getGreen()), brighter(color.getBlue()));
142
        }
143
        return new Color(darker(color.getRed()), darker(color.getGreen()), darker(color.getBlue()));
144
    }
81
    //TODO: A nice idea would be to replace these classes with XML files - minor rewrite of NbTheme to do it
145
    //TODO: A nice idea would be to replace these classes with XML files - minor rewrite of NbTheme to do it
82
146
83
    /** Fetch and cache keys and values */
147
    /** Fetch and cache keys and values */

Return to bug 134281