Slims down the shallow size of the ConfigurationForm implementation of .plugin.notificationconfiguration because it's huge.

cusax-fix
Lyubomir Marinov 18 years ago
parent 16219d3482
commit ecb95161eb

@ -183,7 +183,6 @@ public class ListMulti extends JPanel
{
private MyJTable listMulti;
private ListModel model;
private String colunmToolTips [] = null;
ListMulti(Object columns[], String colunmToolTips [])
{
@ -198,7 +197,6 @@ public class ListMulti extends JPanel
listMulti.getTableHeader().setReorderingAllowed(false);
listMulti.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
this.colunmToolTips = colunmToolTips;
for(int i = 0; i< columns.length; i ++)
{
TableColumn tmp = listMulti.getColumnModel().getColumn(i);

@ -6,7 +6,6 @@
*/
package net.java.sip.communicator.plugin.notificationconfiguration;
import net.java.sip.communicator.service.configuration.*;
import net.java.sip.communicator.service.audionotifier.*;
import net.java.sip.communicator.service.notification.*;
import net.java.sip.communicator.service.gui.*;
@ -20,17 +19,13 @@
*/
public class NotificationConfigurationActivator implements BundleActivator
{
private Logger logger
private final Logger logger
= Logger.getLogger(NotificationConfigurationActivator.class);
public static BundleContext bundleContext;
private static ConfigurationService configService;
private static AudioNotifierService audioService;
private static NotificationService notificationService;
/**
* Starts this bundle and adds the <tt>AudioConfigurationConfigForm</tt>
* contained in it to the configuration window obtained from the
@ -57,27 +52,6 @@ public void stop(BundleContext arg0) throws Exception
{
}
/**
* Returns the <tt>ConfigurationService</tt> obtained from the bundle
* context.
* @return the <tt>ConfigurationService</tt> obtained from the bundle
* context
*/
public static ConfigurationService getConfigurationService()
{
if(configService == null)
{
ServiceReference configReference
= bundleContext.getServiceReference(
ConfigurationService.class.getName());
configService = (ConfigurationService) bundleContext.getService(
configReference);
}
return configService;
}
/**
* Returns the <tt>AudioService</tt> obtained from the bundle
* context.
@ -97,25 +71,25 @@ public static AudioNotifierService getAudioNotifierService()
}
return audioService;
}
/**
* Returns the <tt>NotificationService</tt> obtained from the bundle
* context.
* @return the <tt>NotificationService</tt> obtained from the bundle
* context
* <p>
* <b>Note</b>: No caching of the returned value is made available. Clients
* interested in bringing down the penalties imposed by acquiring the value
* in question should provide it by themselves.
* </p>
*
* @return the <tt>NotificationService</tt> obtained from the bundle context
*/
public static NotificationService getNotificationService()
{
if(notificationService == null)
{
ServiceReference notificationReference
= bundleContext.getServiceReference(
NotificationService.class.getName());
ServiceReference notificationReference =
bundleContext.getServiceReference(NotificationService.class
.getName());
notificationService
= (NotificationService) bundleContext.getService(
notificationReference);
}
return notificationService;
return (NotificationService) bundleContext
.getService(notificationReference);
}
}

@ -4,7 +4,6 @@
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package net.java.sip.communicator.plugin.notificationconfiguration;
import java.awt.*;
@ -37,40 +36,20 @@ public class NotificationConfigurationConfigForm
DocumentListener,
NotificationChangeListener
{
private Logger logger
private final Logger logger
= Logger.getLogger(NotificationConfigurationConfigForm.class);
// Declaration of variables concerning the whole of JPanel
private GridBagConstraints constraints;
private GridBagLayout gridLayoutGlobal = new GridBagLayout();
// Declaration of variables on the table notifications
private Vector dataVector = null;
private ListMulti notificationList;
private JLabel icon1
= new JLabel(new ImageIcon(Resources.getImageInBytes("progIcon")));
private JLabel icon2
= new JLabel(new ImageIcon(Resources.getImageInBytes("popupIcon")));
private JLabel icon3
= new JLabel(new ImageIcon(Resources.getImageInBytes("soundIcon")));
private Object column [] = {"Status", icon1, icon2, icon3, "Event"};
public static final String[] columnToolTips
= {"Enable or disable this feature",
"Execute a program",
"Display a messagebox",
"Play a sound",
"Description of event" };
// Declaration of variables - actions
private GridBagLayout actionsLayout = new GridBagLayout();
private TitledBorder title1;
private JPanel actions = new JPanel();
private JPanel activateDescactivatePanel;
private FlowLayout layoutADP;
private JButton activate;
private JButton desactivate;
@ -82,27 +61,15 @@ public class NotificationConfigurationConfigForm
private JTextField programFileTextField;
private JButton programFileChooser;
private JCheckBox popupCheckBox;
// Declaration of variables - quickControl
private FlowLayout layoutButton = new FlowLayout(FlowLayout.CENTER,2,2);
private TitledBorder title2;
private JPanel quickControl = new JPanel();
private String [] textComboBox
= {"Sounds", "Program Execution", "Messages Popup"};
private JButton turnOnAll;
private JButton turnOffAll;
private JComboBox comboBoxTurnOn;
private JComboBox comboBoxTurnOff;
private JPanel applyPanel = new JPanel();
// private FlowLayout layoutApply = new FlowLayout(FlowLayout.RIGHT, 5,2);
private BorderLayout layoutApply = new BorderLayout(5,2);
private JButton apply;
private JButton restore;
private JFileChooser fileChooserProgram;
private JFileChooser fileChooserSound;
@ -111,16 +78,22 @@ public class NotificationConfigurationConfigForm
private NotificationService notificationService = null;
private NotificationConfigurationConfigForm nC = null;
private boolean noListener = false;
public NotificationConfigurationConfigForm()
{
super();
this.nC = this;
JPanel actions = new JPanel();
GridBagLayout actionsLayout = new GridBagLayout();
JPanel applyPanel = new JPanel();
GridBagLayout gridLayoutGlobal = new GridBagLayout();
JPanel quickControl = new JPanel();
String[] textComboBox =
{ "Sounds", "Program Execution", "Messages Popup" };
// constraints on the table
constraints = new GridBagConstraints();
GridBagConstraints constraints = new GridBagConstraints();
constraints.gridx = 0;
constraints.gridy = 0;
constraints.gridwidth = 1;
@ -128,9 +101,17 @@ public NotificationConfigurationConfigForm()
constraints.weightx = 1.0;
constraints.weighty = 1.0;
constraints.fill = GridBagConstraints.BOTH;
JLabel icon1 =
new JLabel(new ImageIcon(Resources.getImageInBytes("progIcon")));
JLabel icon2 =
new JLabel(new ImageIcon(Resources.getImageInBytes("popupIcon")));
JLabel icon3 =
new JLabel(new ImageIcon(Resources.getImageInBytes("soundIcon")));
Object column[] =
{ "Status", icon1, icon2, icon3, "Event" };
notificationList = new ListMulti(column, columnToolTips);
dataVector = new Vector();
//dataVector.add(row1);
//dataVector.add(row2);
@ -140,12 +121,12 @@ public NotificationConfigurationConfigForm()
this.add(notificationList);
// Initializing variable part of the "actions"
title1 = BorderFactory.createTitledBorder(
TitledBorder title1 = BorderFactory.createTitledBorder(
Resources.getString("actions"));
actions.setBorder(title1);
activateDescactivatePanel = new JPanel();
layoutADP = new FlowLayout(FlowLayout.CENTER);
JPanel activateDescactivatePanel = new JPanel();
FlowLayout layoutADP = new FlowLayout(FlowLayout.CENTER);
layoutADP.setHgap(75);
activateDescactivatePanel.setLayout(layoutADP);
@ -310,9 +291,9 @@ public NotificationConfigurationConfigForm()
turnOffAll.addActionListener(this);
title2 = BorderFactory.createTitledBorder(
TitledBorder title2 = BorderFactory.createTitledBorder(
Resources.getString("quickcontrols"));
quickControl.setLayout(layoutButton);
quickControl.setLayout(new FlowLayout(FlowLayout.CENTER,2,2));
quickControl.setBorder(title2);
quickControl.add(turnOnAll);
quickControl.add(comboBoxTurnOn);
@ -345,7 +326,7 @@ public NotificationConfigurationConfigForm()
restore.addActionListener(this);
apply = new JButton(Resources.getString("apply"));
apply.addActionListener(this);
applyPanel.setLayout(layoutApply);
applyPanel.setLayout(new BorderLayout(5,2));
applyPanel.add(apply, BorderLayout.EAST);
applyPanel.add(restore, BorderLayout.WEST);
gridLayoutGlobal.setConstraints(applyPanel, constraints);

Loading…
Cancel
Save