Changeset 18


Ignore:
Timestamp:
10/02/02 02:10:22 (20 years ago)
Author:
piso
Message:

REORDER_BUFFERS is now an integer property.

Location:
trunk/j/src/org/armedbear/j
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/src/org/armedbear/j/BufferList.java

    r2 r18  
    33 *
    44 * Copyright (C) 1998-2002 Peter Graves
    5  * $Id: BufferList.java,v 1.1.1.1 2002-09-24 16:09:14 piso Exp $
     5 * $Id: BufferList.java,v 1.2 2002-10-02 02:10:22 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    3131    private final ArrayList list = new ArrayList();
    3232
    33     private boolean sort;
     33    private boolean alpha; // Sort alphabetically?
    3434    private boolean reorder;
    3535    private boolean modified;
     
    3939        Preferences p = Editor.preferences();
    4040        if (p != null) {
    41             sort = p.getBooleanProperty(Property.SORT_BUFFER_LIST);
    42             reorder = p.getBooleanProperty(Property.REORDER_BUFFERS) && !sort;
     41            alpha = p.getBooleanProperty(Property.SORT_BUFFER_LIST);
     42            if (alpha)
     43                reorder = false;
     44            else
     45                reorder = p.getIntegerProperty(Property.REORDER_BUFFERS) > 0;
    4346            p.addPreferencesChangeListener(this);
    4447        } else
     
    4851    public synchronized Iterator iterator()
    4952    {
    50         if (sort && modified)
     53        if (alpha && modified)
    5154            sort();
    5255        return list.iterator();
     
    7780    {
    7881        if (list.size() > 0) {
    79             if (sort && modified)
     82            if (alpha && modified)
    8083                sort();
    8184            return (Buffer) list.get(0);
     
    8689    public synchronized Buffer getNextPrimaryBuffer(Buffer buffer)
    8790    {
    88         if (sort && modified)
     91        if (alpha && modified)
    8992            sort();
    9093        if (buffer.isSecondary()) {
     
    113116    public synchronized Buffer getPreviousPrimaryBuffer(Buffer buffer)
    114117    {
    115         if (sort && modified)
     118        if (alpha && modified)
    116119            sort();
    117120        if (buffer.isSecondary()) {
     
    221224        Preferences p = Editor.preferences();
    222225        boolean b = p.getBooleanProperty(Property.SORT_BUFFER_LIST);
    223         if (b != sort) {
    224             sort = b;
    225             if (sort) {
     226        if (b != alpha) {
     227            alpha = b;
     228            if (alpha) {
    226229                sort();
    227230                Sidebar.setUpdateFlagInAllFrames(SIDEBAR_BUFFER_LIST_CHANGED);
    228231            }
    229232        }
    230         reorder = p.getBooleanProperty(Property.REORDER_BUFFERS) && !sort;
     233        if (alpha)
     234            reorder = false;
     235        else
     236            reorder = p.getIntegerProperty(Property.REORDER_BUFFERS) > 0;
    231237    }
    232238
     
    244250    private void sort()
    245251    {
    246         if (sort) {
     252        if (alpha) {
    247253            if (comparator == null) {
    248254                comparator = new Comparator() {
  • trunk/j/src/org/armedbear/j/Property.java

    r6 r18  
    33 *
    44 * Copyright (C) 2000-2002 Peter Graves
    5  * $Id: Property.java,v 1.2 2002-09-25 13:31:42 piso Exp $
     5 * $Id: Property.java,v 1.3 2002-10-02 02:09:49 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    5959    public static final Property PRINTER_FONT_SIZE =
    6060        createProperty("printerFontSize", 10);
     61    public static final Property REORDER_BUFFERS =
     62        createProperty("reorderBuffers", 1);
    6163    public static final Property SHELL_OUTPUT_LIMIT =
    6264        createProperty("shellOutputLimit", 1000);
     
    161163    public static final Property POP_KEEP_MESSAGES_ON_SERVER =
    162164        createProperty("popKeepMessagesOnServer", true);
    163     public static final Property REORDER_BUFFERS =
    164         createProperty("reorderBuffers", true);
    165165    public static final Property REMOVE_TRAILING_WHITESPACE =
    166166        createProperty("removeTrailingWhitespace", false);
Note: See TracChangeset for help on using the changeset viewer.