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 3.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. /*
  2. * Copyright (c) 2006-2017 DMDirc Developers
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
  5. * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
  6. * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
  7. * permit persons to whom the Software is furnished to do so, subject to the following conditions:
  8. *
  9. * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
  10. * Software.
  11. *
  12. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  13. * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
  14. * OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  15. * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  16. */
  17. package com.dmdirc.commandparser;
  18. /**
  19. * An enumeration of the types of popup menu which are supported by the PopupManager.
  20. */
  21. public enum PopupType {
  22. /**
  23. * The menu that appears when right clicking in a channel window.
  24. *
  25. * Expected arguments: none.
  26. */
  27. CHAN_NORMAL(0),
  28. /**
  29. * The menu that appears when right clicking in a nickname in a channel window.
  30. *
  31. * Expected arguments: the nickname of the user who was clicked on.
  32. */
  33. CHAN_NICK(1),
  34. /**
  35. * The menu that appears when right clicking in a channel in a channel window.
  36. *
  37. * Expected arguments: the nickname of the user who was clicked on.
  38. */
  39. CHAN_CHANNEL(1),
  40. /**
  41. * The menu that appears when right clicking in a hyperlink in a channel window.
  42. *
  43. * Expected arguments: the hyperlink clicked.
  44. */
  45. CHAN_HYPERLINK(1),
  46. /**
  47. * The menu that appears when right clicking in a query window.
  48. *
  49. * Expected arguments: the nickname of the user who the query is with.
  50. */
  51. QUERY_NORMAL(1),
  52. /**
  53. * The menu that appears when right clicking in a nickname in a query window.
  54. *
  55. * Expected arguments: the nickname of the user who the query is with.
  56. */
  57. QUERY_NICK(1),
  58. /**
  59. * The menu that appears when right clicking in a channel in a query window.
  60. *
  61. * Expected arguments: the nickname of the user who the query is with.
  62. */
  63. QUERY_CHANNEL(1),
  64. /**
  65. * The menu that appears when right clicking in a hyperlink in a query window.
  66. *
  67. * Expected arguments: the hyperlink clicked.
  68. */
  69. QUERY_HYPERLINK(1),
  70. /**
  71. * The menu that appears when right clicking in a server window.
  72. *
  73. * Expected arguments: the nickname of the user who the query is with.
  74. */
  75. SERVER_NORMAL(1),
  76. /**
  77. * The menu that appears when right clicking in a nickname in a server window.
  78. *
  79. * Expected arguments: the nickname of the user who the query is with.
  80. */
  81. SERVER_NICK(1),
  82. /**
  83. * The menu that appears when right clicking in a channel in a server window.
  84. *
  85. * Expected arguments: the nickname of the user who the query is with.
  86. */
  87. SERVER_CHANNEL(1),
  88. /**
  89. * The menu that appears when right clicking in a hyperlink in a server window.
  90. *
  91. * Expected arguments: the hyperlink clicked.
  92. */
  93. SERVER_HYPERLINK(1);
  94. /** The arity (number of expected arguments) of the type. */
  95. private final int arity;
  96. /**
  97. * Creates a new PopupType with the specified arity.
  98. *
  99. * @param arity The arity of the type
  100. */
  101. PopupType(final int arity) {
  102. this.arity = arity;
  103. }
  104. /**
  105. * Retrieves the arity of this type.
  106. *
  107. * @return The arity of this type
  108. */
  109. public int getArity() {
  110. return arity;
  111. }
  112. }