This commit is contained in:
talisman%anamorphic.com 1999-02-13 03:06:22 +00:00
Родитель 7788993568
Коммит c0a06607ab
4 изменённых файлов: 102 добавлений и 20 удалений

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

@ -371,6 +371,8 @@ public class AddressBook extends JFrame {
DataModel dm = (DataModel) mTable.getModel (); DataModel dm = (DataModel) mTable.getModel ();
dm.reloadData (ds.getDomainName(), ds.getPort(), textToSearchFor); dm.reloadData (ds.getDomainName(), ds.getPort(), textToSearchFor);
dm.fireTableDataChanged();
//repaint the table with results. //repaint the table with results.
mTable.repaint(); mTable.repaint();
} }
@ -385,7 +387,7 @@ public class AddressBook extends JFrame {
private GrendelToolBar createToolbar() { private GrendelToolBar createToolbar() {
GrendelToolBar toolBar = new GrendelToolBar(); 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/newlist.gif", "Create a new list");
addToolbarButton(toolBar, null, "images/properties.gif", "Edit the selected card"); addToolbarButton(toolBar, null, "images/properties.gif", "Edit the selected card");
addToolbarButton(toolBar, null, "images/newmsg.gif", "New Message (Ctrl+M)"); 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)); // JButton b = new JButton(new ImageIcon(aImageName));
// b.setToolTipText(aToolTip); b.setToolTipText(aToolTip);
// b.setPad(new Insets(3,3,3,3)); // b.setPad(new Insets(3,3,3,3));
// b.addActionListener(aActionListener); if (aActionListener != null) {
b.addActionListener(aActionListener);}
aToolBar.add(b); aToolBar.add(b);
} }
@ -498,6 +501,15 @@ System.out.println ("got card");
else if (attrName.equals ("mail")) { else if (attrName.equals ("mail")) {
mail = attr.getValue(); 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. //create this row for the table.

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

@ -16,6 +16,8 @@
# Corporation. Portions created by Netscape are Copyright (C) 1997 # Corporation. Portions created by Netscape are Copyright (C) 1997
# Netscape Communications Corporation. All Rights Reserved. # Netscape Communications Corporation. All Rights Reserved.
TOPDIR = ..
SUBDIRS= \ SUBDIRS= \
addresscard \ addresscard \
$(NULL) $(NULL)

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

@ -25,7 +25,7 @@ import java.util.*;
import javax.swing.*; import javax.swing.*;
class NewCardDialog extends Dialog { class NewCardDialog extends JDialog {
NewCardDialog(Frame aParent) { NewCardDialog(Frame aParent) {
//FIX: Resource //FIX: Resource
@ -33,10 +33,16 @@ class NewCardDialog extends Dialog {
// setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); // setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
JComponent namePanel = createNamePanel (); JTabbedPane tabbedPane = new JTabbedPane();
add (namePanel); 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); // add (contactPanel);
// JComponent netConfPanel = createNetConfPanel (); // JComponent netConfPanel = createNetConfPanel ();
@ -44,31 +50,91 @@ class NewCardDialog extends Dialog {
setResizable(false); setResizable(false);
setSize (716, 515); setSize (716, 515);
addWindowListener(new AppCloser());
}
protected final class AppCloser extends WindowAdapter {
public void windowClosing(WindowEvent e) {
dispose();
}
} }
private JPanel createNamePanel () { private JPanel createNamePanel () {
//the outer most panel has groove etched into it. //the outer most panel has groove etched into it.
JPanel pane = new JPanel(false); 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); JPanel namePane = new JPanel(false);
pane.add (mFirstName); namePane.setLayout (new GridLayout(3,2));
/*
JTextField mLastName = makeField ("Last Name:", 20);
pane.add (mLastName);
JTextField mOrganization = makeField ("Organization:", 20); makeField ("First Name:", 20, namePane);
pane.add (mOrganization); makeField ("Last Name:", 20, namePane);
makeField ("Display Name:",20, namePane);
JTextField mTitle = makeField ("Title:", 20); pane.add (namePane);
pane.add (mTitle);
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; 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) { private JTextField makeField (String aTitle, int aCol) {
// JPanel box = new JPanel (false); // JPanel box = new JPanel (false);
Box box = new Box (BoxLayout.X_AXIS); Box box = new Box (BoxLayout.X_AXIS);

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

@ -16,6 +16,8 @@
# Corporation. Portions created by Netscape are Copyright (C) 1997 # Corporation. Portions created by Netscape are Copyright (C) 1997
# Netscape Communications Corporation. All Rights Reserved. # Netscape Communications Corporation. All Rights Reserved.
TOPDIR = ../..
SRCS= \ SRCS= \
ACS_Personal.java \ ACS_Personal.java \
AC_Attribute.java \ AC_Attribute.java \