diff options
author | hristoterezov <hristo@jitsi.org> | 2014-01-08 11:34:39 +0200 |
---|---|---|
committer | hristoterezov <hristo@jitsi.org> | 2014-01-08 11:34:39 +0200 |
commit | 46888b088779c45c1b3e8aadb266e3b8b4e8bb51 (patch) | |
tree | dd177949d67e1d4ac528790d4355091cd7e61324 /src/net/java/sip/communicator/impl/muc | |
parent | 7e68195e19f55f0d5a8e79fe104148d238501adf (diff) | |
download | jitsi-46888b088779c45c1b3e8aadb266e3b8b4e8bb51.zip jitsi-46888b088779c45c1b3e8aadb266e3b8b4e8bb51.tar.gz jitsi-46888b088779c45c1b3e8aadb266e3b8b4e8bb51.tar.bz2 |
Fixes the previous commit.
Diffstat (limited to 'src/net/java/sip/communicator/impl/muc')
-rw-r--r-- | src/net/java/sip/communicator/impl/muc/MUCGroupCustomContactActionService.java | 121 |
1 files changed, 121 insertions, 0 deletions
diff --git a/src/net/java/sip/communicator/impl/muc/MUCGroupCustomContactActionService.java b/src/net/java/sip/communicator/impl/muc/MUCGroupCustomContactActionService.java new file mode 100644 index 0000000..9398c51 --- /dev/null +++ b/src/net/java/sip/communicator/impl/muc/MUCGroupCustomContactActionService.java @@ -0,0 +1,121 @@ +/* + * Jitsi, 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.muc; + +import java.util.*; + +import org.jitsi.service.resources.*; + +import net.java.sip.communicator.service.contactsource.*; +import net.java.sip.communicator.service.customcontactactions.*; +import net.java.sip.communicator.service.protocol.*; + +/** + * Implements <tt>CustomContactActionsService</tt> for the groups of MUC contact + * source. + * + * @author Hristo Terezov + */ +public class MUCGroupCustomContactActionService + implements CustomContactActionsService<ContactSourceService> +{ + /** + * List of custom menu items. + */ + private final List<ContactActionMenuItem<ContactSourceService>> + actionMenuItems + = new LinkedList<ContactActionMenuItem<ContactSourceService>>(); + + public MUCGroupCustomContactActionService() + { + actionMenuItems.add(new MUCActionMenuItems()); + } + + @Override + public Class<ContactSourceService> getContactSourceClass() + { + return ContactSourceService.class; + } + + @Override + public Iterator<ContactAction<ContactSourceService>> + getCustomContactActions() + { + return null; + } + + @Override + public Iterator<ContactActionMenuItem<ContactSourceService>> + getCustomContactActionsMenuItems() + { + return actionMenuItems.iterator(); + } + + /** + * Implements the MUC custom menu items. + */ + private class MUCActionMenuItems + implements ContactActionMenuItem<ContactSourceService> + { + /** + * The resource management service. + */ + private ResourceManagementService resources + = MUCActivator.getResources(); + + @Override + public void actionPerformed(ContactSourceService actionSource) + throws OperationFailedException + { + MUCActivator.getUIService().showAddChatRoomDialog(); + } + + @Override + public byte[] getIcon() + { + return resources.getImageInBytes( + "service.gui.icons.CHAT_ROOM_16x16_ICON"); + } + + @Override + public String getText() + { + return resources.getI18NString("service.gui.MY_CHAT_ROOMS"); + } + + @Override + public boolean isVisible(ContactSourceService actionSource) + { + return actionSource instanceof ChatRoomContactSourceService; + } + + @Override + public char getMnemonics() + { + return resources.getI18nMnemonic("service.gui.MY_CHAT_ROOMS"); + } + + @Override + public boolean isEnabled(ContactSourceService actionSource) + { + return true; + } + + @Override + public boolean isCheckBox() + { + return false; + } + + @Override + public boolean isSelected(ContactSourceService actionSource) + { + return false; + } + + } +} |