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/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.getTextFgColor() + 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.getTextFgColor());
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.getTextFgColor());
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.getTextFgColor()).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 (+26 lines)
Lines 44-49 Link Here
44
44
45
package org.netbeans.swing.plaf;
45
package org.netbeans.swing.plaf;
46
46
47
import javax.swing.UIManager;
48
import javax.swing.plaf.ColorUIResource;
49
47
/** Look and feel customizations interface.
50
/** Look and feel customizations interface.
48
 * For various look and feels, there is a need to customize colors,
51
 * For various look and feels, there is a need to customize colors,
49
 * borders etc. to provide 'native-like' UI.
52
 * borders etc. to provide 'native-like' UI.
Lines 78-83 public abstract class LFCustoms { Link Here
78
    private Object[] guaranteedKeysAndValues = null;
81
    private Object[] guaranteedKeysAndValues = null;
79
    protected static final String WORKPLACE_FILL = "nb_workplace_fill"; //NOI18N
82
    protected static final String WORKPLACE_FILL = "nb_workplace_fill"; //NOI18N
80
83
84
    public static String getHexString(int color) {
85
            String result = Integer.toHexString(color).toUpperCase();
86
            if (result.length() == 1) {
87
                    return '0'+result;
88
            }
89
            return result;
90
    }
91
    private static String textFgColor = "";
92
    public static String getTextFgColor() {
93
        synchronized(LFCustoms.class) {
94
            if (textFgColor.isEmpty()) {
95
                    Object o = UIManager.getLookAndFeel().getDefaults().get("windowText");
96
                    if (o instanceof ColorUIResource) {
97
                            ColorUIResource resource = (ColorUIResource)o;
98
                            textFgColor = "<font color=#" + getHexString(resource.getRed()) + getHexString(resource.getGreen())+getHexString(resource.getBlue())+">";
99
                    } else {
100
                            textFgColor = "<font color=#000000>";
101
                    }
102
            }
103
            return textFgColor;
104
        }
105
    }
106
    
81
    //TODO: A nice idea would be to replace these classes with XML files - minor rewrite of NbTheme to do it
107
    //TODO: A nice idea would be to replace these classes with XML files - minor rewrite of NbTheme to do it
82
108
83
    /** Fetch and cache keys and values */
109
    /** Fetch and cache keys and values */

Return to bug 134281