aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/sip/communicator/plugin/skinmanager
diff options
context:
space:
mode:
authorVincent Lucas <chenzo@jitsi.org>2012-06-07 12:02:07 +0000
committerVincent Lucas <chenzo@jitsi.org>2012-06-07 12:02:07 +0000
commit5d6b250942bc279f78d755f9e034aaedfcfa58f5 (patch)
treee4a65661999aadef4accd31e9f1bd78d97b44864 /src/net/java/sip/communicator/plugin/skinmanager
parentfb39a5cace8dd9fa4b5f2fadf3b13d384079b083 (diff)
downloadjitsi-5d6b250942bc279f78d755f9e034aaedfcfa58f5.zip
jitsi-5d6b250942bc279f78d755f9e034aaedfcfa58f5.tar.gz
jitsi-5d6b250942bc279f78d755f9e034aaedfcfa58f5.tar.bz2
Adds properties to custom the GUI.
Patch proposed by Vieri (JIRA new feature JITSI-1045).
Diffstat (limited to 'src/net/java/sip/communicator/plugin/skinmanager')
-rw-r--r--src/net/java/sip/communicator/plugin/skinmanager/SkinManagerActivator.java52
1 files changed, 40 insertions, 12 deletions
diff --git a/src/net/java/sip/communicator/plugin/skinmanager/SkinManagerActivator.java b/src/net/java/sip/communicator/plugin/skinmanager/SkinManagerActivator.java
index 9c0fa71..9953a0d 100644
--- a/src/net/java/sip/communicator/plugin/skinmanager/SkinManagerActivator.java
+++ b/src/net/java/sip/communicator/plugin/skinmanager/SkinManagerActivator.java
@@ -7,7 +7,9 @@ package net.java.sip.communicator.plugin.skinmanager;
import java.util.*;
+import net.java.sip.communicator.service.configuration.*;
import net.java.sip.communicator.service.gui.*;
+import net.java.sip.communicator.util.*;
import org.osgi.framework.*;
@@ -31,6 +33,13 @@ public class SkinManagerActivator
private static UIService uiService;
/**
+ * Indicates if the skin manager configuration form should be disabled, i.e.
+ * not visible to the user.
+ */
+ private static final String DISABLED_PROP
+ = "net.java.sip.communicator.plugin.skinconfig.DISABLED";
+
+ /**
* Starts this bundle and adds the
* <td>SkinManagerConfigForm</tt> contained in it to the configuration
* window obtained from the <tt>UIService</tt>.
@@ -42,18 +51,23 @@ public class SkinManagerActivator
{
bundleContext = bc;
- Dictionary<String, String> properties = new Hashtable<String, String>();
- properties.put( ConfigurationForm.FORM_TYPE,
- ConfigurationForm.ADVANCED_TYPE);
- bundleContext.registerService(
- ConfigurationForm.class.getName(),
- new LazyConfigurationForm(
- "net.java.sip.communicator.plugin.skinmanager.SkinManagerPanel",
- getClass().getClassLoader(),
- "plugin.skinmanager.PLUGIN_ICON",
- "plugin.skinmanager.SKINS",
- 1001, true),
- properties);
+ // If the skin manager configuration form is disabled don't continue.
+ if(!getConfigService().getBoolean(DISABLED_PROP, false))
+ {
+ Dictionary<String, String> properties
+ = new Hashtable<String, String>();
+ properties.put( ConfigurationForm.FORM_TYPE,
+ ConfigurationForm.ADVANCED_TYPE);
+ bundleContext.registerService(
+ ConfigurationForm.class.getName(),
+ new LazyConfigurationForm(
+ "net.java.sip.communicator.plugin.skinmanager.SkinManagerPanel",
+ getClass().getClassLoader(),
+ "plugin.skinmanager.PLUGIN_ICON",
+ "plugin.skinmanager.SKINS",
+ 1001, true),
+ properties);
+ }
}
/**
@@ -83,4 +97,18 @@ public class SkinManagerActivator
return uiService;
}
+
+ /**
+ * Returns a reference to a 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 getConfigService()
+ {
+ return ServiceUtils.getService(
+ bundleContext,
+ ConfigurationService.class);
+ }
}