From c0a06607abb8c5dc7f14f5c659c8903645f34fce Mon Sep 17 00:00:00 2001 From: "talisman%anamorphic.com" Date: Sat, 13 Feb 1999 03:06:22 +0000 Subject: [PATCH] *** empty log message *** --- grendel/addressbook/AddressBook.java | 18 +++- grendel/addressbook/Makefile | 2 + grendel/addressbook/NewCardDialog.java | 100 +++++++++++++++++++---- grendel/addressbook/addresscard/Makefile | 2 + 4 files changed, 102 insertions(+), 20 deletions(-) diff --git a/grendel/addressbook/AddressBook.java b/grendel/addressbook/AddressBook.java index c225b0f0474..84ce4072496 100644 --- a/grendel/addressbook/AddressBook.java +++ b/grendel/addressbook/AddressBook.java @@ -371,6 +371,8 @@ public class AddressBook extends JFrame { DataModel dm = (DataModel) mTable.getModel (); dm.reloadData (ds.getDomainName(), ds.getPort(), textToSearchFor); + dm.fireTableDataChanged(); + //repaint the table with results. mTable.repaint(); } @@ -385,7 +387,7 @@ public class AddressBook extends JFrame { private GrendelToolBar createToolbar() { GrendelToolBar toolBar = new GrendelToolBar(); - addToolbarButton(toolBar, null, "images/newcard.gif", "Create a new card"); + addToolbarButton(toolBar, new NewCard(), "images/newcard.gif", "Create a new card"); addToolbarButton(toolBar, null, "images/newlist.gif", "Create a new list"); addToolbarButton(toolBar, null, "images/properties.gif", "Edit the selected card"); addToolbarButton(toolBar, null, "images/newmsg.gif", "New Message (Ctrl+M)"); @@ -429,9 +431,10 @@ public class AddressBook extends JFrame { // JButton b = new JButton(new ImageIcon(aImageName)); -// b.setToolTipText(aToolTip); + b.setToolTipText(aToolTip); // b.setPad(new Insets(3,3,3,3)); -// b.addActionListener(aActionListener); + if (aActionListener != null) { + b.addActionListener(aActionListener);} aToolBar.add(b); } @@ -498,6 +501,15 @@ System.out.println ("got card"); else if (attrName.equals ("mail")) { mail = attr.getValue(); } + + else if (attrName.equals ("sn")) { + phone = attr.getValue(); + } + + else if (attrName.equals ("city")) { + city = attr.getValue(); + } + } //create this row for the table. diff --git a/grendel/addressbook/Makefile b/grendel/addressbook/Makefile index 008a69672e6..a6363cc91f2 100644 --- a/grendel/addressbook/Makefile +++ b/grendel/addressbook/Makefile @@ -16,6 +16,8 @@ # Corporation. Portions created by Netscape are Copyright (C) 1997 # Netscape Communications Corporation. All Rights Reserved. +TOPDIR = .. + SUBDIRS= \ addresscard \ $(NULL) diff --git a/grendel/addressbook/NewCardDialog.java b/grendel/addressbook/NewCardDialog.java index 7eeca4954a7..b5f09d77e7a 100644 --- a/grendel/addressbook/NewCardDialog.java +++ b/grendel/addressbook/NewCardDialog.java @@ -25,7 +25,7 @@ import java.util.*; import javax.swing.*; -class NewCardDialog extends Dialog { +class NewCardDialog extends JDialog { NewCardDialog(Frame aParent) { //FIX: Resource @@ -33,10 +33,16 @@ class NewCardDialog extends Dialog { // setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); - JComponent namePanel = createNamePanel (); - add (namePanel); + JTabbedPane tabbedPane = new JTabbedPane(); + getContentPane().add(tabbedPane, BorderLayout.CENTER); + //add (tabbedPane); -// JComponent contactPanel = createContactPanel (); + JComponent namePanel = createNamePanel (); + tabbedPane.addTab("Name",null,namePanel,"Name Information"); +// add (namePanel); + + JComponent contactPanel = createContactPanel (); + tabbedPane.addTab("Contact",null,contactPanel,"Contact Information"); // add (contactPanel); // JComponent netConfPanel = createNetConfPanel (); @@ -44,31 +50,91 @@ class NewCardDialog extends Dialog { setResizable(false); setSize (716, 515); + + addWindowListener(new AppCloser()); + } + + protected final class AppCloser extends WindowAdapter { + public void windowClosing(WindowEvent e) { + dispose(); + } } private JPanel createNamePanel () { //the outer most panel has groove etched into it. JPanel pane = new JPanel(false); -// pane.setLayout (new BoxLayout(pane, BoxLayout.Y_AXIS)); + pane.setLayout (new FlowLayout(FlowLayout.LEFT)); - JTextField mFirstName = makeField ("First Name:", 20); - pane.add (mFirstName); -/* - JTextField mLastName = makeField ("Last Name:", 20); - pane.add (mLastName); + JPanel namePane = new JPanel(false); + namePane.setLayout (new GridLayout(3,2)); - JTextField mOrganization = makeField ("Organization:", 20); - pane.add (mOrganization); + makeField ("First Name:", 20, namePane); + makeField ("Last Name:", 20, namePane); + makeField ("Display Name:",20, namePane); - JTextField mTitle = makeField ("Title:", 20); - pane.add (mTitle); + pane.add (namePane); + + + JPanel eMailPane = new JPanel(false); + eMailPane.setLayout (new GridLayout (2,2)); + + makeField ("Email Address:", 20, eMailPane); + makeField ("Nick Name:", 20, eMailPane); + + pane.add (eMailPane); + + + JPanel phonePane = new JPanel(false); + phonePane.setLayout (new GridLayout (5,2)); + + makeField ("Work:", 20, phonePane); + makeField ("Home:", 20, phonePane); + makeField ("Fax:", 20, phonePane); + makeField ("Pager:", 20, phonePane); + makeField ("Cellular:", 20, phonePane); + + pane.add (phonePane); - JTextField mEmail = makeField ("Email Address:", 20); - pane.add (mEmail); -*/ return pane; } + private JPanel createContactPanel () { + //the outer most panel has groove etched into it. + JPanel pane = new JPanel(false); + pane.setLayout (new FlowLayout(FlowLayout.LEFT)); + + JPanel contactPane = new JPanel(false); + contactPane.setLayout (new GridLayout (3,2)); + + makeField ("Title:", 20, contactPane); + makeField ("Organization:", 20, contactPane); + makeField ("Department:", 20, contactPane); + + pane.add (contactPane); + + JPanel addressPane = new JPanel(false); + addressPane.setLayout (new GridLayout (6,2)); + + makeField ("Address:", 20, addressPane); + makeField ("City:", 20, addressPane); + makeField ("State:", 20, addressPane); + makeField ("ZIP:", 20, addressPane); + makeField ("Country:", 20, addressPane); + makeField ("URL:", 20, addressPane); + + pane.add (addressPane); + + return pane; + } + + private void makeField (String aTitle, int aCol, JPanel aPanel) { + JLabel title = new JLabel (aTitle); + aPanel.add (title); + + JTextField textField = new JTextField (aCol); + aPanel.add (textField); + } + private JTextField makeField (String aTitle, int aCol) { // JPanel box = new JPanel (false); Box box = new Box (BoxLayout.X_AXIS); diff --git a/grendel/addressbook/addresscard/Makefile b/grendel/addressbook/addresscard/Makefile index 7ef1fd58612..a219519009b 100644 --- a/grendel/addressbook/addresscard/Makefile +++ b/grendel/addressbook/addresscard/Makefile @@ -16,6 +16,8 @@ # Corporation. Portions created by Netscape are Copyright (C) 1997 # Netscape Communications Corporation. All Rights Reserved. +TOPDIR = ../.. + SRCS= \ ACS_Personal.java \ AC_Attribute.java \