Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

MessageTarget.java 3.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /*
  2. * Copyright (c) 2006-2014 DMDirc Developers
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a copy
  5. * of this software and associated documentation files (the "Software"), to deal
  6. * in the Software without restriction, including without limitation the rights
  7. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8. * copies of the Software, and to permit persons to whom the Software is
  9. * furnished to do so, subject to the following conditions:
  10. *
  11. * The above copyright notice and this permission notice shall be included in
  12. * all copies or substantial portions of the Software.
  13. *
  14. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  20. * SOFTWARE.
  21. */
  22. package com.dmdirc;
  23. import com.dmdirc.commandparser.parsers.CommandParser;
  24. import com.dmdirc.interfaces.config.AggregateConfigProvider;
  25. import com.dmdirc.messages.MessageSinkManager;
  26. import com.dmdirc.ui.input.TabCompleter;
  27. import com.dmdirc.util.URLBuilder;
  28. import net.engio.mbassy.bus.MBassador;
  29. import java.util.Collection;
  30. import javax.annotation.Nullable;
  31. /**
  32. * Defines common methods for objects that you can send messages to (such as channels and queries).
  33. */
  34. public abstract class MessageTarget extends FrameContainer {
  35. /**
  36. * Creates a new MessageTarget.
  37. *
  38. * @param parent The parent of this frame container, if any.
  39. * @param icon The icon to use for this target
  40. * @param name The name of this target
  41. * @param title The title of this target
  42. * @param config The config manager to use for this target
  43. * @param parser The command parser for this container
  44. * @param tabCompleter The tab completer to use
  45. * @param messageSinkManager The sink manager to use to dispatch messages.
  46. * @param urlBuilder The URL builder to use when finding icons.
  47. * @param eventBus The bus to dispatch events on.
  48. * @param components The UI components that this frame requires
  49. *
  50. * @since 0.6.4
  51. */
  52. public MessageTarget(
  53. @Nullable final FrameContainer parent,
  54. final String icon,
  55. final String name,
  56. final String title,
  57. final AggregateConfigProvider config,
  58. final CommandParser parser,
  59. final TabCompleter tabCompleter,
  60. final MessageSinkManager messageSinkManager,
  61. final URLBuilder urlBuilder,
  62. final MBassador eventBus,
  63. final Collection<String> components) {
  64. super(parent, icon, name, title, config, urlBuilder, parser, tabCompleter,
  65. messageSinkManager, eventBus, components);
  66. }
  67. /**
  68. * Sends the specified string as an action (CTCP) to the target that this object represents.
  69. *
  70. * @param action The action to send
  71. */
  72. public abstract void sendAction(final String action);
  73. }