PageRenderTime 34ms CodeModel.GetById 7ms RepoModel.GetById 0ms app.codeStats 0ms

/jEdit/tags/jedit-4-0-pre5/org/gjt/sp/jedit/msg/CreateDockableWindow.java

#
Java | 100 lines | 43 code | 12 blank | 45 comment | 2 complexity | 46698fc40752b222ba808b7e3a925c04 MD5 | raw file
Possible License(s): BSD-3-Clause, AGPL-1.0, Apache-2.0, LGPL-2.0, LGPL-3.0, GPL-2.0, CC-BY-SA-3.0, LGPL-2.1, GPL-3.0, MPL-2.0-no-copyleft-exception, IPL-1.0
  1. /*
  2. * CreateDockableWindow.java - Message requesting a dockable window
  3. * Copyright (C) 2000 Slava Pestov
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU General Public License
  7. * as published by the Free Software Foundation; either version 2
  8. * of the License, or any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program; if not, write to the Free Software
  17. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  18. */
  19. package org.gjt.sp.jedit.msg;
  20. import org.gjt.sp.jedit.gui.DockableWindow;
  21. import org.gjt.sp.jedit.*;
  22. /**
  23. * @deprecated Use the new dockable window API (with the <code>dockables.xml</code>
  24. * file) instead of listening for this message.
  25. */
  26. public class CreateDockableWindow extends EBMessage
  27. {
  28. /**
  29. * Creates a dockable window request message.
  30. * @param view The view
  31. * @param name The dockable window name
  32. * @param position The dockable window position
  33. */
  34. public CreateDockableWindow(View view, String name, String position)
  35. {
  36. super(view);
  37. if(name == null)
  38. throw new NullPointerException("Name must be non-null");
  39. this.name = name;
  40. this.position = position;
  41. }
  42. /**
  43. * Returns the view involved.
  44. */
  45. public View getView()
  46. {
  47. return (View)getSource();
  48. }
  49. /**
  50. * Returns the name of the dockable window to create.
  51. */
  52. public String getDockableWindowName()
  53. {
  54. return name;
  55. }
  56. /**
  57. * Sets the dockable window name.
  58. */
  59. public void setDockableWindow(DockableWindow win)
  60. {
  61. this.win = win;
  62. veto();
  63. }
  64. /**
  65. * Returns the dockable window, or null if nobody responded to the
  66. * message.
  67. */
  68. public DockableWindow getDockableWindow()
  69. {
  70. return win;
  71. }
  72. /**
  73. * Returns the dockable window position.
  74. */
  75. public String getPosition()
  76. {
  77. return position;
  78. }
  79. public String paramString()
  80. {
  81. return super.paramString() + ",name=" + name + ",position="
  82. + position;
  83. }
  84. // private members
  85. private String name;
  86. private String position;
  87. private DockableWindow win;
  88. }