customcontrols package and i18n package moved

cusax-fix
Yana Stamcheva 20 years ago
parent e65aa79111
commit b9dbe01882

@ -16,7 +16,7 @@
import javax.swing.JComboBox;
import javax.swing.JPanel;
import net.java.sip.communicator.impl.gui.main.customcontrols.SIPCommButton;
import net.java.sip.communicator.impl.gui.customcontrols.SIPCommButton;
import net.java.sip.communicator.impl.gui.utils.ImageLoader;
/**

@ -19,7 +19,7 @@
import javax.swing.JLabel;
import javax.swing.JPanel;
import net.java.sip.communicator.impl.gui.main.customcontrols.SIPCommButton;
import net.java.sip.communicator.impl.gui.customcontrols.SIPCommButton;
import net.java.sip.communicator.impl.gui.utils.ImageLoader;
/**

@ -18,7 +18,7 @@
import javax.swing.JComboBox;
import javax.swing.JPanel;
import net.java.sip.communicator.impl.gui.main.customcontrols.SIPCommButton;
import net.java.sip.communicator.impl.gui.customcontrols.SIPCommButton;
import net.java.sip.communicator.impl.gui.utils.Constants;
import net.java.sip.communicator.impl.gui.utils.ImageLoader;

@ -9,13 +9,10 @@
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Point;
import java.awt.Toolkit;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
import java.beans.PropertyChangeEvent;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.Iterator;
@ -25,11 +22,10 @@
import javax.swing.JPanel;
import net.java.sip.communicator.impl.gui.GuiActivator;
import net.java.sip.communicator.impl.gui.main.configforms.ConfigurationFrame;
import net.java.sip.communicator.impl.gui.i18n.Messages;
import net.java.sip.communicator.impl.gui.main.contactlist.CListKeySearchListener;
import net.java.sip.communicator.impl.gui.main.contactlist.ContactListModel;
import net.java.sip.communicator.impl.gui.main.contactlist.ContactListPanel;
import net.java.sip.communicator.impl.gui.main.i18n.Messages;
import net.java.sip.communicator.impl.gui.utils.Constants;
import net.java.sip.communicator.impl.gui.utils.ImageLoader;
import net.java.sip.communicator.service.configuration.ConfigurationService;
@ -52,7 +48,6 @@
import net.java.sip.communicator.service.protocol.event.ProviderPresenceStatusListener;
import net.java.sip.communicator.service.protocol.icqconstants.IcqStatusEnum;
import net.java.sip.communicator.util.Logger;
import net.java.sip.communicator.util.xml.XMLException;
/**
* The main application window. This class is the core of this ui

@ -9,9 +9,9 @@
import javax.swing.JPanel;
import net.java.sip.communicator.impl.gui.customcontrols.SIPCommTabbedPane;
import net.java.sip.communicator.impl.gui.i18n.Messages;
import net.java.sip.communicator.impl.gui.main.contactlist.ContactListPanel;
import net.java.sip.communicator.impl.gui.main.customcontrols.SIPCommTabbedPane;
import net.java.sip.communicator.impl.gui.main.i18n.Messages;
/**
* The <tt>MainTabbedPane</tt> is a <tt>SIPCommTabbedPane</tt> that contains

@ -10,7 +10,7 @@
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import net.java.sip.communicator.impl.gui.main.i18n.Messages;
import net.java.sip.communicator.impl.gui.i18n.Messages;
/**
* The main menu.

@ -19,6 +19,9 @@
import javax.swing.JButton;
import javax.swing.JOptionPane;
import net.java.sip.communicator.impl.gui.customcontrols.SIPCommToolBar;
import net.java.sip.communicator.impl.gui.customcontrols.wizard.Wizard;
import net.java.sip.communicator.impl.gui.i18n.Messages;
import net.java.sip.communicator.impl.gui.main.configforms.ConfigurationFrame;
import net.java.sip.communicator.impl.gui.main.contactlist.ContactList;
import net.java.sip.communicator.impl.gui.main.contactlist.ContactListModel;
@ -26,9 +29,6 @@
import net.java.sip.communicator.impl.gui.main.contactlist.addcontact.AddContactWizardPage2;
import net.java.sip.communicator.impl.gui.main.contactlist.addcontact.AddContactWizardPage3;
import net.java.sip.communicator.impl.gui.main.contactlist.addcontact.NewContact;
import net.java.sip.communicator.impl.gui.main.customcontrols.SIPCommToolBar;
import net.java.sip.communicator.impl.gui.main.customcontrols.wizard.Wizard;
import net.java.sip.communicator.impl.gui.main.i18n.Messages;
import net.java.sip.communicator.impl.gui.utils.BrowserLauncher;
import net.java.sip.communicator.impl.gui.utils.ImageLoader;
import net.java.sip.communicator.service.contactlist.MetaContact;
@ -67,7 +67,7 @@ public class QuickMenu extends SIPCommToolBar implements ActionListener,
private JButton addButton = new JButton(new ImageIcon(ImageLoader
.getImage(ImageLoader.QUICK_MENU_ADD_ICON)));
private ConfigurationFrame configFrame = new ConfigurationFrame();
private ConfigurationFrame configFrame;
private MainFrame mainFrame;
@ -82,7 +82,7 @@ public QuickMenu(MainFrame mainFrame) {
this.setLayout(new FlowLayout(FlowLayout.LEFT, 2, 0));
this.setBorder(BorderFactory.createEmptyBorder(0, 5, 5, 5));
this.setFloatable(false);
this.infoButton.setPreferredSize(new Dimension(28, 28));
this.configureButton.setPreferredSize(new Dimension(28, 28));
this.searchButton.setPreferredSize(new Dimension(28, 28));
@ -129,28 +129,28 @@ public void actionPerformed(ActionEvent e) {
if (buttonName.equals("add")) {
Wizard wizard = new Wizard();
wizard.getDialog().setTitle("Add contact wizard");
wizard.getDialog().setTitle(Messages.getString("addContactWizard"));
NewContact newContact = new NewContact();
AddContactWizardPage1 page1
= new AddContactWizardPage1(newContact,
= new AddContactWizardPage1(wizard, newContact,
mainFrame.getProtocolProviders());
wizard.registerWizardPanel(AddContactWizardPage1.IDENTIFIER, page1);
wizard.registerWizardPage(AddContactWizardPage1.IDENTIFIER, page1);
AddContactWizardPage2 page2
= new AddContactWizardPage2(newContact,
= new AddContactWizardPage2(wizard, newContact,
mainFrame.getAllGroups());
wizard.registerWizardPanel(AddContactWizardPage2.IDENTIFIER, page2);
wizard.registerWizardPage(AddContactWizardPage2.IDENTIFIER, page2);
AddContactWizardPage3 page3
= new AddContactWizardPage3(newContact);
wizard.registerWizardPanel(AddContactWizardPage3.IDENTIFIER, page3);
wizard.registerWizardPage(AddContactWizardPage3.IDENTIFIER, page3);
wizard.setCurrentPanel(AddContactWizardPage1.IDENTIFIER);
wizard.setCurrentPage(AddContactWizardPage1.IDENTIFIER);
wizard.getDialog().setLocation(
Toolkit.getDefaultToolkit().getScreenSize().width/2
@ -195,6 +195,8 @@ else if(returnCode == 1) {
}
else if (buttonName.equals("config")) {
configFrame = new ConfigurationFrame(mainFrame);
configFrame.setCalculatedSize();
configFrame.setVisible(true);

@ -20,7 +20,7 @@
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import net.java.sip.communicator.impl.gui.main.i18n.Messages;
import net.java.sip.communicator.impl.gui.i18n.Messages;
import net.java.sip.communicator.service.protocol.AuthorizationRequest;
import net.java.sip.communicator.service.protocol.Contact;
/**

@ -8,7 +8,6 @@
package net.java.sip.communicator.impl.gui.main;
import java.awt.Image;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.image.BufferedImage;
@ -20,9 +19,9 @@
import javax.swing.JOptionPane;
import javax.swing.Timer;
import net.java.sip.communicator.impl.gui.main.customcontrols.SIPCommMsgTextArea;
import net.java.sip.communicator.impl.gui.main.customcontrols.SIPCommSelectorBox;
import net.java.sip.communicator.impl.gui.main.i18n.Messages;
import net.java.sip.communicator.impl.gui.customcontrols.SIPCommMsgTextArea;
import net.java.sip.communicator.impl.gui.customcontrols.SIPCommSelectorBox;
import net.java.sip.communicator.impl.gui.i18n.Messages;
import net.java.sip.communicator.service.protocol.OperationFailedException;
import net.java.sip.communicator.service.protocol.OperationSetPresence;
import net.java.sip.communicator.service.protocol.PresenceStatus;

@ -14,7 +14,6 @@
import java.awt.event.KeyEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
import javax.swing.AbstractAction;
import javax.swing.BorderFactory;
@ -27,8 +26,7 @@
import javax.swing.KeyStroke;
import javax.swing.SwingUtilities;
import net.java.sip.communicator.impl.gui.main.customcontrols.events.CloseListener;
import net.java.sip.communicator.impl.gui.main.i18n.Messages;
import net.java.sip.communicator.impl.gui.i18n.Messages;
import net.java.sip.communicator.impl.gui.main.login.LoginManager;
import net.java.sip.communicator.impl.gui.utils.AntialiasingManager;
import net.java.sip.communicator.impl.gui.utils.Constants;

@ -17,7 +17,7 @@
import javax.swing.JCheckBox;
import javax.swing.JPanel;
import net.java.sip.communicator.impl.gui.main.i18n.Messages;
import net.java.sip.communicator.impl.gui.i18n.Messages;
import net.java.sip.communicator.impl.gui.utils.ImageLoader;
/**

@ -18,7 +18,7 @@
import javax.swing.Icon;
import javax.swing.JLabel;
import net.java.sip.communicator.impl.gui.main.customcontrols.ListCellPanel;
import net.java.sip.communicator.impl.gui.customcontrols.ListCellPanel;
import net.java.sip.communicator.impl.gui.utils.Constants;
/**

@ -8,7 +8,6 @@
package net.java.sip.communicator.impl.gui.main.configforms;
import java.awt.BorderLayout;
import java.awt.Graphics;
import java.awt.event.InputEvent;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
@ -18,9 +17,9 @@
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import net.java.sip.communicator.impl.gui.main.customcontrols.SIPCommList;
import net.java.sip.communicator.impl.gui.main.customcontrols.TitlePanel;
import net.java.sip.communicator.impl.gui.utils.AntialiasingManager;
import net.java.sip.communicator.impl.gui.customcontrols.SIPCommList;
import net.java.sip.communicator.impl.gui.customcontrols.TitlePanel;
import net.java.sip.communicator.impl.gui.main.MainFrame;
import net.java.sip.communicator.impl.gui.utils.Constants;
import net.java.sip.communicator.service.gui.ExportedDialog;
@ -40,7 +39,11 @@ public class ConfigurationFrame extends JFrame
private JPanel centerPanel = new JPanel(new BorderLayout());
public ConfigurationFrame() {
private MainFrame mainFrame;
public ConfigurationFrame(MainFrame mainFrame) {
this.mainFrame = mainFrame;
this.getContentPane().setLayout(new BorderLayout());
@ -57,7 +60,8 @@ public void addDefaultForms() {
this.addConfigurationForm(new GeneralConfigurationForm());
this.addConfigurationForm(new AppearanceConfigurationForm());
this.addConfigurationForm(new AccountsConfigurationForm());
this.addConfigurationForm(
new AccountsConfigurationForm(mainFrame));
}
public void addConfigurationForm(ConfigurationForm configForm) {

@ -17,7 +17,7 @@
import javax.swing.JCheckBox;
import javax.swing.JPanel;
import net.java.sip.communicator.impl.gui.main.i18n.Messages;
import net.java.sip.communicator.impl.gui.i18n.Messages;
import net.java.sip.communicator.impl.gui.utils.ImageLoader;
/**

@ -17,7 +17,7 @@
import javax.swing.JDialog;
import javax.swing.JPanel;
import net.java.sip.communicator.impl.gui.main.customcontrols.TransparentBackground;
import net.java.sip.communicator.impl.gui.customcontrols.TransparentBackground;
import net.java.sip.communicator.service.contactlist.MetaContact;
/**

@ -26,10 +26,8 @@
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.ListCellRenderer;
import javax.swing.ListModel;
import javax.swing.ListSelectionModel;
import net.java.sip.communicator.impl.gui.main.customcontrols.SIPCommButton;
import net.java.sip.communicator.impl.gui.customcontrols.SIPCommButton;
import net.java.sip.communicator.impl.gui.utils.AntialiasingManager;
import net.java.sip.communicator.impl.gui.utils.Constants;
import net.java.sip.communicator.impl.gui.utils.ImageLoader;

@ -36,9 +36,9 @@
import javax.swing.SwingUtilities;
import javax.swing.Timer;
import net.java.sip.communicator.impl.gui.customcontrols.SIPCommMsgTextArea;
import net.java.sip.communicator.impl.gui.i18n.Messages;
import net.java.sip.communicator.impl.gui.main.MainFrame;
import net.java.sip.communicator.impl.gui.main.customcontrols.SIPCommMsgTextArea;
import net.java.sip.communicator.impl.gui.main.i18n.Messages;
import net.java.sip.communicator.impl.gui.main.message.ChatPanel;
import net.java.sip.communicator.impl.gui.main.message.ChatWindow;
import net.java.sip.communicator.impl.gui.utils.Constants;

@ -2,7 +2,7 @@
import java.awt.Image;
import net.java.sip.communicator.impl.gui.main.customcontrols.SIPCommButton;
import net.java.sip.communicator.impl.gui.customcontrols.SIPCommButton;
import net.java.sip.communicator.service.protocol.Contact;
/**

@ -21,11 +21,11 @@
import javax.swing.JPopupMenu;
import javax.swing.SwingUtilities;
import net.java.sip.communicator.impl.gui.customcontrols.MessageDialog;
import net.java.sip.communicator.impl.gui.i18n.Messages;
import net.java.sip.communicator.impl.gui.main.MainFrame;
import net.java.sip.communicator.impl.gui.main.contactlist.addcontact.AddContactDialog;
import net.java.sip.communicator.impl.gui.main.customcontrols.MessageDialog;
import net.java.sip.communicator.impl.gui.main.history.HistoryWindow;
import net.java.sip.communicator.impl.gui.main.i18n.Messages;
import net.java.sip.communicator.impl.gui.utils.BrowserLauncher;
import net.java.sip.communicator.impl.gui.utils.Constants;
import net.java.sip.communicator.impl.gui.utils.ImageLoader;

@ -16,9 +16,9 @@
import javax.swing.JMenuItem;
import javax.swing.JPopupMenu;
import net.java.sip.communicator.impl.gui.i18n.Messages;
import net.java.sip.communicator.impl.gui.main.MainFrame;
import net.java.sip.communicator.impl.gui.main.contactlist.addcontact.AddContactDialog;
import net.java.sip.communicator.impl.gui.main.i18n.Messages;
import net.java.sip.communicator.impl.gui.utils.Constants;
import net.java.sip.communicator.impl.gui.utils.ImageLoader;
import net.java.sip.communicator.service.contactlist.MetaContactGroup;

@ -17,8 +17,8 @@
import javax.swing.JDialog;
import javax.swing.JPanel;
import net.java.sip.communicator.impl.gui.i18n.Messages;
import net.java.sip.communicator.impl.gui.main.contactlist.addcontact.RenameContactPanel;
import net.java.sip.communicator.impl.gui.main.i18n.Messages;
import net.java.sip.communicator.service.contactlist.MetaContact;
import net.java.sip.communicator.service.contactlist.MetaContactListService;

@ -16,7 +16,7 @@
import javax.swing.JDialog;
import javax.swing.JPanel;
import net.java.sip.communicator.impl.gui.main.i18n.Messages;
import net.java.sip.communicator.impl.gui.i18n.Messages;
import net.java.sip.communicator.service.contactlist.MetaContact;
import net.java.sip.communicator.service.contactlist.MetaContactGroup;
import net.java.sip.communicator.service.contactlist.MetaContactListService;

@ -18,8 +18,8 @@
import javax.swing.JPanel;
import javax.swing.JTextField;
import net.java.sip.communicator.impl.gui.main.customcontrols.SIPCommMsgTextArea;
import net.java.sip.communicator.impl.gui.main.i18n.Messages;
import net.java.sip.communicator.impl.gui.customcontrols.SIPCommMsgTextArea;
import net.java.sip.communicator.impl.gui.i18n.Messages;
import net.java.sip.communicator.impl.gui.utils.Constants;
import net.java.sip.communicator.impl.gui.utils.ImageLoader;
@ -38,7 +38,7 @@ public class AddContactPanel extends JPanel {
private JPanel dataPanel = new JPanel(new BorderLayout(5, 5));
private SIPCommMsgTextArea infoLabel
= new SIPCommMsgTextArea(Messages.getString("addContactWizard"));
= new SIPCommMsgTextArea(Messages.getString("addContactIdentifier"));
private JLabel infoTitleLabel = new JLabel(Messages.getString("addContact"));

@ -17,8 +17,8 @@
import javax.swing.JPanel;
import javax.swing.JTextField;
import net.java.sip.communicator.impl.gui.main.customcontrols.SIPCommMsgTextArea;
import net.java.sip.communicator.impl.gui.main.i18n.Messages;
import net.java.sip.communicator.impl.gui.customcontrols.SIPCommMsgTextArea;
import net.java.sip.communicator.impl.gui.i18n.Messages;
import net.java.sip.communicator.impl.gui.utils.Constants;
import net.java.sip.communicator.impl.gui.utils.ImageLoader;

@ -21,8 +21,10 @@
import javax.swing.event.CellEditorListener;
import javax.swing.table.TableModel;
import net.java.sip.communicator.impl.gui.main.customcontrols.SIPCommMsgTextArea;
import net.java.sip.communicator.impl.gui.main.i18n.Messages;
import net.java.sip.communicator.impl.gui.customcontrols.BooleanToCheckTableModel;
import net.java.sip.communicator.impl.gui.customcontrols.LabelTableCellRenderer;
import net.java.sip.communicator.impl.gui.customcontrols.SIPCommMsgTextArea;
import net.java.sip.communicator.impl.gui.i18n.Messages;
import net.java.sip.communicator.impl.gui.utils.Constants;
import net.java.sip.communicator.impl.gui.utils.ImageLoader;
import net.java.sip.communicator.service.protocol.ProtocolProviderService;
@ -39,7 +41,8 @@ public class SelectAccountPanel extends JPanel {
private JTable accountsTable = new JTable();
private CustomTableModel tableModel = new CustomTableModel();
private BooleanToCheckTableModel tableModel
= new BooleanToCheckTableModel();
private NewContact newContact;

@ -21,8 +21,10 @@
import javax.swing.event.CellEditorListener;
import javax.swing.table.TableModel;
import net.java.sip.communicator.impl.gui.main.customcontrols.SIPCommMsgTextArea;
import net.java.sip.communicator.impl.gui.main.i18n.Messages;
import net.java.sip.communicator.impl.gui.customcontrols.BooleanToCheckTableModel;
import net.java.sip.communicator.impl.gui.customcontrols.LabelTableCellRenderer;
import net.java.sip.communicator.impl.gui.customcontrols.SIPCommMsgTextArea;
import net.java.sip.communicator.impl.gui.i18n.Messages;
import net.java.sip.communicator.impl.gui.utils.Constants;
import net.java.sip.communicator.impl.gui.utils.ImageLoader;
import net.java.sip.communicator.service.contactlist.MetaContactGroup;
@ -37,7 +39,8 @@ public class SelectGroupPanel extends JPanel {
private JTable groupsTable = new JTable();
private CustomTableModel tableModel = new CustomTableModel();
private BooleanToCheckTableModel tableModel
= new BooleanToCheckTableModel();
private SIPCommMsgTextArea infoLabel
= new SIPCommMsgTextArea(Messages.getString("selectGroupWizard"));

@ -1,21 +0,0 @@
/*
* SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package net.java.sip.communicator.impl.gui.main.customcontrols.events;
/*
* The content of this file was based on code borrowed from David Bismut,
* davidou@mageos.com Intern, SETLabs, Infosys Technologies Ltd. May 2004 - Jul
* 2004 Ecole des Mines de Nantes, France
*/
import java.awt.event.MouseEvent;
import java.util.EventListener;
/**
* @author Yana Stamcheva
*/
public interface CloseListener extends EventListener {
public void closeOperation(MouseEvent e);
}

@ -1,48 +0,0 @@
/*
* SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package net.java.sip.communicator.impl.gui.main.customcontrols.events;
/*
* The following code is borrowed from David Bismut, davidou@mageos.com Intern,
* SETLabs, Infosys Technologies Ltd. May 2004 - Jul 2004 Ecole des Mines de
* Nantes, France
*/
import java.awt.Event;
import java.awt.event.MouseEvent;
/**
* @author Yana Stamcheva
*/
public class CloseTabbedPaneEvent extends Event {
private String description;
private MouseEvent e;
private int overTabIndex;
public CloseTabbedPaneEvent(MouseEvent e, String description,
int overTabIndex) {
super(null, 0, null);
this.e = e;
this.description = description;
this.overTabIndex = overTabIndex;
}
public String getDescription() {
return description;
}
public MouseEvent getMouseEvent() {
return e;
}
public int getOverTabIndex() {
return overTabIndex;
}
}

@ -1,22 +0,0 @@
/*
* SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package net.java.sip.communicator.impl.gui.main.customcontrols.events;
/*
* The following code borrowed from David Bismut, davidou@mageos.com Intern,
* SETLabs, Infosys Technologies Ltd. May 2004 - Jul 2004 Ecole des Mines de
* Nantes, France
*/
import java.awt.event.MouseEvent;
import java.util.EventListener;
/**
* @author Yana Stamcheva
*/
public interface DoubleClickListener extends EventListener {
public void doubleClickOperation(MouseEvent e);
}

@ -1,22 +0,0 @@
/*
* SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package net.java.sip.communicator.impl.gui.main.customcontrols.events;
/*
* The following code borrowed from David Bismut, davidou@mageos.com Intern,
* SETLabs, Infosys Technologies Ltd. May 2004 - Jul 2004 Ecole des Mines de
* Nantes, France
*/
import java.awt.event.MouseEvent;
import java.util.EventListener;
/**
* @author Yana Stamcheva
*/
public interface MaxListener extends EventListener {
public void maxOperation(MouseEvent e);
}

@ -1,22 +0,0 @@
/*
* SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package net.java.sip.communicator.impl.gui.main.customcontrols.events;
/*
* The following code borrowed from David Bismut, davidou@mageos.com Intern,
* SETLabs, Infosys Technologies Ltd. May 2004 - Jul 2004 Ecole des Mines de
* Nantes, France
*/
import java.awt.event.MouseEvent;
import java.util.EventListener;
/**
* @author Yana Stamcheva
*/
public interface PopupOutsideListener extends EventListener {
public void popupOutsideOperation(MouseEvent e);
}

@ -1,464 +0,0 @@
/*
* SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package net.java.sip.communicator.impl.gui.main.customcontrols.wizard;
import java.awt.*;
import java.awt.event.*;
import java.beans.*;
import java.util.*;
import java.net.*;
import javax.swing.*;
import javax.swing.border.*;
/**
* This class implements a basic wizard dialog, where the programmer can
* insert one or more Components to act as panels. These panels can be navigated
* through arbitrarily using the 'Next' or 'Back' buttons, or the dialog itself
* can be closed using the 'Cancel' button. Note that even though the dialog
* uses a CardLayout manager, the order of the panels is not linear. Each panel
* determines at runtime what its next and previous panel will be.
*/
public class Wizard extends WindowAdapter implements PropertyChangeListener {
/**
* Indicates that the 'Finish' button was pressed to close the dialog.
*/
public static final int FINISH_RETURN_CODE = 0;
/**
* Indicates that the 'Cancel' button was pressed to close the dialog, or
* the user pressed the close box in the corner of the window.
*/
public static final int CANCEL_RETURN_CODE = 1;
/**
* Indicates that the dialog closed due to an internal error.
*/
public static final int ERROR_RETURN_CODE = 2;
/**
* The String-based action command for the 'Next' button.
*/
public static final String NEXT_BUTTON_ACTION_COMMAND
= "NextButtonActionCommand";
/**
* The String-based action command for the 'Back' button.
*/
public static final String BACK_BUTTON_ACTION_COMMAND
= "BackButtonActionCommand";
/**
* The String-based action command for the 'Cancel' button.
*/
public static final String CANCEL_BUTTON_ACTION_COMMAND
= "CancelButtonActionCommand";
/**
* The i18n text used for the buttons. Loaded from a property resource
* file.
*/
static String BACK_TEXT;
static String NEXT_TEXT;
static String FINISH_TEXT;
static String CANCEL_TEXT;
/**
* The image icons used for the buttons. Filenames are loaded from a
* property resource file.
*/
static Icon BACK_ICON;
static Icon NEXT_ICON;
static Icon FINISH_ICON;
static Icon CANCEL_ICON;
private WizardModel wizardModel;
private WizardController wizardController;
private JDialog wizardDialog;
private JPanel cardPanel;
private CardLayout cardLayout;
private JButton backButton;
private JButton nextButton;
private JButton cancelButton;
private int returnCode;
/**
* Default constructor. This method creates a new WizardModel object and
* passes it into the overloaded constructor.
*/
public Wizard() {
this((Frame)null);
}
/**
* This method accepts a java.awt.Dialog object as the javax.swing.JDialog's
* parent.
* @param owner The java.awt.Dialog object that is the owner of this dialog.
*/
public Wizard(Dialog owner) {
wizardModel = new WizardModel();
wizardDialog = new JDialog(owner);
initComponents();
}
/**
* This method accepts a java.awt.Frame object as the javax.swing.JDialog's
* parent.
* @param owner The java.awt.Frame object that is the owner of the
* javax.swing.JDialog.
*/
public Wizard(Frame owner) {
wizardModel = new WizardModel();
wizardDialog = new JDialog(owner);
initComponents();
}
/**
* Returns an instance of the JDialog that this class created.This is useful
* in the event that you want to change any of the JDialog parameters
* manually.
* @return The JDialog instance that this class created.
*/
public JDialog getDialog() {
return wizardDialog;
}
/**
* Returns the owner of the generated javax.swing.JDialog.
* @return The owner (java.awt.Frame or java.awt.Dialog) of the
* javax.swing.JDialog generated
* by this class.
*/
public Component getOwner() {
return wizardDialog.getOwner();
}
/**
* Sets the title of the generated javax.swing.JDialog.
* @param s The title of the dialog.
*/
public void setTitle(String s) {
wizardDialog.setTitle(s);
}
/**
* Returns the current title of the generated dialog.
* @return The String-based title of the generated dialog.
*/
public String getTitle() {
return wizardDialog.getTitle();
}
/**
* Sets the modality of the generated javax.swing.JDialog.
* @param b the modality of the dialog
*/
public void setModal(boolean b) {
wizardDialog.setModal(b);
}
/**
* Returns the modality of the dialog.
* @return A boolean indicating whether or not the generated
* javax.swing.JDialog is modal.
*/
public boolean isModal() {
return wizardDialog.isModal();
}
/**
* Convienence method that displays a modal wizard dialog and blocks until
* the dialog has completed.
* @return Indicates how the dialog was closed. Compare this value against
* the RETURN_CODE constants at the beginning of the class.
*/
public int showModalDialog() {
wizardDialog.setModal(true);
wizardDialog.pack();
wizardDialog.setVisible(true);
return returnCode;
}
/**
* Returns the current model of the wizard dialog.
* @return A WizardModel instance, which serves as the model for the
* wizard dialog.
*/
public WizardModel getModel() {
return wizardModel;
}
/**
* Add a Component as a panel for the wizard dialog by registering its
* WizardPanelDescriptor object. Each panel is identified by a unique
* Object-based identifier (often a String), which can be used by the
* setCurrentPanel() method to display the panel at runtime.
* @param id An Object-based identifier used to identify the
* WizardPanelDescriptor object.
* @param panel The WizardPanelDescriptor object which contains helpful
* information about the panel.
*/
public void registerWizardPanel(Object id, WizardPanelDescriptor panel) {
// Add the incoming panel to our JPanel display that is managed by
// the CardLayout layout manager.
cardPanel.add(panel.getPanelComponent(), id);
// Set a callback to the current wizard.
panel.setWizard(this);
// Place a reference to it in the model.
wizardModel.registerPanel(id, panel);
}
/**
* Displays the panel identified by the object passed in. This is the same
* Object-based identified used when registering the panel.
* @param id The Object-based identifier of the panel to be displayed.
*/
public void setCurrentPanel(Object id) {
// Get the hashtable reference to the panel that should
// be displayed. If the identifier passed in is null, then close
// the dialog.
if (id == null)
close(ERROR_RETURN_CODE);
WizardPanelDescriptor oldPanelDescriptor
= wizardModel.getCurrentPanelDescriptor();
if (oldPanelDescriptor != null)
oldPanelDescriptor.aboutToHidePanel();
wizardModel.setCurrentPanel(id);
wizardModel.getCurrentPanelDescriptor().aboutToDisplayPanel();
// Show the panel in the dialog.
cardLayout.show(cardPanel, id.toString());
wizardModel.getCurrentPanelDescriptor().displayingPanel();
}
/**
* Method used to listen for property change events from the model and
* update the dialog's graphical components as necessary.
* @param evt PropertyChangeEvent passed from the model to signal that one
* of its properties has changed value.
*/
public void propertyChange(PropertyChangeEvent evt) {
if (evt.getPropertyName().equals(
WizardModel.CURRENT_PANEL_DESCRIPTOR_PROPERTY)) {
wizardController.resetButtonsToPanelRules();
} else if (evt.getPropertyName().equals(
WizardModel.NEXT_FINISH_BUTTON_TEXT_PROPERTY)) {
nextButton.setText(evt.getNewValue().toString());
} else if (evt.getPropertyName().equals(
WizardModel.BACK_BUTTON_TEXT_PROPERTY)) {
backButton.setText(evt.getNewValue().toString());
} else if (evt.getPropertyName().equals(
WizardModel.CANCEL_BUTTON_TEXT_PROPERTY)) {
cancelButton.setText(evt.getNewValue().toString());
} else if (evt.getPropertyName().equals(
WizardModel.NEXT_FINISH_BUTTON_ENABLED_PROPERTY)) {
nextButton.setEnabled(((Boolean)evt.getNewValue()).booleanValue());
} else if (evt.getPropertyName().equals(
WizardModel.BACK_BUTTON_ENABLED_PROPERTY)) {
backButton.setEnabled(((Boolean)evt.getNewValue()).booleanValue());
} else if (evt.getPropertyName().equals(
WizardModel.CANCEL_BUTTON_ENABLED_PROPERTY)) {
cancelButton.setEnabled(((Boolean)evt.getNewValue()).booleanValue());
} else if (evt.getPropertyName().equals(
WizardModel.NEXT_FINISH_BUTTON_ICON_PROPERTY)) {
nextButton.setIcon((Icon)evt.getNewValue());
} else if (evt.getPropertyName().equals(
WizardModel.BACK_BUTTON_ICON_PROPERTY)) {
backButton.setIcon((Icon)evt.getNewValue());
} else if (evt.getPropertyName().equals(
WizardModel.CANCEL_BUTTON_ICON_PROPERTY)) {
cancelButton.setIcon((Icon)evt.getNewValue());
}
}
/**
* Retrieves the last return code set by the dialog.
* @return An integer that identifies how the dialog was closed. See the
* RETURN_CODE constants of this class for possible values.
*/
public int getReturnCode() {
return returnCode;
}
/**
* Mirrors the WizardModel method of the same name.
* @return A boolean indicating if the button is enabled.
*/
public boolean getBackButtonEnabled() {
return wizardModel.getBackButtonEnabled().booleanValue();
}
/**
* Mirrors the WizardModel method of the same name.
* @param newValue The new enabled status of the button.
*/
public void setBackButtonEnabled(boolean newValue) {
wizardModel.setBackButtonEnabled(new Boolean(newValue));
}
/**
* Mirrors the WizardModel method of the same name.
* @return A boolean indicating if the button is enabled.
*/
public boolean getNextFinishButtonEnabled() {
return wizardModel.getNextFinishButtonEnabled().booleanValue();
}
/**
* Mirrors the WizardModel method of the same name.
* @param newValue The new enabled status of the button.
*/
public void setNextFinishButtonEnabled(boolean newValue) {
wizardModel.setNextFinishButtonEnabled(new Boolean(newValue));
}
/**
* Mirrors the WizardModel method of the same name.
* @return A boolean indicating if the button is enabled.
*/
public boolean getCancelButtonEnabled() {
return wizardModel.getCancelButtonEnabled().booleanValue();
}
/**
* Mirrors the WizardModel method of the same name.
* @param newValue The new enabled status of the button.
*/
public void setCancelButtonEnabled(boolean newValue) {
wizardModel.setCancelButtonEnabled(new Boolean(newValue));
}
/**
* Closes the dialog and sets the return code to the integer parameter.
* @param code The return code.
*/
void close(int code) {
WizardPanelDescriptor oldPanelDescriptor
= wizardModel.getCurrentPanelDescriptor();
if (oldPanelDescriptor != null)
oldPanelDescriptor.aboutToHidePanel();
returnCode = code;
wizardDialog.dispose();
}
/**
* This method initializes the components for the wizard dialog: it creates
* a JDialog as a CardLayout panel surrounded by a small amount of space on
* each side, as well as three buttons at the bottom.
*/
private void initComponents() {
wizardModel.addPropertyChangeListener(this);
wizardController = new WizardController(this);
wizardDialog.getContentPane().setLayout(new BorderLayout());
wizardDialog.addWindowListener(this);
/*
* Create the outer wizard panel, which is responsible for three
* buttons: Next, Back, and Cancel. It is also responsible a JPanel
* above them that uses a CardLayout layout manager to display multiple
* panels in the same spot.
*/
JPanel buttonPanel = new JPanel();
JSeparator separator = new JSeparator();
Box buttonBox = new Box(BoxLayout.X_AXIS);
cardPanel = new JPanel();
cardPanel.setBorder(new EmptyBorder(new Insets(5, 10, 5, 10)));
cardLayout = new CardLayout();
cardPanel.setLayout(cardLayout);
backButton = new JButton();
nextButton = new JButton();
cancelButton = new JButton();
backButton.setActionCommand(BACK_BUTTON_ACTION_COMMAND);
nextButton.setActionCommand(NEXT_BUTTON_ACTION_COMMAND);
cancelButton.setActionCommand(CANCEL_BUTTON_ACTION_COMMAND);
backButton.addActionListener(wizardController);
nextButton.addActionListener(wizardController);
cancelButton.addActionListener(wizardController);
// Create the buttons with a separator above them, then place them
// on the east side of the panel with a small amount of space between
// the back and the next button, and a larger amount of space between
// the next button and the cancel button.
buttonPanel.setLayout(new BorderLayout());
buttonPanel.add(separator, BorderLayout.NORTH);
buttonBox.setBorder(new EmptyBorder(new Insets(5, 10, 5, 10)));
buttonBox.add(backButton);
buttonBox.add(Box.createHorizontalStrut(10));
buttonBox.add(nextButton);
buttonBox.add(Box.createHorizontalStrut(30));
buttonBox.add(cancelButton);
buttonPanel.add(buttonBox, java.awt.BorderLayout.EAST);
wizardDialog.getContentPane().add(
buttonPanel, java.awt.BorderLayout.SOUTH);
wizardDialog.getContentPane().add(
cardPanel, java.awt.BorderLayout.CENTER);
}
/**
* If the user presses the close box on the dialog's window, treat it
* as a cancel.
* @param e The event passed in from AWT.
*/
public void windowClosing(WindowEvent e) {
returnCode = CANCEL_RETURN_CODE;
}
static {
try {
PropertyResourceBundle resources = (PropertyResourceBundle)
ResourceBundle.getBundle(
"net.java.sip.communicator.impl.gui.main.customcontrols.wizard.wizard");
BACK_TEXT = (String)(resources.getObject("backButtonText"));
NEXT_TEXT = (String)(resources.getObject("nextButtonText"));
CANCEL_TEXT = (String)(resources.getObject("cancelButtonText"));
FINISH_TEXT = (String)(resources.getObject("finishButtonText"));
} catch (MissingResourceException mre) {
System.out.println(mre);
System.exit(1);
}
}
}

@ -1,132 +0,0 @@
/*
* SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package net.java.sip.communicator.impl.gui.main.customcontrols.wizard;
import java.awt.event.ActionListener;
/**
* This class is responsible for reacting to events generated by pushing any
* of the three buttons, 'Next', 'Previous', and 'Cancel.' Based on what
* button is pressed, the controller will update the model to show a new panel
* and reset the state of the buttons as necessary.
*/
public class WizardController implements ActionListener {
private Wizard wizard;
/**
* This constructor accepts a reference to the Wizard component that created
* it, which it uses to update the button components and access the
* WizardModel.
* @param w A callback to the Wizard component that created this controller.
*/
public WizardController(Wizard w) {
wizard = w;
}
/**
* Calling method for the action listener interface. This class listens for
* actions performed by the buttons in the Wizard class, and calls methods
* below to determine the correct course of action.
* @param evt The ActionEvent that occurred.
*/
public void actionPerformed(java.awt.event.ActionEvent evt) {
if (evt.getActionCommand().equals(
Wizard.CANCEL_BUTTON_ACTION_COMMAND))
cancelButtonPressed();
else if (evt.getActionCommand().equals(
Wizard.BACK_BUTTON_ACTION_COMMAND))
backButtonPressed();
else if (evt.getActionCommand().equals(
Wizard.NEXT_BUTTON_ACTION_COMMAND))
nextButtonPressed();
}
/**
* Closes the wizard by specifying the appropriate return code, when user
* has pressed the "Cancel" button.
*/
private void cancelButtonPressed() {
wizard.close(Wizard.CANCEL_RETURN_CODE);
}
/**
* If it is a finishable panel, closes the dialog. Otherwise, gets the
* ID that the current panel identifies as the next panel, and displays
* the panel that it's identifying.
*/
private void nextButtonPressed() {
WizardModel model = wizard.getModel();
WizardPanelDescriptor descriptor = model.getCurrentPanelDescriptor();
Object nextPanelDescriptor = descriptor.getNextPanelDescriptor();
if (nextPanelDescriptor
instanceof WizardPanelDescriptor.FinishIdentifier) {
wizard.close(Wizard.FINISH_RETURN_CODE);
} else {
wizard.setCurrentPanel(nextPanelDescriptor);
}
}
/**
* Gets the descriptor that the current panel identifies as the previous
* panel, and displays the panel that it's identifying.
*/
private void backButtonPressed() {
WizardModel model = wizard.getModel();
WizardPanelDescriptor descriptor = model.getCurrentPanelDescriptor();
Object backPanelDescriptor = descriptor.getBackPanelDescriptor();
wizard.setCurrentPanel(backPanelDescriptor);
}
/**
* Resets the buttons to support the original panel rules, including
* whether the next or back buttons are enabled or disabled, or if
* the panel is finishable. If the panel in question has another panel
* behind it, enables the back button. Otherwise, disables it. If the
* panel in question has one or more panels in front of it, enables the
* next button. Otherwise, disables it.
*/
void resetButtonsToPanelRules() {
WizardModel model = wizard.getModel();
WizardPanelDescriptor descriptor = model.getCurrentPanelDescriptor();
model.setCancelButtonText(Wizard.CANCEL_TEXT);
model.setBackButtonText(Wizard.BACK_TEXT);
if (descriptor.getBackPanelDescriptor() != null)
model.setBackButtonEnabled(Boolean.TRUE);
else
model.setBackButtonEnabled(Boolean.FALSE);
if (descriptor.getNextPanelDescriptor() != null)
model.setNextFinishButtonEnabled(Boolean.TRUE);
else
model.setNextFinishButtonEnabled(Boolean.FALSE);
if (descriptor.getNextPanelDescriptor()
instanceof WizardPanelDescriptor.FinishIdentifier) {
model.setNextFinishButtonText(Wizard.FINISH_TEXT);
} else {
model.setNextFinishButtonText(Wizard.NEXT_TEXT);
}
}
}

@ -1,389 +0,0 @@
/*
* SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package net.java.sip.communicator.impl.gui.main.customcontrols.wizard;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.util.HashMap;
import javax.swing.Icon;
/**
* The model for the Wizard component, which tracks the text, icons, and
* enabled state of each of the buttons, as well as the current panel that
* is displayed. Note that the model, in its current form, is not intended
* to be subclassed.
*
* @author Yana Stamcheva
*/
public class WizardModel {
/**
* Identification string for the current panel.
*/
public static final String CURRENT_PANEL_DESCRIPTOR_PROPERTY
= "currentPanelDescriptorProperty";
/**
* Property identification String for the Back button's text
*/
public static final String BACK_BUTTON_TEXT_PROPERTY
= "backButtonTextProperty";
/**
* Property identification String for the Back button's icon
*/
public static final String BACK_BUTTON_ICON_PROPERTY
= "backButtonIconProperty";
/**
* Property identification String for the Back button's enabled state
*/
public static final String BACK_BUTTON_ENABLED_PROPERTY
= "backButtonEnabledProperty";
/**
* Property identification String for the Next button's text
*/
public static final String NEXT_FINISH_BUTTON_TEXT_PROPERTY
= "nextButtonTextProperty";
/**
* Property identification String for the Next button's icon
*/
public static final String NEXT_FINISH_BUTTON_ICON_PROPERTY
= "nextButtonIconProperty";
/**
* Property identification String for the Next button's enabled state
*/
public static final String NEXT_FINISH_BUTTON_ENABLED_PROPERTY
= "nextButtonEnabledProperty";
/**
* Property identification String for the Cancel button's text
*/
public static final String CANCEL_BUTTON_TEXT_PROPERTY
= "cancelButtonTextProperty";
/**
* Property identification String for the Cancel button's icon
*/
public static final String CANCEL_BUTTON_ICON_PROPERTY
= "cancelButtonIconProperty";
/**
* Property identification String for the Cancel button's enabled state
*/
public static final String CANCEL_BUTTON_ENABLED_PROPERTY
= "cancelButtonEnabledProperty";
private WizardPanelDescriptor currentPanel;
private HashMap panelHashmap;
private HashMap buttonTextHashmap;
private HashMap buttonIconHashmap;
private HashMap buttonEnabledHashmap;
private PropertyChangeSupport propertyChangeSupport;
/**
* Default constructor.
*/
public WizardModel() {
panelHashmap = new HashMap();
buttonTextHashmap = new HashMap();
buttonIconHashmap = new HashMap();
buttonEnabledHashmap = new HashMap();
propertyChangeSupport = new PropertyChangeSupport(this);
}
/**
* Returns the currently displayed WizardPanelDescriptor.
* @return The currently displayed WizardPanelDescriptor
*/
WizardPanelDescriptor getCurrentPanelDescriptor() {
return currentPanel;
}
/**
* Registers the WizardPanelDescriptor in the model using the
* Object-identifier specified.
* @param id Object-based identifier
* @param descriptor WizardPanelDescriptor that describes the panel
*/
void registerPanel(Object id, WizardPanelDescriptor descriptor) {
// Place a reference to it in a hashtable so we can access it later
// when it is about to be displayed.
panelHashmap.put(id, descriptor);
}
/**
* Sets the current panel to that identified by the Object passed in.
* @param id Object-based panel identifier
* @return boolean indicating success or failure
*/
boolean setCurrentPanel(Object id) {
// First, get the hashtable reference to the panel that should
// be displayed.
WizardPanelDescriptor nextPanel =
(WizardPanelDescriptor)panelHashmap.get(id);
// If we couldn't find the panel that should be displayed, return
// false.
if (nextPanel == null)
throw new WizardPanelNotFoundException();
WizardPanelDescriptor oldPanel = currentPanel;
currentPanel = nextPanel;
if (oldPanel != currentPanel) {
firePropertyChange(CURRENT_PANEL_DESCRIPTOR_PROPERTY,
oldPanel, currentPanel);
}
return true;
}
/**
* Returns the text for the Back button.
* @return the text for the Back button.
*/
Object getBackButtonText() {
return buttonTextHashmap.get(BACK_BUTTON_TEXT_PROPERTY);
}
/**
* Sets the text for the back button.
* @param newText The text to set.
*/
void setBackButtonText(Object newText) {
Object oldText = getBackButtonText();
if (!newText.equals(oldText)) {
buttonTextHashmap.put(BACK_BUTTON_TEXT_PROPERTY, newText);
firePropertyChange(BACK_BUTTON_TEXT_PROPERTY, oldText, newText);
}
}
/**
* Returns the text for the Next/Finish button.
* @return the text for the Next/Finish button.
*/
Object getNextFinishButtonText() {
return buttonTextHashmap.get(NEXT_FINISH_BUTTON_TEXT_PROPERTY);
}
void setNextFinishButtonText(Object newText) {
Object oldText = getNextFinishButtonText();
if (!newText.equals(oldText)) {
buttonTextHashmap.put(NEXT_FINISH_BUTTON_TEXT_PROPERTY, newText);
firePropertyChange(NEXT_FINISH_BUTTON_TEXT_PROPERTY,
oldText, newText);
}
}
/**
* Returns the text for the Cancel button.
* @return the text for the Cancel button.
*/
Object getCancelButtonText() {
return buttonTextHashmap.get(CANCEL_BUTTON_TEXT_PROPERTY);
}
/**
* Sets the text for the Cancel button.
* @param newText The text to set.
*/
void setCancelButtonText(Object newText) {
Object oldText = getCancelButtonText();
if (!newText.equals(oldText)) {
buttonTextHashmap.put(CANCEL_BUTTON_TEXT_PROPERTY, newText);
firePropertyChange(CANCEL_BUTTON_TEXT_PROPERTY, oldText, newText);
}
}
/**
* Returns the icon for the Back button.
* @return the icon for the Back button.
*/
Icon getBackButtonIcon() {
return (Icon)buttonIconHashmap.get(BACK_BUTTON_ICON_PROPERTY);
}
/**
* Sets the icon for the Back button.
* @param newIcon The new icon to set.
*/
void setBackButtonIcon(Icon newIcon) {
Object oldIcon = getBackButtonIcon();
if (!newIcon.equals(oldIcon)) {
buttonIconHashmap.put(BACK_BUTTON_ICON_PROPERTY, newIcon);
firePropertyChange(BACK_BUTTON_ICON_PROPERTY, oldIcon, newIcon);
}
}
/**
* Returns the icon for the Next/Finish button.
* @return the icon for the Next/Finish button.
*/
Icon getNextFinishButtonIcon() {
return (Icon)buttonIconHashmap.get(NEXT_FINISH_BUTTON_ICON_PROPERTY);
}
/**
* Sets the icon for the Next/Finish button.
* @param newIcon The new icon to set.
*/
public void setNextFinishButtonIcon(Icon newIcon) {
Object oldIcon = getNextFinishButtonIcon();
if (!newIcon.equals(oldIcon)) {
buttonIconHashmap.put(NEXT_FINISH_BUTTON_ICON_PROPERTY, newIcon);
firePropertyChange(NEXT_FINISH_BUTTON_ICON_PROPERTY,
oldIcon, newIcon);
}
}
/**
* Returns the icon for the Cancel button.
* @return the icon for the Cancel button.
*/
Icon getCancelButtonIcon() {
return (Icon)buttonIconHashmap.get(CANCEL_BUTTON_ICON_PROPERTY);
}
/**
* Sets the icon for the Cancel button.
* @param newIcon The new icon to set.
*/
void setCancelButtonIcon(Icon newIcon) {
Icon oldIcon = getCancelButtonIcon();
if (!newIcon.equals(oldIcon)) {
buttonIconHashmap.put(CANCEL_BUTTON_ICON_PROPERTY, newIcon);
firePropertyChange(CANCEL_BUTTON_ICON_PROPERTY, oldIcon, newIcon);
}
}
/**
* Checks if the Back button is enabled.
* @return <code>true</code> if the Back button is enabled,
* <code>false</code> otherwise.
*/
Boolean getBackButtonEnabled() {
return (Boolean)buttonEnabledHashmap.get(
BACK_BUTTON_ENABLED_PROPERTY);
}
/**
* Enables or disables the Back button.
* @param newValue <code>true</code> to enable the Back button,
* <code>false</code> to disable it.
*/
void setBackButtonEnabled(Boolean newValue) {
Boolean oldValue = getBackButtonEnabled();
if (newValue != oldValue) {
buttonEnabledHashmap.put(BACK_BUTTON_ENABLED_PROPERTY, newValue);
firePropertyChange(BACK_BUTTON_ENABLED_PROPERTY,
oldValue, newValue);
}
}
/**
* Checks if the Next/Finish button is enabled.
* @return <code>true</code> if the Next/Finish button is enabled,
* <code>false</code> otherwise.
*/
Boolean getNextFinishButtonEnabled() {
return (Boolean)buttonEnabledHashmap.get(
NEXT_FINISH_BUTTON_ENABLED_PROPERTY);
}
/**
* Enables or disables the Next/Finish button.
* @param newValue <code>true</code> to enable the Next/Finish button,
* <code>false</code> to disable it.
*/
void setNextFinishButtonEnabled(Boolean newValue) {
Boolean oldValue = getNextFinishButtonEnabled();
if (newValue != oldValue) {
buttonEnabledHashmap.put(
NEXT_FINISH_BUTTON_ENABLED_PROPERTY, newValue);
firePropertyChange(NEXT_FINISH_BUTTON_ENABLED_PROPERTY,
oldValue, newValue);
}
}
/**
* Checks if the Cancel button is enabled.
* @return <code>true</code> if the Cancel button is enabled,
* <code>false</code> otherwise.
*/
Boolean getCancelButtonEnabled() {
return (Boolean)buttonEnabledHashmap.get(
CANCEL_BUTTON_ENABLED_PROPERTY);
}
/**
* Enables or disables the Cancel button.
* @param newValue <code>true</code> to enable the Cancel button,
* <code>false</code> to disable it.
*/
void setCancelButtonEnabled(Boolean newValue) {
Boolean oldValue = getCancelButtonEnabled();
if (newValue != oldValue) {
buttonEnabledHashmap.put(CANCEL_BUTTON_ENABLED_PROPERTY, newValue);
firePropertyChange(CANCEL_BUTTON_ENABLED_PROPERTY,
oldValue, newValue);
}
}
/**
* Adds a <tt>PropertyChangeListener</tt>
* @param p The <tt>PropertyChangeListener</tt> to add.
*/
public void addPropertyChangeListener(PropertyChangeListener p) {
propertyChangeSupport.addPropertyChangeListener(p);
}
/**
* Removes a <tt>PropertyChangeListener</tt>
* @param p The <tt>PropertyChangeListener</tt> to remove.
*/
public void removePropertyChangeListener(PropertyChangeListener p) {
propertyChangeSupport.removePropertyChangeListener(p);
}
/**
* Informs all<tt>PropertyChangeListener</tt>s that the a given property
* has changed.
* @param propertyName The name of the property.
* @param oldValue The old property value.
* @param newValue The new property value.
*/
protected void firePropertyChange(String propertyName,
Object oldValue, Object newValue) {
propertyChangeSupport.firePropertyChange(propertyName,
oldValue, newValue);
}
}

@ -1,170 +0,0 @@
/*
* SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package net.java.sip.communicator.impl.gui.main.customcontrols.wizard;
import java.awt.*;
import javax.swing.*;
/**
* A base descriptor class used to reference a Component panel for the Wizard,
* as well as provide general rules as to how the panel should behave.
*
* @author Yana Stamcheva
*/
public class WizardPanelDescriptor {
private static final String DEFAULT_PANEL_IDENTIFIER
= "defaultPanelIdentifier";
/**
* Identifier returned by getNextPanelDescriptor() to indicate that this
* is the last panel and the text of the 'Next' button should change to
* 'Finish'.
*/
public static final FinishIdentifier FINISH = new FinishIdentifier();
private Wizard wizard;
private Component targetPanel;
private Object panelIdentifier;
/**
* Default constructor. The id and the Component panel must be set
* separately.
*/
public WizardPanelDescriptor() {
panelIdentifier = DEFAULT_PANEL_IDENTIFIER;
targetPanel = new JPanel();
}
/**
* Constructor which accepts both the Object-based identifier and a
* reference to the Component class which makes up the panel.
* @param id Object-based identifier
* @param panel A class which extends java.awt.Component that will be
* inserted as a panel into the wizard dialog.
*/
public WizardPanelDescriptor(Object id, Component panel) {
panelIdentifier = id;
targetPanel = panel;
}
/**
* Returns to java.awt.Component that serves as the actual panel.
* @return A reference to the java.awt.Component that serves as the panel
*/
public final Component getPanelComponent() {
return targetPanel;
}
/**
* Sets the panel's component as a class that extends java.awt.Component
* @param panel java.awt.Component which serves as the wizard panel
*/
public final void setPanelComponent(Component panel) {
targetPanel = panel;
}
/**
* Returns the unique Object-based identifier for this panel descriptor.
* @return The Object-based identifier
*/
public final Object getPanelDescriptorIdentifier() {
return panelIdentifier;
}
/**
* Sets the Object-based identifier for this panel. The identifier must be unique
* from all the other identifiers in the panel.
* @param id Object-based identifier for this panel.
*/
public final void setPanelDescriptorIdentifier(Object id) {
panelIdentifier = id;
}
final void setWizard(Wizard w) {
wizard = w;
}
/**
* Returns a reference to the Wizard component.
* @return The Wizard class hosting this descriptor.
*/
public final Wizard getWizard() {
return wizard;
}
/**
* Returns a reference to the current WizardModel for this Wizard component.
* @return The current WizardModel for this Wizard component.
*/
public WizardModel getWizardModel() {
return wizard.getModel();
}
// Override this method to provide an Object-based identifier
// for the next panel.
/**
* Override this class to provide the Object-based identifier of the panel
* that the user should traverse to when the Next button is pressed. Note
* that this method is only called when the button is actually pressed, so
* that the panel can change the next panel's identifier dynamically at
* runtime if necessary. Return null if the button should be disabled.
* Returns FinishIdentfier if the button text should change to 'Finish' and
* the dialog should end.
* @return Object-based identifier.
*/
public Object getNextPanelDescriptor() {
return null;
}
// Override this method to provide an Object-based identifier
// for the previous panel.
/**
* Override this class to provide the Object-based identifier of the panel
* that the user should traverse to when the Back button is pressed. Note
* that this method is only called when the button is actually pressed,
* so that the panel can change the previous panel's identifier dynamically
* at runtime if necessary. Return null if the button should be disabled.
* @return Object-based identifier
*/
public Object getBackPanelDescriptor() {
return null;
}
/**
* Override this method to provide functionality that will be performed
* just before the panel is to be displayed.
*/
public void aboutToDisplayPanel() {
}
/**
* Override this method to perform functionality when the panel itself is
* displayed.
*/
public void displayingPanel() {
}
/**
* Override this method to perform functionality just before the panel is
* to be hidden.
*/
public void aboutToHidePanel() {
}
static class FinishIdentifier {
public static final String ID = "FINISH";
}
}

@ -1,21 +0,0 @@
/*
* SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package net.java.sip.communicator.impl.gui.main.customcontrols.wizard;
/**
* A <tt>RuntimeException</tt>, which is thrown if the wizard doesn't find
* the panel corresponding to a given <tt>WizardPanelDescriptor</tt>.
*
* @author Yana Stamcheva
*/
public class WizardPanelNotFoundException extends RuntimeException {
public WizardPanelNotFoundException() {
super();
}
}

@ -1,8 +0,0 @@
#
# wizard.properties
#
backButtonText=Back
nextButtonText=Next
cancelButtonText=Cancel
finishButtonText=Finish

@ -14,7 +14,7 @@
import javax.swing.JMenu;
import javax.swing.JMenuItem;
import net.java.sip.communicator.impl.gui.main.i18n.Messages;
import net.java.sip.communicator.impl.gui.i18n.Messages;
/**
* The <tt>HistoryMenu</tt> is the main menu in the history window.

@ -16,7 +16,7 @@
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import net.java.sip.communicator.impl.gui.main.i18n.Messages;
import net.java.sip.communicator.impl.gui.i18n.Messages;
import net.java.sip.communicator.impl.gui.utils.Constants;
import net.java.sip.communicator.impl.gui.utils.ImageLoader;
import net.java.sip.communicator.service.contactlist.MetaContact;

@ -12,7 +12,7 @@
import javax.swing.JButton;
import javax.swing.JPanel;
import net.java.sip.communicator.impl.gui.main.i18n.Messages;
import net.java.sip.communicator.impl.gui.i18n.Messages;
/**
* The <tt>NavigationPanel</tt> is the panel where user could navigate through
* the message history.

@ -22,7 +22,7 @@
import javax.swing.JRadioButton;
import javax.swing.JTextField;
import net.java.sip.communicator.impl.gui.main.i18n.Messages;
import net.java.sip.communicator.impl.gui.i18n.Messages;
import net.java.sip.communicator.impl.gui.utils.ImageLoader;
/**
* The <tt>SearchPanel</tt> is the panel, where user could make a search in

@ -31,8 +31,8 @@
import javax.swing.JPasswordField;
import javax.swing.KeyStroke;
import net.java.sip.communicator.impl.gui.i18n.Messages;
import net.java.sip.communicator.impl.gui.main.MainFrame;
import net.java.sip.communicator.impl.gui.main.i18n.Messages;
import net.java.sip.communicator.impl.gui.utils.AntialiasingManager;
import net.java.sip.communicator.impl.gui.utils.Constants;
import net.java.sip.communicator.impl.gui.utils.ImageLoader;

@ -15,7 +15,7 @@
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import net.java.sip.communicator.impl.gui.main.customcontrols.SIPCommButton;
import net.java.sip.communicator.impl.gui.customcontrols.SIPCommButton;
import net.java.sip.communicator.impl.gui.utils.ImageLoader;
import net.java.sip.communicator.service.contactlist.MetaContact;
import net.java.sip.communicator.service.protocol.PresenceStatus;

@ -21,8 +21,8 @@
import javax.swing.JPanel;
import javax.swing.border.BevelBorder;
import net.java.sip.communicator.impl.gui.main.customcontrols.SIPCommButton;
import net.java.sip.communicator.impl.gui.main.i18n.Messages;
import net.java.sip.communicator.impl.gui.customcontrols.SIPCommButton;
import net.java.sip.communicator.impl.gui.i18n.Messages;
import net.java.sip.communicator.impl.gui.utils.Constants;
import net.java.sip.communicator.impl.gui.utils.ImageLoader;
import net.java.sip.communicator.service.contactlist.MetaContact;

@ -43,7 +43,7 @@
import javax.swing.text.html.HTMLDocument;
import javax.swing.text.html.HTMLEditorKit;
import net.java.sip.communicator.impl.gui.main.i18n.Messages;
import net.java.sip.communicator.impl.gui.i18n.Messages;
import net.java.sip.communicator.impl.gui.main.message.menu.ChatRightButtonMenu;
import net.java.sip.communicator.impl.gui.utils.AntialiasingManager;
import net.java.sip.communicator.impl.gui.utils.BrowserLauncher;

@ -29,7 +29,7 @@
import javax.swing.text.Element;
import javax.swing.text.html.HTMLDocument;
import net.java.sip.communicator.impl.gui.main.customcontrols.SIPCommSelectorBox;
import net.java.sip.communicator.impl.gui.customcontrols.SIPCommSelectorBox;
import net.java.sip.communicator.impl.gui.utils.Constants;
import net.java.sip.communicator.service.contactlist.MetaContact;
import net.java.sip.communicator.service.gui.ExportedDialog;

@ -24,9 +24,9 @@
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import net.java.sip.communicator.impl.gui.main.customcontrols.SIPCommMsgTextArea;
import net.java.sip.communicator.impl.gui.main.customcontrols.SIPCommSelectorBox;
import net.java.sip.communicator.impl.gui.main.i18n.Messages;
import net.java.sip.communicator.impl.gui.customcontrols.SIPCommMsgTextArea;
import net.java.sip.communicator.impl.gui.customcontrols.SIPCommSelectorBox;
import net.java.sip.communicator.impl.gui.i18n.Messages;
import net.java.sip.communicator.impl.gui.utils.AntialiasingManager;
import net.java.sip.communicator.impl.gui.utils.Constants;
import net.java.sip.communicator.impl.gui.utils.StringUtils;

@ -14,7 +14,6 @@
import java.awt.event.MouseEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.util.Enumeration;
import java.util.Hashtable;
import javax.swing.AbstractAction;
@ -27,11 +26,11 @@
import javax.swing.KeyStroke;
import net.java.sip.communicator.impl.gui.GuiActivator;
import net.java.sip.communicator.impl.gui.customcontrols.SIPCommMsgTextArea;
import net.java.sip.communicator.impl.gui.customcontrols.SIPCommTabbedPane;
import net.java.sip.communicator.impl.gui.customcontrols.events.CloseListener;
import net.java.sip.communicator.impl.gui.i18n.Messages;
import net.java.sip.communicator.impl.gui.main.MainFrame;
import net.java.sip.communicator.impl.gui.main.customcontrols.SIPCommMsgTextArea;
import net.java.sip.communicator.impl.gui.main.customcontrols.SIPCommTabbedPane;
import net.java.sip.communicator.impl.gui.main.customcontrols.events.CloseListener;
import net.java.sip.communicator.impl.gui.main.i18n.Messages;
import net.java.sip.communicator.impl.gui.utils.Constants;
import net.java.sip.communicator.impl.gui.utils.ImageLoader;
import net.java.sip.communicator.service.configuration.ConfigurationService;

@ -12,10 +12,9 @@
import java.util.ArrayList;
import javax.swing.JButton;
import javax.swing.JEditorPane;
import net.java.sip.communicator.impl.gui.main.customcontrols.BoxPopupMenu;
import net.java.sip.communicator.impl.gui.main.customcontrols.ChatToolbarButton;
import net.java.sip.communicator.impl.gui.customcontrols.BoxPopupMenu;
import net.java.sip.communicator.impl.gui.customcontrols.ChatToolbarButton;
import net.java.sip.communicator.impl.gui.utils.ImageLoader;
import net.java.sip.communicator.impl.gui.utils.Smiley;

@ -13,7 +13,7 @@
import javax.swing.JMenuItem;
import javax.swing.JPopupMenu;
import net.java.sip.communicator.impl.gui.main.i18n.Messages;
import net.java.sip.communicator.impl.gui.i18n.Messages;
import net.java.sip.communicator.impl.gui.main.message.ChatWindow;
import net.java.sip.communicator.impl.gui.utils.ImageLoader;

@ -7,16 +7,14 @@
package net.java.sip.communicator.impl.gui.main.message.menu;
import java.awt.Graphics;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.ImageIcon;
import javax.swing.JEditorPane;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
import net.java.sip.communicator.impl.gui.main.i18n.Messages;
import net.java.sip.communicator.impl.gui.i18n.Messages;
import net.java.sip.communicator.impl.gui.main.message.ChatWindow;
import net.java.sip.communicator.impl.gui.utils.ImageLoader;
/**

@ -7,7 +7,6 @@
package net.java.sip.communicator.impl.gui.main.message.menu;
import java.awt.Graphics;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
@ -15,7 +14,7 @@
import javax.swing.JMenu;
import javax.swing.JMenuItem;
import net.java.sip.communicator.impl.gui.main.i18n.Messages;
import net.java.sip.communicator.impl.gui.i18n.Messages;
import net.java.sip.communicator.impl.gui.main.message.ChatWindow;
import net.java.sip.communicator.impl.gui.utils.ImageLoader;
/**

@ -10,7 +10,7 @@
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import net.java.sip.communicator.impl.gui.main.i18n.Messages;
import net.java.sip.communicator.impl.gui.i18n.Messages;
import net.java.sip.communicator.impl.gui.main.message.ChatWindow;
/**
* The <tt>MessageWindowMenuBar</tt> is the menu bar in the chat window where

@ -6,7 +6,7 @@
import javax.swing.JCheckBoxMenuItem;
import javax.swing.JMenu;
import net.java.sip.communicator.impl.gui.main.i18n.Messages;
import net.java.sip.communicator.impl.gui.i18n.Messages;
import net.java.sip.communicator.impl.gui.main.message.ChatWindow;
/**

@ -13,7 +13,7 @@
import javax.swing.JMenuItem;
import javax.swing.JPopupMenu;
import net.java.sip.communicator.impl.gui.main.i18n.Messages;
import net.java.sip.communicator.impl.gui.i18n.Messages;
import net.java.sip.communicator.impl.gui.main.message.ChatWindow;
import net.java.sip.communicator.impl.gui.utils.ImageLoader;

@ -13,8 +13,8 @@
import javax.swing.BorderFactory;
import javax.swing.JComboBox;
import net.java.sip.communicator.impl.gui.main.customcontrols.SIPCommButton;
import net.java.sip.communicator.impl.gui.main.customcontrols.SIPCommToolBar;
import net.java.sip.communicator.impl.gui.customcontrols.SIPCommButton;
import net.java.sip.communicator.impl.gui.customcontrols.SIPCommToolBar;
import net.java.sip.communicator.impl.gui.utils.ImageLoader;
/**

@ -14,11 +14,11 @@
import javax.swing.BorderFactory;
import net.java.sip.communicator.impl.gui.main.customcontrols.ChatToolbarButton;
import net.java.sip.communicator.impl.gui.main.customcontrols.SIPCommButton;
import net.java.sip.communicator.impl.gui.main.customcontrols.SIPCommToolBar;
import net.java.sip.communicator.impl.gui.customcontrols.ChatToolbarButton;
import net.java.sip.communicator.impl.gui.customcontrols.SIPCommButton;
import net.java.sip.communicator.impl.gui.customcontrols.SIPCommToolBar;
import net.java.sip.communicator.impl.gui.i18n.Messages;
import net.java.sip.communicator.impl.gui.main.history.HistoryWindow;
import net.java.sip.communicator.impl.gui.main.i18n.Messages;
import net.java.sip.communicator.impl.gui.main.message.ChatWindow;
import net.java.sip.communicator.impl.gui.main.message.SmiliesSelectorBox;
import net.java.sip.communicator.impl.gui.utils.ImageLoader;

Loading…
Cancel
Save