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.

PopupType.java 3.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. /*
  2. * Copyright (c) 2006-2015 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.commandparser;
  23. /**
  24. * An enumeration of the types of popup menu which are supported by the PopupManager.
  25. */
  26. public enum PopupType {
  27. /**
  28. * The menu that appears when right clicking in a channel window.
  29. *
  30. * Expected arguments: none.
  31. */
  32. CHAN_NORMAL(0),
  33. /**
  34. * The menu that appears when right clicking in a nickname in a channel window.
  35. *
  36. * Expected arguments: the nickname of the user who was clicked on.
  37. */
  38. CHAN_NICK(1),
  39. /**
  40. * The menu that appears when right clicking in a channel in a channel window.
  41. *
  42. * Expected arguments: the nickname of the user who was clicked on.
  43. */
  44. CHAN_CHANNEL(1),
  45. /**
  46. * The menu that appears when right clicking in a hyperlink in a channel window.
  47. *
  48. * Expected arguments: the hyperlink clicked.
  49. */
  50. CHAN_HYPERLINK(1),
  51. /**
  52. * The menu that appears when right clicking in a query window.
  53. *
  54. * Expected arguments: the nickname of the user who the query is with.
  55. */
  56. QUERY_NORMAL(1),
  57. /**
  58. * The menu that appears when right clicking in a nickname in a query window.
  59. *
  60. * Expected arguments: the nickname of the user who the query is with.
  61. */
  62. QUERY_NICK(1),
  63. /**
  64. * The menu that appears when right clicking in a channel in a query window.
  65. *
  66. * Expected arguments: the nickname of the user who the query is with.
  67. */
  68. QUERY_CHANNEL(1),
  69. /**
  70. * The menu that appears when right clicking in a hyperlink in a query window.
  71. *
  72. * Expected arguments: the hyperlink clicked.
  73. */
  74. QUERY_HYPERLINK(1),
  75. /**
  76. * The menu that appears when right clicking in a server window.
  77. *
  78. * Expected arguments: the nickname of the user who the query is with.
  79. */
  80. SERVER_NORMAL(1),
  81. /**
  82. * The menu that appears when right clicking in a nickname in a server window.
  83. *
  84. * Expected arguments: the nickname of the user who the query is with.
  85. */
  86. SERVER_NICK(1),
  87. /**
  88. * The menu that appears when right clicking in a channel in a server window.
  89. *
  90. * Expected arguments: the nickname of the user who the query is with.
  91. */
  92. SERVER_CHANNEL(1),
  93. /**
  94. * The menu that appears when right clicking in a hyperlink in a server window.
  95. *
  96. * Expected arguments: the hyperlink clicked.
  97. */
  98. SERVER_HYPERLINK(1);
  99. /** The arity (number of expected arguments) of the type. */
  100. private final int arity;
  101. /**
  102. * Creates a new PopupType with the specified arity.
  103. *
  104. * @param arity The arity of the type
  105. */
  106. PopupType(final int arity) {
  107. this.arity = arity;
  108. }
  109. /**
  110. * Retrieves the arity of this type.
  111. *
  112. * @return The arity of this type
  113. */
  114. public int getArity() {
  115. return arity;
  116. }
  117. }