Bug 106386 Correct misspellings in source code

patch by unknown@simplemachines.org r=timeless rs=brendan
This commit is contained in:
timeless%mozdev.org 2005-11-25 08:31:42 +00:00
Родитель b78d0c2416
Коммит 908f7fa2f2
6 изменённых файлов: 3 добавлений и 5836 удалений

Просмотреть файл

@ -1,258 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc on Sun Aug 01 23:07:24 MDT 1999 -->
<TITLE>
: Class DragSourceDropEvent
</TITLE>
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style">
</HEAD>
<BODY BGCOLOR="white">
<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_top"><!-- --></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" ID="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" ID="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT ID="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" ID="NavBarCell1"> <A HREF="package-summary.html"><FONT ID="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" ID="NavBarCell1Rev"> &nbsp;<FONT ID="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" ID="NavBarCell1"> <A HREF="package-tree.html"><FONT ID="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" ID="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT ID="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" ID="NavBarCell1"> <A HREF="../../index-all.html"><FONT ID="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" ID="NavBarCell1"> <A HREF="../../help-doc.html"><FONT ID="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" ID="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../grendel/dnd/DragSourceDragEvent.html"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../grendel/dnd/DropTarget.html"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" ID="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../index.html" TARGET="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="DragSourceDropEvent.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" ID="NavBarCell3"><FONT SIZE="-2">
SUMMARY: &nbsp;INNER&nbsp;|&nbsp;<A HREF="#fields_inherited_from_class_java.util.EventObject">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" ID="NavBarCell3"><FONT SIZE="-2">
DETAIL: &nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
grendel.dnd</FONT>
<BR>
Class DragSourceDropEvent</H2>
<PRE>
java.lang.Object
|
+--java.util.EventObject
|
+--<B>grendel.dnd.DragSourceDropEvent</B>
</PRE>
<HR>
<DL>
<DT>public class <B>DragSourceDropEvent</B><DT>extends java.util.EventObject</DL>
<P>
<DL>
<DT><B>See Also: </B><DD><A HREF="../../serialized-form.html#grendel.dnd.DragSourceDropEvent">Serialized Form</A></DL>
<HR>
<P>
<!-- ======== INNER CLASS SUMMARY ======== -->
<!-- =========== FIELD SUMMARY =========== -->
<A NAME="fields_inherited_from_class_java.util.EventObject"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#EEEEFF" ID="TableSubHeadingColor">
<TD><B>Fields inherited from class java.util.EventObject</B></TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD><CODE>source</CODE></TD>
</TR>
</TABLE>
&nbsp;
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" ID="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD><CODE><B><A HREF="../../grendel/dnd/DragSourceDropEvent.html#DragSourceDropEvent(java.lang.Object, boolean, boolean)">DragSourceDropEvent</A></B>(java.lang.Object&nbsp;aSource,
boolean&nbsp;cancelled,
boolean&nbsp;sucessful)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" ID="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Method Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../grendel/dnd/DragSourceDropEvent.html#isDragCancelled()">isDragCancelled</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../grendel/dnd/DragSourceDropEvent.html#isDropSuccessful()">isDropSuccessful</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.util.EventObject"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#EEEEFF" ID="TableSubHeadingColor">
<TD><B>Methods inherited from class java.util.EventObject</B></TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD><CODE>getSource,
toString</CODE></TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#EEEEFF" ID="TableSubHeadingColor">
<TD><B>Methods inherited from class java.lang.Object</B></TD>
</TR>
<TR BGCOLOR="white" ID="TableRowColor">
<TD><CODE>clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait</CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>
<!-- ============ FIELD DETAIL =========== -->
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" ID="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="DragSourceDropEvent(java.lang.Object, boolean, boolean)"><!-- --></A><H3>
DragSourceDropEvent</H3>
<PRE>
public <B>DragSourceDropEvent</B>(java.lang.Object&nbsp;aSource,
boolean&nbsp;cancelled,
boolean&nbsp;sucessful)</PRE>
<DL>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" ID="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Method Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="isDragCancelled()"><!-- --></A><H3>
isDragCancelled</H3>
<PRE>
public boolean <B>isDragCancelled</B>()</PRE>
<DL>
</DL>
<HR>
<A NAME="isDropSuccessful()"><!-- --></A><H3>
isDropSuccessful</H3>
<PRE>
public boolean <B>isDropSuccessful</B>()</PRE>
<DL>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_bottom"><!-- --></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" ID="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" ID="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT ID="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" ID="NavBarCell1"> <A HREF="package-summary.html"><FONT ID="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" ID="NavBarCell1Rev"> &nbsp;<FONT ID="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" ID="NavBarCell1"> <A HREF="package-tree.html"><FONT ID="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" ID="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT ID="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" ID="NavBarCell1"> <A HREF="../../index-all.html"><FONT ID="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" ID="NavBarCell1"> <A HREF="../../help-doc.html"><FONT ID="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" ID="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../grendel/dnd/DragSourceDragEvent.html"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../grendel/dnd/DropTarget.html"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" ID="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../index.html" TARGET="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="DragSourceDropEvent.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" ID="NavBarCell3"><FONT SIZE="-2">
SUMMARY: &nbsp;INNER&nbsp;|&nbsp;<A HREF="#fields_inherited_from_class_java.util.EventObject">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" ID="NavBarCell3"><FONT SIZE="-2">
DETAIL: &nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->
<HR>
</BODY>
</HTML>

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -1,841 +0,0 @@
/* -*- Mode: java; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is the Grendel mail/news client.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are
* Copyright (C) 1997 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s): Jeff Galyan <talisman@anamorphic.com>
* Edwin Woudt <edwin@woudt.nl>
* Brian Duff <Brian.Duff@oracle.com>
*/
package grendel.composition;
/* Gadget organization:
an AddressList has one AddressPanel.
an AddressPanel has many AddressLine(s).
an AddressLine has one DeliveryButton, one AddressIcon and one AddressTextField.
*/
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.util.*;
import javax.swing.*;
import javax.swing.JTable;
public class AddressList extends JScrollPane implements Serializable {
protected AddressPanel mAddressPanel;
public static final Color LINE_COLOR = new Color(200, 200, 255);
public AddressList() {
super();
//scroll panel
// JViewport spViewPort = getViewport();
JViewport spViewPort = new JViewport();
// System.out.println(spViewPort.toString());
//create addressList panel
mAddressPanel = new AddressPanel ();
//add address list panel to scroll panel.
spViewPort.add(mAddressPanel);
spViewPort.setView(mAddressPanel);
setViewport(spViewPort);
// Use the textfield background color for the grid. This is
// consistent with Mozilla and looks neat on all LAFs
setBackground (UIManager.getColor("TextField.background"));
}
int mProp1 = 0;
public void setProp1 (int aVal) {
mProp1 = aVal;
}
public int getProp1 () {
return mProp1;
}
int mProp2 = 0;
public void setProp2 (int aVal) {
mProp2 = aVal;
}
public int getProp2 () {
return mProp2;
}
/**
* Clears and sets the addresses from an Array.
* @param aAddresses An array of addresses.
* @see getAddresses()
*/
public void setAddresses (Addressee[] aAddresses) {
mAddressPanel.removeAllAddressLines (); //delete all entries.
if (null != aAddresses) {
for (int i = 0; i < aAddresses.length; i++) {
if (null != aAddresses[i])
mAddressPanel.addAddresseLine (aAddresses[i]);
}
}
mAddressPanel.repack();
}
/**
*/
public Dimension getPreferredSize() {
return mAddressPanel.getPreferredSize();
}
/**
* Returns the addresses in the form of an array.
* @returns An array of addresses.
* @see setAddresses()
*/
public Addressee[] getAddresses () {
Vector temp = mAddressPanel.mAddressees;
int i;
//reject blank entries.
for (i = 0; i < temp.size(); i++) {
AddressLine al = (AddressLine) temp.elementAt(i);
if (al.isBlank()) {
temp.removeElement (al);
}
}
//copy over from vector into array.
Addressee[] anArray = new Addressee[temp.size()];
for (i = 0; i < temp.size(); i++) {
anArray[i] = ((AddressLine) temp.elementAt(i)).getAddressee();
}
return anArray;
}
/**
*
*/
public class AddressPanel extends JPanel implements KeyListener {
protected Vector mAddressees; //Addresses
private Dimension mAddLineSize; //The size of one AddressLine. For layout.
private Dimension mPerfSize; //The preferred size of this panel = 4 * mAddLineSize.
public AddressPanel () {
super();
this.setLayout (null);
//vector for holding addressee list.
mAddressees = new Vector();
setBackground(UIManager.getColor("TextField.background"));
setOpaque(true);
//create the first addressee to start them off.
repack();
}
/**
* layout Addressee lines.
*/
public void doLayout() {
int i;
Enumeration e;
Dimension size = getSize();
/*place each addressee line in one column multiple rows.
+---------------+
| addressee #1 |
|---------------|
| addressee #2 |
|---------------|
| ... |
|---------------|
| addressee #n |
+---------------+
*/
for (e = mAddressees.elements(), i = 0; e.hasMoreElements(); i++) {
AddressLine al = (AddressLine) e.nextElement();
al.setBounds(0, i * mAddLineSize.height, size.width, mAddLineSize.height);
}
}
// public Dimension getMaximumSize() {
// return getPreferredSize();
// }
// public Dimension getMinimumSize() {
// return getPreferredSize();
// }
public void addNotify () {
super.addNotify ();
//store the first AddressLine's size for layout.
AddressLine al = (AddressLine) mAddressees.elementAt(0);
mAddLineSize = al.getPreferredSize();
//the preferred size of the panel is 4 AddressLines tall and full parent width.
mPerfSize = new Dimension (mAddLineSize.width, 5 * mAddLineSize.height);
}
/**
* Returns the preferred size.
* The preferred size of the panel is 4 AddressLines tall and full parent width.
* @return
*/
public Dimension getPreferredSize() {
//the preferred size of the panel is 4 AddressLines tall and full parent width.
return (mPerfSize);
}
/**
* Adds a new address line to the list.
* @param aAddressee the Addresee you which to add.
* @see removeAddressLine
*/
private synchronized void addAddresseLine (Addressee aAddressee) {
//create the new AddressLine.
AddressLine al = new AddressLine (aAddressee);
//Add a keyboard listener for navigation
//so they may navigate BETWEEN AddressLines using arrow keys.
al.atfAddKeyListener (this);
add (al); //add AddressLine gadget to panel
mAddressees.addElement (al); //remember in vector table
validate(); //layout control again (scrollbar may appear).
}
/**
* Remove any blank lines from the middle
* and appends a single blank line to the list.
*/
private void repack () {
//remove blank lines
for (int i = 0; i < mAddressees.size() - 2; i++) {
AddressLine al = (AddressLine) mAddressees.elementAt(i);
if (al.isBlank()) {
removeAddressLine(al);
}
}
//no entries at all so add a blank line.
if (0 == mAddressees.size()) {
addAddresseLine (new Addressee ("", Addressee.TO));
}
else {
//add a blank last line if needed.
AddressLine lastAL = (AddressLine) mAddressees.elementAt(mAddressees.size() - 1);
if (!lastAL.isBlank()) {
addAddresseLine (new Addressee ("", lastAL.getDeliveryMode()));
}
}
}
/*
* Place focus on the last addressLine.
*/
private void focusOnLast () {
int last = mAddressees.size() - 1;
//get its TextFiled and set focus on it.
if (last > -1) {
AddressLine al = (AddressLine) mAddressees.elementAt(last);
al.atfRequestFocus();
}
}
/**
* Removes an address line from the list.
* @param aAddressLine The address line you wish to remove.
* @see addAddresseLine
*/
private synchronized void removeAddressLine (AddressLine aAddressLine) {
remove (aAddressLine); //remove AddressLine gadget from panel.
aAddressLine.atfRemoveKeyListener (this); //stop listening for key events.
mAddressees.removeElement (aAddressLine); //remove from vector table.
validate(); //layout control again (scrollbar).
repaint();
}
/**
* Removes all addressee lines.
* @see removeAddressLine
* @see addAddresseLine
*/
private synchronized void removeAllAddressLines () {
removeAll(); //remove all AddressLines gadget from panel.
mAddressees.removeAllElements(); //clear vector table.
validate(); //layout control again (scrollbar).
repaint();
}
/**
* Resonds to keyboard events for navigation (up, down, enter, etc.)
* @see addAddresseLine
*/
//implements KeyListener...
public void keyReleased (KeyEvent e) {}
public void keyTyped (KeyEvent e) {}
/* Recieve keyPressed events for this->AddressLine->AddressTextField.
KeyEvent response table
KEY_PRESSED Old Position State New Positon Behavior
---------------------------------------------------------------------------------------
VK_UP NOT first - Previous
VK_UP First - First
VK_DOWN NOT last - Next
VK_DOWN Last - Last
VK_BACK_SPACE First line empty First
VK_BACK_SPACE NOT first line empty Previous Delete this address line.
VK_DELETE Last line empty Last
VK_DELETE NOT last line empty Same Delete this address line.
*/
public void keyPressed (KeyEvent e) {
//filter out only the keys we're interested in.
if ((KeyEvent.KEY_PRESSED == e.getID()) &&
( (KeyEvent.VK_UP == e.getKeyCode()) ||
(KeyEvent.VK_BACK_SPACE == e.getKeyCode()) ||
(KeyEvent.VK_DELETE == e.getKeyCode()) ||
(KeyEvent.VK_DOWN == e.getKeyCode())
)
) {
//find out which AddressLine created this key press.
Component sourceComp = e.getComponent();
//check that this is an AddressTextField.
if (sourceComp instanceof AddressTextField) {
AddressTextField sourceATF = (AddressTextField)sourceComp;
//get its parent AddressLine gadget.
AddressLine sourceAL = (AddressLine) sourceATF.getParent();
//locate the AddressLine in the vector table mAddressees.
int lastIndex = mAddressees.lastIndexOf(sourceAL);
// This should never happen.
// (i.e. You should never get a KeyEvent from a gadget not in the mAddressees Vector)
// FIX: do something.
if (-1 == lastIndex) {
//System.out.println ("Internal error.");
}
else {
//calculate where to send focus depending on the keypress.
int incFocus = 0; //increment focus (-1, 0, +1)
//UP
if (KeyEvent.VK_UP == e.getKeyCode()) {
incFocus = -1; //focus previous.
}
//DOWN
else if (KeyEvent.VK_DOWN == e.getKeyCode()) {
incFocus = +1; //focus next.
}
//BACKSPACE or DELETE
else if ((KeyEvent.VK_BACK_SPACE == e.getKeyCode()) ||
(KeyEvent.VK_DELETE == e.getKeyCode())) {
//if they've pressed backspace or delete and this address line
// is already empty them delete this AddressLine.
//no matter what, if there is only one AddressLine left
// then don't delete it or try to change focus.
if (1 >= mAddressees.size())
return;
//Check to see if the current AddressTextField (ATF) is empty.
// If so then delete it.
if (sourceAL.isBlank()) {
//remove the AddressLine from this container and vector list.
removeAddressLine (sourceAL);
if (KeyEvent.VK_BACK_SPACE == e.getKeyCode())
incFocus = -1; //focus previous.
else //KeyEvent.VK_DELETE == e.getKeyCode()
incFocus = 0; //stay where you are.
}
}
//set focus to the next AddressTextField.
{
int nextIndex = lastIndex + incFocus;
if (nextIndex < 0) {
nextIndex = 0;
}
else if (nextIndex > (mAddressees.size() - 1)) {
nextIndex = mAddressees.size() - 1;
}
//get its TextFiled and set focus on it.
AddressLine nextAL = (AddressLine) mAddressees.elementAt(nextIndex);
nextAL.atfRequestFocus();
}
}
}
}
}
public void paint(Graphics g) {
//paint the AddressLine gadets.
super.paint(g);
Dimension size = getSize();
g.setColor (AddressList.LINE_COLOR);
//draw horizonttal lines BELOW the AddressLine gadgets.
for (int i = mAddressees.size() * mAddLineSize.height; i < size.height; i += mAddLineSize.height) {
g.drawLine (0, i, size.width, i);
}
//draw Vertical line BELOW the AddressLine gadgets and lined up with the left side addressee button.
if (0 < mAddressees.size()) {
AddressLine firstAddressLine = (AddressLine) mAddressees.elementAt(0);
int buttonWidth = firstAddressLine.getButtonWidth();
g.drawLine (buttonWidth, mAddressees.size() * mAddLineSize.height, buttonWidth, size.height);
}
}
}
//*************************
/**
* An AddressLine has one DeliveryButton and one AddressTextField.
*/
public class AddressLine extends JPanel {
private DeliveryButton mDeliveryButton;
private AddressTextField mAddressTextField;
private DragIcon mDragIcon;
private boolean mShowDeliveryButton = true;
public AddressLine (Addressee aAddressee) {
super();
this.setLayout (null); //see doLayout.
//left side delivery button ("To:")
mDeliveryButton = new DeliveryButton (aAddressee.getDelivery());
add (mDeliveryButton);
//center DragIcon
mDragIcon = new DragIcon();
add (mDragIcon);
//right side text field ("john_doe@company.com")
mAddressTextField = new AddressTextField (aAddressee.getText(), mDeliveryButton);
add (mAddressTextField);
// Set the background to be the same as the text field. This
// makes the overall grid look a little less messy
setBackground(mAddressTextField.getBackground());
}
protected void atfRemoveKeyListener(KeyListener kl){ mAddressTextField.removeKeyListener (kl); }
protected void atfAddKeyListener(KeyListener kl) { mAddressTextField.addKeyListener (kl); }
protected void atfRequestFocus() { mAddressTextField.requestFocus(); }
protected int getButtonWidth() { return mDeliveryButton.getPreferredSize ().width; }
protected boolean isBlank() { return mAddressTextField.getText().equals (""); }
protected int getDeliveryMode() { return mDeliveryButton.getDeliveryMode (); }
/**
* layout Delivery Button, DragIcon and AddressTextField.
*/
public void doLayout() {
/* Layout
+----------------+----------+---------------------+
| DeliveryButton | DragIcon | AddressTextField >>>|
+----------------+----------+---------------------+
*/
Dimension mySize = getSize(); //get this containers size.
//DeliveryButton
Dimension dbSize = mDeliveryButton.getPreferredSize ();
mDeliveryButton.setBounds(0, 0, dbSize.width, mySize.height);
int x = dbSize.width;
//DragIcon
Dimension diSize = mDragIcon.getPreferredSize ();
mDragIcon.setBounds(x, 0, diSize.width, mySize.height);
x += diSize.width;
//AddressTetField takes up the rest.
Dimension atfSize = mAddressTextField.getPreferredSize ();
mAddressTextField.setBounds(x, (mySize.height - atfSize.height)/2, mySize.width - x, mySize.height);
}
/*
*/
public Dimension getPreferredSize() {
return mDeliveryButton.getPreferredSize ();
}
/*
* Returns an Addressee for the line.
*/
protected Addressee getAddressee() {
return (new Addressee (mAddressTextField.getText(), mDeliveryButton.getDeliveryMode ()));
}
/**
* Paint the blue lines in the background.
*/
public void paint(Graphics g) {
super.paint(g);
Dimension size = getSize();
FontMetrics fm = g.getFontMetrics();
int buttonWidth = getButtonWidth();
g.setColor (AddressList.LINE_COLOR);
g.drawLine (buttonWidth, 0, size.width, 0); //top
g.drawLine (buttonWidth, size.height, size.width, size.height); //bottom
}
}
//*************************
/**
* Image icon for drag and drop.
*/
public class DragIcon extends JPanel {
private ImageIcon mIcon;
public DragIcon () {
super();
setBorder(BorderFactory.createEmptyBorder (5, 8, 5, 8));
//create image icon for drag and drop.
mIcon = new ImageIcon("composition/images/card.gif");
}
public void paint (Graphics g) {
Dimension size = getSize();
//try to center the icon.
int x = (size.width - mIcon.getIconWidth())/2;
x = (x < 0) ? 0 : x;
int y = (size.height - mIcon.getIconHeight())/2;
y = (y < 0) ? 0 : y;
mIcon.paintIcon (this, g, x, y);
}
}
public class AddressTextField extends JTextField implements FocusListener {
// public class AddressTextField extends ATC_Field implements FocusListener {
private final String ADDRESS_SEPERATORS = ",";
private final String ADDRESS_QUOTES = "\"";
private DeliveryButton mDeliveryButton;
public AddressTextField (String aString, DeliveryButton aDeliveryButton) {
super(aString);
// super (aString, new TestDataSource2());
mDeliveryButton = aDeliveryButton;
//red completion text.
// setCompletionColor (Color.red);
//NO border.
setBorder(null);
//get focus gained/lost events.
addFocusListener(this);
//catch tabs and enters before anyone else.
enableEvents (AWTEvent.KEY_EVENT_MASK); //see processKeyEvent
}
public void setCompletionColor(Color c) {
}
/**
* catch tabs before anyone else.
*/
public void processKeyEvent (KeyEvent e) {
//TAB
if ('\t' == e.getKeyChar())
return; //ignore tab characters.
//ENTER
if ('\n' == e.getKeyChar()) {
evaluate (); //evaluate this line for mutilple entries.
mAddressPanel.focusOnLast(); //Put focus on the last blank entry.
}
super.processKeyEvent(e);
}
/**
* stub
*/
public void focusGained(FocusEvent evt) {
}
/**
* On focusLost, evaluate line for multiple entries.
*/
public void focusLost(FocusEvent evt) {
evaluate ();
}
/**
* Evaluate line for multiple addresses, notify parent to add the new entries.
*/
private void evaluate() {
String [] tokens = parseLine (getText());
//we've lost focus and they type nothing or a bunch of ADDRESS_SEPERATORS on this line.
if (tokens.length == 0) {
setText ("");
}
//else they typed something....
else {
//we keep the first.
setText (tokens[0]);
//if more than one address is on this line then add the others.
if (tokens.length > 1) {
for (int i = 1; i < tokens.length; i++) {
mAddressPanel.addAddresseLine (new Addressee (tokens[i], mDeliveryButton.getDeliveryMode()));
}
}
}
//repack the lines. (remove blanks)
mAddressPanel.repack();
}
/**
* Parses up the string.
* @param aString The String to parse.
* @return returns an array of strings.
* @see ADDRESS_SEPERATORS
* @see ADDRESS_QUOTES
*/
private String[] parseLine (String aString) {
Vector tokenVec = new Vector ();
boolean quoted = false;
int tail = 0;
int head = 0;
//step through each character in the string.
for (head = 0; head < aString.length(); head++) {
//is this a quote character?
if (-1 != ADDRESS_QUOTES.indexOf(aString.charAt(head))) {
//are we already in a quoted string?
if (quoted) {
String token = aString.substring(tail, head + 1).trim();
//if this is not a blank then increment count.
if (!token.equals(""))
tokenVec.addElement(token);
tail = head + 1;
quoted = false; //quoting off
}
else {
tail = head; //remember the quote char.
quoted = true; //quoting on.
}
}
//is this a seperator character?
else if (-1 != ADDRESS_SEPERATORS.indexOf(aString.charAt(head))) {
//if not in a quote and not
if (!quoted) {
String token = aString.substring(tail, head).trim();
//if this is not a blank then increment count.
if (!token.equals(""))
tokenVec.addElement(token);
tail = head + 1;
}
}
}
//last token
String quotingChar = "";
//did we finish with an open quote?
if (quoted) {
quotingChar = aString.substring(tail, tail + 1); //add a matching quote.
}
String token = aString.substring(tail, head).trim();
//if this is not a blank then increment count.
if (!token.equals(""))
tokenVec.addElement(token + quotingChar);
//return an array of Strings.
String [] tokenArray = new String [tokenVec.size()];
tokenVec.copyInto(tokenArray);
return tokenArray;
}
}
/**
* DeliveryButton displays "To:", "Cc:", etc and has a popup menu to change values.
*/
public class DeliveryButton extends JButton implements ActionListener {
private int mDeliveryMode;
private JPopupMenu mPopup;
private Dimension mPrefSize;
private int stringWidth = 0;
public DeliveryButton(int aDeliveryMode) {
//create the popup menu..
mPopup = createPopup();
setDeliveryMode (aDeliveryMode);
setDefaultCapable(false);
addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
Point buttonLoc = DeliveryButton.this.getLocation();
int buttonHeight = DeliveryButton.this.getHeight();
mPopup.show(DeliveryButton.this,
buttonLoc.x, buttonLoc.y + buttonHeight);
}
});
Font fnt = getFont();
setMargin(new Insets(0, 0, 0, 0));
if (null != fnt) {
FontMetrics fm = getToolkit().getFontMetrics(fnt);
if (null != fm) {
String longestString = Addressee.getLongestString();
mPrefSize = new Dimension(
fm.stringWidth(longestString) + 20, // Fudge factor.
super.getPreferredSize().height // whatever the default is
);
}
}
setIcon(new DownArrowIcon());
}
/**
* The preferred size of the button is whatever the default preferred
* height is and the preferred width of the popup menu.
*/
public Dimension getPreferredSize()
{
return mPrefSize;
}
/**
* Creates the popup menu.
*/
private JPopupMenu createPopup () {
JPopupMenu pm = new JPopupMenu (Addressee.getDeliveryTitle());
//added text commands to popup
for (int i = 0; i < Addressee.mDeliveryStr.length; i++) {
JMenuItem mi = new JMenuItem (Addressee.mDeliveryStr[i]);
pm.add (mi);
mi.addActionListener (this);
}
return pm;
}
/*
* Set the button delivery mode.
* @param aDeliveryMode a value like Addressee.TO or Addressee.BCC
* @see getDeliveryMode
*/
protected void setDeliveryMode (int aDeliveryMode) {
mDeliveryMode = aDeliveryMode;
setText(Addressee.deliveryToString(mDeliveryMode));
stringWidth = getToolkit().getFontMetrics(getFont()).stringWidth(getText());
repaint();
}
/*
* Return the button delivery mode.
* @return a delivery mode a value like Addressee.TO or Addressee.BCC
* @see setDeliveryMode
*/
protected int getDeliveryMode () { return mDeliveryMode; }
/**
* Called when popup menu item is selected.
*/
public void actionPerformed (ActionEvent e) {
String menuCommand = e.getActionCommand();
setDeliveryMode (Addressee.deliveryToInt (menuCommand));
}
/**
* A downwards pointing arrow icon
*/
private class DownArrowIcon implements Icon
{
// Must be odd. 7 is the same as Mozilla uses.
private final int WIDTH=7;
private final int HEIGHT = (WIDTH +1) / 2;
public int getIconHeight() {
return HEIGHT;
}
public int getIconWidth() {
return WIDTH + mPrefSize.width - 20 - stringWidth;
}
public void paintIcon(Component c, Graphics g, int x, int y) {
g.setColor(UIManager.getColor("Button.foreground"));
for (int i=0; i < HEIGHT; i++)
{
g.drawLine(x + i, y + i, x + WIDTH - i, y + i);
}
}
}
}
}

Просмотреть файл

@ -1,140 +0,0 @@
/* -*- Mode: java; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is the Grendel mail/news client.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are
* Copyright (C) 1997 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s): Jeff Galyan <talisman@anamorphic.com>
*/
package grendel.composition;
import java.awt.*;
import javax.swing.JTabbedPane;
import javax.swing.plaf.basic.BasicTabbedPaneUI;
import javax.swing.*;
import javax.swing.plaf.*;
import javax.swing.plaf.metal.MetalTabbedPaneUI;
public class NSTabbedPane extends JTabbedPane {
protected Object fID = null;
protected String fName = null;
protected String fFloatingTitle = "";
public NSTabbedPane() {
super.setUI(new MyTabbedPaneUI());
setBorder(BorderFactory.createLoweredBevelBorder());
}
/**
* the toolbar is about to be docked
*/
public void dock() {
}
/**
* tells the toolbar it is about to float
*/
public void floatToolbar() {
}
/**
* sets the title to be used when the toolbar is floating
*/
public void setFloatingTitle(String aTitle) {
fFloatingTitle = aTitle;
}
/**
* gets the title used when the toolbar is floating
*/
public String getFloatingTitle() {
return fFloatingTitle;
}
/**
* adds a new tab.
*/
public void addTab(String aLabel, ImageIcon aIcon, Component mAddressList) {
super.addTab(aLabel, aIcon, mAddressList);
}
/**
* set tab selection
*/
public void setSelectedIndex(int aIndex) {
super.setSelectedIndex(aIndex);
}
/**
* sets an ID for this toolbar
*/
public void setID(Object anID) {
fID = anID;
}
/**
* gets the toolbar's id
*/
public Object getID() {
return fID;
}
/**
* sets the name of the toolbar
*/
public void setName(String aName) {
fName = aName;
}
/**
* gets the name of the toolbar
*/
public String getName() {
return fName;
}
/**
* gets the component associated with the toolbar
*/
public Component getComponent() {
return this;
}
//***************************
public class MyTabbedPaneUI extends MetalTabbedPaneUI {
public Dimension getPreferredSize(JComponent container) {
int widest = 0;
int tallest = 0;
//return the component with the largst preferred size.
Component[] comps = container.getComponents();
for (int i = 0; i < comps.length; i++) {
Dimension dim = comps[i].getPreferredSize();
if (dim.width > widest)
widest = dim.width;
if (dim.height > tallest)
tallest = dim.height;
}
return new Dimension(widest, tallest);
}
}
}

Просмотреть файл

@ -27,10 +27,10 @@ package grendel.dnd;
public class DragSourceDropEvent
extends java.util.EventObject {
boolean fCancelled;
boolean fSucessful;
boolean fSuccessful;
public DragSourceDropEvent(Object aSource, boolean cancelled,
boolean sucessful) {
boolean successful) {
super(aSource);
fSucessful = sucessful;
fCancelled = cancelled;
@ -41,6 +41,6 @@ public class DragSourceDropEvent
}
public boolean isDropSuccessful() {
return fSucessful;
return fSuccessful;
}
}

Просмотреть файл

@ -1,449 +0,0 @@
From - Mon Jun 10 09:11:27 1996
Delivery-Date: Fri, 07 Jun 1996 19:41:36 -0700
Return-Path: list@glacier.mcom.com
Received: from glacier.mcom.com (glacier.mcom.com [205.217.233.39]) by dome.mcom.com (8.6.10/8.6.9) with ESMTP id TAA26191 for <terry@dome.mcom.com>; Fri, 7 Jun 1996 19:41:33 -0700
Received: (from list@localhost) by glacier.mcom.com (8.7.3/8.7.3) id TAA01443; Fri, 7 Jun 1996 19:38:52 -0700 (PDT)
Resent-Date: Fri, 7 Jun 1996 19:38:52 -0700 (PDT)
To: clienteng@netscape.com
Path: usenet
X-UIDL: 834201705.000
From: Jamie Zawinski <jwz@netscape.com>
Newsgroups: mcom.dev.clienteng
Subject: Re: Email bug was [Fwd: Apologies and complaints]
Date: Fri, 07 Jun 1996 18:38:41 -0700
Organization: Netscape Communications Corporation, Mozilla Division
Lines: 280
Message-ID: <31B8E7B1.41C6@netscape.com>
References: <31B8AEBF.4A7B@netscape.com> <ML-2.3.834195020.8606.max@jimi-hendrix.mcom.com>
NNTP-Posting-Host: gruntle.mcom.com
Mime-Version: 1.0
Content-Type: multipart/digest; boundary="------------167E2781446B"
X-Mailer: Mozilla 3.0b5 (X11; U; IRIX 5.3 IP22)
To: Mike Macgirvin <MAX@netscape.com>
Content-Disposition: inline
Resent-Message-ID: <"lghyh3.0.VM.wUEkn"@glacier>
Resent-From: clienteng@netscape.com
X-Mailing-List: <clienteng@netscape.com> archive/latest/1926
X-Loop: clienteng@netscape.com
Precedence: list
Resent-Sender: clienteng-request@netscape.com
Status: U
X-Mozilla-Status: 8010
Content-Length: 12874
This is a multi-part message in MIME format.
--------------167E2781446B
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Mike Macgirvin wrote:
>
> I guess I need to find out why this is an issue (for us). We are doing
> "proper" delivery using native methods.
So that means that on Unix, you use sendmail (wearing its MDA hat
instead of its MTA hat) to move messages into /var/spool/mail/$USER ?
I think that's a totally reasonable thing to do.
> Seems to me that movemail needs fixing to deal with Solaris'
> Content-Length, or replaced with something that can handle it. Yes,
> we can hack something in on this side too, but
>
> Mlocal, P=/bin/mail, F=EflsSDFMmnP, S=10, R=20, A=mail -d $u
>
> isn't gonna' fly with our customers. A check box that turns on "From
> stuffing" "...IF you use Unix delivery and IF you are using a Solaris
> 2.x OS and IF you have Netscape Navigator users accessing the local
> spool..." isn't very clean either.
(Well first off, fixing that is really hard, which is why I didn't just
do it.)
But I think, actually, that telling them that they need to configure
sendmail in that was *does* fly, because *most* people on Solaris do
that anyway -- the simple fact of life is that almost all Unix MUAs
expect /var/spool/mail/$USER to be in BSD Mailbox format, not in
Content-Length format. It's not just Netscape. If any Solaris user
wants to use a mailer other than one that Sun ships, they have to
reconfigure sendmail in this way.
> Fixing movemail is a much better solution.
That would be a nice solution, but you can't look at /var/mail/ and know
which of the two formats its in, so you need a new user option in the
client. And its one that no end-user is going to know how to set.
And it only fixes the "Get Mail" case. The thing that sucks most about
this, actually, is not the "Get Mail" case, but the fact that both Sun's
MailTool and Eudora write folder files using the Content-Length format;
they don't do From mangling. So that means that importing folders is
dicey -- every now and then, a message will get split.
> 'Nuther Q... (Jamie? and I really don't know the answer to this...)
> Does Nav itself parse From lines? Does it actually rely on
> stuffing in its parsing algorithms? Or is this strictly a movemail
> issue?
Movemail depends on From-mangling, because it assumes BSD format.
Mozilla has movemail code built-in, and also can use an external
program to do this.
But, Mozilla *also* uses BSD format for its saved folders. So if it's
pointed at a folder written by another program, and that other program
uses the Content-Length format, messages might get split.
> Remember, we don't need stuffing on POP/IMAP delivery. Do we
> need to have it to make Nav work right?
No; this isn't an issue for Get-Mail-using-POP3, only for
Get-Mail-using-movemail (and for folders already on disk.)
> What are you going to do when you get a message from a Microsoft
> Exchange server which doesn't need From stuffing and doesn't do it?
Responses from POP3 servers need not be mangled; those are terminated by
`CRLF . CRLF' so there's no ambiguity (and then when we write that
message to disk, we write it in our native folder format, which is to
say, we mangle the internal From lines.)
> Tell them their server is broken? This isn't strong ground to be
> standing on...because their server may in fact not be. Nothing says
> that messages have to be stuffed for transport (except in the case of
> \r\n.\r\n via SMTP). It's purely a Unix storage issue.
Yes, I agree. We don't have to tell them their server is broken,
because Get-Mail-via-POP3 isn't a problem for us.
In fact, in the Get Mail case, it's only an issue on Solaris, and only
when using movemail. All other Unix platforms on which we ship come
with MDAs which use the BSD format, not the Content-Length format.
Solaris can do either, but comes configured for Content-Length.
Why is supporting Content-Length hard?
= You can't look at a file and tell whether it's in BSD format or
Content-Length format (the presence of the CL headers doesn't
actually tell you anything.)
= If you're in a world where you can't really make assumptions about
how many bytes a line terminator is (as all of our code is, since
so far we've managed to support input with CR, LF, and CRLF on all
platforms, regardless of which is native) you will often find
yourself faced with Content-Length lines that no longer match, so
your parser has to do sophisticated error recovery.
= We are currently writing out-of-spec BSD files anyway -- we are
treating "\nFrom " as a delimiter, when really we should be
treating "\n\nFrom " as a delimiter. This messes with the lengths,
so that would have to be fixed first (there's a bug about it.)
More background:
--------------167E2781446B
Message-ID: <319CEA7A.7A79@netscape.com>
Date: Fri, 17 May 1996 14:07:06 -0700
From: Jamie Zawinski <jwz@netscape.com>
Organization: Netscape Communications Corporation, Mozilla Division
X-Mailer: Mozilla 3.0b4 (X11; U; IRIX 5.3 IP22)
MIME-Version: 1.0
Newsgroups: comp.mail.headers
Subject: Re: "From_" specification
References: <1996May16.171931.26752@jarvis.cs.toronto.edu> <4nhcr1$7sf@lyra.csx.cam.ac.uk>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Philip Hazel wrote:
>
> In article <1996May16.171931.26752@jarvis.cs.toronto.edu>, edwin@cs.toronto.edu (Edwin Allum) writes:
> |>
> |> Is there a standard specification (rfc) or format for the "From_" line
> |> used to delimit messages in the mail spool file?
>
> There is some discussion of From_ lines in RFC 976 ("UUCP Mail
> Interchange Format Standard").
RFCs specify internet protocols, that is, on-the-wire formats. The
thing that the original poster is looking for is a description of the
BSD Mailbox file format (which is not something an RFC would cover.)
But, here's the good news, there *is* no true specification of this file
format, just a collection of word-of-mouth behaviors of the various
programs over the last few decades which have used that format.
Essentially the only safe way to parse that file format is to consider
all lines which begin with the characters "From " (From-space), which
are preceeded by a blank line or beginning-of-file, to be the division
between messages. That is, the delimiter is "\n\nFrom .*\n" except for
the very first message in the file, where it is "^From .*\n".
Some people will tell you that you should do stricter parsing on those
lines: check for user names and dates and so on. They are wrong. The
random crap that has traditionally been dumped into that line is without
bound; comparing the first five characters is the only safe and portable
thing to do. *Usually*, but not always, the next token on the line
after "From " will be a user-id, or email address, or UUCP path, and
*usually* the next thing on the line will be a date specification, in
*some* format, and *usually* there's nothing after that. But you can't
rely on any of this.
In the BSD format, the only safe way to add a message to a file is to
mangle occurences of the "From " delimiter in the body of messages to
some other string, usually ">From ". This is mangling, not quoting,
because it's not a reversible process (since ">From " is not also
quoted.)
Now, there are actually two very similar-looking file formats. One is
the BSD format, which I've described. The other, which one might as
well call the "content-length" format, is used by some SYSV-derived
systems, notably Solaris. It's very similar, but subtly incompatible.
This format does not quote "From " lines, but instead relies on a
Content-Length header in the message proper to indicate the exact
byte-position of the end of each message.
This latter format is non-portable, easily-corruptible, and overall,
brain-damaged (that's a technical term.) But I'll refrain from ranting
about it again right now...
--
Jamie Zawinski jwz@netscape.com http://www.netscape.com/people/jwz/
``A signature isn't a return address, it is the ASCII equivalent of a
black velvet clown painting; it's a rectangle of carets surrounding
a quote from a literary giant of weeniedom like Heinlein or Dr. Who.''
-- Chris Maeda
--------------167E2781446B
Message-ID: <319D3B7A.6201@netscape.com>
Date: Fri, 17 May 1996 19:52:42 -0700
From: Jamie Zawinski <jwz@netscape.com>
Organization: Netscape Communications Corporation, Mozilla Division
X-Mailer: Mozilla 3.0b4 (X11; U; IRIX 5.3 IP22)
MIME-Version: 1.0
Newsgroups: comp.mail.headers
Subject: Re: "From_" specification
References: <1996May16.171931.26752@jarvis.cs.toronto.edu>
<4nhcr1$7sf@lyra.csx.cam.ac.uk> <319CEA7A.7A79@netscape.com> <xcdvihuyjsq.fsf@woodlawn.uchicago.edu>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Soren Dayton wrote:
>
> Our friend, Jamie Zawinski <jwz@netscape.com>, wrote:
>
> > Now, there are actually two very similar-looking file formats.
>
> <snip>
>
> > This latter format is non-portable, easily-corruptible, and overall,
> > brain-damaged (that's a technical term.) But I'll refrain from ranting
> > about it again right now...
>
> So this is to claim that the one style is portable easily-corruptible,
> brain-damage while the other is non-portable?
>
> letter to a file, very hard to forget to quote the '^From_'s
I'm not sure exactly what you're trying to say, but I'll clarify what I
meant: I'm not saying that the BSD Mailbox format is *good*. Just that
the Content-Length variant of that format is *worse*.
Ok, so someone took the From_ format, and extended it to not require
mangling by adding a length indicator to the format. At first glance,
this may sound simple and elegant, but it breaks the world, and one
shouldn't encourage its use to spread.
The thing that breaks is taking an existing, widely-implemented format,
and *adding* a requirement that it have a length indicator. This means
that any existing software that already *thinks* it knows how to
manipulate that format is going to damage the file (any change to the
data will cause the length indicator to be wrong w.r.t. the *new*
specification but not w.r.t. the *old* specification.)
If the content-length-based format was not otherwise-indistinguishable
from the "From " format, there wouldn't be a problem; the old software
would simply fail to work with this new file format, instead of
"corrupting" the documents (in quotes, because it's really just a
matter of which spec you're following.)
Also, mailboxes are by their nature a textual format; but, the
content-length header measures in *bytes* rather than lines. This
means that if you move the file to a system which has a different
end-of-line representation (Windows <=> Mac, or Windows <=> Unix) then
the content-lengths will suddenly be wrong, because the linebreaks now
take two bytes instead of one, or vice versa.
It's impossible for a mail client to look at a file, and tell which of
the two formats (From_ or Content-Length) it is in; they are
programatically indistinguishable. The presence of a Content-Length
header is not enough, because suppose you were on a system which knew
nothing at all about that header, and some *incoming* message just
happened to have that header in it. Then that header would end up in
your mailbox (because nobody would have known to remove or recalculate
it), and it would possibly be incorrect. (Presume further that the
header was not just incorrect, but intentionally malicious...)
Stricter parsing of the "From " seperator line doesn't help either,
because there are many, many variations on what goes in that line
(since it was never standardized either); and also, some mail readers
include that line verbatim when forwarding messages (Sun's MailTool,
for example) so a stricter parser wouldn't help that case at all,
because message bodies tend to contain "valid" matches.
Some mail readers attempt to cope with this by recognising the case
where the Content-Length is not obviously spot-on-target, and then
searching forward and backward for the nearest message delimiter; but
this is obviously not foolproof, and makes one's parser much more
inefficient (requiring arbitrary lookahead and backtracking.)
Conventional wisdom is, ``if you believe the Content-Length header,
I've got a bridge to sell you.''
--
Jamie Zawinski jwz@netscape.com http://www.netscape.com/people/jwz/
``A signature isn't a return address, it is the ASCII equivalent of a
black velvet clown painting; it's a rectangle of carets surrounding
a quote from a literary giant of weeniedom like Heinlein or Dr. Who.''
-- Chris Maeda
--------------167E2781446B--
From - Wed Dec 03 07:58:41 1997
Path: pixie.mcom.com!news
From: Eric Mader <emader@netscape.com>
Newsgroups: mcom.humour
Subject: [Fwd: Luggage]
Date: Wed, 19 Nov 1997 10:32:22 -0800
Organization: Netscape Communications Corporation
Lines: 60
Message-ID: <347330B6.42D3CDD8@netscape.com>
NNTP-Posting-Host: 208.12.37.141
Mime-Version: 1.0
Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; micalg=sha1; boundary="------------ms691B6036709EBB7DE811477F"
X-Mailer: Mozilla 4.01 [en] (WinNT; U)
X-Priority: 3 (Normal)
X-Mozilla-Status: 8009
This is a cryptographically signed message in MIME format.
--------------ms691B6036709EBB7DE811477F
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
<forwards have been stowed in the overhead compartment>
-----------------------------------------------------------------------
As migration approached, two elderly vultures doubted they could make
the trip south, so they decided to go by airplane.
When they checked their baggage, the attendant noticed that they were
carrying two dead raccoons. "Do you wish to check the raccoons
through as luggage?" she asked.
"No, thanks," replied the vultures. "They're carrion."
--------------ms691B6036709EBB7DE811477F
Content-Type: application/x-pkcs7-signature; name="smime.p7s"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7s"
Content-Description: S/MIME Cryptographic Signature
MIIHewYJKoZIhvcNAQcCoIIHbDCCB2gCAQExCzAJBgUrDgMCGgUAMAsGCSqGSIb3DQEHAaCC
BWwwggKrMIICFKADAgECAgIIOjANBgkqhkiG9w0BAQQFADB3MQswCQYDVQQGEwJVUzEsMCoG
A1UEChMjTmV0c2NhcGUgQ29tbXVuaWNhdGlvbnMgQ29ycG9yYXRpb24xHDAaBgNVBAsTE0lu
Zm9ybWF0aW9uIFN5c3RlbXMxHDAaBgNVBAMTE3Jvb3RjYS5uZXRzY2FwZS5jb20wHhcNOTcx
MTE0MDEwMDE0WhcNOTgwNTEzMDEwMDE0WjCBhjELMAkGA1UEBhMCVVMxJjAkBgNVBAoTHU5l
dHNjYXBlIENvbW11bmljYXRpb25zIENvcnAuMRMwEQYDVQQDEwpFcmljIE1hZGVyMSIwIAYJ
KoZIhvcNAQkBFhNlbWFkZXJAbmV0c2NhcGUuY29tMRYwFAYKCZImiZPyLGQBARMGZW1hZGVy
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDMFuyovDlaYG44cW2wAEV66eUqhC4RAKOC
76xkYy7c0ZvV2B2RDYeTGqw6ZBJotuY/h6tztgOX61lz2O6ViYl2NRUq+Fl2bbY2rq+QXsLX
/04TveXoxpQMnY0bYe8nOfAUxj7pRNXG2CfWc/QVFti+yg6XwgCmTo1xmQjq5lhf9wIDAQAB
ozYwNDARBglghkgBhvhCAQEEBAMCAKAwHwYDVR0jBBgwFoAU/OBU6Afxld4695nGrvoVDG7E
LpIwDQYJKoZIhvcNAQEEBQADgYEAP/kXpuPBjKW/pypwPfwJYxfmTgaKLcZAjZ8YpbIJEeiU
rY3/uSofuVWhjx6TpMigY8v3o5ufQi1ge/1ERIG3GjbjHhcUUINRU2Z/+a7+80nadciAQV+n
jsJm47w9jDA8vQxazDIz6M720malCHU8xRxkWxjBxX4jxhdkK48iVdMwggK5MIICIqADAgEC
AgEBMA0GCSqGSIb3DQEBBAUAMHcxCzAJBgNVBAYTAlVTMSwwKgYDVQQKEyNOZXRzY2FwZSBD
b21tdW5pY2F0aW9ucyBDb3Jwb3JhdGlvbjEcMBoGA1UECxMTSW5mb3JtYXRpb24gU3lzdGVt
czEcMBoGA1UEAxMTcm9vdGNhLm5ldHNjYXBlLmNvbTAeFw05NzAzMjYwMTQ0MzhaFw05OTAz
MjYwMTQ0MzhaMHcxCzAJBgNVBAYTAlVTMSwwKgYDVQQKEyNOZXRzY2FwZSBDb21tdW5pY2F0
aW9ucyBDb3Jwb3JhdGlvbjEcMBoGA1UECxMTSW5mb3JtYXRpb24gU3lzdGVtczEcMBoGA1UE
AxMTcm9vdGNhLm5ldHNjYXBlLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAwao+
/i0/pYfDR9/72m3YGKBFPfnHm0POJ7RaE5wRfb/S8ohex7+yi3m6p+UoC0CmjpkxVcX4zpYG
XiKEdr8BImLDqZknuwhoERTHCn7csof4x+AkMAG8LZaF5xnDLqGTdyw0GC/736JIs+egr3oD
5IuMdaQtkyCMIDlUp0W6QGUCAwEAAaNVMFMwEQYJYIZIAYb4QgEBBAQDAgAEMB0GA1UdDgQW
BBT84FToB/GV3jr3mcau+hUMbsQukjAfBgNVHSMEGDAWgBT84FToB/GV3jr3mcau+hUMbsQu
kjANBgkqhkiG9w0BAQQFAAOBgQBZ99sbXHoGxObFmGGEGM76BksgsSTK/Fl+Pxjx5L6sENlK
0mmPbvyRyvUEHAquufrKOexNABmmZ5TM5UBbWYQkkvABLBnkCy87HPYPG4VF7MOX8eC6QMvd
V3GJ4ItJcEkf3bbLNG9vzy8h5FPRGWaPZ2Lw3e4dSCrwR3uDdId5yDGCAdcwggHTAgEBMH0w
dzELMAkGA1UEBhMCVVMxLDAqBgNVBAoTI05ldHNjYXBlIENvbW11bmljYXRpb25zIENvcnBv
cmF0aW9uMRwwGgYDVQQLExNJbmZvcm1hdGlvbiBTeXN0ZW1zMRwwGgYDVQQDExNyb290Y2Eu
bmV0c2NhcGUuY29tAgIIOjAJBgUrDgMCGgUAoIGxMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0B
BwEwIwYJKoZIhvcNAQkEMRYEFFagObyiR2QAb/2AgG/uvXOz13ByMBwGCSqGSIb3DQEJBTEP
Fw05NzExMTkxODMyMjJaMFIGCSqGSIb3DQEJDzFFMEMwCgYIKoZIhvcNAwcwDgYIKoZIhvcN
AwICAgCAMAcGBSsOAwIHMA0GCCqGSIb3DQMCAgFAMA0GCCqGSIb3DQMCAgEoMA0GCSqGSIb3
DQEBAQUABIGAD7qsSJAuy1NeHQJOQphJ3Zeo0rvtieSNPDK2mf1MzIDTjD1wk1zyd9wImzFw
Kt99mxZgvmA6Ynqh32zbl2eB0MnZ7CHV2cYAN8Dto+DwKopQvKhTLgpFIWHtqK3jHFiew9JI
EZxq6VIuj+09gq6XaSBOYWLwGcdSr6ZegqXfM2I=
--------------ms691B6036709EBB7DE811477F--
From - Wed Dec 03 08:00:37 1997
Return-Path: <terry@dome.mcom.com>
Received: from dome.mcom.com ([208.12.42.33]) by terryw.mcom.com
(Netscape Messaging Server 3.01) with ESMTP id 400
for <terry@terryw.mcom.com>; Tue, 2 Dec 1997 11:29:00 -0800
Received: from dome.mcom.com ([127.0.0.1]) by dome.mcom.com
(Netscape Mail Server v2.02) with SMTP id AAA18756
for <terry@terryw>; Tue, 2 Dec 1997 11:29:00 -0800
Return-Path: list@glacier.mcom.com
Return-Path: <list@glacier.mcom.com>
Received: from glacier.mcom.com ([205.217.233.39]) by dome.mcom.com
(Netscape Mail Server v2.02) with ESMTP id AAA18742
for <terry@dome.mcom.com>; Tue, 2 Dec 1997 11:28:58 -0800
Received: (from list@localhost) by glacier.mcom.com (8.7.3/8.7.3) id LAA09662; Tue, 2 Dec 1997 11:28:46 -0800 (PST)
Resent-Date: Tue, 2 Dec 1997 11:28:46 -0800 (PST)
Message-ID: <3484604F.AED7FEED@netscape.com>
Date: Tue, 02 Dec 1997 11:23:59 -0800
From: dcasados@netscape.com (Debbie Casados)
Reply-To: dcasados@netscape.com
Organization: Netscape
X-Mailer: Mozilla 4.02 [en]C-NSCP (Win95; U)
MIME-Version: 1.0
To: stp-all@netscape.com, cpd-all@netscape.com, spd-all@netscape.com
CC: pdhr@netscape.com, beer@netscape.com, campsey@netscape.com
Subject: SITN REGISTRATION INFO
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
Resent-Message-ID: <"H4WE_2.0.CM2.W56Xq"@glacier>
Resent-From: cpd-all@netscape.com
X-Mailing-List: <cpd-all@netscape.com> archive/latest/63
X-Loop: cpd-all@netscape.com
Precedence: list
Resent-Sender: cpd-all-request@netscape.com
X-Mozilla-Status: 8001
<HTML>
I wanted to update you on another developmental opportunity that Netscape
is sponsoring for extended education.&nbsp; SITN, Stanford Instructional
Television Network, will be broadcast to the Netscape campus beginning
in the winter quarter.&nbsp; This is an opportunity for individuals to
enroll in Stanford's School of Engineering to study for a technical, graduate
degree.
<P><B>Registration for non-degree classes and credit ends on <U>December
5</U> while registration for auditing courses ends on <U>Dec. 19th.</U></B>
<P>We will be having an information session tomorrow, <B><FONT COLOR="#CC0000">December
3, from 11-12pm in building 14 Grab-n-Go area.</FONT></B>&nbsp; If you
are interested in learning more about SITN please drop by the session.&nbsp;
If you would like to register for SITN please check out Stanford's SITN
website.&nbsp;<A HREF="www.SCPD.stanford.edu"> SCPD.stanford.edu</A>
<P>--
<BR>Debbie Casados
<BR>HR Director, Product Development
<BR>415-937-3883
<BR>Fax 415-938-9039
<BR>&nbsp;</HTML>