Fix plugin listeners.

cusax-fix
Yana Stamcheva 18 years ago
parent 4b884386ed
commit 5cfe944d37

@ -87,6 +87,8 @@ public void start(BundleContext bundleContext) throws Exception {
finally {
logger.logExit();
}
bundleContext.addServiceListener(uiService);
}
/**

@ -12,8 +12,6 @@
import javax.swing.*;
import org.osgi.framework.*;
import net.java.sip.communicator.impl.gui.event.*;
import net.java.sip.communicator.impl.gui.lookandfeel.*;
import net.java.sip.communicator.impl.gui.main.*;
@ -27,10 +25,11 @@
import net.java.sip.communicator.service.contactlist.*;
import net.java.sip.communicator.service.gui.*;
import net.java.sip.communicator.service.gui.Container;
import net.java.sip.communicator.service.gui.event.*;
import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.util.*;
import org.osgi.framework.*;
/**
* An implementation of the <tt>UIService</tt> that gives access to other
* bundles to this particular swing ui implementation.
@ -360,7 +359,7 @@ private void firePluginEvent( PluginComponent pluginComponent,
= new PluginComponentEvent( pluginComponent,
eventID);
logger.trace("Will dispatch the following plugin component event: "
logger.debug("Will dispatch the following plugin component event: "
+ evt);
synchronized (pluginComponentListeners)
@ -856,7 +855,7 @@ public void serviceChanged(ServiceEvent event)
if (event.getType() == ServiceEvent.REGISTERED)
{
logger
.debug("Handling registration of a new Plugin Component.");
.info("Handling registration of a new Plugin Component.");
if(!(pluginComponent.getComponent() instanceof Component))
{

@ -1298,26 +1298,25 @@ private void initPluginComponents()
logger.error("Could not obtain plugin reference.", exc);
}
if (serRefs == null)
return;
for (int i = 0; i < serRefs.length; i ++)
if (serRefs != null)
{
PluginComponent c = (PluginComponent) GuiActivator
.bundleContext.getService(serRefs[i]);
for (int i = 0; i < serRefs.length; i ++)
{
PluginComponent c = (PluginComponent) GuiActivator
.bundleContext.getService(serRefs[i]);
Object constraints = null;
Object constraints = null;
if (c.getConstraints() != null)
constraints = UIServiceImpl
.getBorderLayoutConstraintsFromContainer(c.getConstraints());
else
constraints = BorderLayout.SOUTH;
if (c.getConstraints() != null)
constraints = UIServiceImpl
.getBorderLayoutConstraintsFromContainer(c.getConstraints());
else
constraints = BorderLayout.SOUTH;
this.getContentPane().add( (Component) c.getComponent(),
constraints);
this.getContentPane().add( (Component) c.getComponent(),
constraints);
}
}
GuiActivator.getUIService().addPluginComponentListener(this);
}

@ -76,7 +76,7 @@ public MainTabbedPane(MainFrame parent) {
this.addChangeListener(this);
GuiActivator.getUIService().addPluginComponentListener(this);
this.initPluginComponents();
}
/**
@ -175,16 +175,16 @@ private void initPluginComponents()
logger.error("Could not obtain plugin reference.", exc);
}
if (serRefs == null)
return;
for (int i = 0; i < serRefs.length; i ++)
if (serRefs != null)
{
PluginComponent component = (PluginComponent) GuiActivator
.bundleContext.getService(serRefs[i]);;
this.addTab(component.getName(),
(Component) component.getComponent());
for (int i = 0; i < serRefs.length; i ++)
{
PluginComponent component = (PluginComponent) GuiActivator
.bundleContext.getService(serRefs[i]);;
this.addTab(component.getName(),
(Component) component.getComponent());
}
}
GuiActivator.getUIService().addPluginComponentListener(this);

@ -138,15 +138,15 @@ private void initPluginComponents()
logger.error("Could not obtain plugin reference.", exc);
}
if (serRefs == null)
return;
for (int i = 0; i < serRefs.length; i ++)
if (serRefs != null)
{
PluginComponent component = (PluginComponent) GuiActivator
.bundleContext.getService(serRefs[i]);;
for (int i = 0; i < serRefs.length; i ++)
{
PluginComponent component = (PluginComponent) GuiActivator
.bundleContext.getService(serRefs[i]);;
this.pluginPanel.add((Component)component.getComponent());
this.pluginPanel.add((Component)component.getComponent());
}
}
GuiActivator.getUIService().addPluginComponentListener(this);

@ -13,23 +13,21 @@
import javax.swing.*;
import org.osgi.framework.*;
import net.java.sip.communicator.impl.gui.*;
import net.java.sip.communicator.impl.gui.customcontrols.*;
import net.java.sip.communicator.impl.gui.customcontrols.events.*;
import net.java.sip.communicator.impl.gui.event.*;
import net.java.sip.communicator.impl.gui.main.*;
import net.java.sip.communicator.impl.gui.main.MainFrame.*;
import net.java.sip.communicator.impl.gui.main.chat.menus.*;
import net.java.sip.communicator.impl.gui.main.chat.toolBars.*;
import net.java.sip.communicator.impl.gui.utils.*;
import net.java.sip.communicator.impl.gui.utils.Constants;
import net.java.sip.communicator.service.gui.*;
import net.java.sip.communicator.service.gui.Container;
import net.java.sip.communicator.service.gui.event.*;
import net.java.sip.communicator.util.*;
import org.osgi.framework.*;
/**
* The chat window is the place, where users can write and send messages, view
* received messages. The ChatWindow supports two modes of use: "Group all
@ -676,18 +674,19 @@ private void initPluginComponents()
logger.error("Could not obtain plugin component reference.", exc);
}
if (serRefs == null)
return;
for (int i = 0; i < serRefs.length; i ++)
if (serRefs != null)
{
PluginComponent c = (PluginComponent) GuiActivator
.bundleContext.getService(serRefs[i]);
Object borderLayoutConstraint = UIServiceImpl
.getBorderLayoutConstraintsFromContainer(c.getConstraints());
for (int i = 0; i < serRefs.length; i ++)
{
PluginComponent c = (PluginComponent) GuiActivator
.bundleContext.getService(serRefs[i]);
this.add((Component)c.getComponent(), borderLayoutConstraint);
Object borderLayoutConstraint = UIServiceImpl
.getBorderLayoutConstraintsFromContainer(c.getConstraints());
this.add((Component)c.getComponent(), borderLayoutConstraint);
}
}
GuiActivator.getUIService().addPluginComponentListener(this);

@ -92,15 +92,15 @@ private void initPluginComponents()
logger.error("Could not obtain plugin reference.", exc);
}
if (serRefs == null)
return;
for (int i = 0; i < serRefs.length; i ++)
if (serRefs != null)
{
PluginComponent component = (PluginComponent) GuiActivator
.bundleContext.getService(serRefs[i]);;
for (int i = 0; i < serRefs.length; i ++)
{
PluginComponent component = (PluginComponent) GuiActivator
.bundleContext.getService(serRefs[i]);;
this.add((Component)component.getComponent());
this.add((Component)component.getComponent());
}
}
GuiActivator.getUIService().addPluginComponentListener(this);

@ -400,18 +400,18 @@ private void initPluginComponents()
logger.error("Could not obtain plugin reference.", exc);
}
if (serRefs == null)
return;
for (int i = 0; i < serRefs.length; i ++)
if (serRefs != null)
{
PluginComponent component = (PluginComponent) GuiActivator
.bundleContext.getService(serRefs[i]);;
for (int i = 0; i < serRefs.length; i ++)
{
PluginComponent component = (PluginComponent) GuiActivator
.bundleContext.getService(serRefs[i]);;
this.add((Component)component.getComponent());
this.add((Component)component.getComponent());
this.revalidate();
this.repaint();
this.revalidate();
this.repaint();
}
}
GuiActivator.getUIService().addPluginComponentListener(this);

@ -403,18 +403,18 @@ private void initPluginComponents()
logger.error("Could not obtain plugin reference.", exc);
}
if (serRefs == null)
return;
for (int i = 0; i < serRefs.length; i ++)
if (serRefs != null)
{
PluginComponent component = (PluginComponent) GuiActivator
.bundleContext.getService(serRefs[i]);;
for (int i = 0; i < serRefs.length; i ++)
{
PluginComponent component = (PluginComponent) GuiActivator
.bundleContext.getService(serRefs[i]);;
this.add((Component)component.getComponent());
this.add((Component)component.getComponent());
this.revalidate();
this.repaint();
this.revalidate();
this.repaint();
}
}
GuiActivator.getUIService().addPluginComponentListener(this);

@ -384,17 +384,17 @@ private void initPluginComponents()
logger.error("Could not obtain plugin reference.", exc);
}
if (serRefs == null)
return;
for (int i = 0; i < serRefs.length; i ++)
if (serRefs != null)
{
PluginComponent component = (PluginComponent) GuiActivator
.bundleContext.getService(serRefs[i]);;
for (int i = 0; i < serRefs.length; i ++)
{
PluginComponent component = (PluginComponent) GuiActivator
.bundleContext.getService(serRefs[i]);;
component.setCurrentContact(contactItem);
component.setCurrentContact(contactItem);
this.add((Component)component.getComponent());
this.add((Component)component.getComponent());
}
}
GuiActivator.getUIService().addPluginComponentListener(this);

@ -166,19 +166,19 @@ private void initPluginComponents()
logger.error("Could not obtain plugin reference.", exc);
}
if (serRefs == null)
return;
for (int i = 0; i < serRefs.length; i ++)
if (serRefs != null)
{
PluginComponent component = (PluginComponent) GuiActivator
.bundleContext.getService(serRefs[i]);;
for (int i = 0; i < serRefs.length; i ++)
{
PluginComponent component = (PluginComponent) GuiActivator
.bundleContext.getService(serRefs[i]);;
component.setCurrentContactGroup(group);
component.setCurrentContactGroup(group);
this.add((Component)component.getComponent());
this.add((Component)component.getComponent());
this.repaint();
this.repaint();
}
}
GuiActivator.getUIService().addPluginComponentListener(this);

@ -212,31 +212,30 @@ else if(selectedValue instanceof MetaContactGroup)
logger.error("Could not obtain plugin reference.", exc);
}
if (serRefs == null)
return;
for (int i = 0; i < serRefs.length; i ++)
if (serRefs != null)
{
PluginComponent component = (PluginComponent) GuiActivator
.bundleContext.getService(serRefs[i]);;
Object selectedValue = mainFrame.getContactListPanel()
.getContactList().getSelectedValue();
if(selectedValue instanceof MetaContact)
{
component.setCurrentContact((MetaContact)selectedValue);
}
else if(selectedValue instanceof MetaContactGroup)
for (int i = 0; i < serRefs.length; i ++)
{
component
.setCurrentContactGroup((MetaContactGroup)selectedValue);
}
PluginComponent component = (PluginComponent) GuiActivator
.bundleContext.getService(serRefs[i]);;
Object selectedValue = mainFrame.getContactListPanel()
.getContactList().getSelectedValue();
if(selectedValue instanceof MetaContact)
{
component.setCurrentContact((MetaContact)selectedValue);
}
else if(selectedValue instanceof MetaContactGroup)
{
component
.setCurrentContactGroup((MetaContactGroup)selectedValue);
}
this.add((Component)component.getComponent());
this.add((Component)component.getComponent());
this.repaint();
this.repaint();
}
}
GuiActivator.getUIService().addPluginComponentListener(this);

@ -91,15 +91,16 @@ private void initPluginComponents()
logger.error("Could not obtain plugin reference.", exc);
}
if (serRefs == null)
return;
for (int i = 0; i < serRefs.length; i ++)
if (serRefs != null)
{
PluginComponent component = (PluginComponent) GuiActivator
.bundleContext.getService(serRefs[i]);;
this.add((Component)component.getComponent());
for (int i = 0; i < serRefs.length; i ++)
{
PluginComponent component = (PluginComponent) GuiActivator
.bundleContext.getService(serRefs[i]);;
this.add((Component)component.getComponent());
}
}
GuiActivator.getUIService().addPluginComponentListener(this);

@ -208,31 +208,30 @@ else if(selectedValue instanceof MetaContactGroup)
logger.error("Could not obtain plugin reference.", exc);
}
if (serRefs == null)
return;
for (int i = 0; i < serRefs.length; i ++)
if (serRefs != null)
{
PluginComponent component = (PluginComponent) GuiActivator
.bundleContext.getService(serRefs[i]);;
Object selectedValue = mainFrame.getContactListPanel()
.getContactList().getSelectedValue();
if(selectedValue instanceof MetaContact)
{
component.setCurrentContact((MetaContact)selectedValue);
}
else if(selectedValue instanceof MetaContactGroup)
for (int i = 0; i < serRefs.length; i ++)
{
component
.setCurrentContactGroup((MetaContactGroup)selectedValue);
}
PluginComponent component = (PluginComponent) GuiActivator
.bundleContext.getService(serRefs[i]);;
Object selectedValue = mainFrame.getContactListPanel()
.getContactList().getSelectedValue();
if(selectedValue instanceof MetaContact)
{
component.setCurrentContact((MetaContact)selectedValue);
}
else if(selectedValue instanceof MetaContactGroup)
{
component
.setCurrentContactGroup((MetaContactGroup)selectedValue);
}
this.add((Component)component.getComponent());
this.add((Component)component.getComponent());
this.repaint();
this.repaint();
}
}
GuiActivator.getUIService().addPluginComponentListener(this);

@ -109,15 +109,15 @@ private void initPluginComponents()
logger.error("Could not obtain plugin reference.", exc);
}
if (serRefs == null)
return;
for (int i = 0; i < serRefs.length; i ++)
if (serRefs != null)
{
PluginComponent component = (PluginComponent) GuiActivator
.bundleContext.getService(serRefs[i]);;
for (int i = 0; i < serRefs.length; i ++)
{
PluginComponent component = (PluginComponent) GuiActivator
.bundleContext.getService(serRefs[i]);;
this.add((Component)component.getComponent());
this.add((Component)component.getComponent());
}
}
GuiActivator.getUIService().addPluginComponentListener(this);

Loading…
Cancel
Save