Changeset 260


Ignore:
Timestamp:
11/15/02 17:35:47 (20 years ago)
Author:
piso
Message:

getContextString()

File:
1 edited

Legend:

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

    r2 r260  
    33 *
    44 * Copyright (C) 2000-2002 Peter Graves
    5  * $Id: NewsGroupSummaryMode.java,v 1.1.1.1 2002-09-24 16:10:14 piso Exp $
     5 * $Id: NewsGroupSummaryMode.java,v 1.2 2002-11-15 17:35:47 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    2626import org.armedbear.j.Buffer;
    2727import org.armedbear.j.Constants;
     28import org.armedbear.j.Editor;
    2829import org.armedbear.j.Formatter;
    2930import org.armedbear.j.KeyMap;
     31import org.armedbear.j.Line;
    3032import org.armedbear.j.Mode;
     33import org.armedbear.j.Position;
    3134import org.armedbear.j.Property;
    3235
     
    5861        km.mapKey(KeyEvent.VK_ENTER, 0, "readArticle");
    5962    }
     63
     64    public String getContextString(Editor editor, boolean verbose)
     65    {
     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;
     76    }
    6077}
Note: See TracChangeset for help on using the changeset viewer.