2 * Copyright (C) 2016 - 2024 Free Software Foundation
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 package org.mxchange.addressbook.client.gui;
19 import java.awt.BorderLayout;
20 import java.awt.GridLayout;
21 import java.awt.event.ActionEvent;
22 import java.awt.event.ActionListener;
23 import java.awt.event.MouseAdapter;
24 import java.awt.event.MouseEvent;
25 import java.awt.event.WindowAdapter;
26 import java.awt.event.WindowEvent;
27 import java.io.IOException;
28 import java.sql.SQLException;
29 import java.text.MessageFormat;
30 import javax.swing.BorderFactory;
31 import javax.swing.BoxLayout;
32 import javax.swing.DefaultComboBoxModel;
33 import javax.swing.JButton;
34 import javax.swing.JComboBox;
35 import javax.swing.JDialog;
36 import javax.swing.JFormattedTextField;
37 import javax.swing.JFrame;
38 import javax.swing.JLabel;
39 import javax.swing.JMenu;
40 import javax.swing.JMenuBar;
41 import javax.swing.JMenuItem;
42 import javax.swing.JPanel;
43 import javax.swing.JScrollPane;
44 import javax.swing.JTable;
45 import javax.swing.JTextArea;
46 import javax.swing.JTextField;
47 import javax.swing.border.TitledBorder;
48 import javax.swing.table.TableModel;
49 import org.mxchange.addressbook.BaseAddressbookSystem;
50 import org.mxchange.addressbook.application.AddressbookApplication;
51 import org.mxchange.addressbook.facade.contact.ContactFacade;
52 import org.mxchange.jcontacts.contact.Contact;
53 import org.mxchange.jcontacts.contact.title.PersonalTitle;
54 import org.mxchange.jcontacts.exceptions.ContactAlreadyAddedException;
55 import org.mxchange.jcore.application.Application;
56 import org.mxchange.jcore.client.Client;
57 import org.mxchange.jcore.exceptions.FrameAlreadyInitializedException;
58 import org.mxchange.jcore.facade.Facade;
59 import org.mxchange.jcoreswing.client.gui.ClientFrame;
60 import org.mxchange.jcoreswing.model.swing.contact.ContactTableModel;
63 * A Swing frame for addressbook.
65 * @author Roland Häder<roland@mxchange.org>
67 public class AddressbookFrame extends BaseAddressbookSystem implements ClientFrame {
72 private static ClientFrame self;
75 * Singelton getter for this frame instance.
77 * @param client Client instance
79 * @return Returns a singelton instance of this frame
81 public static ClientFrame getSelfInstance (final Client client) {
83 if (!(self instanceof ClientFrame)) {
84 // Create new instance
85 self = new AddressbookFrame(client);
93 * Dialog box "add contact"
95 private JDialog addContact;
98 * Frame instance for "add own data"
100 private JMenuItem addOwnItem;
103 * Instance to table model
105 private TableModel dataModel;
110 private JTable dataTable;
113 * Frame instance for "edit own data"
115 private JMenuItem editOwnItem;
120 private final JFrame frame;
123 * Whether this frame has been initialized
125 private boolean initialized;
128 * Status label needs to be updated
130 private JLabel statusLabel;
133 * Creates an instance of this frame with a client instance
137 private AddressbookFrame (final Client client) {
139 this.getLoggerBeanLocal().logTrace(MessageFormat.format("client={0}: CALLED!", client)); //NOI18N
141 // Set frame instance
142 this.frame = new JFrame();
143 this.frame.setTitle(this.generateFrameTitle("main")); //NOI18N
146 this.setClient(client);
149 this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N
153 public Contact doEnterOwnData () {
155 this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N
157 // Is the "add contact" window visible?
158 if (this.addContact.isVisible()) {
159 // Something bad happened
160 throw new IllegalStateException("Window addContact is already visible."); //NOI18N
163 // Disable main window
164 this.frame.setEnabled(false);
166 // Make other window visible
167 this.addContact.setVisible(true);
170 this.getLoggerBeanLocal().logTrace("Returning null : EXIT!"); //NOI18N
172 // Return value is not supported
177 * Shutdown this frame
180 public void doShutdown () {
182 this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N
184 // First only show shutdown status
185 this.updateStatus("shutdown"); //NOI18N
188 this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N
192 * Enables main window (frame)
195 public void enableMainWindow () {
197 this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N
200 this.frame.setEnabled(true);
202 // Request focus for this window
203 this.frame.requestFocus();
206 this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N
210 public Application getApplication () {
211 throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
215 public Client getClient () {
216 throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
220 public Facade getFacade () {
221 throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
225 public String getMessageStringFromKey (String key) {
226 throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
230 * Setups the frame, do not set isInitialized here
232 * @param client Client instance
235 public void setupFrame (final Client client) throws IOException {
237 this.getLoggerBeanLocal().logTrace(MessageFormat.format("client={0}: CALLED!", client)); //NOI18N
239 // Has the user entered own data?
240 if (((ContactFacade) this.getClient().getFacade()).isOwnContactAdded()) {
242 this.getLoggerBeanLocal().logDebug("Disabling menus: isOwnContactAdded()=false"); //NOI18N
244 // Not entered yet, so disable "add" menu
245 this.addOwnItem.setEnabled(false);
248 this.editOwnItem.setEnabled(false);
251 // Make the frame visible
252 this.frame.setVisible(true);
255 this.updateStatus("done"); //NOI18N
258 this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N
262 * Initalizes this frame. Having initComponents() exposed (publicly
263 * accessible) means that any other object can initialize components which
266 * @throws org.mxchange.jcore.exceptions.FrameAlreadyInitializedException If
267 * this method has been called twice
270 public void init () throws FrameAlreadyInitializedException {
272 this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N
274 // Has this frame been initialized?
275 if (this.isInitialized()) {
277 throw new FrameAlreadyInitializedException();
281 this.initComponents();
284 this.initialized = true;
287 this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N
291 * Returns field isInitialized. This flag indicates whether this frame has
292 * been initialized or not.
294 * @return Field isInitialized
297 public boolean isInitialized () {
298 return this.initialized;
302 public void logException (final Throwable exception) {
303 // Yes, I know, ugly.
304 super.logException(exception);
308 * Shuts down the application.
311 public void shutdownApplication () {
313 this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N
315 // To do this, the frame must be initialized
316 if (!this.isInitialized()) {
317 // Not initalized, so bad call
318 this.getLoggerBeanLocal().logFatal("Bad call of shutdownApplication(). Please report this."); //NOI18N
322 // Call shutdown method
324 this.getClient().getApplication().doShutdown();
325 } catch (final SQLException | IOException ex) {
327 this.abortProgramWithException(ex);
331 this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N
335 * Adds a new menu item with given key to menu instance
337 * @param menu Menu instance to add item to
338 * @param key Message key part
339 * @param listener Listener instance
341 private void addMenuItem (final JMenu menu, final String key, final ActionListener listener) {
343 this.getLoggerBeanLocal().logTrace(MessageFormat.format("menu={0},key={1},listener={2} - CALLED!", menu, key, listener)); //NOI18N
346 JMenuItem item = this.initMenuItemWithTooltip(key);
349 item.addActionListener(listener);
355 this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N
359 * Adds a JTextField with label and tool tip to given panel
361 * @param panel Panel instance to add text field
362 * @param key Part of message key from resource bundle
363 * @param fieldLength Length of text field
365 private void addTextFieldWithLabelToPanel (final JPanel panel, final String key, final int fieldLength) {
367 this.getLoggerBeanLocal().logTrace(MessageFormat.format("panel={0},key={1},fieldLength={2} - CALLED!", panel, key, fieldLength)); //NOI18N
369 // Init label for given key
370 JLabel label = new JLabel(this.getBundle().getString(String.format("AddressbookFrame.%s.text", key))); //NOI18N
372 // And input box wih tool tip
373 JTextField field = new JTextField(fieldLength);
374 field.setToolTipText(this.getBundle().getString(String.format("AddressbookFrame.%s.toolTipText", key))); //NOI18N
381 this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N
385 * Generates a title for borders
387 * @param key Key part to look for
389 * @return Human-readable title
391 private String generateBorderTitle (final String key) {
392 // Call bundle instance
393 return this.getBundle().getString(String.format("AddressbookFrame.border.%s.title.text", key)); //NOI18N
397 * Generates a title for all frames based on given sub title key. If null is
398 * given, the sub title is not generated.
400 * @param subKey Key for sub title resource
402 * @return A full application title
404 private String generateFrameTitle (final String subKey) {
406 String title = AddressbookApplication.printableTitle();
409 if (subKey != null) {
411 title = String.format("%s - %s", title, this.getBundle().getString(String.format("AddressbookFrame.%s.title.text", subKey))); //NOI18N
419 * Initializes "add" and "cancel" buttons
421 private void initAddCancelButtons () {
423 this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N
426 JPanel panel = new JPanel();
427 panel.setLayout(new GridLayout(1, 2, 10, 10));
429 // Generate "add" button
430 JButton addButton = new JButton(this.getBundle().getString("AddressbookFrame.button.addAddress.text"));
433 addButton.addActionListener(new AddActionListener(this.addContact, this));
435 // Add button to panel
436 panel.add(addButton);
438 // Generate "cancel" button
439 JButton cancelButton = new JButton(this.getBundle().getString("AddressbookFrame.button.cancel.text"));
442 cancelButton.addActionListener(new CancelActionListener(this.addContact, this));
444 // Add button to panel
445 panel.add(cancelButton);
447 // Add panel to main panel
448 this.addContact.add(panel);
451 this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N
455 * Initializes "add contact" dialog
457 private void initAddContactDialog () {
459 this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N
461 // Instance dialog and set title
462 this.addContact = new JDialog();
463 this.addContact.setTitle(this.generateFrameTitle("dialog.addContact")); //NOI18N
466 this.addContact.setLayout(new GridLayout(0, 1, 2, 2));
468 // Only hide it on close and make it appear in middle of screen
469 this.addContact.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
470 this.addContact.setLocationRelativeTo(this.frame);
472 // Set always on top and auto-focus
473 this.addContact.setAlwaysOnTop(true);
474 this.addContact.setAutoRequestFocus(true);
477 this.addContact.setSize(500, 500);
479 // And it is not resizeable
480 this.addContact.setResizable(false);
483 * Add listener which asks for confirmation, if data has been entered
484 * but not saved yet. The user may appriciate this ... ;-)
488 this.addContact.addWindowListener(new WindowAdapter() {
490 * Invoked when a window has been closed.
493 public void windowClosed (final WindowEvent e) {
494 // Enable main window again
495 AddressbookFrame.getSelfInstance(null).enableMainWindow();
499 * Invoked when a window is in the process of being closed. The
500 * close operation can be overridden at this point.
503 public void windowClosing (final WindowEvent e) {
504 e.getWindow().dispose();
510 this.initNameDataPanel(this.addContact);
512 // 2) "address" panel
513 this.initAddressDataPanel(this.addContact);
516 this.initOtherDataPanel(this.addContact);
518 // 4) "Add" and "Cancel" buttons, combined they are unique for this dialog
519 this.initAddCancelButtons();
521 // x)Only for developing:
524 */ this.addContact.setVisible(true);
527 this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N
531 * Initializes address panel
533 * @param dialog A JDialog instance to this components to
535 private void initAddressDataPanel (final JDialog dialog) {
537 this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N
539 // Panel "address" input boxes
540 JPanel addressPanel = new JPanel();
541 addressPanel.setLayout(new GridLayout(0, 4, 3, 3));
543 // Set border to titled version
544 addressPanel.setBorder(new TitledBorder(this.generateBorderTitle("address"))); //NOI18N
546 // Add text field for street
547 this.addTextFieldWithLabelToPanel(addressPanel, "street", 20); //NOI18N
550 JLabel numberLabel = new JLabel(this.getBundle().getString("AddressbookFrame.number.text"));
552 // And text field, but only accept numbers
553 JFormattedTextField number = new JFormattedTextField();
554 number.setToolTipText(this.getBundle().getString("AddressbookFrame.number.toolTipText"));
556 // Add both to street panel
557 addressPanel.add(numberLabel);
558 addressPanel.add(number);
560 // Label for ZIP code, again numbers only
561 JLabel zipLabel = new JLabel(this.getBundle().getString("AddressbookFrame.zip.text"));
563 // Init text field with label
564 JFormattedTextField zip = new JFormattedTextField();
565 zip.setToolTipText(this.getBundle().getString("AddressbookFrame.zip.toolTipText"));
567 // Add both to street panel
568 addressPanel.add(zipLabel);
569 addressPanel.add(zip);
571 // Add text field for city name
572 this.addTextFieldWithLabelToPanel(addressPanel, "city", 20); //NOI18N
574 // Add panel to dialog
575 dialog.add(addressPanel);
578 this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N
582 * Initialize components
584 private void initComponents () {
586 this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N
588 // Set default close operation
589 this.frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
591 // Register shutdown listener
592 this.frame.addWindowListener(new WindowAdapter() {
594 * Invoked when a window has been closed.
597 public void windowClosed (final WindowEvent e) {
598 // Shutdown application cleanly
599 self.shutdownApplication();
603 * Invoked when a window is in the process of being closed. The
604 * close operation can be overridden at this point.
607 public void windowClosing (final WindowEvent e) {
608 // Also shutdown cleanly here
609 self.shutdownApplication();
613 // Setup layout manager
614 this.frame.setLayout(new BorderLayout(2, 2));
617 this.frame.setSize(700, 400);
619 // Center window in middle of screen, instead of top-left corner
620 this.frame.setLocationRelativeTo(null);
623 this.initMenuSystem();
629 this.initStatusPanel();
631 // Init other windows
632 this.initOtherDialogs();
635 this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N
639 * Initializes a menu item instance with tool tip
641 * @param key Message key part
643 * @return A finished JMenuItem instance
645 private JMenuItem initMenuItemWithTooltip (final String key) {
647 this.getLoggerBeanLocal().logTrace(MessageFormat.format("key={0} - CALLED!", key)); //NOI18N
649 JMenuItem item = new JMenuItem(this.getBundle().getString(String.format("AddressbookFrame.menuItem.%s.text", key))); //NOI18N
650 item.setToolTipText(this.getBundle().getString(String.format("AddressbookFrame.menuItem.%s.toolTipText", key))); //NOI18N
653 this.getLoggerBeanLocal().logTrace(MessageFormat.format("item={0} - EXIT!", item)); //NOI18N
660 * Initializes the menu system
662 private void initMenuSystem () {
664 this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N
666 // Init menu bar, menu and item instances
667 JMenuBar menuBar = new JMenuBar();
673 menu = new JMenu(this.getBundle().getString("AddressbookFrame.menu.file.text"));
676 // 1.x) Exit program (should be last)
677 this.addMenuItem(menu, "exitProgram", new ActionListener() { //NOI18N
679 * If the user has performed this action
681 * @param e An instance of an ActionEvent class
684 public void actionPerformed (final ActionEvent e) {
685 self.shutdownApplication();
689 // Add menu -> menu bar
693 // 2) Addressbook menu
694 menu = new JMenu(this.getBundle().getString("AddressbookFrame.menu.addressbook.text"));
697 this.addOwnItem = this.initMenuItemWithTooltip("addOwnData"); //NOI18N
699 // Add listener to exit menu
700 this.addOwnItem.addActionListener(new ActionListener() {
702 * If the user has performed this action
704 * @param e An instance of an ActionEvent class
707 public void actionPerformed (final ActionEvent e) {
709 ((ContactFacade) self.getClient().getFacade()).doEnterOwnData();
710 } catch (final ContactAlreadyAddedException ex) {
711 // Already added, log away
712 // @TODO maybe output message here?
713 self.logException(ex);
719 menu.add(this.addOwnItem);
721 // 2.2) Edit own data
722 this.editOwnItem = this.initMenuItemWithTooltip("editOwnData"); //NOI18N
724 // Add listener to exit menu
725 this.editOwnItem.addActionListener(new ActionListener() {
727 * If the user has performed this action
729 * @param e An instance of an ActionEvent class
732 public void actionPerformed (final ActionEvent e) {
733 ((ContactFacade) self.getClient().getFacade()).doChangeOwnData();
738 menu.add(this.editOwnItem);
741 // 1) Add new contact
742 this.addMenuItem(menu, "addNewContact", new ActionListener() { //NOI18N
744 * If the user has performed this action
746 * @param e An instance of an ActionEvent class
749 public void actionPerformed (final ActionEvent e) {
750 ((ContactFacade) self.getClient().getFacade()).doAddOtherAddress();
754 // Add menu -> menu bar
757 // Add menu bar -> frame
758 this.frame.add(menuBar, BorderLayout.NORTH);
761 this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N
765 * Initializes name panel
767 * @param dialog A JDialog instance to this components to
769 private void initNameDataPanel (final JDialog dialog) {
771 this.getLoggerBeanLocal().logTrace(MessageFormat.format("dialog={0} - CALLED!", dialog)); //NOI18N
773 // Panel "name" input boxes
774 JPanel namePanel = new JPanel();
775 namePanel.setLayout(new GridLayout(0, 2, 3, 3));
777 // Set border to titled version
778 namePanel.setBorder(new TitledBorder(this.generateBorderTitle("name"))); //NOI18N
780 // PersonalTitle text field
781 JLabel gLabel = new JLabel(this.getBundle().getString("AddressbookFrame.title.text"));
784 PersonalTitle[] titles = PersonalTitle.values();
786 // Init title combo box with tool tip
787 JComboBox<PersonalTitle> title = new JComboBox<>(new DefaultComboBoxModel<>(titles));
788 title.setToolTipText(this.getBundle().getString("AddressbookFrame.title.toolTipText"));
790 // Add both to title panel
791 namePanel.add(gLabel);
792 namePanel.add(title);
794 // Add text field for surname
795 this.addTextFieldWithLabelToPanel(namePanel, "surname", 20); //NOI18N
797 // Add text field for family name
798 this.addTextFieldWithLabelToPanel(namePanel, "familyName", 20); //NOI18N
800 // Finally add panel to dialog
801 dialog.add(namePanel);
804 this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N
808 * Initializes "other" data panel
810 * @param dialog A JDialog instance to this components to TODO Fill this
813 private void initOtherDataPanel (final JDialog dialog) {
815 this.getLoggerBeanLocal().logTrace(MessageFormat.format("dialog={0} - CALLED!", dialog)); //NOI18N
817 // Panel "other" input boxes
818 JPanel otherPanel = new JPanel();
819 otherPanel.setLayout(new GridLayout(0, 2, 3, 3));
820 otherPanel.setBorder(new TitledBorder(this.generateBorderTitle("other"))); //NOI18N
822 // Add text field for email address
823 this.addTextFieldWithLabelToPanel(otherPanel, "emailAddress", 20); //NOI18N
825 // Add text field for phone number
826 this.addTextFieldWithLabelToPanel(otherPanel, "phoneNumber", 20); //NOI18N
828 // Add text field for cellphone number
829 this.addTextFieldWithLabelToPanel(otherPanel, "mobileNumber", 20); //NOI18N
831 // Add text field for fax number
832 this.addTextFieldWithLabelToPanel(otherPanel, "faxNumber", 20); //NOI18N
835 JLabel commentLabel = new JLabel(this.getBundle().getString("AddressbookFrame.comment.text"));
837 // Init text area with tool tip
838 JTextArea comment = new JTextArea(5, 20);
839 comment.setToolTipText(this.getBundle().getString("AddressbookFrame.comment.toolTipText"));
842 otherPanel.add(commentLabel);
843 otherPanel.add(comment);
845 // Finally add panel to dialog
846 dialog.add(otherPanel);
849 this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N
853 * Initialize other dialogs (example: "Add contact")
855 private void initOtherDialogs () {
857 this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N
859 // Init other windows:
861 this.initAddContactDialog();
864 this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N
868 * Initializes status panel
870 private void initStatusPanel () {
872 this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N
874 // Init status label (which needs to be updated
875 this.statusLabel = new JLabel();
876 this.updateStatus("initializing"); //NOI18N
878 // Init status bar in south
879 JPanel panel = new JPanel();
880 panel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS));
881 panel.add(this.statusLabel);
882 panel.setBorder(BorderFactory.createEtchedBorder());
884 // Add panel to frame
885 this.frame.add(panel, BorderLayout.SOUTH);
888 this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N
892 * Initializes the table which will show all contacts
894 private void initTable () {
896 this.getLoggerBeanLocal().logTrace("CALLED!"); //NOI18N
898 // Instance table model
899 this.dataModel = new ContactTableModel(this.getClient().getFacade());
902 this.dataTable = new JTable(this.dataModel);
904 // Add mouse listener
905 this.dataTable.addMouseListener(new MouseAdapter() {
907 * If the user peformed a click on a cell
909 * @param e Mouse event instance
912 public void mouseClicked (final MouseEvent e) {
913 throw new UnsupportedOperationException("Unfinished."); //NOI18N
917 // Instance scroll pane
918 JScrollPane scroller = new JScrollPane();
920 // Add table to scroll pane
921 scroller.setViewportView(this.dataTable);
922 scroller.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
923 scroller.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
926 this.frame.add(scroller, BorderLayout.CENTER);
929 this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N
933 * Updates status to given type
935 * @param type Status type
937 private void updateStatus (final String type) {
939 this.getLoggerBeanLocal().logTrace(MessageFormat.format("type={0} - CALLED!", type)); //NOI18N
941 // Set status message
942 this.statusLabel.setText(this.getBundle().getString(String.format("AddressbookFrame.statusLabel.%s.text", type))); //NOI18N
945 this.getLoggerBeanLocal().logTrace("EXIT!"); //NOI18N
949 * Class for "add address" button
951 private static class AddActionListener extends BaseAddressbookSystem implements ActionListener {
956 private final JDialog dialog;
959 * Frame (not JFrame) instance
961 private final ClientFrame frame;
964 * Constructor for action listener
966 * @param dialog Dialog instance to call back
967 * @param frame Frame instance (not JFrame)
969 protected AddActionListener (final JDialog dialog, final ClientFrame frame) {
970 // Set dialog and frame here
971 this.dialog = dialog;
976 * If the action has been performed
978 * @param e The performed action event
981 public void actionPerformed (final ActionEvent e) {
982 throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
987 * Class for "cancel address" button
989 private static class CancelActionListener extends BaseAddressbookSystem implements ActionListener {
994 private final JDialog dialog;
997 * Frame (not JFrame) instance
999 private final ClientFrame frame;
1002 * Constructor for action listener
1004 * @param dialog Dialog instance to call back
1005 * @param frame Frame instance (not JFrame)
1007 protected CancelActionListener (final JDialog dialog, final ClientFrame frame) {
1008 // Set dialog and frame here
1009 this.dialog = dialog;
1014 * If the action has been performed
1016 * @param e The performed action event
1019 public void actionPerformed (final ActionEvent e) {
1020 throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.