mirror of https://github.com/sipwise/jitsi.git
- Delays the creation of the Options dialog and the loading of the ConfigurationForm implementations (which get listed in the Options dialog).
- Spares a couple of ImageIcon allocations. - Removes unused fields and fixes raw-type warnings in the files touched by the other changes.cusax-fix
parent
3c911f558f
commit
2e83c45aa2
@ -1,65 +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.account;
|
||||
|
||||
import net.java.sip.communicator.impl.gui.*;
|
||||
import net.java.sip.communicator.impl.gui.utils.*;
|
||||
import net.java.sip.communicator.service.gui.*;
|
||||
|
||||
/**
|
||||
* The <tt>AccountsConfigurationForm</tt> is the form where the user could
|
||||
* create, modify or delete an account.
|
||||
*
|
||||
* @author Yana Stamcheva
|
||||
*/
|
||||
public class AccountsConfigurationForm
|
||||
extends AbstractConfigurationForm
|
||||
{
|
||||
private Object form;
|
||||
|
||||
/**
|
||||
* Returns the form of this configuration form.
|
||||
*
|
||||
* @return the form of this configuration form.
|
||||
*/
|
||||
public Object getForm()
|
||||
{
|
||||
if (form == null)
|
||||
form = super.getForm();
|
||||
return form;
|
||||
}
|
||||
|
||||
protected String getFormClassName()
|
||||
{
|
||||
return "net.java.sip.communicator.impl.gui.main.account.AccountsConfigurationPanel";
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the icon of this configuration form.
|
||||
*
|
||||
* @return the icon of this configuration form.
|
||||
*/
|
||||
public byte[] getIcon()
|
||||
{
|
||||
return ImageLoader.getImageInBytes(ImageLoader.ACCOUNT_ICON);
|
||||
}
|
||||
|
||||
public int getIndex()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the title of this configuration form.
|
||||
*
|
||||
* @return the title of this configuration form.
|
||||
*/
|
||||
public String getTitle()
|
||||
{
|
||||
return GuiActivator.getResources()
|
||||
.getI18NString("service.gui.ACCOUNTS");
|
||||
}
|
||||
}
|
||||
@ -1,33 +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.media;
|
||||
|
||||
import net.java.sip.communicator.service.gui.*;
|
||||
|
||||
/**
|
||||
* @author Lubomir Marinov
|
||||
*/
|
||||
public class MediaConfigurationForm
|
||||
extends AbstractConfigurationForm
|
||||
{
|
||||
protected String getFormClassName()
|
||||
{
|
||||
return "net.java.sip.communicator.impl.media.MediaConfigurationPanel";
|
||||
}
|
||||
|
||||
public byte[] getIcon()
|
||||
{
|
||||
return MediaActivator.getResources().getImageInBytes(
|
||||
"plugin.mediaconfig.PLUGIN_ICON");
|
||||
}
|
||||
|
||||
public String getTitle()
|
||||
{
|
||||
return MediaActivator.getResources().getI18NString(
|
||||
"impl.media.configform.TITLE");
|
||||
}
|
||||
}
|
||||
@ -1,45 +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.plugin.keybindingchooser;
|
||||
|
||||
import net.java.sip.communicator.service.gui.*;
|
||||
|
||||
/**
|
||||
* The <tt>ConfigurationForm</tt> that would be added to the settings
|
||||
* configuration to configure the application keybindings.
|
||||
*
|
||||
* @author Damian Johnson
|
||||
* @author Lubomir Marinov
|
||||
*/
|
||||
public class KeybindingsConfigForm
|
||||
extends AbstractConfigurationForm
|
||||
{
|
||||
/**
|
||||
* Implements the <tt>ConfigurationForm.getTitle()</tt> method. Returns the
|
||||
* title of this configuration form.
|
||||
*/
|
||||
public String getTitle()
|
||||
{
|
||||
return KeybindingChooserActivator.getResources().getI18NString(
|
||||
"plugin.keybindings.PLUGIN_NAME");
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements the <tt>ConfigurationForm.getIcon()</tt> method. Returns the
|
||||
* icon of this configuration form.
|
||||
*/
|
||||
public byte[] getIcon()
|
||||
{
|
||||
return KeybindingChooserActivator.getResources().getImageInBytes(
|
||||
"plugin.keybinding.PLUGIN_ICON");
|
||||
}
|
||||
|
||||
protected String getFormClassName()
|
||||
{
|
||||
return "net.java.sip.communicator.plugin.keybindingchooser.KeybindingsConfigPanel";
|
||||
}
|
||||
}
|
||||
@ -1,57 +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.plugin.notificationconfiguration;
|
||||
|
||||
import net.java.sip.communicator.service.gui.*;
|
||||
|
||||
/**
|
||||
* Implements the <code>ConfigurationForm</code> interface in order to allow
|
||||
* integrating the UI of this plug-in into the configuration UI.
|
||||
* <p>
|
||||
* The interface implementation in question is separated from the very UI
|
||||
* implementation in order to allow the <code>ConfigurationForm</code> to be
|
||||
* loaded at startup without creating and loading the very UI implementation.
|
||||
* </p>
|
||||
*
|
||||
* @author Lubomir Marinov
|
||||
*/
|
||||
public class NotificationConfigurationForm
|
||||
implements ConfigurationForm
|
||||
{
|
||||
|
||||
/**
|
||||
* Implements the <tt>ConfigurationForm.getForm()</tt> method. Returns the
|
||||
* component corresponding to this configuration form.
|
||||
*/
|
||||
public Object getForm()
|
||||
{
|
||||
return new NotificationConfigurationPanel();
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements the <tt>ConfigurationForm.getIcon()</tt> method. Returns the
|
||||
* icon of this configuration form.
|
||||
*/
|
||||
public byte[] getIcon()
|
||||
{
|
||||
return Resources.getImageInBytes("plugin.notificationconfig.PLUGIN_ICON");
|
||||
}
|
||||
|
||||
public int getIndex()
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements the <tt>ConfigurationForm.getTitle()</tt> method. Returns the
|
||||
* title of this configuration form.
|
||||
*/
|
||||
public String getTitle()
|
||||
{
|
||||
return Resources.getString("service.gui.NOTIFICATIONS");
|
||||
}
|
||||
}
|
||||
@ -1,46 +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.plugin.pluginmanager;
|
||||
|
||||
import net.java.sip.communicator.service.gui.*;
|
||||
|
||||
/**
|
||||
* The <tt>ConfigurationForm</tt> that would be added in the user interface
|
||||
* configuration window. It contains a list of all installed plug-ins. Allows
|
||||
* installing new plugins and managing the existing ones.
|
||||
*
|
||||
* @author Yana Stamcheva
|
||||
* @author Lubomir Marinov
|
||||
*/
|
||||
public class PluginManagerConfigForm
|
||||
extends AbstractConfigurationForm
|
||||
{
|
||||
|
||||
/**
|
||||
* Implements the <tt>ConfigurationForm.getTitle()</tt> method. Returns the
|
||||
* title of this configuration form.
|
||||
*/
|
||||
public String getTitle()
|
||||
{
|
||||
return Resources.getString("plugin.pluginmanager.PLUGINS");
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements the <tt>ConfigurationForm.getIcon()</tt> method. Returns the
|
||||
* icon of this configuration form.
|
||||
*/
|
||||
public byte[] getIcon()
|
||||
{
|
||||
return Resources.getResources().getImageInBytes(
|
||||
"plugin.pluginmanager.PLUGIN_ICON");
|
||||
}
|
||||
|
||||
protected String getFormClassName()
|
||||
{
|
||||
return "net.java.sip.communicator.plugin.pluginmanager.PluginManagerPanel";
|
||||
}
|
||||
}
|
||||
@ -1,45 +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.service.gui;
|
||||
|
||||
import java.lang.reflect.*;
|
||||
|
||||
/**
|
||||
* @author Lubomir Marinov
|
||||
*/
|
||||
public abstract class AbstractConfigurationForm
|
||||
implements ConfigurationForm
|
||||
{
|
||||
public Object getForm()
|
||||
{
|
||||
Exception exception;
|
||||
try
|
||||
{
|
||||
return Class.forName(getFormClassName(), true,
|
||||
getClass().getClassLoader()).newInstance();
|
||||
}
|
||||
catch (ClassNotFoundException ex)
|
||||
{
|
||||
exception = ex;
|
||||
}
|
||||
catch (IllegalAccessException ex)
|
||||
{
|
||||
exception = ex;
|
||||
}
|
||||
catch (InstantiationException ex)
|
||||
{
|
||||
exception = ex;
|
||||
}
|
||||
throw new UndeclaredThrowableException(exception);
|
||||
}
|
||||
|
||||
protected abstract String getFormClassName();
|
||||
|
||||
public int getIndex()
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,114 @@
|
||||
/*
|
||||
* 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.service.gui;
|
||||
|
||||
import java.lang.reflect.*;
|
||||
|
||||
import net.java.sip.communicator.service.gui.internal.*;
|
||||
import net.java.sip.communicator.service.resources.*;
|
||||
|
||||
/**
|
||||
* @author Lubomir Marinov
|
||||
*/
|
||||
public class LazyConfigurationForm
|
||||
implements ConfigurationForm
|
||||
{
|
||||
private static ResourceManagementService resources;
|
||||
|
||||
private static ResourceManagementService getResources()
|
||||
{
|
||||
if (resources == null)
|
||||
resources =
|
||||
ResourceManagementServiceUtils.getService(GuiServiceActivator
|
||||
.getBundleContext());
|
||||
return resources;
|
||||
}
|
||||
|
||||
private final ClassLoader formClassLoader;
|
||||
|
||||
private final String formClassName;
|
||||
|
||||
private final String iconID;
|
||||
|
||||
private final int index;
|
||||
|
||||
private final String titleID;
|
||||
|
||||
public LazyConfigurationForm(String formClassName,
|
||||
ClassLoader formClassLoader, String iconID, String titleID)
|
||||
{
|
||||
this(formClassName, formClassLoader, iconID, titleID, -1);
|
||||
}
|
||||
|
||||
public LazyConfigurationForm(String formClassName,
|
||||
ClassLoader formClassLoader, String iconID, String titleID, int index)
|
||||
{
|
||||
this.formClassName = formClassName;
|
||||
this.formClassLoader = formClassLoader;
|
||||
this.iconID = iconID;
|
||||
this.titleID = titleID;
|
||||
this.index = index;
|
||||
}
|
||||
|
||||
public Object getForm()
|
||||
{
|
||||
Exception exception;
|
||||
try
|
||||
{
|
||||
return Class
|
||||
.forName(getFormClassName(), true, getFormClassLoader())
|
||||
.newInstance();
|
||||
}
|
||||
catch (ClassNotFoundException ex)
|
||||
{
|
||||
exception = ex;
|
||||
}
|
||||
catch (IllegalAccessException ex)
|
||||
{
|
||||
exception = ex;
|
||||
}
|
||||
catch (InstantiationException ex)
|
||||
{
|
||||
exception = ex;
|
||||
}
|
||||
throw new UndeclaredThrowableException(exception);
|
||||
}
|
||||
|
||||
protected ClassLoader getFormClassLoader()
|
||||
{
|
||||
return formClassLoader;
|
||||
}
|
||||
|
||||
protected String getFormClassName()
|
||||
{
|
||||
return formClassName;
|
||||
}
|
||||
|
||||
public byte[] getIcon()
|
||||
{
|
||||
return getResources().getImageInBytes(getIconID());
|
||||
}
|
||||
|
||||
protected String getIconID()
|
||||
{
|
||||
return iconID;
|
||||
}
|
||||
|
||||
public int getIndex()
|
||||
{
|
||||
return index;
|
||||
}
|
||||
|
||||
public String getTitle()
|
||||
{
|
||||
return getResources().getI18NString(getTitleID());
|
||||
}
|
||||
|
||||
protected String getTitleID()
|
||||
{
|
||||
return titleID;
|
||||
}
|
||||
}
|
||||
@ -1,7 +1,10 @@
|
||||
Bundle-Activator: net.java.sip.communicator.service.gui.internal.GuiServiceActivator
|
||||
Bundle-Name: UI Service
|
||||
Bundle-Description: The User Interface Service.
|
||||
Bundle-Vendor: sip-communicator.org
|
||||
Bundle-Version: 0.0.1
|
||||
System-Bundle: yes
|
||||
Import-Package: org.osgi.framework,
|
||||
net.java.sip.communicator.service.resources
|
||||
Export-Package: net.java.sip.communicator.service.gui,
|
||||
net.java.sip.communicator.service.gui.event
|
||||
|
||||
@ -0,0 +1,33 @@
|
||||
/*
|
||||
* 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.service.gui.internal;
|
||||
|
||||
import org.osgi.framework.*;
|
||||
|
||||
/**
|
||||
* @author Lubomir Marinov
|
||||
*/
|
||||
public class GuiServiceActivator
|
||||
implements BundleActivator
|
||||
{
|
||||
private static BundleContext bundleContext;
|
||||
|
||||
public static BundleContext getBundleContext()
|
||||
{
|
||||
return bundleContext;
|
||||
}
|
||||
|
||||
public void start(BundleContext bundleContext)
|
||||
{
|
||||
GuiServiceActivator.bundleContext = bundleContext;
|
||||
}
|
||||
|
||||
public void stop(BundleContext bundleContext)
|
||||
{
|
||||
if (GuiServiceActivator.bundleContext == bundleContext)
|
||||
GuiServiceActivator.bundleContext = null;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in new issue