aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/sip/communicator/plugin/advancedconfig
diff options
context:
space:
mode:
authorYana Stamcheva <yana@jitsi.org>2011-02-24 13:48:24 +0000
committerYana Stamcheva <yana@jitsi.org>2011-02-24 13:48:24 +0000
commitbf3fd3dcdaa47ef8a5e246c5af9915e052d7aa74 (patch)
tree80ee644b2be8a865f2c73f77dc42e21a7166d3fd /src/net/java/sip/communicator/plugin/advancedconfig
parent4269c5ff7d9253622fadea90ae5e4bb1f7c154b7 (diff)
downloadjitsi-bf3fd3dcdaa47ef8a5e246c5af9915e052d7aa74.zip
jitsi-bf3fd3dcdaa47ef8a5e246c5af9915e052d7aa74.tar.gz
jitsi-bf3fd3dcdaa47ef8a5e246c5af9915e052d7aa74.tar.bz2
Allow to enable provisioning when you start jitsi for the first time. As part of the solution proposed by Conrad Beckert on dev (subject: "Re: Updates to the Provisioning Plugin").
Diffstat (limited to 'src/net/java/sip/communicator/plugin/advancedconfig')
-rw-r--r--src/net/java/sip/communicator/plugin/advancedconfig/AdvancedConfigActivator.java7
-rw-r--r--src/net/java/sip/communicator/plugin/advancedconfig/AdvancedConfigurationPanel.java76
2 files changed, 75 insertions, 8 deletions
diff --git a/src/net/java/sip/communicator/plugin/advancedconfig/AdvancedConfigActivator.java b/src/net/java/sip/communicator/plugin/advancedconfig/AdvancedConfigActivator.java
index abf9b26..5dfc8e4 100644
--- a/src/net/java/sip/communicator/plugin/advancedconfig/AdvancedConfigActivator.java
+++ b/src/net/java/sip/communicator/plugin/advancedconfig/AdvancedConfigActivator.java
@@ -47,12 +47,7 @@ public class AdvancedConfigActivator
bundleContext
.registerService(
ConfigurationForm.class.getName(),
- new LazyConfigurationForm(
- "net.java.sip.communicator.plugin.advancedconfig.AdvancedConfigurationPanel",
- getClass().getClassLoader(),
- "plugin.advancedconfig.PLUGIN_ICON",
- "service.gui.ADVANCED",
- 300),
+ new AdvancedConfigurationPanel(),
properties);
if (logger.isInfoEnabled())
diff --git a/src/net/java/sip/communicator/plugin/advancedconfig/AdvancedConfigurationPanel.java b/src/net/java/sip/communicator/plugin/advancedconfig/AdvancedConfigurationPanel.java
index ef07e3b..aad5dd9 100644
--- a/src/net/java/sip/communicator/plugin/advancedconfig/AdvancedConfigurationPanel.java
+++ b/src/net/java/sip/communicator/plugin/advancedconfig/AdvancedConfigurationPanel.java
@@ -24,7 +24,9 @@ import org.osgi.framework.*;
*/
public class AdvancedConfigurationPanel
extends TransparentPanel
- implements ServiceListener,
+ implements ConfigurationForm,
+ ConfigurationContainer,
+ ServiceListener,
ListSelectionListener
{
/**
@@ -181,8 +183,20 @@ public class AdvancedConfigurationPanel
break;
}
listModel.add(i, configForm);
+ }
- configList.setSelectedIndex(0);
+ /**
+ * Implements <code>ApplicationWindow.show</code> method.
+ *
+ * @param isVisible specifies whether the frame is to be visible or not.
+ */
+ public void setVisible(boolean isVisible)
+ {
+ if (isVisible && configList.getSelectedIndex() < 0)
+ {
+ this.configList.setSelectedIndex(0);
+ }
+ super.setVisible(isVisible);
}
/**
@@ -306,4 +320,62 @@ public class AdvancedConfigurationPanel
showFormContent(configForm);
}
}
+
+ /**
+ * Selects the given <tt>ConfigurationForm</tt>.
+ *
+ * @param configForm the <tt>ConfigurationForm</tt> to select
+ */
+ public void setSelected(ConfigurationForm configForm)
+ {
+ configList.setSelectedValue(configForm, true);
+ }
+
+ /**
+ * Returns the title of the form.
+ * @return the title of the form
+ */
+ public String getTitle()
+ {
+ return AdvancedConfigActivator.getResources()
+ .getI18NString("service.gui.ADVANCED");
+ }
+
+ /**
+ * Returns the icon of the form.
+ * @return a byte array containing the icon of the form
+ */
+ public byte[] getIcon()
+ {
+ return AdvancedConfigActivator.getResources()
+ .getImageInBytes("plugin.advancedconfig.PLUGIN_ICON");
+ }
+
+ /**
+ * Returns the form component.
+ * @return the form component
+ */
+ public Object getForm()
+ {
+ return this;
+ }
+
+ /**
+ * Returns the index of the form in its parent container.
+ * @return the index of the form in its parent container
+ */
+ public int getIndex()
+ {
+ return 300;
+ }
+
+ /**
+ * Indicates if the form is an advanced form.
+ * @return <tt>true</tt> to indicate that this is an advanced form,
+ * otherwise returns <tt>false</tt>
+ */
+ public boolean isAdvanced()
+ {
+ return true;
+ }
}