You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

PopupType.java 4.0KB

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