Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

PopupType.java 3.9KB

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