Changeset 263


Ignore:
Timestamp:
11/15/02 20:24:46 (20 years ago)
Author:
piso
Message:

NewsGroupSummaryMode? now extends MailboxMode?.

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

Legend:

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

    r38 r263  
    33 *
    44 * Copyright (C) 1998-2002 Peter Graves
    5  * $Id: MailboxMode.java,v 1.2 2002-10-03 17:40:26 piso Exp $
     5 * $Id: MailboxMode.java,v 1.3 2002-11-15 20:23:09 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    2323
    2424import java.awt.event.KeyEvent;
    25 import javax.swing.ButtonGroup;
    2625import javax.swing.JCheckBoxMenuItem;
    27 import javax.swing.JRadioButtonMenuItem;
    2826import org.armedbear.j.AbstractMode;
    2927import org.armedbear.j.Buffer;
     
    4341import org.armedbear.j.View;
    4442
    45 public final class MailboxMode extends AbstractMode implements Constants, Mode
     43public class MailboxMode extends AbstractMode implements Constants, Mode
    4644{
    4745    private static final MailboxMode mode = new MailboxMode();
     
    4947    private MailboxMode()
    5048    {
    51         super(MAILBOX_MODE, MAILBOX_MODE_NAME);
     49        this(MAILBOX_MODE, MAILBOX_MODE_NAME);
     50    }
     51
     52    protected MailboxMode(int id, String displayName)
     53    {
     54        super(id, displayName);
    5255        setProperty(Property.VERTICAL_RULE, 0);
    5356        setProperty(Property.SHOW_LINE_NUMBERS, false);
     
    5760    }
    5861
    59     public static final MailboxMode getMode()
     62    public static Mode getMode()
    6063    {
    6164        return mode;
  • trunk/j/src/org/armedbear/j/mail/NewsGroupSummaryMode.java

    r260 r263  
    33 *
    44 * Copyright (C) 2000-2002 Peter Graves
    5  * $Id: NewsGroupSummaryMode.java,v 1.2 2002-11-15 17:35:47 piso Exp $
     5 * $Id: NewsGroupSummaryMode.java,v 1.3 2002-11-15 20:24:46 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    2323
    2424import java.awt.event.KeyEvent;
    25 import org.armedbear.j.AbstractMode;
    26 import org.armedbear.j.Buffer;
    27 import org.armedbear.j.Constants;
    2825import org.armedbear.j.Editor;
    29 import org.armedbear.j.Formatter;
     26import org.armedbear.j.Frame;
    3027import org.armedbear.j.KeyMap;
    31 import org.armedbear.j.Line;
    3228import org.armedbear.j.Mode;
    33 import org.armedbear.j.Position;
    34 import org.armedbear.j.Property;
     29import org.armedbear.j.NavigationComponent;
     30import org.armedbear.j.ToolBar;
    3531
    36 public final class NewsGroupSummaryMode extends AbstractMode
    37     implements Constants, Mode
     32public final class NewsGroupSummaryMode extends MailboxMode
    3833{
    39     private static final Mode mode = new NewsGroupSummaryMode();
     34    private static final NewsGroupSummaryMode mode = new NewsGroupSummaryMode();
    4035
    4136    private NewsGroupSummaryMode()
    4237    {
    4338        super(NEWS_GROUP_SUMMARY_MODE, NEWS_GROUP_SUMMARY_MODE_NAME);
    44         setProperty(Property.VERTICAL_RULE, 0);
    45         setProperty(Property.SHOW_LINE_NUMBERS, false);
    46         setProperty(Property.SHOW_CHANGE_MARKS, false);
    4739    }
    4840
     
    5244    }
    5345
    54     public final Formatter getFormatter(Buffer buffer)
     46    public NavigationComponent getSidebarComponent(Editor editor)
    5547    {
    56         return new MailboxFormatter(buffer);
     48        return null;
    5749    }
    5850
    5951    protected final void setKeyMapDefaults(KeyMap km)
    6052    {
    61         km.mapKey(KeyEvent.VK_ENTER, 0, "readArticle");
     53        km.mapKey(KeyEvent.VK_ENTER, 0, "readArticleOtherWindow");
     54        km.mapKey(KeyEvent.VK_ENTER, CTRL_MASK, "readArticle");
    6255    }
    6356
    64     public String getContextString(Editor editor, boolean verbose)
     57    protected ToolBar getDefaultToolBar(Frame frame)
    6558    {
    66         Position dot = editor.getDot();
    67         if (dot != null) {
    68             final Line dotLine = dot.getLine();
    69             if (dotLine instanceof MailboxLine) {
    70                 MailboxEntry entry = ((MailboxLine)dotLine).getMailboxEntry();
    71                 if (entry != null)
    72                     return entry.getSubject();
    73             }
    74         }
    75         return null;
     59        return frame.getDefaultToolBar();
    7660    }
    7761}
Note: See TracChangeset for help on using the changeset viewer.