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 123853
Collapse All | Expand All

(-)editor/options/src/org/netbeans/modules/options/colors/CategoryComparator.java (-5 / +7 lines)
Lines 44-49 Link Here
44
import java.util.Comparator;
44
import java.util.Comparator;
45
import javax.swing.text.AttributeSet;
45
import javax.swing.text.AttributeSet;
46
import org.netbeans.api.editor.settings.EditorStyleConstants;
46
import org.netbeans.api.editor.settings.EditorStyleConstants;
47
import org.openide.util.NbBundle;
47
48
48
49
49
/**
50
/**
Lines 51-69 Link Here
51
 * @author Jan Jancura
52
 * @author Jan Jancura
52
 */
53
 */
53
public final class CategoryComparator implements Comparator<AttributeSet> {
54
public final class CategoryComparator implements Comparator<AttributeSet> {
54
55
    String default_string = NbBundle.getMessage(org.netbeans.modules.editor.NbEditorKit.class, "default");
56
                
55
    public int compare (AttributeSet o1, AttributeSet o2) {
57
    public int compare (AttributeSet o1, AttributeSet o2) {
56
        String name_1 = name(o1);
58
        String name_1 = name(o1);
57
        String name_2 = name(o2);
59
        String name_2 = name(o2);
58
	if (name_1.startsWith ("default")) // NOI18N
60
	if (name_1.startsWith (default_string))
59
	    return name_2.startsWith ("default") ? 0 : -1; // NOI18N
61
	    return name_2.startsWith (default_string) ? 0 : -1;
60
        if (name_2.startsWith ("default")) // NOI18N
62
        if (name_2.startsWith (default_string))
61
            return 1;
63
            return 1;
62
	return name_1.compareTo (name_2);
64
	return name_1.compareTo (name_2);
63
    }
65
    }
64
    
66
    
65
    private static String name (AttributeSet o) {
67
    private static String name (AttributeSet o) {
66
        return ((String) o.getAttribute(EditorStyleConstants.DisplayName)).toLowerCase();
68
        return ((String) o.getAttribute(EditorStyleConstants.DisplayName));
67
    }
69
    }
68
    
70
    
69
}
71
}
(-)editor/options/src/org/netbeans/modules/options/colors/SyntaxColoringPanel.java (+2 lines)
Lines 997-1002 Link Here
997
        public int compare(String o1, String o2) {
997
        public int compare(String o1, String o2) {
998
            if (o1.equals(ColorModel.ALL_LANGUAGES))
998
            if (o1.equals(ColorModel.ALL_LANGUAGES))
999
                return o2.equals(ColorModel.ALL_LANGUAGES) ? 0 : -1;
999
                return o2.equals(ColorModel.ALL_LANGUAGES) ? 0 : -1;
1000
            if (o2.equals(ColorModel.ALL_LANGUAGES))
1001
                return 1;
1000
            return o1.compareTo(o2);
1002
            return o1.compareTo(o2);
1001
        }
1003
        }
1002
    }
1004
    }

Return to bug 123853