Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

CustomInputFrame.java 3.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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.addons.ui_swing.components.frames;
  23. import com.dmdirc.addons.ui_swing.components.inputfields.SwingInputField;
  24. import com.dmdirc.commandparser.PopupType;
  25. import com.dmdirc.interfaces.WindowModel;
  26. import javax.inject.Provider;
  27. import javax.swing.JPopupMenu;
  28. import net.miginfocom.swing.MigLayout;
  29. /**
  30. * A custom frame that includes an input field (for use with writable containers).
  31. */
  32. public class CustomInputFrame extends InputTextFrame {
  33. /** A version number for this class. */
  34. private static final long serialVersionUID = 2;
  35. /**
  36. * Creates a new instance of CustomInputFrame.
  37. *
  38. * @param deps The dependencies required by text frames.
  39. * @param inputFieldProvider The provider to use to create a new input field.
  40. * @param owner The frame container that owns this frame
  41. */
  42. public CustomInputFrame(
  43. final TextFrameDependencies deps,
  44. final Provider<SwingInputField> inputFieldProvider,
  45. final InputTextFramePasteActionFactory inputTextFramePasteActionFactory,
  46. final WindowModel owner) {
  47. super(deps, inputFieldProvider, inputTextFramePasteActionFactory, owner);
  48. initComponents();
  49. }
  50. /**
  51. * Initialises the instance, adding any required listeners.
  52. */
  53. @Override
  54. public void init() {
  55. // TODO: Move adding listeners and things to here
  56. super.init();
  57. }
  58. /**
  59. * Initialises components in this frame.
  60. */
  61. private void initComponents() {
  62. setLayout(new MigLayout("ins 0, fill, hidemode 3, wrap 1"));
  63. add(getTextPane(), "grow, push");
  64. add(getSearchBar(), "growx, pushx");
  65. add(inputPanel, "growx, pushx");
  66. }
  67. @Override
  68. public PopupType getNicknamePopupType() {
  69. return null;
  70. }
  71. @Override
  72. public PopupType getChannelPopupType() {
  73. return null;
  74. }
  75. @Override
  76. public PopupType getHyperlinkPopupType() {
  77. return null;
  78. }
  79. @Override
  80. public PopupType getNormalPopupType() {
  81. return null;
  82. }
  83. @Override
  84. public void addCustomPopupItems(final JPopupMenu popupMenu) {
  85. //Add no custom popup items
  86. }
  87. }