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 (-4 / +3 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 121-127 public abstract class CsmResultItem implements CompletionItem { Link Here
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.gray;
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) ? KEYWORD_COLOR : LFCustoms.getTextFgColor();
149
    }
148
    }
150
149
151
    public void setSubstituteOffset(int substituteOffset) {
150
    public void setSubstituteOffset(int substituteOffset) {
Lines 953-959 public abstract class CsmResultItem implements CompletionItem { Link Here
953
                    varArgIndex = i;
952
                    varArgIndex = i;
954
                } else {
953
                } else {
955
                    String typeName = getTypeName(type, instantiateTypes);
954
                    String typeName = getTypeName(type, instantiateTypes);
956
                    params.add(new ParamStr(typeName, typeName, ((CsmParameter) prm).getName().toString(), false, TYPE_COLOR /*getTypeColor(type.getClassifier())*/));
955
                    params.add(new ParamStr(typeName, typeName, ((CsmParameter) prm).getName().toString(), false, LFCustoms.getTextFgColor() /*getTypeColor(type.getClassifier())*/));
957
                }
956
                }
958
                i++;
957
                i++;
959
            }
958
            }
(-)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 (-19 / +18 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 102-108 public abstract class CsmPaintComponent extends JPanel { Link Here
102
    };
102
    };
103
    
103
    
104
    private static final Color KEYWORD_COLOR = Color.darkGray;
104
    private static final Color KEYWORD_COLOR = Color.darkGray;
105
    private static final Color TYPE_COLOR = Color.black;
106
    private static final Color POSTFIX_COLOR = Color.gray;
105
    private static final Color POSTFIX_COLOR = Color.gray;
107
    
106
    
108
    private Icon icon;
107
    private Icon icon;
Lines 397-403 public abstract class CsmPaintComponent extends JPanel { Link Here
397
396
398
        private String pkgName;
397
        private String pkgName;
399
        private boolean displayFullNamespacePath;
398
        private boolean displayFullNamespacePath;
400
        private Color NAMESPACE_COLOR = Color.green.darker().darker().darker();
399
        private Color NAMESPACE_COLOR = Color.green;
401
        
400
        
402
        public NamespacePaintComponent(){
401
        public NamespacePaintComponent(){
403
            super();
402
            super();
Lines 434-440 public abstract class CsmPaintComponent extends JPanel { Link Here
434
    public static class NamespaceAliasPaintComponent extends CsmPaintComponent{
433
    public static class NamespaceAliasPaintComponent extends CsmPaintComponent{
435
434
436
        private String aliasName;
435
        private String aliasName;
437
        private Color NAMESPACE_COLOR = Color.green.darker().darker().darker();
436
        private Color NAMESPACE_COLOR = Color.green;
438
        
437
        
439
        public NamespaceAliasPaintComponent(){
438
        public NamespaceAliasPaintComponent(){
440
            super();
439
            super();
Lines 463-469 public abstract class CsmPaintComponent extends JPanel { Link Here
463
    public static class EnumPaintComponent extends CsmPaintComponent {
462
    public static class EnumPaintComponent extends CsmPaintComponent {
464
        
463
        
465
        String formatEnumName;
464
        String formatEnumName;
466
        private Color ENUM_COLOR = Color.red.darker().darker().darker().darker();
465
        private Color ENUM_COLOR = Color.red;
467
        private boolean displayFQN;
466
        private boolean displayFQN;
468
        
467
        
469
        public void EnumPaintComponent(String formatEnumName){
468
        public void EnumPaintComponent(String formatEnumName){
Lines 498-504 public abstract class CsmPaintComponent extends JPanel { Link Here
498
    public static class EnumeratorPaintComponent extends CsmPaintComponent {
497
    public static class EnumeratorPaintComponent extends CsmPaintComponent {
499
        
498
        
500
        String formatEnumeratorName;
499
        String formatEnumeratorName;
501
        private Color ENUMERATOR_COLOR = Color.blue.darker().darker().darker().darker();
500
        private Color ENUMERATOR_COLOR = Color.blue;
502
        private boolean displayFQN;
501
        private boolean displayFQN;
503
        
502
        
504
        public void EnumeratorPaintComponent(String formatEnumeratorName){
503
        public void EnumeratorPaintComponent(String formatEnumeratorName){
Lines 534-540 public abstract class CsmPaintComponent extends JPanel { Link Here
534
    public static class ClassPaintComponent extends CsmPaintComponent{
533
    public static class ClassPaintComponent extends CsmPaintComponent{
535
        
534
        
536
        String formatClassName;
535
        String formatClassName;
537
        private Color CLASS_COLOR = Color.red.darker().darker().darker();
536
        private Color CLASS_COLOR = Color.red;
538
        private boolean displayFQN;
537
        private boolean displayFQN;
539
        
538
        
540
        public void setFormatClassName(String formatClassName){
539
        public void setFormatClassName(String formatClassName){
Lines 597-603 public abstract class CsmPaintComponent extends JPanel { Link Here
597
596
598
    public static class StructPaintComponent extends ClassPaintComponent{
597
    public static class StructPaintComponent extends ClassPaintComponent{
599
        
598
        
600
        private Color STRUCT_COLOR = Color.red.darker().darker();
599
        private Color STRUCT_COLOR = Color.red;
601
        
600
        
602
        @Override
601
        @Override
603
        protected Color getColor(){
602
        protected Color getColor(){
Lines 611-617 public abstract class CsmPaintComponent extends JPanel { Link Here
611
    
610
    
612
    public static class UnionPaintComponent extends ClassPaintComponent{
611
    public static class UnionPaintComponent extends ClassPaintComponent{
613
        
612
        
614
        private Color UNION_COLOR = Color.red.darker();
613
        private Color UNION_COLOR = Color.red;
615
        
614
        
616
        @Override
615
        @Override
617
        protected Color getColor(){
616
        protected Color getColor(){
Lines 706-712 public abstract class CsmPaintComponent extends JPanel { Link Here
706
    }
705
    }
707
    
706
    
708
    public static class LocalVariablePaintComponent extends FieldPaintComponent {
707
    public static class LocalVariablePaintComponent extends FieldPaintComponent {
709
        private Color VARIABLE_COLOR = Color.red.darker().darker().darker();
708
        private Color VARIABLE_COLOR = Color.red;
710
        
709
        
711
        public LocalVariablePaintComponent(){
710
        public LocalVariablePaintComponent(){
712
            super();
711
            super();
Lines 725-731 public abstract class CsmPaintComponent extends JPanel { Link Here
725
    }
724
    }
726
    
725
    
727
    public static class FileLocalVariablePaintComponent extends FieldPaintComponent {
726
    public static class FileLocalVariablePaintComponent extends FieldPaintComponent {
728
        private Color VARIABLE_COLOR = Color.blue.darker().darker().darker();
727
        private Color VARIABLE_COLOR = Color.blue;
729
        
728
        
730
        public FileLocalVariablePaintComponent(){
729
        public FileLocalVariablePaintComponent(){
731
            super();
730
            super();
Lines 738-744 public abstract class CsmPaintComponent extends JPanel { Link Here
738
    }
737
    }
739
    
738
    
740
    public static class GlobalVariablePaintComponent extends FieldPaintComponent {
739
    public static class GlobalVariablePaintComponent extends FieldPaintComponent {
741
        private Color VARIABLE_COLOR = Color.blue.darker().darker().darker();
740
        private Color VARIABLE_COLOR = Color.blue;
742
        
741
        
743
        public GlobalVariablePaintComponent(){
742
        public GlobalVariablePaintComponent(){
744
            super();
743
            super();
Lines 832-838 public abstract class CsmPaintComponent extends JPanel { Link Here
832
    }
831
    }
833
    
832
    
834
    public static class TemplateParameterPaintComponent extends CsmPaintComponent{
833
    public static class TemplateParameterPaintComponent extends CsmPaintComponent{
835
        private Color PARAMETER_NAME_COLOR = Color.BLACK.darker().darker();
834
        private Color PARAMETER_NAME_COLOR = LFCustoms.getTextFgColor();
836
        private List params = null;
835
        private List params = null;
837
        private String name;
836
        private String name;
838
837
Lines 879-885 public abstract class CsmPaintComponent extends JPanel { Link Here
879
    }
878
    }
880
879
881
    public static class LabelPaintComponent extends  CsmPaintComponent {
880
    public static class LabelPaintComponent extends  CsmPaintComponent {
882
        private Color LABEL_NAME_COLOR = Color.BLACK.darker().darker();
881
        private Color LABEL_NAME_COLOR = LFCustoms.getTextFgColor();
883
        private List params = null;
882
        private List params = null;
884
        private String name;
883
        private String name;
885
884
Lines 927-933 public abstract class CsmPaintComponent extends JPanel { Link Here
927
    
926
    
928
    public static class ConstructorPaintComponent extends CsmPaintComponent{
927
    public static class ConstructorPaintComponent extends CsmPaintComponent{
929
        
928
        
930
        private Color CONSTRUCTOR_COLOR = Color.orange.darker().darker();
929
        private Color CONSTRUCTOR_COLOR = Color.orange;
931
        private Color PARAMETER_NAME_COLOR = new Color(163, 102, 10);//Color.magenta.darker();
930
        private Color PARAMETER_NAME_COLOR = new Color(163, 102, 10);//Color.magenta.darker();
932
        private List params = new ArrayList();
931
        private List params = new ArrayList();
933
        private List excs = new ArrayList();
932
        private List excs = new ArrayList();
Lines 1084-1090 public abstract class CsmPaintComponent extends JPanel { Link Here
1084
    public static class MethodPaintComponent extends ConstructorPaintComponent {
1083
    public static class MethodPaintComponent extends ConstructorPaintComponent {
1085
        
1084
        
1086
        //private Color PARAMETER_NAME_COLOR = Color.magenta.darker();
1085
        //private Color PARAMETER_NAME_COLOR = Color.magenta.darker();
1087
        private Color METHOD_COLOR = Color.black;//red.darker().darker();
1086
        private Color METHOD_COLOR = LFCustoms.getTextFgColor();
1088
        private String typeName;
1087
        private String typeName;
1089
        private Color typeColor;
1088
        private Color typeColor;
1090
        private boolean drawTypeAsPrefix = false;
1089
        private boolean drawTypeAsPrefix = false;
Lines 1169-1175 public abstract class CsmPaintComponent extends JPanel { Link Here
1169
    }
1168
    }
1170
1169
1171
    public static class FileLocalFunctionPaintComponent extends MethodPaintComponent {
1170
    public static class FileLocalFunctionPaintComponent extends MethodPaintComponent {
1172
        private Color FUN_COLOR = Color.black;//red.darker().darker();
1171
        private Color FUN_COLOR = LFCustoms.getTextFgColor();
1173
        
1172
        
1174
        public FileLocalFunctionPaintComponent(){
1173
        public FileLocalFunctionPaintComponent(){
1175
            super();
1174
            super();
Lines 1182-1188 public abstract class CsmPaintComponent extends JPanel { Link Here
1182
    }
1181
    }
1183
    
1182
    
1184
    public static class GlobalFunctionPaintComponent extends MethodPaintComponent {
1183
    public static class GlobalFunctionPaintComponent extends MethodPaintComponent {
1185
        private Color FUN_COLOR = Color.black;//.red.darker().darker();
1184
        private Color FUN_COLOR = LFCustoms.getTextFgColor();
1186
        
1185
        
1187
        public GlobalFunctionPaintComponent(){
1186
        public GlobalFunctionPaintComponent(){
1188
            super();
1187
            super();
Lines 1253-1259 public abstract class CsmPaintComponent extends JPanel { Link Here
1253
        
1252
        
1254
        protected void draw(Graphics g){
1253
        protected void draw(Graphics g){
1255
            drawIcon(g, null);
1254
            drawIcon(g, null);
1256
            drawString(g, str, TYPE_COLOR);
1255
            drawString(g, str, LFCustoms.getTextFgColor());
1257
        }
1256
        }
1258
1257
1259
        public String toString() {
1258
        public String toString() {
(-)a/java.editor/nbproject/project.xml (+8 lines)
Lines 328-333 made subject to such option by the copyright holder. Link Here
328
                    </run-dependency>
328
                    </run-dependency>
329
                </dependency>
329
                </dependency>
330
                <dependency>
330
                <dependency>
331
                    <code-name-base>org.netbeans.swing.plaf</code-name-base>
332
                    <build-prerequisite/>
333
                    <compile-dependency/>
334
                    <run-dependency>
335
                        <specification-version>1.23.1</specification-version>
336
                    </run-dependency>
337
                </dependency>
338
                <dependency>
331
                    <code-name-base>org.openide.awt</code-name-base>
339
                    <code-name-base>org.openide.awt</code-name-base>
332
                    <build-prerequisite/>
340
                    <build-prerequisite/>
333
                    <compile-dependency/>
341
                    <compile-dependency/>
(-)a/java.editor/src/org/netbeans/modules/editor/java/JavaCompletionItem.java (-9 / +6 lines)
Lines 94-99 import org.openide.util.Exceptions; Link Here
94
import org.openide.util.ImageUtilities;
94
import org.openide.util.ImageUtilities;
95
import org.openide.util.NbBundle;
95
import org.openide.util.NbBundle;
96
import org.openide.xml.XMLUtil;
96
import org.openide.xml.XMLUtil;
97
import org.netbeans.swing.plaf.LFCustoms;
97
98
98
/**
99
/**
99
 *
100
 *
Lines 1054-1060 public abstract class JavaCompletionItem implements CompletionItem { Link Here
1054
    
1055
    
1055
    static class TypeParameterItem extends JavaCompletionItem {
1056
    static class TypeParameterItem extends JavaCompletionItem {
1056
        
1057
        
1057
        private static final String TYPE_PARAMETER_COLOR = "<font color=#000000>"; //NOI18N
1058
1058
1059
        private String simpleName;
1059
        private String simpleName;
1060
        private String leftText;
1060
        private String leftText;
Lines 1078-1084 public abstract class JavaCompletionItem implements CompletionItem { Link Here
1078
        
1078
        
1079
        protected String getLeftHtmlText() {
1079
        protected String getLeftHtmlText() {
1080
            if (leftText == null)
1080
            if (leftText == null)
1081
                leftText = TYPE_PARAMETER_COLOR + simpleName + COLOR_END;
1081
                leftText = LFCustoms.getTextFgColorHTML() + simpleName + COLOR_END;
1082
            return leftText;
1082
            return leftText;
1083
        }
1083
        }
1084
        
1084
        
Lines 1382-1388 public abstract class JavaCompletionItem implements CompletionItem { Link Here
1382
        private static final String METHOD_ST_PROTECTED = "org/netbeans/modules/editor/resources/completion/method_static_protected_16.png"; //NOI18N
1382
        private static final String METHOD_ST_PROTECTED = "org/netbeans/modules/editor/resources/completion/method_static_protected_16.png"; //NOI18N
1383
        private static final String METHOD_ST_PRIVATE = "org/netbeans/modules/editor/resources/completion/method_static_private_16.png"; //NOI18N
1383
        private static final String METHOD_ST_PRIVATE = "org/netbeans/modules/editor/resources/completion/method_static_private_16.png"; //NOI18N
1384
        private static final String METHOD_ST_PACKAGE = "org/netbeans/modules/editor/resources/completion/method_static_package_private_16.png"; //NOI18N
1384
        private static final String METHOD_ST_PACKAGE = "org/netbeans/modules/editor/resources/completion/method_static_package_private_16.png"; //NOI18N
1385
        private static final String METHOD_COLOR = "<font color=#000000>"; //NOI18N
1386
        private static final String PARAMETER_NAME_COLOR = "<font color=#a06001>"; //NOI18N
1385
        private static final String PARAMETER_NAME_COLOR = "<font color=#a06001>"; //NOI18N
1387
        private static ImageIcon icon[][] = new ImageIcon[2][4];
1386
        private static ImageIcon icon[][] = new ImageIcon[2][4];
1388
1387
Lines 1464-1470 public abstract class JavaCompletionItem implements CompletionItem { Link Here
1464
        protected String getLeftHtmlText() {
1463
        protected String getLeftHtmlText() {
1465
            if (leftText == null) {
1464
            if (leftText == null) {
1466
                StringBuilder lText = new StringBuilder();
1465
                StringBuilder lText = new StringBuilder();
1467
                lText.append(METHOD_COLOR);
1466
                lText.append(LFCustoms.getTextFgColorHTML());
1468
                if (!isInherited)
1467
                if (!isInherited)
1469
                    lText.append(BOLD);
1468
                    lText.append(BOLD);
1470
                if (isDeprecated || isBlackListed())
1469
                if (isDeprecated || isBlackListed())
Lines 1747-1753 public abstract class JavaCompletionItem implements CompletionItem { Link Here
1747
            return sb.toString();
1746
            return sb.toString();
1748
        }
1747
        }
1749
    }    
1748
    }    
1750
1749
    
1751
    static class OverrideMethodItem extends MethodItem {
1750
    static class OverrideMethodItem extends MethodItem {
1752
        
1751
        
1753
        private static final String IMPL_BADGE_PATH = "org/netbeans/modules/java/editor/resources/implement_badge.png";
1752
        private static final String IMPL_BADGE_PATH = "org/netbeans/modules/java/editor/resources/implement_badge.png";
Lines 1868-1874 public abstract class JavaCompletionItem implements CompletionItem { Link Here
1868
        private static final String METHOD_PUBLIC = "org/netbeans/modules/editor/resources/completion/method_16.png"; //NOI18N
1867
        private static final String METHOD_PUBLIC = "org/netbeans/modules/editor/resources/completion/method_16.png"; //NOI18N
1869
        private static final String GETTER_BADGE_PATH = "org/netbeans/modules/java/editor/resources/getter_badge.png"; //NOI18N
1868
        private static final String GETTER_BADGE_PATH = "org/netbeans/modules/java/editor/resources/getter_badge.png"; //NOI18N
1870
        private static final String SETTER_BADGE_PATH = "org/netbeans/modules/java/editor/resources/setter_badge.png"; //NOI18N
1869
        private static final String SETTER_BADGE_PATH = "org/netbeans/modules/java/editor/resources/setter_badge.png"; //NOI18N
1871
        private static final String METHOD_COLOR = "<font color=#000000>"; //NOI18N
1872
        private static final String PARAMETER_NAME_COLOR = "<font color=#a06001>"; //NOI18N
1870
        private static final String PARAMETER_NAME_COLOR = "<font color=#a06001>"; //NOI18N
1873
        
1871
        
1874
        private static ImageIcon superIcon;
1872
        private static ImageIcon superIcon;
Lines 1919-1925 public abstract class JavaCompletionItem implements CompletionItem { Link Here
1919
        protected String getLeftHtmlText() {
1917
        protected String getLeftHtmlText() {
1920
            if (leftText == null) {
1918
            if (leftText == null) {
1921
                StringBuilder lText = new StringBuilder();
1919
                StringBuilder lText = new StringBuilder();
1922
                lText.append(METHOD_COLOR);
1920
                lText.append(LFCustoms.getTextFgColorHTML());
1923
                lText.append(BOLD);
1921
                lText.append(BOLD);
1924
                lText.append(name);
1922
                lText.append(name);
1925
                lText.append(BOLD_END);
1923
                lText.append(BOLD_END);
Lines 2493-2499 public abstract class JavaCompletionItem implements CompletionItem { Link Here
2493
    static class ParametersItem extends JavaCompletionItem {
2491
    static class ParametersItem extends JavaCompletionItem {
2494
        
2492
        
2495
        private static final String PARAMETERS_COLOR = "<font color=#808080>"; //NOI18N
2493
        private static final String PARAMETERS_COLOR = "<font color=#808080>"; //NOI18N
2496
        private static final String ACTIVE_PARAMETER_COLOR = "<font color=#000000>"; //NOI18N
2497
2494
2498
        protected ElementHandle<ExecutableElement> elementHandle;
2495
        protected ElementHandle<ExecutableElement> elementHandle;
2499
        private boolean isDeprecated;
2496
        private boolean isDeprecated;
Lines 2564-2570 public abstract class JavaCompletionItem implements CompletionItem { Link Here
2564
                for (int i = 0; i < params.size(); i++) {
2561
                for (int i = 0; i < params.size(); i++) {
2565
                    ParamDesc paramDesc = params.get(i);
2562
                    ParamDesc paramDesc = params.get(i);
2566
                    if (i == activeParamsIndex)
2563
                    if (i == activeParamsIndex)
2567
                        lText.append(COLOR_END).append(ACTIVE_PARAMETER_COLOR).append(BOLD);
2564
                        lText.append(COLOR_END).append(LFCustoms.getTextFgColorHTML()).append(BOLD);
2568
                    lText.append(escape(paramDesc.typeName));
2565
                    lText.append(escape(paramDesc.typeName));
2569
                    lText.append(' ');
2566
                    lText.append(' ');
2570
                    lText.append(paramDesc.name);
2567
                    lText.append(paramDesc.name);
(-)a/o.n.swing.plaf/src/org/netbeans/swing/plaf/LFCustoms.java (+40 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
    }
81
    //TODO: A nice idea would be to replace these classes with XML files - minor rewrite of NbTheme to do it
121
    //TODO: A nice idea would be to replace these classes with XML files - minor rewrite of NbTheme to do it
82
122
83
    /** Fetch and cache keys and values */
123
    /** Fetch and cache keys and values */

Return to bug 134281