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.

ComponentInputFrame.java 3.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /*
  2. * Copyright (c) 2006-2013 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.addons.ui_swing.components.frames;
  23. import com.dmdirc.FrameContainer;
  24. import com.dmdirc.WritableFrameContainer;
  25. import com.dmdirc.addons.ui_swing.SwingController;
  26. import com.dmdirc.commandparser.PopupType;
  27. import javax.swing.JComponent;
  28. import javax.swing.JPopupMenu;
  29. import net.miginfocom.swing.MigLayout;
  30. /**
  31. * A component frame that includes an input field (for use with writable
  32. * containers).
  33. */
  34. public class ComponentInputFrame extends InputTextFrame {
  35. /**
  36. * A version number for this class. It should be changed whenever the class
  37. * structure is changed (or anything else that would prevent serialized
  38. * objects being unserialized with the new class).
  39. */
  40. private static final long serialVersionUID = 2;
  41. /** Parent frame container. */
  42. private final FrameContainer owner;
  43. /** Parent controller. */
  44. private final SwingController controller;
  45. /**
  46. * Creates a new instance of CustomInputFrame.
  47. *
  48. * @param owner The frame container that owns this frame
  49. * @param controller Swing controller
  50. */
  51. public ComponentInputFrame(final SwingController controller,
  52. final WritableFrameContainer owner) {
  53. super(controller, owner);
  54. this.controller = controller;
  55. this.owner = owner;
  56. initComponents();
  57. }
  58. /**
  59. * Initialises components in this frame.
  60. */
  61. private void initComponents() {
  62. setLayout(new MigLayout("fill"));
  63. for (JComponent comp : new ComponentCreator().initFrameComponents(this,
  64. controller, owner)) {
  65. add(comp, "wrap, grow");
  66. }
  67. }
  68. /** {@inheritDoc} */
  69. @Override
  70. public PopupType getNicknamePopupType() {
  71. return null;
  72. }
  73. /** {@inheritDoc} */
  74. @Override
  75. public PopupType getChannelPopupType() {
  76. return null;
  77. }
  78. /** {@inheritDoc} */
  79. @Override
  80. public PopupType getHyperlinkPopupType() {
  81. return null;
  82. }
  83. /** {@inheritDoc} */
  84. @Override
  85. public PopupType getNormalPopupType() {
  86. return null;
  87. }
  88. /** {@inheritDoc} */
  89. @Override
  90. public void addCustomPopupItems(final JPopupMenu popupMenu) {
  91. //Add no custom popup items
  92. }
  93. }