aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/sip/communicator/plugin/spellcheck/CheckerToggleButton.java
diff options
context:
space:
mode:
authorPurvesh Sahoo <jimpu2@gmail.com>2011-08-28 03:55:43 +0000
committerPurvesh Sahoo <jimpu2@gmail.com>2011-08-28 03:55:43 +0000
commita4752915054bc9b456d4583e1a596e6f83dbaa6e (patch)
tree64f68904a0ba4cf1f847b49da992d4e3a37976d7 /src/net/java/sip/communicator/plugin/spellcheck/CheckerToggleButton.java
parenta538e0f6e2d8ded78275b49d20d9c224910c7b60 (diff)
downloadjitsi-a4752915054bc9b456d4583e1a596e6f83dbaa6e.zip
jitsi-a4752915054bc9b456d4583e1a596e6f83dbaa6e.tar.gz
jitsi-a4752915054bc9b456d4583e1a596e6f83dbaa6e.tar.bz2
Adds support to uninstall dictionary and persist enable state across reboots.
Diffstat (limited to 'src/net/java/sip/communicator/plugin/spellcheck/CheckerToggleButton.java')
-rw-r--r--src/net/java/sip/communicator/plugin/spellcheck/CheckerToggleButton.java89
1 files changed, 89 insertions, 0 deletions
diff --git a/src/net/java/sip/communicator/plugin/spellcheck/CheckerToggleButton.java b/src/net/java/sip/communicator/plugin/spellcheck/CheckerToggleButton.java
new file mode 100644
index 0000000..0d7840c
--- /dev/null
+++ b/src/net/java/sip/communicator/plugin/spellcheck/CheckerToggleButton.java
@@ -0,0 +1,89 @@
+/*
+ * 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.spellcheck;
+
+import java.awt.event.*;
+
+import javax.swing.*;
+
+import net.java.sip.communicator.service.contactlist.*;
+import net.java.sip.communicator.service.gui.*;
+import net.java.sip.communicator.service.protocol.Contact;
+
+/**
+ * Toggle-able button that sets the spell checker to be either enabled or
+ * disabled.
+ *
+ * @author Damian Johnson
+ */
+public class CheckerToggleButton
+ implements PluginComponent
+{
+ private final JToggleButton toggleButton;
+
+ CheckerToggleButton(final SpellChecker checker)
+ {
+ this.toggleButton =
+ new JToggleButton(Resources.getImage("plugin.spellcheck.DISABLE"));
+ this.toggleButton.setSelectedIcon(Resources
+ .getImage("plugin.spellcheck.ENABLE"));
+ this.toggleButton.setSelected(checker.isEnabled());
+ this.toggleButton.addActionListener(new ActionListener()
+ {
+ public void actionPerformed(ActionEvent event)
+ {
+ checker.setEnabled(toggleButton.isSelected());
+ }
+ });
+ }
+
+ public Object getComponent()
+ {
+ return this.toggleButton;
+ }
+
+ public String getConstraints()
+ {
+ return Container.RIGHT;
+ }
+
+ public Container getContainer()
+ {
+ return Container.CONTAINER_CHAT_TOOL_BAR;
+ }
+
+ public String getName()
+ {
+ return "Spell Checker Toggle";
+ }
+
+ public int getPositionIndex()
+ {
+ return -1;
+ }
+
+ public boolean isNativeComponent()
+ {
+ return false;
+ }
+
+ public void setCurrentContact(MetaContact metaContact)
+ {
+
+ }
+
+ public void setCurrentContactGroup(MetaContactGroup metaGroup)
+ {
+
+ }
+
+ @Override
+ public void setCurrentContact(Contact contact)
+ {
+ // TODO Auto-generated method stub
+
+ }
+}