Old references to Orion, etc. ripped now. Replacements dropped it. It

compiles. Let the games begin.
This commit is contained in:
grail%cafebabe.org 1999-01-09 03:55:32 +00:00
Родитель 7a250789ef
Коммит 183c4296d2
83 изменённых файлов: 1048 добавлений и 709 удалений

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

@ -19,24 +19,22 @@
package grendel.addressbook;
import grendel.addressbook.AddressCard.*;
import grendel.addressbook.addresscard.*;
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.util.*;
import com.sun.java.swing.*;
import com.sun.java.swing.text.*;
import com.sun.java.swing.ImageIcon;
import com.sun.java.swing.table.*;
//import com.sun.java.swing.table.DefaultTableModel;
import com.sun.java.swing.event.TableModelEvent;
import com.sun.java.swing.border.EmptyBorder;
import javax.swing.*;
import javax.swing.text.*;
import javax.swing.ImageIcon;
import javax.swing.table.*;
//import javax.swing.table.DefaultTableModel;
import javax.swing.event.TableModelEvent;
import javax.swing.border.EmptyBorder;
import netscape.ldap.*;
import netscape.orion.toolbars.*;
import netscape.orion.menus.NsMenuManager;
/**
*

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

@ -23,7 +23,7 @@ import java.awt.*;
import java.awt.event.*;
import java.util.*;
import com.sun.java.swing.*;
import javax.swing.*;
class NewCardDialog extends Dialog {

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

@ -15,12 +15,14 @@
* 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.
*
* Modified: Jeff Galyan <jeffrey.galyan@sun.com>, 30 Dec 1998
*/
package grendel.composition;
import java.awt.*;
import com.sun.java.swing.*;
import javax.swing.*;
public class AddressBar extends NSTabbedPane {
AddressList mAddressList;
@ -28,19 +30,19 @@ public class AddressBar extends NSTabbedPane {
OptionsPanel mOptionsPanel;
public AddressBar() {
//address panel
// address panel
ImageIcon addressIcon = new ImageIcon(getClass().getResource("images/small_address.gif"));
mAddressList = new AddressList ();
//attachments panel
// attachments panel
ImageIcon attachmentsIcon = new ImageIcon(getClass().getResource("images/small_attachments.gif"));
mAttachmentsList = new AttachmentsList();
//otpions panel
// options panel
ImageIcon optionsIcon = new ImageIcon(getClass().getResource("images/small_otpions.gif"));
mOptionsPanel = new OptionsPanel();
//tabbed panel holds address, attachments and otpions.
// tabbed panel holds address, attachments and otpions.
addTab("", addressIcon, mAddressList);
addTab("", attachmentsIcon, mAttachmentsList);
addTab("", optionsIcon, mOptionsPanel);

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

@ -23,9 +23,9 @@ import java.awt.*;
import java.awt.event.*;
import java.util.*;
import com.sun.java.swing.*;
import com.sun.java.swing.table.*;
import com.sun.java.swing.border.*;
import javax.swing.*;
import javax.swing.table.*;
import javax.swing.border.*;
class AddressDialog extends Dialog implements ActionListener {
private final int BUTTON_WIDTH = 100;

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

@ -15,6 +15,8 @@
* 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.
*
* Modified: Jeff Galyan <jeffrey.galyan@sun.com>, 30 Dec 1998
*/
package grendel.composition;
@ -30,10 +32,10 @@ import java.awt.event.*;
import java.io.*;
import java.util.*;
import com.sun.java.swing.*;
import com.sun.java.swing.JTable;
import javax.swing.*;
import javax.swing.JTable;
import netscape.orion.misc.*;
//import netscape.orion.misc.*;
public class AddressList extends JScrollPane implements Serializable {
protected AddressPanel mAddressPanel;
@ -533,19 +535,20 @@ public class AddressList extends JScrollPane implements Serializable {
}
}
// public class AddressTextField extends JTextField implements FocusListener {
public class AddressTextField extends ATC_Field implements FocusListener {
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, new TestDataSource2());
super(aString);
// super (aString, new TestDataSource2());
mDeliveryButton = aDeliveryButton;
//red completion text.
setCompletionColor (Color.red);
// setCompletionColor (Color.red);
//NO border.
setBorder(null);
@ -557,6 +560,10 @@ public class AddressList extends JScrollPane implements Serializable {
enableEvents (AWTEvent.KEY_EVENT_MASK); //see processKeyEvent
}
public void setCompletionColor(Color c) {
}
/**
* catch tabs before anyone else.
*/

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

@ -29,7 +29,7 @@ import java.util.*;
import java.awt.*;
import java.awt.event.*;
import com.sun.java.swing.*;
import javax.swing.*;
/*
*/

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

@ -15,6 +15,8 @@
* 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.
*
* Modified: Jeff Galyan <jeffrey.galyan@sun.com>, 30 Dec 1998
*/
package grendel.composition;
@ -25,11 +27,11 @@ import java.awt.BorderLayout;
import java.util.Properties;
import java.util.Vector;
//import com.sun.java.swing.*;
import com.sun.java.swing.event.*;
import javax.swing.*;
import javax.swing.event.*;
import netscape.orion.toolbars.*;
import netscape.orion.menus.NsMenuManager;
//import netscape.orion.toolbars.*;
//import netscape.orion.menus.NsMenuManager;
import grendel.storage.MessageExtra;
import grendel.storage.MessageExtraFactory;
@ -76,14 +78,16 @@ public class Composition extends GeneralFrame {
mCompositionPanel.addCompositionPanelListener(new PanelListener());
//create menubar (top)
fMenu = buildMenu("mainMenubar",
mCompositionPanel.getActions());
// fMenu = buildMenu("mainMenubar",
// mCompositionPanel.getActions());
fMenu = buildMenu();
getRootPane().setMenuBar(fMenu);
fToolBar = mCompositionPanel.getToolBar();
fToolBar.addItem(ToolbarFactory.MakeINSToolbarItem(ToolBarLayout.CreateSpring(),
null));
fToolBar.addItem(ToolbarFactory.MakeINSToolbarItem(fAnimation, null));
// fToolBar.addItem(ToolbarFactory.MakeINSToolbarItem(ToolBarLayout.CreateSpring(),
// null));
// fToolBar.addItem(ToolbarFactory.MakeINSToolbarItem(fAnimation, null));
mAddressBar = mCompositionPanel.getAddressBar();
@ -141,7 +145,7 @@ public class Composition extends GeneralFrame {
for (int w=0 ; w<2 ; w++) {
Address list[] = null;
try {
list = msg.getRecipients(w == 0 ? Message.TO : Message.CC);
list = msg.getRecipients(w == 0 ? Message.RecipientType.TO : Message.RecipientType.CC);
} catch (MessagingException e) {
}
if (list != null) {

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

@ -17,6 +17,7 @@
* Netscape Communications Corporation. All Rights Reserved.
*
* Created: Will Scullin <scullin@netscape.com>, 20 Oct 1997.
* Modified: Jeff Galyan <jeffrey.galyan@sun.com>, 30 Dec 1998
*/
package grendel.composition;
@ -45,38 +46,37 @@ import java.util.Hashtable;
import java.util.StringTokenizer;
import java.util.Properties;
import com.sun.java.swing.BorderFactory;
import com.sun.java.swing.ImageIcon;
import com.sun.java.swing.JButton;
import com.sun.java.swing.JLabel;
import com.sun.java.swing.JPanel;
import com.sun.java.swing.JScrollPane;
import com.sun.java.swing.JTextField;
import com.sun.java.swing.JTextArea;
import com.sun.java.swing.border.BevelBorder;
import com.sun.java.swing.event.ChangeEvent;
import com.sun.java.swing.event.EventListenerList;
import com.sun.java.swing.text.BadLocationException;
import com.sun.java.swing.text.Document;
import com.sun.java.swing.text.JTextComponent;
import com.sun.java.swing.text.TextAction;
import javax.swing.AbstractAction;
import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextField;
import javax.swing.JTextArea;
import javax.swing.JToolBar;
import javax.swing.border.BevelBorder;
import javax.swing.event.ChangeEvent;
import javax.swing.event.EventListenerList;
import javax.swing.text.BadLocationException;
import javax.swing.text.Document;
import javax.swing.text.JTextComponent;
import javax.swing.text.TextAction;
import javax.mail.Address;
import javax.mail.Session;
import javax.mail.Message;
import javax.mail.Transport;
import javax.mail.MessagingException;
import javax.mail.internet.MimeMessage;
import javax.mail.internet.InternetAddress;
import netscape.orion.toolbars.NSButton;
import netscape.orion.toolbars.NSToolbar;
import netscape.orion.uimanager.AbstractUICmd;
import netscape.orion.uimanager.IUICmd;
import grendel.storage.MessageExtra;
import grendel.storage.MessageExtraFactory;
import grendel.ui.ActionFactory;
import grendel.ui.GeneralPanel;
import grendel.ui.UIAction;
public class CompositionPanel extends GeneralPanel {
private Hashtable mCommands;
@ -134,7 +134,7 @@ public class CompositionPanel extends GeneralPanel {
* of actions supported by the embedded JTextComponent
* augmented with the actions defined locally.
*/
public IUICmd[] getActions() {
public UIAction[] getActions() {
return defaultActions;
// XXX WHS need to translate Actions to UICmds
// return TextAction.augmentList(mEditor.getActions(), defaultActions);
@ -273,7 +273,7 @@ public class CompositionPanel extends GeneralPanel {
public static final String wrapLongLinesTag ="wrapLongLines";
// --- action implementations -----------------------------------
private IUICmd[] defaultActions = {
private UIAction[] defaultActions = {
//"File" actions
// new SaveDraft(),
new SaveAs(),
@ -326,7 +326,7 @@ public class CompositionPanel extends GeneralPanel {
* Try to save the message to the "draft" mailbox.
* @see SaveAs
*/
class SaveDraft extends AbstractUICmd {
class SaveDraft extends UIAction {
SaveDraft() {
super(saveDraftTag);
setEnabled(true);
@ -338,7 +338,7 @@ public class CompositionPanel extends GeneralPanel {
* Try to save the message to a text file.
* @see SaveDraft
*/
class SaveAs extends AbstractUICmd {
class SaveAs extends UIAction {
SaveAs() {
super(saveAsTag);
setEnabled(true);
@ -376,7 +376,7 @@ public class CompositionPanel extends GeneralPanel {
/**
* Send the mail message now.
*/
class SendNow extends AbstractUICmd {
class SendNow extends UIAction {
SendNow() {
super(sendNowTag);
setEnabled(true);
@ -395,7 +395,7 @@ public class CompositionPanel extends GeneralPanel {
//try to send the message
//get the current list of recipients.
Addressee[] recipients = mAddressList.getAddresses ();
Addressee[] recipients = mAddressList.getAddresses();
//Check that is at least one recipient.
if (0 < recipients.length) {
@ -417,19 +417,19 @@ public class CompositionPanel extends GeneralPanel {
javax.mail.Address[] toAddress = new InternetAddress[1];
toAddress[0] = new InternetAddress(recipients[i].getText());
int deliverMode = Message.TO;
Message.RecipientType deliverMode = Message.RecipientType.TO;
//map grendel.composition.Addressee delivery modes
// into javax.mail.Message delivery modes.
switch (recipients[i].getDelivery()) {
case Addressee.TO:
deliverMode = Message.TO;
deliverMode = Message.RecipientType.TO;
break;
case Addressee.CC:
deliverMode = Message.CC;
deliverMode = Message.RecipientType.CC;
break;
case Addressee.BCC:
deliverMode = Message.BCC;
deliverMode = Message.RecipientType.BCC;
break;
}
msg.addRecipients(deliverMode, toAddress);
@ -439,7 +439,12 @@ public class CompositionPanel extends GeneralPanel {
//field.
msg.setSentDate(new java.util.Date()); //set date to now.
msg.setContent(messageText, "text/plain"); //contents.
msg.send(); //send the message.
try {
mSession.getTransport().send(msg); // send the message.
} catch (MessagingException exc) {
exc.printStackTrace();
}
success = true;
} catch (javax.mail.SendFailedException sex) {
sex.printStackTrace();
@ -471,7 +476,7 @@ public class CompositionPanel extends GeneralPanel {
* Quote the original text message into the editor.
* @see PasteAsQuotation
*/
class QuoteOriginalText extends AbstractUICmd {
class QuoteOriginalText extends UIAction {
QuoteOriginalText() {
super(quoteOriginalTextTag);
setEnabled(true);
@ -485,6 +490,7 @@ public class CompositionPanel extends GeneralPanel {
InputStream plaintext = null;
try {
plaintext = referredMsg.getInputStream();
} catch (IOException ioe) {
} catch (MessagingException e) {
}
if (plaintext == null) return; // Or beep or whine??? ###
@ -549,7 +555,7 @@ public class CompositionPanel extends GeneralPanel {
}
}
class SelectAddresses extends AbstractUICmd {
class SelectAddresses extends UIAction {
SelectAddresses() {
super(selectAddressesTag);
setEnabled(true);
@ -585,7 +591,7 @@ public class CompositionPanel extends GeneralPanel {
//-----------------------
// "file->attach" actions
//-----------------------
class AttachFile extends AbstractUICmd {
class AttachFile extends UIAction {
AttachFile() {
super(fileTag);
setEnabled(true);
@ -606,7 +612,7 @@ public class CompositionPanel extends GeneralPanel {
* Quote and paste whatever string that's on the clipboard into the editor.
* @see QuoteOriginalText
*/
class PasteAsQuotation extends AbstractUICmd {
class PasteAsQuotation extends UIAction {
PasteAsQuotation() {
super(pasteAsQuotationTag);
setEnabled(true);
@ -637,7 +643,7 @@ public class CompositionPanel extends GeneralPanel {
appendQuotaion = true;
quotedString.append (token);
//if this token is a line then skip inserting a quotitona on the line
//if this token is a line then skip inserting a quotation on the line
if (!token.equals ("\n"))
appendQuotaion = false;
}
@ -661,7 +667,7 @@ public class CompositionPanel extends GeneralPanel {
//"View" actions
//-----------------------
class ViewAddress extends AbstractUICmd {
class ViewAddress extends UIAction {
ViewAddress() {
super(viewAddressTag);
setEnabled(true);
@ -672,7 +678,7 @@ public class CompositionPanel extends GeneralPanel {
}
}
class ViewAttachments extends AbstractUICmd {
class ViewAttachments extends UIAction {
ViewAttachments() {
super(viewAttachmentsTag);
setEnabled(true);
@ -683,7 +689,7 @@ public class CompositionPanel extends GeneralPanel {
}
}
class ViewOptions extends AbstractUICmd {
class ViewOptions extends UIAction {
ViewOptions() {
super(viewOptionsTag);
setEnabled(true);
@ -698,9 +704,9 @@ public class CompositionPanel extends GeneralPanel {
* Create a Toolbar
* @see addToolbarButton
*/
private NSToolbar createToolbar() {
private JToolBar createToolbar() {
NSToolbar toolBar = new NSToolbar();
JToolBar toolBar = new JToolBar();
addToolbarButton(toolBar, new SendNow(),
"send", "Send this message");
addToolbarButton(toolBar, new QuoteOriginalText(),
@ -730,11 +736,11 @@ public class CompositionPanel extends GeneralPanel {
* @param aToolTip The buttons tool tip. like "Save the current file".
* @see createToolbar
*/
public void addToolbarButton(NSToolbar aToolBar,
IUICmd aActionListener,
public void addToolbarButton(JToolBar aToolBar,
UIAction aActionListener,
String aImageName,
String aToolTip) {
NSButton b = new NSButton();
JButton b = new JButton();
b.setHorizontalTextPosition(JButton.CENTER);
b.setVerticalTextPosition(JButton.BOTTOM);
@ -766,7 +772,7 @@ public class CompositionPanel extends GeneralPanel {
b.setEnabled(false);
}
aToolBar.addItem(b);
aToolBar.add(b);
}
/**

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

@ -23,7 +23,7 @@ package grendel.composition;
import java.util.EventListener;
import com.sun.java.swing.event.ChangeEvent;
import javax.swing.event.ChangeEvent;
public interface CompositionPanelListener extends EventListener {
public void sendingMail(ChangeEvent aEvent);

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

@ -29,8 +29,8 @@
package grendel.composition;
import com.sun.java.swing.text.*;
import com.sun.java.swing.*;
import javax.swing.text.*;
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;

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

@ -15,20 +15,22 @@
* 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.
*
* Modified: Jeff Galyan <jeffrey.galyan@sun.com>, 30 Dec 1998
*/
package grendel.composition;
import java.awt.*;
import com.sun.java.swing.JTabbedPane;
import com.sun.java.swing.basic.BasicTabbedPaneUI;
import com.sun.java.swing.*;
import com.sun.java.swing.plaf.*;
import javax.swing.JTabbedPane;
import javax.swing.plaf.basic.BasicTabbedPaneUI;
import javax.swing.*;
import javax.swing.plaf.*;
import netscape.orion.toolbars.*;
import pk.core.*;
//import netscape.orion.toolbars.*;
//import pk.core.*;
public class NSTabbedPane extends BaseDelegate implements INSToolbar, IFloatingToolbar {
public class NSTabbedPane extends JTabbedPane {
protected JTabbedPane fTabbedPane;
protected Object fID = null;
protected String fName = null;

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

@ -15,14 +15,16 @@
* 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.
*
* Modified: Jeff Galyan <jeffrey.galyan@sun.com>, 30 Dec 1998
*/
package grendel.composition;
import java.io.Serializable;
import java.awt.*;
import com.sun.java.swing.*;
import com.sun.java.swing.border.*;
import javax.swing.*;
import javax.swing.border.*;
public class OptionsPanel extends JPanel implements Serializable {
private final int BOX_WIDTH = 300;
@ -69,7 +71,7 @@ public class OptionsPanel extends JPanel implements Serializable {
JCheckBox checkButton = new JCheckBox(aLabel, isChecked);
if (!aToolTip.equals ("")) checkButton.setToolTipText(aToolTip);
if (' ' != aAccelerator) checkButton.setKeyAccelerator(aAccelerator);
if (' ' != aAccelerator) checkButton.setMnemonic(aAccelerator);
//create a fixed sized panel.
add(new FixedSizedPanel (BOX_WIDTH, BOX_HEIGHT, checkButton));

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

@ -20,7 +20,7 @@
package grendel.composition;
import java.util.Vector;
import com.sun.java.swing.event.*;
import javax.swing.event.*;
import netscape.orion.misc.*;
public class TestDataSource2 extends ATC_SourceAdapter {

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

@ -25,7 +25,7 @@ import java.awt.*;
import java.awt.datatransfer.*;
import java.awt.event.*;
import java.util.*;
import com.sun.java.swing.*;
import javax.swing.*;
public class DragSourceContext {
static final int ACTION_MASK =

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

@ -26,6 +26,7 @@ package grendel.filters;
import java.io.Reader;
import javax.mail.Message;
import javax.mail.Flags;
import javax.mail.Flags.Flag;
import javax.mail.MessagingException;
import grendel.filters.IFilterAction;
@ -46,7 +47,7 @@ public class DeleteFilterActionFactory extends Object
}
System.err.println("Message: " + subject + " -> discard;");
try {
message.setFlags(Flags.DeletedFlag, true);
message.setFlag(Flags.Flag.DELETED, true);
} catch (MessagingException e) {
System.err.println("DeleteFilterAction.exercise() failed: " + e);
}

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

@ -29,17 +29,17 @@ import java.util.Vector;
import javax.activation.DataHandler;
import com.sun.java.swing.AbstractAction;
import com.sun.java.swing.event.EventListenerList;
import javax.swing.AbstractAction;
import javax.swing.event.EventListenerList;
import calypso.util.NullJavaEnumeration;
import netscape.orion.uimanager.AbstractUICmd;
import grendel.ui.UIAction;
import netscape.shell.IShellIntegrator;
import netscape.shell.IShellView;
import netscape.shell.IShellViewCtx;
import netscape.shell.ShellViewCtxListener;
//import netscape.shell.IShellIntegrator;
//import netscape.shell.IShellView;
//import netscape.shell.IShellViewCtx;
//import netscape.shell.ShellViewCtxListener;
import grendel.composition.CompositionPanel;
import grendel.prefs.Prefs;
@ -247,7 +247,7 @@ public class CompositionShell implements IShellViewCtx {
return fDataHandler;
}
class ComposeAction extends AbstractUICmd {
class ComposeAction extends UIAction {
public ComposeAction() {
super("msgNew");

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

@ -33,20 +33,20 @@ import java.util.StringTokenizer;
import java.util.Vector;
import java.util.Properties;
import com.sun.java.swing.Action;
import com.sun.java.swing.JMenu;
import com.sun.java.swing.JMenuItem;
import com.sun.java.swing.event.ChangeEvent;
import javax.swing.Action;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
import javax.swing.event.ChangeEvent;
import calypso.util.Preferences;
import calypso.util.PreferencesFactory;
import netscape.orion.toolbars.NSToolbar;
//import netscape.orion.toolbars.NSToolbar;
import netscape.shell.IShellAnimation;
import netscape.shell.IShellIntegrator;
import netscape.shell.IShellView;
import netscape.shell.IShellViewCtx;
//import netscape.shell.IShellAnimation;
//import netscape.shell.IShellIntegrator;
//import netscape.shell.IShellView;
//import netscape.shell.IShellViewCtx;
import grendel.composition.AddressBar;
import grendel.composition.CompositionPanel;

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

@ -28,13 +28,13 @@ import java.util.Vector;
import javax.activation.DataHandler;
import com.sun.java.swing.event.ChangeEvent;
import com.sun.java.swing.event.EventListenerList;
import javax.swing.event.ChangeEvent;
import javax.swing.event.EventListenerList;
import netscape.shell.IShellIntegrator;
import netscape.shell.IShellView;
import netscape.shell.IShellViewCtx;
import netscape.shell.ShellViewCtxListener;
//import netscape.shell.IShellIntegrator;
//import netscape.shell.IShellView;
//import netscape.shell.IShellViewCtx;
//import netscape.shell.ShellViewCtxListener;
import javax.mail.Folder;
import javax.mail.MessagingException;

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

@ -34,28 +34,28 @@ import java.util.Vector;
import javax.mail.Folder;
import com.sun.java.swing.Action;
import com.sun.java.swing.JMenu;
import com.sun.java.swing.JMenuItem;
import com.sun.java.swing.event.ChangeEvent;
import javax.swing.Action;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
import javax.swing.event.ChangeEvent;
import netscape.orion.toolbars.NSToolbar;
import netscape.orion.uimanager.UIMConstants;
import netscape.orion.uimanager.IUICmd;
//import netscape.orion.toolbars.NSToolbar;
//import netscape.orion.uimanager.UIMConstants;
//import netscape.orion.uimanager.IUICmd;
import netscape.shell.IShellAnimation;
import netscape.shell.IShellIntegrator;
import netscape.shell.IShellView;
import netscape.shell.IShellViewCtx;
//import netscape.shell.IShellAnimation;
//import netscape.shell.IShellIntegrator;
//import netscape.shell.IShellView;
//import netscape.shell.IShellViewCtx;
import netscape.orion.uimanager.AbstractUICmd;
import netscape.orion.uimanager.ConfigFormatException;
import netscape.orion.uimanager.IUICmd;
import netscape.orion.uimanager.IUIMMenuBar;
import netscape.orion.uimanager.UIMConstants;
//import netscape.orion.uimanager.AbstractUICmd;
//import netscape.orion.uimanager.ConfigFormatException;
//import netscape.orion.uimanager.IUICmd;
//import netscape.orion.uimanager.IUIMMenuBar;
//import netscape.orion.uimanager.UIMConstants;
import xml.tree.TreeBuilder;
import xml.tree.XMLNode;
//import xml.tree.TreeBuilder;
//import xml.tree.XMLNode;
import grendel.ui.ActionFactory;
import grendel.ui.FolderPanel;

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

@ -36,25 +36,25 @@ import java.util.Vector;
import javax.mail.Folder;
import com.sun.java.swing.Action;
import com.sun.java.swing.JMenu;
import com.sun.java.swing.JMenuItem;
import com.sun.java.swing.event.ChangeEvent;
import javax.swing.Action;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
import javax.swing.event.ChangeEvent;
import netscape.orion.toolbars.NSToolbar;
import netscape.orion.uimanager.AbstractUICmd;
import netscape.orion.uimanager.ConfigFormatException;
import netscape.orion.uimanager.IUICmd;
import netscape.orion.uimanager.IUIMMenuBar;
import netscape.orion.uimanager.UIMConstants;
//import netscape.orion.toolbars.NSToolbar;
//import netscape.orion.uimanager.AbstractUICmd;
//import netscape.orion.uimanager.ConfigFormatException;
//import netscape.orion.uimanager.IUICmd;
//import netscape.orion.uimanager.IUIMMenuBar;
//import netscape.orion.uimanager.UIMConstants;
import xml.tree.TreeBuilder;
import xml.tree.XMLNode;
//import xml.tree.TreeBuilder;
//import xml.tree.XMLNode;
import netscape.shell.IShellAnimation;
import netscape.shell.IShellIntegrator;
import netscape.shell.IShellView;
import netscape.shell.IShellViewCtx;
//import netscape.shell.IShellAnimation;
//import netscape.shell.IShellIntegrator;
//import netscape.shell.IShellView;
//import netscape.shell.IShellViewCtx;
import grendel.ui.ActionFactory;
import grendel.ui.MasterPanel;

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

@ -25,14 +25,14 @@ import java.awt.Toolkit;
import java.util.Enumeration;
import java.util.Vector;
import com.sun.java.swing.event.ChangeEvent;
import com.sun.java.swing.event.ChangeListener;
import com.sun.java.swing.event.EventListenerList;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.event.EventListenerList;
import netscape.shell.IShellIntegrator;
import netscape.shell.IShellView;
import netscape.shell.IShellViewCtx;
import netscape.shell.ShellViewCtxListener;
//import netscape.shell.IShellIntegrator;
//import netscape.shell.IShellView;
//import netscape.shell.IShellViewCtx;
//import netscape.shell.ShellViewCtxListener;
import javax.activation.DataHandler;
import javax.mail.Folder;

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

@ -24,9 +24,9 @@ package grendel.integrator;
import java.awt.Image;
import java.text.MessageFormat;
import netscape.shell.IShellIntegrator;
import netscape.shell.IShellView;
import netscape.shell.IShellViewCtx;
//import netscape.shell.IShellIntegrator;
//import netscape.shell.IShellView;
//import netscape.shell.IShellViewCtx;
import grendel.view.ViewedFolder;
import grendel.view.ViewedStore;

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

@ -40,31 +40,31 @@ import java.util.Vector;
import javax.mail.Store;
import javax.mail.URLName;
import com.sun.java.swing.AbstractListModel;
import com.sun.java.swing.FileType;
import com.sun.java.swing.JFileChooser;
import javax.swing.AbstractListModel;
import javax.swing.FileType;
import javax.swing.JFileChooser;
//import java.awt.FileDialog;
//import java.io.File;
//import java.io.FilenameFilter;
import com.sun.java.swing.JList;
import com.sun.java.swing.JScrollPane;
import com.sun.java.swing.ListModel;
import com.sun.java.swing.border.BevelBorder;
import com.sun.java.swing.event.EventListenerList;
import com.sun.java.swing.event.ListDataEvent;
import com.sun.java.swing.event.ListDataListener;
import com.sun.java.swing.event.ListSelectionEvent;
import com.sun.java.swing.event.ListSelectionListener;
import com.sun.java.swing.table.AbstractTableModel;
import javax.swing.JList;
import javax.swing.JScrollPane;
import javax.swing.ListModel;
import javax.swing.border.BevelBorder;
import javax.swing.event.EventListenerList;
import javax.swing.event.ListDataEvent;
import javax.swing.event.ListDataListener;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import javax.swing.table.AbstractTableModel;
import netscape.orion.dialogs.AbstractCtrl;
import netscape.orion.dialogs.AttrNotFoundException;
import netscape.orion.dialogs.JLISTeditor;
import netscape.orion.dialogs.PageModel;
import netscape.orion.dialogs.PageUI;
//import netscape.orion.dialogs.AbstractCtrl;
//import netscape.orion.dialogs.AttrNotFoundException;
//import netscape.orion.dialogs.JLISTeditor;
//import netscape.orion.dialogs.PageModel;
//import netscape.orion.dialogs.PageUI;
import xml.tree.XMLNode;
import xml.tree.TreeBuilder;
//import xml.tree.XMLNode;
//import xml.tree.TreeBuilder;
import grendel.ui.EditHostDialog;
import grendel.ui.Util;

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

@ -25,8 +25,8 @@ import java.util.StringTokenizer;
import javax.mail.URLName;
import com.sun.java.swing.UIManager;
import com.sun.java.swing.UnsupportedLookAndFeelException;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
import calypso.util.Preferences;
import calypso.util.PreferencesFactory;

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

@ -21,7 +21,7 @@
package grendel.prefs;
import com.sun.java.swing.LookAndFeel;
import javax.swing.LookAndFeel;
public class UIPrefs {
LookAndFeel fLAF;

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

@ -37,18 +37,18 @@ import java.util.Hashtable;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
import com.sun.java.swing.AbstractListModel;
import com.sun.java.swing.LookAndFeel;
import com.sun.java.swing.UIManager;
import javax.swing.AbstractListModel;
import javax.swing.LookAndFeel;
import javax.swing.UIManager;
import netscape.orion.dialogs.AbstractCtrl;
import netscape.orion.dialogs.AttrNotFoundException;
import netscape.orion.dialogs.JLISTeditor;
import netscape.orion.dialogs.PageModel;
import netscape.orion.dialogs.PageUI;
//import netscape.orion.dialogs.AbstractCtrl;
//import netscape.orion.dialogs.AttrNotFoundException;
//import netscape.orion.dialogs.JLISTeditor;
//import netscape.orion.dialogs.PageModel;
//import netscape.orion.dialogs.PageUI;
import xml.tree.XMLNode;
import xml.tree.TreeBuilder;
//import xml.tree.XMLNode;
//import xml.tree.TreeBuilder;
public class UIPrefsEditor implements PropertyEditor {
UIPrefs fPrefs = new UIPrefs();
@ -195,9 +195,9 @@ public class UIPrefsEditor implements PropertyEditor {
fLAFs = UIManager.getAuxiliaryLookAndFeels();
*/
fLAFs = new LookAndFeel[] {
new com.sun.java.swing.jlf.JLFLookAndFeel(),
new com.sun.java.swing.motif.MotifLookAndFeel(),
new com.sun.java.swing.windows.WindowsLookAndFeel()
new javax.swing.jlf.JLFLookAndFeel(),
new javax.swing.motif.MotifLookAndFeel(),
new javax.swing.windows.WindowsLookAndFeel()
};
}

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

@ -36,13 +36,13 @@ import java.util.Hashtable;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
import netscape.orion.dialogs.AbstractCtrl;
import netscape.orion.dialogs.AttrNotFoundException;
import netscape.orion.dialogs.PageModel;
import netscape.orion.dialogs.PageUI;
//import netscape.orion.dialogs.AbstractCtrl;
//import netscape.orion.dialogs.AttrNotFoundException;
//import netscape.orion.dialogs.PageModel;
//import netscape.orion.dialogs.PageUI;
import xml.tree.XMLNode;
import xml.tree.TreeBuilder;
//import xml.tree.XMLNode;
//import xml.tree.TreeBuilder;
public class UserPrefsEditor implements PropertyEditor {
UserPrefs fPrefs = new UserPrefs();

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

@ -27,10 +27,10 @@ import java.awt.LayoutManager2;
import javax.mail.search.AndTerm;
import javax.mail.search.SearchTerm;
import com.sun.java.swing.JLabel;
import com.sun.java.swing.JPanel;
import com.sun.java.swing.border.BevelBorder;
import com.sun.java.swing.border.TitledBorder;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.border.BevelBorder;
import javax.swing.border.TitledBorder;
import grendel.widgets.SelectionManager;

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

@ -31,13 +31,13 @@ import java.awt.event.ItemListener;
import javax.mail.search.SearchTerm;
import com.sun.java.swing.JComboBox;
import com.sun.java.swing.JLabel;
import com.sun.java.swing.JList;
import com.sun.java.swing.JPanel;
import com.sun.java.swing.JTextField;
import com.sun.java.swing.ListCellRenderer;
import com.sun.java.swing.border.EmptyBorder;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.ListCellRenderer;
import javax.swing.border.EmptyBorder;
import grendel.widgets.SelectionManager;

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

@ -35,7 +35,7 @@ import javax.mail.search.SentDateTerm;
import javax.mail.search.SubjectTerm;
import javax.mail.search.SearchTerm;
import com.sun.java.swing.JTextField;
import javax.swing.JTextField;
import grendel.ui.FolderCombo;
import grendel.ui.FolderFrame;

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

@ -27,10 +27,10 @@ import java.awt.LayoutManager2;
import javax.mail.search.OrTerm;
import javax.mail.search.SearchTerm;
import com.sun.java.swing.JLabel;
import com.sun.java.swing.JPanel;
import com.sun.java.swing.border.BevelBorder;
import com.sun.java.swing.border.TitledBorder;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.border.BevelBorder;
import javax.swing.border.TitledBorder;
import grendel.widgets.SelectionManager;

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

@ -17,6 +17,7 @@
* Netscape Communications Corporation. All Rights Reserved.
*
* Created: Will Scullin <scullin@netscape.com>, 9 Oct 1997.
* Modified: Jeff Galyan <jeffrey.galyan@sun.com>, 30 Dec 1998
*/
package grendel.search;
@ -28,16 +29,17 @@ import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import com.sun.java.swing.Action;
import com.sun.java.swing.AbstractAction;
import com.sun.java.swing.JComponent;
import com.sun.java.swing.JButton;
import com.sun.java.swing.JLabel;
import com.sun.java.swing.JPanel;
import com.sun.java.swing.KeyStroke;
import com.sun.java.swing.border.EmptyBorder;
import javax.swing.Action;
import javax.swing.AbstractAction;
import javax.swing.BoxLayout;
import javax.swing.JComponent;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.KeyStroke;
import javax.swing.border.EmptyBorder;
import netscape.orion.toolbars.BarLayout;
//import netscape.orion.toolbars.BarLayout;
import grendel.ui.GeneralFrame;
@ -55,9 +57,9 @@ public class SearchFrame extends GeneralFrame {
fSearchPanel = new SearchPanel(new MailSearch());
getContentPane().add(fSearchPanel);
fActionPanel = new JPanel(new BarLayout(BarLayout.kHorizontal, 5), true);
fActionPanel = new JPanel(new BoxLayout(this, BoxLayout.X_AXIS), true);
fActionPanel.setBorder(new EmptyBorder(5,5,5,5));
fActionPanel.add(new Canvas(), BarLayout.kSpring);
fActionPanel.add(new Canvas());
fCloseButton = new JButton("Close");
fCloseButton.addActionListener(new ActionListener() {
@ -65,22 +67,20 @@ public class SearchFrame extends GeneralFrame {
dispose();
}
});
fActionPanel.add(fCloseButton, BarLayout.kSheep);
fActionPanel.add(fCloseButton);
fSearchButton = new JButton("Search");
fSearchButton.addActionListener(new SearchAction());
fActionPanel.add(fSearchButton, BarLayout.kSheep);
fActionPanel.add(fSearchButton);
fPanel.add(BorderLayout.SOUTH, fActionPanel);
fTargetPanel = new JPanel(new BarLayout(BarLayout.kHorizontal), true);
fTargetPanel = new JPanel(new BoxLayout(this, BoxLayout.X_AXIS), true);
fTargetPanel.setBorder(new EmptyBorder(5,5,5,5));
fTargetPanel.add(new Canvas(), BarLayout.kSpring);
fTargetPanel.add(new JLabel("Search In: "),
BarLayout.kVariable);
fTargetPanel.add(fSearchPanel.getSearchable().getTargetComponent(),
BarLayout.kVariable);
fTargetPanel.add(new Canvas(), BarLayout.kSpring);
fTargetPanel.add(new Canvas());
fTargetPanel.add(new JLabel("Search In: "));
fTargetPanel.add(fSearchPanel.getSearchable().getTargetComponent());
fTargetPanel.add(new Canvas());
fPanel.add(BorderLayout.NORTH, fTargetPanel);

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

@ -17,6 +17,7 @@
* Netscape Communications Corporation. All Rights Reserved.
*
* Created: Will Scullin <scullin@netscape.com>, 9 Oct 1997.
* Modified: Jeff Galyan <jeffrey.galyan@sun.com>, 31 Dec 1998
*/
package grendel.search;
@ -35,13 +36,12 @@ import java.util.Enumeration;
import javax.mail.search.SearchTerm;
import com.sun.java.swing.JComponent;
import com.sun.java.swing.JButton;
import com.sun.java.swing.JPanel;
import com.sun.java.swing.JScrollPane;
import com.sun.java.swing.border.EmptyBorder;
import netscape.orion.toolbars.BarLayout;
import javax.swing.BoxLayout;
import javax.swing.JComponent;
import javax.swing.JButton;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.border.EmptyBorder;
import grendel.widgets.SelectionManager;
import grendel.widgets.SingleSelectionManager;
@ -76,20 +76,21 @@ public class SearchPanel extends JPanel {
add(fQueryPanel);
// Create Operator buttons
fOperatorPanel = new JPanel(new BarLayout(BarLayout.kVertical, 5), true);
fOperatorPanel = new JPanel();
fOperatorPanel.setLayout(new BoxLayout(fOperatorPanel, BoxLayout.Y_AXIS));
fOperatorPanel.setBorder(new EmptyBorder(5,5,5,5));
fAndButton = new JButton("And");
fAndButton.addActionListener(new AndAction());
fOperatorPanel.add(fAndButton, BarLayout.kSheep);
fOperatorPanel.add(fAndButton);
fOrButton = new JButton("Or");
fOrButton.addActionListener(new OrAction());
fOperatorPanel.add(fOrButton, BarLayout.kSheep);
fOperatorPanel.add(fOrButton);
fDeleteButton = new JButton("Delete");
fDeleteButton.addActionListener(new DeleteAction());
fOperatorPanel.add(fDeleteButton, BarLayout.kSheep);
fOperatorPanel.add(fDeleteButton);
add(BorderLayout.EAST, fOperatorPanel);
}

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

@ -32,7 +32,7 @@ import java.awt.event.MouseEvent;
import javax.mail.search.SearchTerm;
import com.sun.java.swing.JPanel;
import javax.swing.JPanel;
import grendel.widgets.SelectionEvent;
import grendel.widgets.SelectionListener;

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

@ -17,6 +17,7 @@
* Netscape Communications Corporation. All Rights Reserved.
*
* Created: Will Scullin <scullin@netscape.com>, 8 Sep 1997.
* Modified: Jeff Galyan <jeffrey.galyan@sun.com>, 30 Dec 1998
*/
package grendel.ui;
@ -29,69 +30,72 @@ import java.text.MessageFormat;
import java.util.Enumeration;
import java.util.ResourceBundle;
import com.sun.java.swing.JFrame;
import com.sun.java.swing.ToolTipManager;
import javax.swing.JFrame;
import javax.swing.ToolTipManager;
import calypso.util.Preferences;
import calypso.util.PreferencesFactory;
import netscape.orion.uimanager.AbstractUICmd;
import netscape.orion.uimanager.IUICmd;
//import netscape.orion.uimanager.AbstractUICmd;
//import netscape.orion.uimanager.IUICmd;
import grendel.storage.MailDrop;
import grendel.search.SearchFrame;
import grendel.filters.FilterMaster;
import grendel.composition.Composition;
import grendel.ui.UIAction;
public class ActionFactory {
static IUICmd fExitAction = new ExitAction();
static IUICmd fNewMailAction = new NewMailAction();
static IUICmd fComposeMessageAction = new ComposeMessageAction();
static IUICmd fPrefsAction = new PreferencesAction();
static IUICmd fSearchAction = new SearchAction();
static IUICmd fRunFiltersAction = new RunFiltersAction();
static IUICmd fShowTooltipsAction = new ShowTooltipsAction();
static ExitAction fExitAction = new ExitAction();
static NewMailAction fNewMailAction = new NewMailAction();
static ComposeMessageAction fComposeMessageAction = new ComposeMessageAction();
static PreferencesAction fPrefsAction = new PreferencesAction();
static SearchAction fSearchAction = new SearchAction();
static RunFiltersAction fRunFiltersAction = new RunFiltersAction();
static ShowTooltipsAction fShowTooltipsAction = new ShowTooltipsAction();
static public IUICmd GetExitAction() {
static public ExitAction GetExitAction() {
return fExitAction;
}
static public IUICmd GetNewMailAction() {
static public NewMailAction GetNewMailAction() {
return fNewMailAction;
}
static public IUICmd GetComposeMessageAction() {
static public ComposeMessageAction GetComposeMessageAction() {
return fComposeMessageAction;
}
static public void SetComposeMessageAction(IUICmd aAction) {
static public void SetComposeMessageAction(ComposeMessageAction aAction) {
fComposeMessageAction = aAction;
}
static public IUICmd GetPreferencesAction() {
static public PreferencesAction GetPreferencesAction() {
return fPrefsAction;
}
static public IUICmd GetSearchAction() {
static public SearchAction GetSearchAction() {
return fSearchAction;
}
static public IUICmd GetRunFiltersAction() {
static public RunFiltersAction GetRunFiltersAction() {
return fRunFiltersAction;
}
static public IUICmd GetShowTooltipsAction() {
static public ShowTooltipsAction GetShowTooltipsAction() {
return fShowTooltipsAction;
}
}
class ExitAction extends AbstractUICmd {
class ExitAction extends UIAction {
public ExitAction() {
super("appExit");
setEnabled(true);
}
public void actionPerformed(ActionEvent aEvent) {
GeneralFrame.CloseAllFrames();
@ -102,19 +106,22 @@ class ExitAction extends AbstractUICmd {
}
}
class NewMailAction extends AbstractUICmd {
class NewMailAction extends UIAction {
public NewMailAction() {
super("msgGetNew");
setEnabled(true);
}
public void actionPerformed(ActionEvent aEvent) {
ProgressFactory.NewMailProgress();
}
}
class ComposeMessageAction extends AbstractUICmd {
class ComposeMessageAction extends UIAction {
public ComposeMessageAction() {
super("msgNew");
@ -135,7 +142,7 @@ class ComposeMessageAction extends AbstractUICmd {
}
}
class PreferencesAction extends AbstractUICmd {
class PreferencesAction extends UIAction {
PreferencesAction fThis;
public PreferencesAction() {
@ -170,7 +177,7 @@ class PreferencesAction extends AbstractUICmd {
}
}
class SearchAction extends AbstractUICmd {
class SearchAction extends UIAction {
SearchAction() {
super("appSearch");
}
@ -183,7 +190,8 @@ class SearchAction extends AbstractUICmd {
}
}
class RunFiltersAction extends AbstractUICmd {
class RunFiltersAction extends UIAction {
RunFiltersAction() {
super("appRunFilters");
}
@ -194,7 +202,8 @@ class RunFiltersAction extends AbstractUICmd {
}
}
class ShowTooltipsAction extends AbstractUICmd {
class ShowTooltipsAction extends UIAction {
ShowTooltipsAction() {
super("appShowTooltips");
@ -202,13 +211,13 @@ class ShowTooltipsAction extends AbstractUICmd {
PreferencesFactory.Get().getBoolean("app.tooltips", true);
ToolTipManager.sharedInstance().setEnabled(enabled);
setSelected(enabled ? AbstractUICmd.kSelected : AbstractUICmd.kUnselected);
// setSelected(enabled ? AbstractUICmd.kSelected : AbstractUICmd.kUnselected);
}
public void actionPerformed(ActionEvent aEvent) {
boolean enabled = !ToolTipManager.sharedInstance().isEnabled();
ToolTipManager.sharedInstance().setEnabled(enabled);
setSelected(enabled ? AbstractUICmd.kSelected : AbstractUICmd.kUnselected);
// setSelected(enabled ? AbstractUICmd.kSelected : AbstractUICmd.kUnselected);
PreferencesFactory.Get().putBoolean("app.tooltips", enabled);
}
}

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

@ -21,11 +21,11 @@
package grendel.ui;
import com.sun.java.swing.Icon;
import com.sun.java.swing.ImageIcon;
import com.sun.java.swing.JLabel;
import com.sun.java.swing.event.ChangeListener;
import com.sun.java.swing.event.ChangeEvent;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.event.ChangeListener;
import javax.swing.event.ChangeEvent;
import grendel.storage.MailDrop;

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

@ -22,9 +22,9 @@ package grendel.ui;
import java.io.IOException;
import java.util.Enumeration;
import com.sun.java.swing.event.ChangeEvent;
import com.sun.java.swing.event.ChangeListener;
import com.sun.java.swing.event.EventListenerList;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.event.EventListenerList;
import calypso.util.PreferencesFactory;
import calypso.util.Preferences;

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

@ -41,13 +41,13 @@ import java.util.ResourceBundle;
import javax.mail.Authenticator;
import javax.mail.PasswordAuthentication;
import com.sun.java.swing.JButton;
import com.sun.java.swing.JCheckBox;
import com.sun.java.swing.JLabel;
import com.sun.java.swing.JOptionPane;
import com.sun.java.swing.JPanel;
import com.sun.java.swing.JTextField;
import com.sun.java.swing.JPasswordField;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.JPasswordField;
import calypso.util.Preferences;
import calypso.util.PreferencesFactory;

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

@ -17,6 +17,7 @@
* Netscape Communications Corporation. All Rights Reserved.
*
* Created: Will Scullin <scullin@netscape.com>, 26 Nov 1997.
* Modified: Jeff Galyan <jeffrey.galyan@sun.com>, 30 Dec 1998
*/
package grendel.ui;
@ -33,14 +34,14 @@ import java.util.ResourceBundle;
import javax.mail.URLName;
import com.sun.java.swing.JOptionPane;
import javax.swing.JOptionPane;
import netscape.orion.dialogs.AttrNotFoundException;
import netscape.orion.dialogs.PageModel;
import netscape.orion.dialogs.PageUI;
//import netscape.orion.dialogs.AttrNotFoundException;
//import netscape.orion.dialogs.PageModel;
//import netscape.orion.dialogs.PageUI;
import xml.tree.XMLNode;
import xml.tree.TreeBuilder;
//import xml.tree.XMLNode;
//import xml.tree.TreeBuilder;
public class EditHostDialog extends GeneralDialog {
static final String kIMAPRadioKey="imapRadio";

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

@ -32,13 +32,13 @@ import javax.mail.Session;
import javax.mail.Store;
import javax.mail.Folder;
import com.sun.java.swing.ImageIcon;
import com.sun.java.swing.ListCellRenderer;
import com.sun.java.swing.JComboBox;
import com.sun.java.swing.JLabel;
import com.sun.java.swing.JList;
import com.sun.java.swing.border.EmptyBorder;
import com.sun.java.swing.UIManager;
import javax.swing.ImageIcon;
import javax.swing.ListCellRenderer;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.border.EmptyBorder;
import javax.swing.UIManager;
import grendel.view.ViewedStore;
import grendel.view.ViewedFolder;

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

@ -31,13 +31,9 @@ import javax.mail.MessagingException;
import grendel.view.ViewedMessage;
import com.sun.java.swing.event.ChangeEvent;
import netscape.orion.toolbars.ToolbarFactory;
import netscape.orion.toolbars.ToolBarLayout;
import netscape.orion.uimanager.AbstractUICmd;
import netscape.orion.uimanager.IUICmd;
import javax.swing.event.ChangeEvent;
import grendel.ui.UIAction;
import grendel.widgets.StatusEvent;
import grendel.widgets.TreePath;
@ -57,14 +53,15 @@ public class FolderFrame extends GeneralFrame {
fFolderPanel = new FolderPanel();
fFolderPanel.addFolderPanelListener(new MessageSelectionListener());
fPanel.add(fFolderPanel);
fMenu = buildMenu("folderMain", Util.MergeActions(actions,
fFolderPanel.getActions()));
// fMenu = buildMenu("folderMain", Util.MergeActions(actions,
// fFolderPanel.getActions()));
fMenu = buildMenu();
getRootPane().setMenuBar(fMenu);
fToolBar = fFolderPanel.getToolBar();
fToolBar.addItem(ToolbarFactory.MakeINSToolbarItem(ToolBarLayout.CreateSpring(),
null));
fToolBar.addItem(ToolbarFactory.MakeINSToolbarItem(fAnimation, null));
// fToolBar.addItem(ToolbarFactory.MakeINSToolbarItem(ToolBarLayout.CreateSpring(),
// null));
// fToolBar.addItem(ToolbarFactory.MakeINSToolbarItem(fAnimation, null));
fToolBarPanel.add(fToolBar);
fStatusBar = buildStatusBar();
@ -143,7 +140,7 @@ public class FolderFrame extends GeneralFrame {
}
}
}
IUICmd actions[] = { ActionFactory.GetExitAction(),
UIAction actions[] = { ActionFactory.GetExitAction(),
ActionFactory.GetNewMailAction(),
ActionFactory.GetComposeMessageAction()};
}

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

@ -17,6 +17,7 @@
* Netscape Communications Corporation. All Rights Reserved.
*
* Created: Will Scullin <scullin@netscape.com>, 3 Sep 1997.
* Modified: Jeff Galyan <jeffrey.galyan@sun.com>, 30 Dec 1998
*/
package grendel.ui;
@ -44,28 +45,30 @@ import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.Flags;
import com.sun.java.swing.BorderFactory;
import com.sun.java.swing.Icon;
import com.sun.java.swing.ImageIcon;
import com.sun.java.swing.JMenu;
import com.sun.java.swing.JMenuItem;
import com.sun.java.swing.JPopupMenu;
import com.sun.java.swing.JScrollPane;
import com.sun.java.swing.KeyStroke;
import com.sun.java.swing.ToolTipManager;
import com.sun.java.swing.event.ChangeEvent;
//import com.sun.java.swing.plaf.BorderUIResource;
import javax.swing.BorderFactory;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
import javax.swing.JPopupMenu;
import javax.swing.JScrollPane;
import javax.swing.JToolBar;
import javax.swing.KeyStroke;
import javax.swing.ToolTipManager;
import javax.swing.event.ChangeEvent;
//import javax.swing.plaf.BorderUIResource;
import calypso.util.Preferences;
import calypso.util.PreferencesFactory;
import netscape.orion.toolbars.NSToolbar;
import netscape.orion.uimanager.AbstractUICmd;
import netscape.orion.uimanager.IUICmd;
//import netscape.orion.toolbars.NSToolbar;
//import netscape.orion.uimanager.AbstractUICmd;
//import netscape.orion.uimanager.IUICmd;
import grendel.composition.Composition;
import grendel.storage.MessageExtra;
import grendel.storage.MessageExtraFactory;
import grendel.ui.UIAction;
import grendel.view.FolderView;
import grendel.view.FolderViewFactory;
import grendel.view.MessageSetView;
@ -171,20 +174,20 @@ public class FolderPanel extends GeneralPanel {
// Actions that can be enabled/disabled
//
IUICmd fDeleteMessageAction = new DeleteMessageAction();
IUICmd fOpenMessageAction = new OpenMessageAction();
DeleteMessageAction fDeleteMessageAction = new DeleteMessageAction();
OpenMessageAction fOpenMessageAction = new OpenMessageAction();
IUICmd fReplyAction = new ReplyAction("msgReply", false);
IUICmd fReplyAllAction = new ReplyAction("msgReplyAll", true);
ReplyAction fReplyAction = new ReplyAction("msgReply", false);
ReplyAction fReplyAllAction = new ReplyAction("msgReplyAll", true);
IUICmd fMarkMsgReadAction = new MarkAction("markMsgRead", kMessage);
IUICmd fMarkThreadReadAction = new MarkAction("markThreadRead", kThread);
IUICmd fMarkAllReadAction = new MarkAction("markAllRead", kAll);
MarkAction fMarkMsgReadAction = new MarkAction("markMsgRead", kMessage);
MarkAction fMarkThreadReadAction = new MarkAction("markThreadRead", kThread);
MarkAction fMarkAllReadAction = new MarkAction("markAllRead", kAll);
IUICmd fThreadAction = new ThreadAction();
ThreadAction fThreadAction = new ThreadAction();
// The big action list
IUICmd fActions[] = {ActionFactory.GetNewMailAction(),
UIAction fActions[] = {ActionFactory.GetNewMailAction(),
ActionFactory.GetComposeMessageAction(),
fDeleteMessageAction,
fOpenMessageAction,
@ -392,7 +395,7 @@ public class FolderPanel extends GeneralPanel {
* Returns the actions available for this panel
*/
public IUICmd[] getActions() {
public UIAction[] getActions() {
return Util.MergeActions(fActions, fSortActions);
}
@ -400,7 +403,7 @@ public class FolderPanel extends GeneralPanel {
* Returns the toolbar associated with this panel.
*/
public NSToolbar getToolBar() {
public JToolBar getToolBar() {
return buildToolBar("folderToolBar", getActions());
}
@ -439,12 +442,12 @@ public class FolderPanel extends GeneralPanel {
if (order != null && order.length > 0) {
for (int i = 0; i < fSortActions.length; i++) {
if (fSortActions[i].getType() == order[0]) {
fSortActions[i].setSelected(IUICmd.kSelected);
fSortActions[i].setSelected(true);
}
}
}
fThreadAction.setSelected(fView.isThreaded() ?
IUICmd.kSelected : IUICmd.kUnselected);
true : false);
}
}
@ -713,7 +716,8 @@ public class FolderPanel extends GeneralPanel {
}
}
class OpenMessageAction extends AbstractUICmd implements Runnable {
class OpenMessageAction extends UIAction implements Runnable {
OpenMessageAction() {
super("msgOpen");
}
@ -746,7 +750,8 @@ public class FolderPanel extends GeneralPanel {
// DeleteMessageAction class
//
class DeleteMessageAction extends AbstractUICmd {
class DeleteMessageAction extends UIAction {
DeleteMessageAction() {
super("msgDelete");
setEnabled(false);
@ -761,7 +766,8 @@ public class FolderPanel extends GeneralPanel {
// CopyMessageAction class
//
class CopyMessageAction extends AbstractUICmd {
class CopyMessageAction extends UIAction {
Folder fDest;
CopyMessageAction(Folder aFolder) {
@ -779,7 +785,8 @@ public class FolderPanel extends GeneralPanel {
// MoveMessageAction class
//
class MoveMessageAction extends AbstractUICmd {
class MoveMessageAction extends UIAction {
Folder fDest;
MoveMessageAction(Folder aFolder) {
@ -797,16 +804,23 @@ public class FolderPanel extends GeneralPanel {
// ThreadAction class
//
class ThreadAction extends AbstractUICmd {
class ThreadAction extends UIAction {
boolean selected;
public ThreadAction() {
super("toggleThreading");
}
public void setSelected(boolean isSelected) {
selected = isSelected;
}
public void actionPerformed(ActionEvent aEvent) {
if (fView != null) {
boolean selected = !fView.isThreaded();
fView.setIsThreaded(selected);
setSelected(selected ? IUICmd.kSelected : IUICmd.kUnselected);
setSelected(selected ? true : false);
fView.reThread();
}
}
@ -816,8 +830,9 @@ public class FolderPanel extends GeneralPanel {
// SortAction class
//
class SortAction extends AbstractUICmd {
class SortAction extends UIAction {
int fType;
boolean selected;
public SortAction(String aAction, int aType) {
super(aAction);
@ -827,12 +842,16 @@ public class FolderPanel extends GeneralPanel {
public int getType() {
return fType;
}
public void setSelected(boolean isSelected) {
selected = isSelected;
}
public void actionPerformed(ActionEvent aEvent) {
String action = aEvent.getActionCommand();
if (fView != null) {
fView.prependSortOrder(fType);
setSelected(kSelected);
setSelected(true);
fView.reThread();
}
}
@ -842,7 +861,7 @@ public class FolderPanel extends GeneralPanel {
// ReplyAction class
//
class ReplyAction extends AbstractUICmd {
class ReplyAction extends UIAction {
boolean replyall;
public ReplyAction(String aAction, boolean r) {
super(aAction);
@ -850,6 +869,7 @@ public class FolderPanel extends GeneralPanel {
replyall = r;
}
public void actionPerformed(ActionEvent aEvent) {
Vector selection = getSelectedMessageVector();
if (selection.size() != 1) {
@ -867,7 +887,7 @@ public class FolderPanel extends GeneralPanel {
// MarkAction class
//
class MarkAction extends AbstractUICmd {
class MarkAction extends UIAction {
int fScope;
MarkAction(String aName, int aScope) {
@ -932,17 +952,14 @@ public class FolderPanel extends GeneralPanel {
//
if (msgs != null) {
try {
fFolder.setFlags(msgs, new Flags(Flags.SEEN), true);
} catch (MessagingException e) {
// #### pop up a dialog or something
synchronized(System.err) {
System.err.print("Error: ");
e.printStackTrace(System.err);
}
fFolder.setFlags(msgs, new Flags(Flags.Flag.SEEN), true);
} catch (MessagingException exc) {
exc.printStackTrace();
}
}
}
}
}
//
// Cut-n-paste stuff
@ -954,7 +971,8 @@ public class FolderPanel extends GeneralPanel {
}
}
class CopyToClipboardAction extends AbstractUICmd {
class CopyToClipboardAction extends UIAction {
CopyToClipboardAction() {
super("copy-to-clipboard");
}
@ -971,7 +989,8 @@ public class FolderPanel extends GeneralPanel {
}
}
class PasteFromClipboardAction extends AbstractUICmd {
class PasteFromClipboardAction extends UIAction {
PasteFromClipboardAction() {
super("paste-from-clipboard");
}

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

@ -23,7 +23,7 @@ package grendel.ui;
import java.util.EventListener;
import com.sun.java.swing.event.ChangeEvent;
import javax.swing.event.ChangeEvent;
import grendel.widgets.StatusEvent;

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

@ -17,6 +17,7 @@
* Netscape Communications Corporation. All Rights Reserved.
*
* Created: Will Scullin <scullin@netscape.com>, 6 Jan 1998.
* Modified: Jeff Galyan <jeffrey.galyan@sun.com>, 30 Dec 1998
*/
package grendel.ui;
@ -27,9 +28,9 @@ import java.util.ResourceBundle;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import com.sun.java.swing.JDialog;
import com.sun.java.swing.SwingUtilities;
import com.sun.java.swing.UIManager;
import javax.swing.JDialog;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
public class GeneralDialog extends JDialog {
static ResourceBundle fLabels = ResourceBundle.getBundle("grendel.ui.Labels",

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

@ -17,6 +17,7 @@
* Netscape Communications Corporation. All Rights Reserved.
*
* Created: Will Scullin <scullin@netscape.com>, 3 Sep 1997.
* Modified: Jeff Galyan <jeffrey.galyan@sun.com>, 30 Dec 1998
*/
package grendel.ui;
@ -40,31 +41,36 @@ import java.util.ResourceBundle;
import java.util.StringTokenizer;
import java.util.Vector;
import com.sun.java.swing.Action;
import com.sun.java.swing.Icon;
import com.sun.java.swing.ImageIcon;
import com.sun.java.swing.JButton;
import com.sun.java.swing.JFrame;
import com.sun.java.swing.JLabel;
import com.sun.java.swing.JMenuBar;
import com.sun.java.swing.JOptionPane;
import com.sun.java.swing.JPanel;
import com.sun.java.swing.JToolBar;
import com.sun.java.swing.SwingUtilities;
import com.sun.java.swing.UIManager;
import javax.swing.Action;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JMenuBar;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
import javax.swing.JCheckBoxMenuItem;
import javax.swing.JRadioButtonMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JToolBar;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.BoxLayout;
import netscape.orion.toolbars.BarLayout;
import netscape.orion.toolbars.CollapsibleToolbarPanel;
import netscape.orion.toolbars.NSButton;
import netscape.orion.toolbars.NSToolbar;
import netscape.orion.toolbars.ToolBarLayout;
import netscape.orion.uimanager.AbstractUICmd;
import netscape.orion.uimanager.IUICmd;
import netscape.orion.uimanager.IUIMMenuBar;
import netscape.orion.uimanager.UIMConstants;
//import netscape.orion.toolbars.BarLayout;
//import netscape.orion.toolbars.CollapsibleToolbarPanel;
//import netscape.orion.toolbars.NSButton;
//import netscape.orion.toolbars.NSToolbar;
//import netscape.orion.toolbars.ToolBarLayout;
//import netscape.orion.uimanager.AbstractUICmd;
//import netscape.orion.uimanager.IUICmd;
//import netscape.orion.uimanager.IUIMMenuBar;
//import netscape.orion.uimanager.UIMConstants;
import xml.tree.TreeBuilder;
import xml.tree.XMLNode;
//import xml.tree.TreeBuilder;
//import xml.tree.XMLNode;
import calypso.util.Preferences;
import calypso.util.PreferencesFactory;
@ -80,14 +86,15 @@ public class GeneralFrame extends JFrame
protected Container fPanel;
protected Animation fAnimation;
protected JMenuBar fMenu;
protected CollapsibleToolbarPanel fToolBarPanel;
protected NSToolbar fToolBar;
// protected CollapsibleToolbarPanel fToolBarPanel;
protected JPanel fToolBarPanel;
protected JToolBar fToolBar;
protected Component fStatusBar;
protected String fResourceBase = "grendel.ui";
protected String fID;
protected JLabel fStatusLabel;
protected netscape.orion.uimanager.UIManager fUIManager;
// protected netscape.orion.uimanager.UIManager fUIManager;
private LAFListener fLAFListener;
@ -124,9 +131,10 @@ public class GeneralFrame extends JFrame
fAnimation.setImageTemplate("/grendel/ui/images/animation/AnimHuge{0,number,00}.gif",
40);
fToolBarPanel = new CollapsibleToolbarPanel(this);
// fToolBarPanel = new CollapsibleToolbarPanel(this);
fToolBarPanel = new JPanel(true);
fPanel.add(BorderLayout.NORTH, fToolBarPanel);
fUIManager = new netscape.orion.uimanager.UIManager(fToolBarPanel);
// fUIManager = new netscape.orion.uimanager.UIManager(fToolBarPanel);
// We need to use Class.forName because getClass() might return a child
// class in another package.
@ -151,7 +159,8 @@ public class GeneralFrame extends JFrame
super.dispose();
if (!sExternalShell && fFrameList.size() == 0) {
ActionFactory.GetExitAction().actionPerformed(null);
// ActionFactory.GetExitAction().actionPerformed(null);
System.out.println("Exiting...");
}
UIManager.removePropertyChangeListener(fLAFListener);
@ -237,30 +246,187 @@ public class GeneralFrame extends JFrame
}
}
protected JMenuBar buildMenu(String aMenu, IUICmd aActions[]) {
JMenuBar res = null;
try {
IUIMMenuBar bar = fUIManager.getMenuBar(getID());
/** Creates the MenuBar. This method has been completely re-written by Jeff Galyan, 12/30/1998 */
protected JMenuBar buildMenu() {
JMenuBar res = new JMenuBar();
URL url = getClass().getResource("menus.xml");
XMLNode root = TreeBuilder.build(url, getClass());
XMLNode node = root.getChild(UIMConstants.kMenubarType,
UIMConstants.kIDAttribute,
getID());
JMenu fileMenu = new JMenu("File");
JMenu editMenu = new JMenu("Edit");
JMenu viewMenu = new JMenu("View");
JMenu sortMenu = new JMenu("Sort");
JMenu layoutMenu = new JMenu("Layout");
JMenu messageMenu = new JMenu("Message");
JMenu msgMarkMenu = new JMenu("Mark");
fileMenu.setMnemonic('F');
editMenu.setMnemonic('E');
viewMenu.setMnemonic('V');
sortMenu.setMnemonic('S');
layoutMenu.setMnemonic('L');
messageMenu.setMnemonic('M');
msgMarkMenu.setMnemonic('M');
bar.addMenus(node, aActions, this);
bar.configureForOwner(this);
JMenuItem fileMsgNew = new JMenuItem("New Message");
fileMsgNew.setMnemonic('N');
JMenuItem folderNew = new JMenuItem("New Folder...");
folderNew.setMnemonic('F');
JMenuItem msgOpen = new JMenuItem("Open Message");
msgOpen.setMnemonic('M');
res = bar.getComponent();
} catch (Exception e) {
e.printStackTrace();
}
JMenuItem msgSaveAs = new JMenuItem("Save As...");
msgSaveAs.setMnemonic('A');
JMenuItem msgGetNew = new JMenuItem("Get New Messages");
msgGetNew.setMnemonic('G');
JMenuItem appExit = new JMenuItem("Exit");
appExit.setMnemonic('x');
fileMenu.add(fileMsgNew);
fileMenu.add(folderNew);
fileMenu.add(msgOpen);
fileMenu.add(msgSaveAs);
fileMenu.addSeparator();
fileMenu.add(msgGetNew);
fileMenu.addSeparator();
fileMenu.add(appExit);
res.add(fileMenu);
JMenuItem editUndo = new JMenuItem("Undo");
editUndo.setMnemonic('U');
JMenuItem editCut = new JMenuItem("Cut");
editCut.setMnemonic('t');
JMenuItem editCopy = new JMenuItem("Copy");
editCopy.setMnemonic('C');
JMenuItem editPaste = new JMenuItem("Paste");
editPaste.setMnemonic('P');
JMenuItem editFolderDelete = new JMenuItem("Delete Folder");
editFolderDelete.setMnemonic('D');
JMenuItem editAppSearch = new JMenuItem("Search");
editAppSearch.setMnemonic('S');
JMenuItem editAppRunFilters = new JMenuItem("Run Filters on TestInbox");
editAppRunFilters.setMnemonic('F');
JMenuItem editAppPrefs = new JMenuItem("Preferences...");
editAppPrefs.setMnemonic('r');
editMenu.add(editUndo);
editMenu.add(editCut);
editMenu.add(editCopy);
editMenu.add(editPaste);
editMenu.addSeparator();
editMenu.add(editFolderDelete);
editMenu.addSeparator();
editMenu.add(editAppSearch);
editMenu.add(editAppRunFilters);
editMenu.addSeparator();
editMenu.add(editAppPrefs);
res.add(editMenu);
JCheckBoxMenuItem toggleThreading = new JCheckBoxMenuItem("Toggle Threading");
toggleThreading.setMnemonic('T');
JRadioButtonMenuItem sortAuthor = new JRadioButtonMenuItem("by Author");
sortAuthor.setMnemonic('A');
JRadioButtonMenuItem sortDate = new JRadioButtonMenuItem("by Date");
sortDate.setMnemonic('D');
JRadioButtonMenuItem sortNumber = new JRadioButtonMenuItem("by Number");
sortNumber.setMnemonic('N');
JRadioButtonMenuItem sortSubject = new JRadioButtonMenuItem("by Subject");
sortSubject.setMnemonic('S');
sortMenu.add(toggleThreading);
sortMenu.addSeparator();
sortMenu.add(sortAuthor);
sortMenu.add(sortDate);
sortMenu.add(sortNumber);
sortMenu.add(sortSubject);
JRadioButtonMenuItem splitTop = new JRadioButtonMenuItem("Split Top");
splitTop.setMnemonic('T');
JRadioButtonMenuItem splitLeft = new JRadioButtonMenuItem("Split Left");
splitLeft.setMnemonic('L');
JRadioButtonMenuItem splitRight = new JRadioButtonMenuItem("Split Right");
splitRight.setMnemonic('R');
JRadioButtonMenuItem layoutStacked = new JRadioButtonMenuItem("Stacked");
layoutStacked.setMnemonic('S');
layoutMenu.add(splitTop);
layoutMenu.add(splitLeft);
layoutMenu.add(splitRight);
layoutMenu.add(layoutStacked);
JCheckBoxMenuItem viewAppShowToolTips = new JCheckBoxMenuItem("Show Tooltips");
viewAppShowToolTips.setMnemonic('T');
viewMenu.add(sortMenu);
viewMenu.add(layoutMenu);
viewMenu.addSeparator();
viewMenu.add(viewAppShowToolTips);
res.add(viewMenu);
JMenuItem msgNew = new JMenuItem("New Message");
msgNew.setMnemonic('N');
JMenuItem msgReply = new JMenuItem("Reply");
msgReply.setMnemonic('R');
JMenuItem msgReplyAll = new JMenuItem("Reply All");
msgReplyAll.setMnemonic('A');
JMenuItem msgForward = new JMenuItem("Forward");
msgForward.setMnemonic('F');
JMenuItem msgForwardQuoted = new JMenuItem("Forward Quoted");
msgForwardQuoted.setMnemonic('Q');
JMenuItem markMsgRead = new JMenuItem("As Read");
markMsgRead.setMnemonic('R');
JMenuItem markThreadRead = new JMenuItem("Thread Read");
markThreadRead.setMnemonic('T');
JMenuItem markAllRead = new JMenuItem("All Read");
markAllRead.setMnemonic('A');
msgMarkMenu.add(markMsgRead);
msgMarkMenu.add(markThreadRead);
msgMarkMenu.add(markAllRead);
messageMenu.add(msgNew);
messageMenu.addSeparator();
messageMenu.add(msgReply);
messageMenu.add(msgReplyAll);
messageMenu.add(msgForward);
messageMenu.add(msgForwardQuoted);
messageMenu.addSeparator();
messageMenu.add(msgMarkMenu);
res.add(messageMenu);
return res;
}
protected Component buildStatusBar() {
JPanel res = new JPanel(new BarLayout());
JPanel res = new JPanel();
res.setLayout(new BoxLayout(res, BoxLayout.X_AXIS));
fBiffIcon = new BiffIcon();
fBiffIcon.setSize(fBiffIcon.getPreferredSize());
@ -268,8 +434,8 @@ public class GeneralFrame extends JFrame
fStatusLabel = new JLabel("Grendel");
fStatusLabel.setFont(Font.decode("Dialog-12"));
res.add(fStatusLabel, BarLayout.kSpring);
res.add(fBiffIcon, BarLayout.kStrut);
res.add(fStatusLabel);
res.add(fBiffIcon);
return res;
}

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

@ -17,51 +17,58 @@
* Netscape Communications Corporation. All Rights Reserved.
*
* Created: Will Scullin <scullin@netscape.com>, 13 Oct 1997.
* Modified: Jeff Galyan <jeffrey.galyan@sun.com>, 22 Dec 1998.
*/
package grendel.ui;
import grendel.ui.UIAction;
import java.awt.BorderLayout;
import java.awt.Image;
import java.awt.datatransfer.Clipboard;
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Locale;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
import java.util.StringTokenizer;
import com.sun.java.swing.Icon;
import com.sun.java.swing.ImageIcon;
import com.sun.java.swing.JPanel;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JPanel;
import javax.swing.JToolBar;
import javax.swing.JButton;
import netscape.orion.toolbars.NSButton;
import netscape.orion.toolbars.NSToolbar;
import netscape.orion.uimanager.IUICmd;
//import netscape.orion.toolbars.NSButton;
//import netscape.orion.toolbars.NSToolbar;
//import netscape.orion.uimanager.IUICmd;
public class GeneralPanel extends JPanel {
private final boolean DEBUG = true;
static ResourceBundle fLabels = ResourceBundle.getBundle("grendel.ui.Labels",
Locale.getDefault());
static Clipboard fPrivateClipboard = new Clipboard("Grendel");
protected String fResourceBase = "grendel.ui";
protected NSToolbar fToolBar;
protected JToolBar fToolBar;
public GeneralPanel() {
setLayout(new BorderLayout());
}
public IUICmd[] getActions() {
public UIAction[] getActions() {
return null;
}
protected NSButton makeToolbarButton(String aAction) {
protected JButton makeToolbarButton(String aAction) {
Icon icon = new ImageIcon(getClass().getResource("images/toolbar/" + aAction + ".gif"));
Icon iconDisabled = new ImageIcon(getClass().getResource("images/toolbar/" + aAction + "-disabled.gif"));
Icon iconPressed = new ImageIcon(getClass().getResource("images/toolbar/" + aAction + "-pressed.gif"));
Icon iconRollover = new ImageIcon(getClass().getResource("images/toolbar/" + aAction + "-rollover.gif"));
NSButton res = new NSButton();
JButton res = new JButton();
res.setIcon(icon);
res.setDisabledIcon(iconDisabled);
@ -72,42 +79,58 @@ public class GeneralPanel extends JPanel {
return res;
}
protected NSToolbar buildToolBar(String aToolbar, IUICmd aActions[]) {
NSToolbar res = null;
protected JToolBar buildToolBar(String aToolbar, UIAction[] aActions) {
JToolBar res = null;
Hashtable commands = new Hashtable();
for (int i = 0; i < aActions.length; i++)
{
IUICmd a = aActions[i];
commands.put(a.getText(IUICmd.NAME), a);
}
{
UIAction a = aActions[i];
String name = a.getName();
// commands.put((a.getName()), a);
commands.put(name, a);
}
try {
res = new NSToolbar();
res = new JToolBar();
ResourceBundle resources = ResourceBundle.getBundle(fResourceBase + ".Menus");
String toolbar = resources.getString(aToolbar);
StringTokenizer tokens = new StringTokenizer(toolbar, " ", false);
while (tokens.hasMoreTokens()) {
String token = tokens.nextToken();
NSButton button = makeToolbarButton(token);
IUICmd action = (IUICmd) commands.get(token);
if (DEBUG) {
System.out.println("Local token = " + token);
}
JButton button = makeToolbarButton(token);
UIAction action = (UIAction)commands.get(token);
if (action != null) {
button.addActionListener(action);
// button.addActionListener(action);
} else {
button.setEnabled(false);
}
res.addItem(button);
res.add(button);
}
} catch (MissingResourceException e) {
System.err.println(e);
}
if (DEBUG) {
System.out.println("Toolbar status:");
if (res == null) {
System.out.println("\tbuildToolBar failed.");
}
else {
System.out.println("\tbuildToolBar succeeded.");
System.out.println("\tJToolBar res contains " + res.getComponentCount() + " components.");
}
}
return res;
}
public NSToolbar getToolBar() {
public JToolBar getToolBar() {
return fToolBar;
}
}

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

@ -17,6 +17,7 @@
* Netscape Communications Corporation. All Rights Reserved.
*
* Created: Will Scullin <scullin@netscape.com>, 3 Sep 1997.
* Modified: Jeff Galyan <jeffrey.galyan@sun.com>, 31 Dec 1998
*/
package grendel.ui;
@ -42,27 +43,28 @@ import java.util.ResourceBundle;
import java.util.StringTokenizer;
import java.util.Vector;
import com.sun.java.swing.BorderFactory;
import com.sun.java.swing.BoxLayout;
import com.sun.java.swing.Icon;
import com.sun.java.swing.JOptionPane;
import com.sun.java.swing.JPanel;
import com.sun.java.swing.JScrollPane;
import com.sun.java.swing.JViewport;
import com.sun.java.swing.KeyStroke;
import com.sun.java.swing.ToolTipManager;
import com.sun.java.swing.event.ChangeEvent;
import com.sun.java.swing.event.ChangeListener;
//import com.sun.java.swing.plaf.BorderUIResource;
import javax.swing.BorderFactory;
import javax.swing.BoxLayout;
import javax.swing.Icon;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JToolBar;
import javax.swing.JViewport;
import javax.swing.KeyStroke;
import javax.swing.ToolTipManager;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
//import javax.swing.plaf.BorderUIResource;
import calypso.util.ArrayEnumeration;
import calypso.util.Assert;
import calypso.util.Preferences;
import calypso.util.PreferencesFactory;
import netscape.orion.toolbars.NSToolbar;
import netscape.orion.uimanager.AbstractUICmd;
import netscape.orion.uimanager.IUICmd;
//import netscape.orion.toolbars.NSToolbar;
//import netscape.orion.uimanager.AbstractUICmd;
//import netscape.orion.uimanager.IUICmd;
import javax.mail.Folder;
import javax.mail.MessagingException;
@ -71,10 +73,12 @@ import javax.mail.Store;
import grendel.storage.FolderExtraFactory;
import grendel.storage.SearchResultsFolderFactory;
import grendel.ui.UIAction;
import grendel.view.ViewedFolder;
import grendel.view.ViewedStore;
import grendel.view.ViewedStoreEvent;
import grendel.view.ViewedStoreListener;
import grendel.widgets.CellEditor;
import grendel.widgets.Column;
import grendel.widgets.ColumnHeader;
import grendel.widgets.ColumnModel;
@ -105,7 +109,7 @@ public class MasterPanel extends GeneralPanel {
StoreChangeListener fStoreChangeListener = null;
ViewedStore fStores[];
IUICmd fActions[] = {ActionFactory.GetNewMailAction(),
UIAction fActions[] = {ActionFactory.GetNewMailAction(),
ActionFactory.GetComposeMessageAction(),
new CopyToClipboardAction(),
new PasteFromClipboardAction(),
@ -181,7 +185,7 @@ public class MasterPanel extends GeneralPanel {
System.out.println("*** software from JavaSoft).");
} catch (java.io.IOException e) {
System.out.println("*** Couldn't create empty mailcap file: " + e);
System.out.println("*** Immanent crash is likely due to buggy");
System.out.println("*** Imminent crash is likely due to buggy");
System.out.println("*** javamail software from JavaSoft.");
}
}
@ -216,7 +220,7 @@ public class MasterPanel extends GeneralPanel {
* Returns the actions associated with this panel.
*/
public IUICmd[] getActions() {
public UIAction[] getActions() {
return fActions;
}
@ -224,7 +228,7 @@ public class MasterPanel extends GeneralPanel {
* Returns the toolbar associated with this panel.
*/
public NSToolbar getToolBar() {
public JToolBar getToolBar() {
return buildToolBar("masterToolBar", fActions);
}
@ -329,11 +333,13 @@ public class MasterPanel extends GeneralPanel {
}
}
class NewFolderAction extends AbstractUICmd {
class NewFolderAction extends UIAction {
NewFolderAction() {
super("folderNew");
}
public void actionPerformed(ActionEvent aEvent) {
new Thread(new NewFolderThread(), "NewFolder").start();
}
@ -346,7 +352,7 @@ public class MasterPanel extends GeneralPanel {
}
}
class DeleteFolderAction extends AbstractUICmd {
class DeleteFolderAction extends UIAction {
DeleteFolderAction() {
super("folderDelete");
}
@ -372,7 +378,8 @@ public class MasterPanel extends GeneralPanel {
}
}
class CopyToClipboardAction extends AbstractUICmd {
class CopyToClipboardAction extends UIAction {
CopyToClipboardAction() {
super("copy-to-clipboard");
}
@ -389,7 +396,8 @@ public class MasterPanel extends GeneralPanel {
}
}
class PasteFromClipboardAction extends AbstractUICmd {
class PasteFromClipboardAction extends UIAction {
PasteFromClipboardAction() {
super("paste-from-clipboard");
}
@ -676,13 +684,17 @@ class FolderModel implements TreeTableDataModel {
}
public void setData(Object aNode, Object aID, Object aValue) {
Folder parent = null, node = null;
if (aValue.equals(getData(aNode, aID))) {
return;
}
Folder node = getFolder(aNode);
try {
node = getFolder(aNode);
if (aID == MasterPanel.kNameID) {
Folder parent = node.getParent();
parent = node.getParent();
}
String newName = (String) aValue;
Folder newFolder = null;
@ -709,6 +721,7 @@ class FolderModel implements TreeTableDataModel {
System.err.println("setData: " + e);
}
if (newFolder != null) {
try {
if (newFolder.exists()) {
Object args[] = {newName};
String err =
@ -717,6 +730,9 @@ class FolderModel implements TreeTableDataModel {
JOptionPane.showMessageDialog(null, err,
fLabels.getString("folderCreateError"),
JOptionPane.ERROR_MESSAGE);
}
} catch (MessagingException exc) {
}
} else {
try {
node.renameTo(newFolder);
@ -724,9 +740,10 @@ class FolderModel implements TreeTableDataModel {
System.err.println("renameTo: " + e);
}
}
}
} catch (MessagingException e) {
}
}
}
Folder getFolder(Object aObject) {
Folder res = null;

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

@ -23,7 +23,7 @@ package grendel.ui;
import java.util.EventListener;
import com.sun.java.swing.event.ChangeEvent;
import javax.swing.event.ChangeEvent;
/**
* Interface for information about changes in the <code>MasterPanel</code>

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

@ -17,6 +17,7 @@
* Netscape Communications Corporation. All Rights Reserved.
*
* Created: Will Scullin <scullin@netscape.com>, 18 Nov 1997.
* Modified: Jeff Galyan <jeffrey.galyan@sun.com>, 30 Dec 1998
*/
package grendel.ui;
@ -28,10 +29,10 @@ import java.util.Vector;
import javax.mail.Message;
import javax.mail.MessagingException;
import netscape.orion.toolbars.ToolbarFactory;
import netscape.orion.toolbars.ToolBarLayout;
import netscape.orion.uimanager.AbstractUICmd;
import netscape.orion.uimanager.IUICmd;
//import netscape.orion.toolbars.ToolbarFactory;
//import netscape.orion.toolbars.ToolBarLayout;
//import netscape.orion.uimanager.AbstractUICmd;
//import netscape.orion.uimanager.IUICmd;
public class MessageFrame extends GeneralFrame {
static Vector fMessageFrames = new Vector();
@ -53,14 +54,15 @@ public class MessageFrame extends GeneralFrame {
fMessagePanel = new MessagePanel();
fPanel.add(fMessagePanel);
fMenu = buildMenu("messageMain", Util.MergeActions(actions,
fMessagePanel.getActions()));
// fMenu = buildMenu("messageMain", Util.MergeActions(actions,
// fMessagePanel.getActions()));
fMenu = buildMenu();
getRootPane().setMenuBar(fMenu);
fToolBar = fMessagePanel.getToolBar();
fToolBar.addItem(ToolbarFactory.MakeINSToolbarItem(ToolBarLayout.CreateSpring(),
null));
fToolBar.addItem(ToolbarFactory.MakeINSToolbarItem(fAnimation, null));
// fToolBar.addItem(ToolbarFactory.MakeINSToolbarItem(ToolBarLayout.CreateSpring(),
// null));
// fToolBar.addItem(ToolbarFactory.MakeINSToolbarItem(fAnimation, null));
fToolBarPanel.add(fToolBar);
fStatusBar = buildStatusBar();
@ -124,6 +126,6 @@ public class MessageFrame extends GeneralFrame {
return null;
}
IUICmd actions[] = { ActionFactory.GetExitAction(),
Object actions[] = { ActionFactory.GetExitAction(),
ActionFactory.GetComposeMessageAction() };
}

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

@ -21,7 +21,7 @@
package grendel.ui;
import com.sun.java.swing.JComponent;
import javax.swing.JComponent;
import javax.mail.Message;

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

@ -25,8 +25,8 @@ import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Vector;
import com.sun.java.swing.Icon;
import com.sun.java.swing.ImageIcon;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.mail.Message;
import javax.mail.MessagingException;

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

@ -17,6 +17,7 @@
* Netscape Communications Corporation. All Rights Reserved.
*
* Created: Will Scullin <scullin@netscape.com>, 3 Sep 1997.
* Modified: Jeff Galyan <jeffrey.galyan@sun.com>, 30 Dec 1998
*/
package grendel.ui;
@ -38,19 +39,20 @@ import java.net.MalformedURLException;
import java.util.Locale;
import java.util.ResourceBundle;
import com.sun.java.swing.Action;
import com.sun.java.swing.AbstractAction;
import com.sun.java.swing.BorderFactory;
import com.sun.java.swing.JPanel;
import com.sun.java.swing.JScrollPane;
import com.sun.java.swing.JTextArea;
import com.sun.java.swing.UIManager;
import com.sun.java.swing.event.ChangeEvent;
import com.sun.java.swing.event.EventListenerList;
import com.sun.java.swing.text.Document;
import com.sun.java.swing.text.BadLocationException;
import javax.swing.Action;
import javax.swing.AbstractAction;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JToolBar;
import javax.swing.UIManager;
import javax.swing.event.ChangeEvent;
import javax.swing.event.EventListenerList;
import javax.swing.text.Document;
import javax.swing.text.BadLocationException;
import netscape.orion.toolbars.NSToolbar;
//import netscape.orion.toolbars.NSToolbar;
import javax.mail.Message;
import javax.mail.MessagingException;
@ -61,6 +63,7 @@ import grendel.mime.parser.MimeParserFactory;
import grendel.mime.html.MimeHTMLOperatorFactory;
import grendel.storage.MessageExtra;
import grendel.storage.MessageExtraFactory;
import grendel.ui.UIAction;
import grendel.widgets.StatusEvent;
/* ####
@ -71,17 +74,17 @@ import calypso.util.ByteBuf;
import calypso.util.Preferences;
import calypso.util.PreferencesFactory;
import netscape.orion.uimanager.IUICmd;
//import netscape.orion.uimanager.IUICmd;
import lego.document.HTMLDocument;
//import lego.document.HTMLDocument;
import mg.edge.embed.jfc.URLComponent;
import mg.edge.embed.jfc.URLComponentFactory;
import mg.magellan.document.IDocument;
//import mg.edge.embed.jfc.URLComponent;
//import mg.edge.embed.jfc.URLComponentFactory;
//import mg.magellan.document.IDocument;
public class MessagePanel extends GeneralPanel {
JTextArea fTextArea;
URLComponent fViewer;
// URLComponent fViewer;
Thread fMessageLoadThread;
Message fMessage;
MessageHeader fHeader;
@ -91,7 +94,7 @@ public class MessagePanel extends GeneralPanel {
EventListenerList fListeners = new EventListenerList();
IUICmd fActions[] = {ActionFactory.GetNewMailAction(),
UIAction fActions[] = {ActionFactory.GetNewMailAction(),
ActionFactory.GetComposeMessageAction()};
/**
* Constructs a new message panel.
@ -101,13 +104,14 @@ public class MessagePanel extends GeneralPanel {
fPanel = this;
Preferences prefs = PreferencesFactory.Get();
useMagellan = prefs.getBoolean("usemagellan", true);
// useMagellan = prefs.getBoolean("usemagellan", true);
useMagellan = false;
makeRealHTML = prefs.getBoolean("makerealhtml", true);
if (useMagellan) {
fViewer = (URLComponent) URLComponentFactory.NewURLComponent(null);
Component viewComponent = fViewer.getComponent();
add(viewComponent);
// fViewer = (URLComponent) URLComponentFactory.NewURLComponent(null);
// Component viewComponent = fViewer.getComponent();
// add(viewComponent);
} else {
fTextArea = new JTextArea();
fTextArea.setEditable(false);
@ -139,7 +143,7 @@ public class MessagePanel extends GeneralPanel {
* Returns the toolbar associated with this panel.
*/
public NSToolbar getToolBar() {
public JToolBar getToolBar() {
return buildToolBar("messageToolBar", fActions);
}
@ -289,14 +293,14 @@ public class MessagePanel extends GeneralPanel {
in = new StringBufferInputStream("This space intentionally left blank");
}
synchronized (fViewer) {
// synchronized (fViewer) {
/* ####
URL url = new URL("http://home.netscape.com/");
URLSource source = new URLSource(url, null, in);
IDocument doc = new HTMLDocument(source);
fViewer.goTo(doc);
*/
}
// }
}
} catch (Exception e) {
notifyStatus(e.toString());

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

@ -23,7 +23,7 @@ package grendel.ui;
import java.util.EventListener;
import com.sun.java.swing.event.ChangeEvent;
import javax.swing.event.ChangeEvent;
import grendel.widgets.StatusEvent;

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

@ -17,6 +17,7 @@
* Netscape Communications Corporation. All Rights Reserved.
*
* Created: Will Scullin <scullin@netscape.com>, 3 Sep 1997.
* Modified: Jeff Galyan <jeffrey.galyan@sun.com>, 1 Jan 1999
*/
package grendel.ui;
@ -25,15 +26,14 @@ import java.awt.BorderLayout;
import java.util.Enumeration;
import java.util.Vector;
import com.sun.java.swing.event.ChangeEvent;
import javax.swing.event.ChangeEvent;
import javax.mail.Folder;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.Store;
import netscape.orion.uimanager.IUICmd;
import grendel.ui.UIAction;
import grendel.view.ViewedFolder;
import grendel.view.ViewedMessage;
import grendel.widgets.TreePath;
@ -129,7 +129,8 @@ class MasterFrame extends GeneralFrame {
fMasterPanel = new MasterPanel();
fMasterPanel.addMasterPanelListener(new FolderSelectionListener());
fPanel.add(fMasterPanel);
fMenu = buildMenu("masterMain", actions);
// fMenu = buildMenu("masterMain", actions);
fMenu = buildMenu();
getRootPane().setMenuBar(fMenu);
fToolBar = fMasterPanel.getToolBar();
@ -193,7 +194,7 @@ class MasterFrame extends GeneralFrame {
// Action array
IUICmd actions[] = { ActionFactory.GetExitAction(),
UIAction actions[] = { ActionFactory.GetExitAction(),
ActionFactory.GetNewMailAction(),
ActionFactory.GetComposeMessageAction()};
}

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

@ -17,36 +17,44 @@
* Netscape Communications Corporation. All Rights Reserved.
*
* Created: Will Scullin <scullin@netscape.com>, 20 Nov 1997.
* Modified: Jeff Galyan <jeffrey.galyan@sun.com>, 31 Dec 1998
*/
package grendel.ui;
import java.awt.Dimension;
import java.awt.Frame;
import java.awt.GridBagLayout;
import java.awt.GridBagConstraints;
import java.awt.event.ActionEvent;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.net.URL;
import java.text.MessageFormat;
import java.util.Hashtable;
import java.util.NoSuchElementException;
import javax.mail.Folder;
import javax.mail.MessagingException;
import com.sun.java.swing.JOptionPane;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextField;
import netscape.orion.dialogs.AttrNotFoundException;
import netscape.orion.dialogs.PageModel;
import netscape.orion.dialogs.PageUI;
//import netscape.orion.dialogs.AttrNotFoundException;
//import netscape.orion.dialogs.PageModel;
//import netscape.orion.dialogs.PageUI;
import xml.tree.XMLNode;
import xml.tree.TreeBuilder;
//import xml.tree.XMLNode;
//import xml.tree.TreeBuilder;
import grendel.view.ViewedFolder;
public class NewFolderDialog extends GeneralDialog {
PageUI fPanel;
FolderPanel fPanel;
JPanel newFolderDialogPanel;
ViewedFolder fFolder;
FolderCombo fParentCombo;
@ -55,20 +63,20 @@ public class NewFolderDialog extends GeneralDialog {
private static final String kFolderComboKey = "folderCombo";
private static final String kNameKey = "nameField";
class NewFolderModel extends PageModel {
class NewFolderModel {
public NewFolderModel(FolderCombo aCombo) {
fValues = new Hashtable();
fValues.put(kNameKey, "");
fValues.put(kFolderComboKey, aCombo);
}
public Object getAttribute(String aAttrib) throws AttrNotFoundException {
public Object getAttribute(String aAttrib) throws NoSuchElementException {
Object res = fValues.get(aAttrib);
if (res == null) {
res = fLabels.getString(aAttrib);
}
if (res == null) {
throw new AttrNotFoundException(aAttrib);
throw new NoSuchElementException(aAttrib);
}
return res;
}
@ -95,19 +103,27 @@ public class NewFolderDialog extends GeneralDialog {
NewFolderModel model = new NewFolderModel(fParentCombo);
// use the XML parser to get the root XML node of the resource tree
XMLNode root = null;
URL url = getClass().getResource("dialogs.xml");
try {
root = xml.tree.TreeBuilder.build(url, getClass());
} catch (Exception e) {
e.printStackTrace();
}
// XMLNode root = null;
// URL url = getClass().getResource("dialogs.xml");
// try {
// root = xml.tree.TreeBuilder.build(url, getClass());
// } catch (Exception e) {
// e.printStackTrace();
// }
XMLNode editHost = root.getChild("dialog", "id", "newFolderDialog");
// XMLNode editHost = root.getChild("dialog", "id", "newFolderDialog");
fPanel = new PageUI(url, editHost, model);
newFolderDialogPanel = new JPanel(new GridBagLayout(), true);
JOptionPane actionPanel = new JOptionPane(fPanel,
JLabel parentPrompt = new JLabel("Parent:");
newFolderDialogPanel.add(parentPrompt, GridBagConstraints.WEST);
newFolderDialogPanel.add(fParentCombo, GridBagConstraints.REMAINDER);
JLabel namePrompt = new JLabel("Name:");
newFolderDialogPanel.add(namePrompt, GridBagConstraints.WEST);
JTextField nameField = new JTextField();
newFolderDialogPanel.add(nameField, GridBagConstraints.REMAINDER);
JOptionPane actionPanel = new JOptionPane(newFolderDialogPanel,
JOptionPane.PLAIN_MESSAGE,
JOptionPane.OK_CANCEL_OPTION);
actionPanel.addPropertyChangeListener(new OptionListener());
@ -115,12 +131,11 @@ public class NewFolderDialog extends GeneralDialog {
// XXX This is a stupid hack because PageUI doesn't to a resource lookup
// on it's title. Bleh.
String title = fPanel.getTitle();
if (title.charAt(0) == '$') {
String title = null;
try {
title = (String) model.getAttribute(title.substring(1));
} catch (AttrNotFoundException e) {}
}
} catch (NoSuchElementException e) {}
setTitle(title);
Dimension size = getPreferredSize();
@ -168,7 +183,7 @@ public class NewFolderDialog extends GeneralDialog {
int value = ((Integer) aEvent.getNewValue()).intValue();
if (value == JOptionPane.OK_OPTION) {
fPanel.saveAll();
// fPanel.saveAll();
setVisible(!createFolder());
} else {
setVisible(false);

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

@ -15,16 +15,19 @@
* 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.
*
* Modified: Jeff Galyan <jeffrey.galyan@sun.com>, 30 Dec 1998
*/
package grendel.ui;
import com.sun.java.swing.JFrame;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import calypso.util.Preferences;
import calypso.util.PreferencesFactory;
import netscape.orion.propeditor.PropertyEditorDlg;
//import netscape.orion.propeditor.PropertyEditorDlg;
import grendel.prefs.Prefs;
@ -43,9 +46,9 @@ public class PrefsDialog {
public static void EditPrefs(JFrame aParent) {
Object objs[] = {new Prefs()};
PropertyEditorDlg.Edit(aParent, objs, false, true, "",
PropertyEditorDlg.UI_TREE);
// PropertyEditorDlg.Edit(aParent, objs, false, true, "",
// PropertyEditorDlg.UI_TREE);
JOptionPane.showMessageDialog(aParent, "This part of the UI is\nstill being worked on.", "Under Construction", JOptionPane.INFORMATION_MESSAGE);
}
public static boolean ValidPrefs() {

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

@ -27,6 +27,7 @@ import java.util.ResourceBundle;
import java.util.Vector;
import javax.mail.Flags;
import javax.mail.Flags.Flag;
import javax.mail.Folder;
import javax.mail.Message;
import javax.mail.MessagingException;
@ -151,7 +152,7 @@ class MoveMessageProgress extends ProgressFrame {
try {
Message mlist[] = { message };
fDest.appendMessages(mlist);
message.setFlags(Flags.DeletedFlag, true);
message.setFlag(Flags.Flag.DELETED, true);
} catch (MessagingException e) {
System.err.println("DeleteMessageProgress: " + e);
}

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

@ -32,13 +32,13 @@ import java.awt.event.ActionEvent;
import java.util.Locale;
import java.util.ResourceBundle;
import com.sun.java.swing.AbstractAction;
import com.sun.java.swing.Box;
import com.sun.java.swing.JButton;
import com.sun.java.swing.JFrame;
import com.sun.java.swing.JLabel;
import com.sun.java.swing.JProgressBar;
import com.sun.java.swing.UIManager;
import javax.swing.AbstractAction;
import javax.swing.Box;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JProgressBar;
import javax.swing.UIManager;
public abstract class ProgressFrame extends GeneralFrame implements Runnable {
int fMax;

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

@ -30,8 +30,8 @@ import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.internet.InternetAddress;
import com.sun.java.swing.JLabel;
import com.sun.java.swing.border.BevelBorder;
import javax.swing.JLabel;
import javax.swing.border.BevelBorder;
public class SimpleMessageHeader extends MessageHeader {
static final int kMargin = 3;
@ -81,7 +81,7 @@ public class SimpleMessageHeader extends MessageHeader {
StringBuffer fromString = new StringBuffer();
String personal = null;
Address recipients[] = fMessage.getRecipients(Message.TO);
Address recipients[] = fMessage.getRecipients(Message.RecipientType.TO);
Address sender[] = fMessage.getFrom();
int i;

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

@ -31,10 +31,10 @@ import javax.mail.Session;
import javax.mail.Store;
import javax.mail.URLName;
import com.sun.java.swing.JOptionPane;
import com.sun.java.swing.event.ChangeEvent;
import com.sun.java.swing.event.ChangeListener;
import com.sun.java.swing.event.EventListenerList;
import javax.swing.JOptionPane;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.event.EventListenerList;
import calypso.util.Preferences;
import calypso.util.PreferencesFactory;

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

@ -23,8 +23,8 @@ package grendel.ui;
import java.awt.Image;
import com.sun.java.swing.Icon;
import com.sun.java.swing.ImageIcon;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import grendel.view.ViewedFolder;
import grendel.view.ViewedStore;

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

@ -17,6 +17,7 @@
* Netscape Communications Corporation. All Rights Reserved.
*
* Created: Will Scullin <scullin@netscape.com>, 3 Sep 1997.
* Modified: Jeff Galyan <jeffrey.galyan@sun.com>, 31 Dec 1998
*/
package grendel.ui;
@ -26,28 +27,30 @@ import java.awt.Rectangle;
import java.awt.event.ActionEvent;
import java.util.Enumeration;
import com.sun.java.swing.BoxLayout;
import com.sun.java.swing.Icon;
import com.sun.java.swing.ImageIcon;
import com.sun.java.swing.JComponent;
import com.sun.java.swing.JFrame;
import com.sun.java.swing.JMenuBar;
import com.sun.java.swing.event.ChangeEvent;
import javax.swing.BoxLayout;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JMenuBar;
import javax.swing.JToolBar;
import javax.swing.event.ChangeEvent;
import calypso.util.Preferences;
import calypso.util.PreferencesFactory;
import netscape.orion.toolbars.NSToolbar;
import netscape.orion.toolbars.ToolbarFactory;
import netscape.orion.toolbars.ToolBarLayout;
import netscape.orion.uimanager.AbstractUICmd;
import netscape.orion.uimanager.IUICmd;
//import netscape.orion.toolbars.NSToolbar;
//import netscape.orion.toolbars.ToolbarFactory;
//import netscape.orion.toolbars.ToolBarLayout;
//import netscape.orion.uimanager.AbstractUICmd;
//import netscape.orion.uimanager.IUICmd;
import javax.mail.Store;
import javax.mail.Folder;
import javax.mail.Message;
import javax.mail.MessagingException;
import grendel.ui.UIAction;
import grendel.view.ViewedMessage;
import grendel.widgets.Splitter;
import grendel.widgets.StatusEvent;
@ -131,11 +134,13 @@ public class UnifiedMessageDisplayManager extends MessageDisplayManager {
}
class UnifiedMessageFrame extends GeneralFrame {
private final boolean DEBUG = true;
MasterPanel fFolders = null;
FolderPanel fThreads = null;
MessagePanel fMessage = null;
Splitter splitter1 = null, splitter2 = null;
String fLayout = null;
JToolBar fToolBar1 = null;
public UnifiedMessageFrame() {
super("appNameLabel", "mail.multi_pane");
@ -159,26 +164,43 @@ class UnifiedMessageFrame extends GeneralFrame {
layoutPanels(layout);
fMenu = buildMenu("multiMain",
Util.MergeActions(actions,
Util.MergeActions(fFolders.getActions(),
Util.MergeActions(fThreads.getActions(),
fMessage.getActions()))));
fMenu = buildMenu();
getRootPane().setMenuBar(fMenu);
NSToolbar masterToolBar = fFolders.getToolBar();
NSToolbar folderToolBar = fThreads.getToolBar();
NSToolbar messageToolBar = fMessage.getToolBar();
JToolBar masterToolBar = fFolders.getToolBar();
JToolBar folderToolBar = fThreads.getToolBar();
JToolBar messageToolBar = fMessage.getToolBar();
fToolBar = Util.MergeToolBars(masterToolBar,
Util.MergeToolBars(folderToolBar,
messageToolBar));
fToolBar1 = Util.MergeToolBars(folderToolBar, messageToolBar);
if (DEBUG) {
System.out.println("MergeToolBars status:");
if (fToolBar1 == null) {
System.out.println("\tCreation of fToolBar1 failed.");
}
else {
System.out.println("\tfToolBar1 contains " + fToolBar1.getComponentCount() + " components.");
}
}
fToolBar = Util.MergeToolBars(masterToolBar, fToolBar1);
if (DEBUG) {
System.out.println("MergeToolBars status:");
if (fToolBar == null) {
System.out.println("\tCreation of fToolBar failed.");
}
else {
System.out.println("\tfToolBar contains " + fToolBar.getComponentCount() + " components.");
}
}
fToolBar.addItem(ToolbarFactory.MakeINSToolbarItem(ToolBarLayout.CreateSpring(),
null));
fToolBar.addItem(ToolbarFactory.MakeINSToolbarItem(fAnimation, null));
fToolBarPanel.add(fToolBar);
// fToolBar = Util.MergeToolBars(masterToolBar,
// Util.MergeToolBars(folderToolBar,
// messageToolBar));
// fToolBar.addItem(ToolbarFactory.MakeINSToolbarItem(ToolBarLayout.CreateSpring(),
// null));
// fToolBar.addItem(ToolbarFactory.MakeINSToolbarItem(fAnimation, null));
fToolBarPanel.add(fToolBar);
fStatusBar = buildStatusBar();
fPanel.add(BorderLayout.SOUTH, fStatusBar);
@ -262,7 +284,7 @@ class UnifiedMessageFrame extends GeneralFrame {
splitter1.add(splitter1.createSeparator(4));
splitter1.add(fMessage, new Float(messageWeight));
fStackedLayoutAction.setSelected(IUICmd.kSelected);
// fStackedLayoutAction.setSelected(IUICmd.kSelected);
} else if (layout.equals(UnifiedMessageDisplayManager.SPLIT_LEFT)) {
splitter1 = new Splitter(Splitter.HORIZONTAL);
@ -275,7 +297,7 @@ class UnifiedMessageFrame extends GeneralFrame {
splitter1.add(splitter1.createSeparator(4));
splitter1.add(fMessage, new Float(messageWeight));
fSplitLeftLayoutAction.setSelected(IUICmd.kSelected);
// fSplitLeftLayoutAction.setSelected(IUICmd.kSelected);
} else if (layout.equals(UnifiedMessageDisplayManager.SPLIT_RIGHT)) {
splitter2 = new Splitter(Splitter.VERTICAL);
@ -288,7 +310,7 @@ class UnifiedMessageFrame extends GeneralFrame {
splitter1.add(splitter1.createSeparator(4));
splitter1.add(splitter2, new Float(splitWeight));
fSplitRightLayoutAction.setSelected(IUICmd.kSelected);
// fSplitRightLayoutAction.setSelected(IUICmd.kSelected);
} else { // Default: SPLIT_TOP
splitter1 = new Splitter(Splitter.VERTICAL);
@ -301,7 +323,7 @@ class UnifiedMessageFrame extends GeneralFrame {
splitter1.add(splitter1.createSeparator(4));
splitter1.add(fMessage, new Float(messageWeight));
fSplitTopLayoutAction.setSelected(IUICmd.kSelected);
// fSplitTopLayoutAction.setSelected(IUICmd.kSelected);
}
fPanel.add("Center", splitter1);
@ -311,16 +333,16 @@ class UnifiedMessageFrame extends GeneralFrame {
fLayout = layout;
}
IUICmd fSplitLeftLayoutAction =
LayoutAction fSplitLeftLayoutAction =
new LayoutAction(UnifiedMessageDisplayManager.SPLIT_LEFT);
IUICmd fSplitRightLayoutAction =
LayoutAction fSplitRightLayoutAction =
new LayoutAction(UnifiedMessageDisplayManager.SPLIT_RIGHT);
IUICmd fSplitTopLayoutAction =
LayoutAction fSplitTopLayoutAction =
new LayoutAction(UnifiedMessageDisplayManager.SPLIT_TOP);
IUICmd fStackedLayoutAction =
LayoutAction fStackedLayoutAction =
new LayoutAction(UnifiedMessageDisplayManager.STACKED);
IUICmd actions[] = { ActionFactory.GetExitAction(),
UIAction actions[] = { ActionFactory.GetExitAction(),
ActionFactory.GetNewMailAction(),
ActionFactory.GetComposeMessageAction(),
ActionFactory.GetPreferencesAction(),
@ -444,7 +466,7 @@ class UnifiedMessageFrame extends GeneralFrame {
// LayoutAction class
//
class LayoutAction extends AbstractUICmd {
class LayoutAction extends UIAction {
ImageIcon fIcon;
public LayoutAction(String aAction) {
super(aAction);

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

@ -17,6 +17,7 @@
* Netscape Communications Corporation. All Rights Reserved.
*
* Created: Will Scullin <scullin@netscape.com>, 9 Sep 1997.
* Modified: Jeff Galyan <jeffrey.galyan@sun.com>, 31 Dec 1998
*/
package grendel.ui;
@ -35,18 +36,23 @@ import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.internet.MimeUtility;
import netscape.orion.toolbars.NSButton;
import netscape.orion.toolbars.NSToolbar;
import netscape.orion.uimanager.AbstractUICmd;
import netscape.orion.uimanager.IUICmd;
//import netscape.orion.toolbars.NSButton;
//import netscape.orion.toolbars.NSToolbar;
//import netscape.orion.uimanager.AbstractUICmd;
//import netscape.orion.uimanager.IUICmd;
import com.sun.java.swing.JComponent;
import com.sun.java.swing.JPopupMenu;
import com.sun.java.swing.JScrollBar;
import com.sun.java.swing.JScrollPane;
import com.sun.java.swing.KeyStroke;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JPopupMenu;
import javax.swing.JScrollBar;
import javax.swing.JScrollPane;
import javax.swing.JToolBar;
import javax.swing.KeyStroke;
import grendel.ui.UIAction;
public class Util {
static final boolean DEBUG = true;
public static final int LEFT = 0;
public static final int CENTER = 0;
public static final int RIGHT = 0;
@ -100,17 +106,17 @@ public class Util {
g.drawChars(fChars, first, length, x, y);
}
static IUICmd FindAction(Vector aVector, String aAction) {
static UIAction FindAction(Vector aVector, String aAction) {
for (int i = 0; i < aVector.size(); i++) {
IUICmd action = (IUICmd) aVector.elementAt(i);
if (action.getText(IUICmd.NAME).equals(aAction)) {
UIAction action = (UIAction)aVector.elementAt(i);
if (action.equals(aAction)) {
return action;
}
}
return null;
}
static public IUICmd[] MergeActions(IUICmd aActions1[], IUICmd aActions2[]) {
static public UIAction[] MergeActions(UIAction aActions1[], UIAction aActions2[]) {
Vector resVector = new Vector();
int i;
if (aActions1 != null) {
@ -120,66 +126,79 @@ public class Util {
}
if (aActions2 != null) {
for (i = 0; i < aActions2.length; i++) {
if (FindAction(resVector, aActions2[i].getText(IUICmd.NAME)) == null) {
if (FindAction(resVector, aActions2[i].toString()) == null) {
resVector.addElement(aActions2[i]);
}
}
}
IUICmd res[] = new IUICmd[resVector.size()];
UIAction res[] = new UIAction[resVector.size()];
resVector.copyInto(res);
return res;
}
static public NSToolbar MergeToolBars(NSToolbar aBar1, NSToolbar aBar2) {
NSToolbar res = new NSToolbar();
int count1 = aBar1.getItemCount();
int count2 = aBar2.getItemCount();
static public JToolBar MergeToolBars(JToolBar aBar1, JToolBar aBar2) {
JToolBar res = new JToolBar();
Component barArray1[] = aBar1.getComponents();
Component barArray2[] = aBar2.getComponents();
int count1 = aBar1.getComponentCount();
int count2 = aBar2.getComponentCount();
int i = 0, j = 0, k, l;
if (DEBUG) {
System.out.println("count1 = " + count1 + "; count2 = " + count2);
}
while (i < count1) {
NSButton button1 = (NSButton) aBar1.getItemAt(i);
JButton button1 = (JButton) barArray1[i];
if (j < count2) {
NSButton button2 = (NSButton) aBar2.getItemAt(j);
JButton button2 = (JButton) barArray2[j];
if (button1.getActionCommand().equals(button2.getActionCommand())) {
res.addItem(button1);
res.add(button1);
i++;
j++;
} else {
boolean merge = false;
for (k = j; k < count2; k++) {
button2 = (NSButton) aBar2.getItemAt(k);
if (button1.getActionCommand().equals(button2.getActionCommand())) {
merge = true;
while (j < k) {
NSButton button3 = (NSButton) aBar2.getItemAt(j);
res.addItem(button3);
j++;
} else {
boolean merge = false;
for (k = j; k < count2; k++) {
button2 = (JButton) barArray2[k];
if (button1.getActionCommand().equals(button2.getActionCommand())) {
merge = true;
while (j < k) {
JButton button3 = (JButton) barArray2[j];
res.add(button3);
j++;
}
break;
}
break;
}
}
if (merge) {
res.addItem(button1);
res.add(button1);
j++;
} else {
res.addItem(button1);
res.add(button1);
}
i++;
}
} else {
res.addItem(button1);
res.add(button1);
i++;
}
}
while (j < count2) {
NSButton button2 = (NSButton) aBar2.getItemAt(j);
res.addItem(button2);
JButton button2 = null;
if (barArray2[j] != null)
{
button2 = (JButton) barArray2[j];
}
if (button2 != null)
{
res.add(button2);
}
j++;
}
return res;
}
public static void RegisterScrollingKeys(JScrollPane aScrollPane) {
aScrollPane.registerKeyboardAction(new ScrollAction(aScrollPane, KeyEvent.VK_UP),
@ -254,7 +273,7 @@ public class Util {
}
}
class ScrollAction extends AbstractUICmd {
class ScrollAction extends UIAction {
JScrollPane fScrollPane;
int fAction;

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

@ -32,8 +32,8 @@ import javax.mail.event.ConnectionListener;
import javax.mail.event.FolderEvent;
import javax.mail.event.FolderListener;
import com.sun.java.swing.JOptionPane;
import com.sun.java.swing.event.EventListenerList;
import javax.swing.JOptionPane;
import javax.swing.event.EventListenerList;
import calypso.util.PreferencesFactory;
@ -277,8 +277,7 @@ public class ViewedStoreBase extends ViewedFolderBase implements ViewedStore {
}
}
void notifyFolderCreated(Folder aFolder)
throws MessagingException {
void notifyFolderCreated(Folder aFolder) {
if (aFolder.getParent() != null) {
try {
ViewedFolderBase parent =

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

@ -26,8 +26,8 @@ import java.awt.Dimension;
import java.awt.Graphics;
import java.text.MessageFormat;
import com.sun.java.swing.Icon;
import com.sun.java.swing.ImageIcon;
import javax.swing.Icon;
import javax.swing.ImageIcon;
public class Animation extends Component implements Runnable
{

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

@ -22,7 +22,7 @@ package grendel.widgets;
import java.util.EventObject;
import java.awt.Component;
public interface CellEditor extends com.sun.java.swing.CellEditor {
public interface CellEditor extends javax.swing.CellEditor {
void setValue(Object aObject, Object aData, boolean aSelected);
boolean startCellEditing(EventObject aEvent);
Component getCellEditorComponent();

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

@ -23,8 +23,8 @@ package grendel.widgets;
import java.util.Vector;
import com.sun.java.swing.Icon;
import com.sun.java.swing.event.ChangeEvent;
import javax.swing.Icon;
import javax.swing.event.ChangeEvent;
/**
* A Column is a vertical display unit for a table that maintains width, rendering,
@ -276,7 +276,7 @@ public class Column {
* Sets the column's header renderer. This renders the
* column caption in a space provided by that object
* @see getHeaderRenderer()
* @see com.sun.java.swing.CellRenderer
* @see javax.swing.CellRenderer
*/
public void setHeaderRenderer(HeaderRenderer aRenderer) {

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

@ -23,7 +23,7 @@ package grendel.widgets;
import java.util.EventListener;
import com.sun.java.swing.event.ChangeEvent;
import javax.swing.event.ChangeEvent;
public interface ColumnChangeListener extends EventListener {
public void columnWidthChanged(ChangeEvent aEvent);

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

@ -33,10 +33,10 @@ import java.awt.event.MouseMotionListener;
import java.util.Enumeration;
import com.sun.java.swing.CellRendererPane;
import com.sun.java.swing.JComponent;
import com.sun.java.swing.UIManager;
import com.sun.java.swing.event.ChangeEvent;
import javax.swing.CellRendererPane;
import javax.swing.JComponent;
import javax.swing.UIManager;
import javax.swing.event.ChangeEvent;
public class ColumnHeader extends JComponent implements ColumnModelListener {
ColumnModel fColumnModel;

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

@ -26,7 +26,7 @@ import java.util.Vector;
import java.util.Enumeration;
import java.util.StringTokenizer;
import com.sun.java.swing.event.ChangeEvent;
import javax.swing.event.ChangeEvent;
public class ColumnModelImp implements ColumnModel, ColumnChangeListener {
Vector fColumns = new Vector();

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

@ -23,7 +23,7 @@ package grendel.widgets;
import java.util.EventListener;
import com.sun.java.swing.event.ChangeEvent;
import javax.swing.event.ChangeEvent;
public interface ColumnModelListener extends EventListener {
public void columnAdded(ColumnModelEvent e);

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

@ -17,12 +17,15 @@
* Netscape Communications Corporation. All Rights Reserved.
*
* Created: Will Scullin <scullin@netscape.com>, 2 Oct 1997.
* Modified: Jeff Galyan <jeffrey.galyan@sun.com>, 30 Dec 1998
*/
package grendel.widgets;
import calypso.util.Assert;
import grendel.ui.Util;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
@ -31,13 +34,13 @@ import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.Insets;
import com.sun.java.swing.Icon;
import com.sun.java.swing.JComponent;
import com.sun.java.swing.UIManager;
import com.sun.java.swing.basic.BasicGraphicsUtils;
import com.sun.java.swing.border.BevelBorder;
import com.sun.java.swing.border.Border;
import com.sun.java.swing.BorderFactory;
import javax.swing.Icon;
import javax.swing.JComponent;
import javax.swing.UIManager;
import javax.swing.plaf.basic.BasicGraphicsUtils;
import javax.swing.border.BevelBorder;
import javax.swing.border.Border;
import javax.swing.BorderFactory;
/**
* The default TreeTable cell renderer. Handles text and not much

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

@ -17,6 +17,7 @@
* Netscape Communications Corporation. All Rights Reserved.
*
* Created: Will Scullin <scullin@netscape.com>, 2 Oct 1997.
* Modified: Jeff Galyan <jeffrey.galyan@sun.com>, 31 Dec 1998
*/
package grendel.widgets;
@ -29,14 +30,14 @@ import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.Insets;
import com.sun.java.swing.BorderFactory;
import com.sun.java.swing.Icon;
import com.sun.java.swing.JComponent;
import com.sun.java.swing.UIManager;
import com.sun.java.swing.basic.BasicGraphicsUtils;
import com.sun.java.swing.border.BevelBorder;
import com.sun.java.swing.border.Border;
import com.sun.java.swing.border.EmptyBorder;
import javax.swing.BorderFactory;
import javax.swing.Icon;
import javax.swing.JComponent;
import javax.swing.UIManager;
import javax.swing.plaf.basic.BasicGraphicsUtils;
import javax.swing.border.BevelBorder;
import javax.swing.border.Border;
import javax.swing.border.EmptyBorder;
/**
* The default renderer for column headers. Handles text headers and

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

@ -23,7 +23,7 @@ package grendel.widgets;
import java.awt.Component;
import com.sun.java.swing.Renderer;
import javax.swing.Renderer;
public interface HeaderRenderer {
public final static int NORMAL = 0;

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

@ -26,7 +26,7 @@ import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Vector;
import com.sun.java.swing.event.ChangeEvent;
import javax.swing.event.ChangeEvent;
public class MultiSelectionManager implements SelectionManager {
Vector fSelection = new Vector();

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

@ -24,7 +24,7 @@ package grendel.widgets;
import java.awt.event.MouseEvent;
import java.util.EventListener;
import com.sun.java.swing.event.ChangeEvent;
import javax.swing.event.ChangeEvent;
public interface SelectionListener extends EventListener {
void selectionChanged(SelectionEvent aEvent);

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

@ -26,7 +26,7 @@ import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Vector;
import com.sun.java.swing.event.ChangeEvent;
import javax.swing.event.ChangeEvent;
public class SingleSelectionManager implements SelectionManager {
Object fSelection = null;

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

@ -40,8 +40,8 @@ import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Vector;
import com.sun.java.swing.JComponent;
import com.sun.java.swing.UIManager;
import javax.swing.JComponent;
import javax.swing.UIManager;
/**
* This class is used to create a divided pane with moveable dividers (NYI)

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

@ -17,6 +17,7 @@
* Netscape Communications Corporation. All Rights Reserved.
*
* Created: Will Scullin <scullin@netscape.com>, 30 Oct 1997.
* Modified: Jeff Galyan <jeffrey.galyan@sun.com>, 30 Dec 1998
*/
package grendel.widgets;
@ -33,16 +34,17 @@ import java.awt.event.KeyEvent;
import java.awt.event.MouseEvent;
import java.util.EventObject;
import com.sun.java.swing.CellEditorListener;
import com.sun.java.swing.JTextField;
import com.sun.java.swing.KeyStroke;
import com.sun.java.swing.event.ChangeEvent;
import com.sun.java.swing.event.DocumentEvent;
import com.sun.java.swing.event.DocumentListener;
import javax.swing.event.CellEditorListener;
import javax.swing.JTextField;
import javax.swing.KeyStroke;
//import javax.swing.CellEditor;
import javax.swing.event.ChangeEvent;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
public class TextCellEditor extends JTextField implements CellEditor,
DocumentListener {
CellEditorListener fListener;
MyCellEditorListener fListener;
boolean fSelected, fStopping;
Dimension fSize = new Dimension();
@ -105,7 +107,7 @@ DocumentListener {
}
public void addCellEditorListener(CellEditorListener aListener) {
fListener = aListener;
fListener = (MyCellEditorListener) aListener;
}
public void removeCellEditorListener(CellEditorListener aListener) {
@ -133,6 +135,14 @@ DocumentListener {
updateSize(getPreferredSize());
}
class MyCellEditorListener implements CellEditorListener {
public void editingCanceled(ChangeEvent evt) {
}
public void editingStopped(ChangeEvent evt) {
}
}
class CancelAction implements ActionListener {
public void actionPerformed(ActionEvent aEvent) {
cancelCellEditing();

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

@ -15,6 +15,8 @@
* 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.
*
* Modified: Jeff Galyan <jeffrey.galyan@sun.com>, 30 Dec 1998
*/
package grendel.widgets;
@ -26,10 +28,10 @@ import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.util.EventObject;
import com.sun.java.swing.CellEditorListener;
import com.sun.java.swing.JCheckBox;
import com.sun.java.swing.event.ChangeEvent;
import com.sun.java.swing.UIManager;
import javax.swing.event.CellEditorListener;
import javax.swing.JCheckBox;
import javax.swing.event.ChangeEvent;
import javax.swing.UIManager;
public class ToggleCellEditor implements CellEditor, ActionListener {
JCheckBox fToggle;

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

@ -21,8 +21,8 @@ package grendel.widgets;
import java.awt.Component;
import com.sun.java.swing.JCheckBox;
import com.sun.java.swing.UIManager;
import javax.swing.JCheckBox;
import javax.swing.UIManager;
public class ToggleCellRenderer implements CellRenderer {
JCheckBox fToggle = new JCheckBox();

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

@ -17,6 +17,7 @@
* Netscape Communications Corporation. All Rights Reserved.
*
* Created: Will Scullin <scullin@netscape.com>, 21 Aug 1997.
* Modified: Jeff Galyan <jeffrey.galyan@sun.com>, 30 Dec 1998
*/
package grendel.widgets;
@ -42,21 +43,21 @@ import java.awt.event.MouseEvent;
import java.util.Enumeration;
import java.util.Vector;
import com.sun.java.swing.CellEditorListener;
import com.sun.java.swing.CellRendererPane;
import com.sun.java.swing.Icon;
import com.sun.java.swing.ImageIcon;
import com.sun.java.swing.JComponent;
import com.sun.java.swing.JLabel;
import com.sun.java.swing.JViewport;
import com.sun.java.swing.KeyStroke;
import com.sun.java.swing.Scrollable;
import com.sun.java.swing.SwingConstants;
import com.sun.java.swing.SwingUtilities;
import com.sun.java.swing.UIManager;
import com.sun.java.swing.basic.BasicGraphicsUtils;
import com.sun.java.swing.event.ChangeEvent;
import com.sun.java.swing.event.ListSelectionEvent;
import javax.swing.event.CellEditorListener;
import javax.swing.CellRendererPane;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JViewport;
import javax.swing.KeyStroke;
import javax.swing.Scrollable;
import javax.swing.SwingConstants;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.plaf.basic.BasicGraphicsUtils;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ListSelectionEvent;
import grendel.dnd.DropTarget;
import grendel.dnd.DropTargetComponent;

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

@ -23,7 +23,7 @@ package grendel.widgets;
import java.util.Enumeration;
import com.sun.java.swing.Icon;
import javax.swing.Icon;
/**
* The <code>TreeTableDataModel</code> interface is used to mediate