aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/sip/communicator/plugin/advancedconfig
diff options
context:
space:
mode:
authorYana Stamcheva <yana@jitsi.org>2011-06-21 14:59:42 +0000
committerYana Stamcheva <yana@jitsi.org>2011-06-21 14:59:42 +0000
commit76c5df100be8a1fefe098c725bacb3a16766c059 (patch)
treee748681dfee8216e0e13e75b5ff153b1404761f5 /src/net/java/sip/communicator/plugin/advancedconfig
parent76cecff08d03207c38e32abd8ec81852d5521fb7 (diff)
downloadjitsi-76c5df100be8a1fefe098c725bacb3a16766c059.zip
jitsi-76c5df100be8a1fefe098c725bacb3a16766c059.tar.gz
jitsi-76c5df100be8a1fefe098c725bacb3a16766c059.tar.bz2
Adds a configuration property allowing to enable/disable different configuration forms from provisioning.
Diffstat (limited to 'src/net/java/sip/communicator/plugin/advancedconfig')
-rw-r--r--src/net/java/sip/communicator/plugin/advancedconfig/AdvancedConfigActivator.java38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/net/java/sip/communicator/plugin/advancedconfig/AdvancedConfigActivator.java b/src/net/java/sip/communicator/plugin/advancedconfig/AdvancedConfigActivator.java
index 5dfc8e4..3423e45 100644
--- a/src/net/java/sip/communicator/plugin/advancedconfig/AdvancedConfigActivator.java
+++ b/src/net/java/sip/communicator/plugin/advancedconfig/AdvancedConfigActivator.java
@@ -2,6 +2,7 @@ package net.java.sip.communicator.plugin.advancedconfig;
import java.util.*;
+import net.java.sip.communicator.service.configuration.*;
import net.java.sip.communicator.service.gui.*;
import net.java.sip.communicator.service.resources.*;
import net.java.sip.communicator.util.*;
@@ -32,6 +33,20 @@ public class AdvancedConfigActivator
private static ResourceManagementService resourceService;
/**
+ * The <tt>ConfigurationService</tt> registered in {@link #bundleContext}
+ * and used by the <tt>SecurityConfigActivator</tt> instance to read and
+ * write configuration properties.
+ */
+ private static ConfigurationService configurationService;
+
+ /**
+ * Indicates if the advanced configuration form should be disabled, i.e.
+ * not visible to the user.
+ */
+ private static final String DISABLED_PROP
+ = "net.java.sip.communicator.plugin.advancedconfig.DISABLED";
+
+ /**
* Starts this bundle.
* @param bc the bundle context
* @throws Exception if something goes wrong
@@ -41,6 +56,10 @@ public class AdvancedConfigActivator
{
bundleContext = bc;
+ // If the notification configuration form is disabled don't continue.
+ if (getConfigurationService().getBoolean(DISABLED_PROP, false))
+ return;
+
Dictionary<String, String> properties = new Hashtable<String, String>();
properties.put( ConfigurationForm.FORM_TYPE,
ConfigurationForm.GENERAL_TYPE);
@@ -74,4 +93,23 @@ public class AdvancedConfigActivator
= ResourceManagementServiceUtils.getService(bundleContext);
return resourceService;
}
+
+ /**
+ * Returns a reference to the ConfigurationService implementation currently
+ * registered in the bundle context or null if no such implementation was
+ * found.
+ *
+ * @return a currently valid implementation of the ConfigurationService.
+ */
+ public static ConfigurationService getConfigurationService()
+ {
+ if (configurationService == null)
+ {
+ configurationService
+ = ServiceUtils.getService(
+ bundleContext,
+ ConfigurationService.class);
+ }
+ return configurationService;
+ }
}