PageRenderTime 40ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/bundles/plugins-trunk/Sessions/sessions/SessionPropertiesShowing.java

#
Java | 103 lines | 39 code | 24 blank | 40 comment | 0 complexity | 6a7181f8c4cbdd106e50426a2d1b1978 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. * SessionPropertiesShowing.java - EditBus message
  3. * Copyright (c) 2001 Dirk Moebius
  4. *
  5. * :tabSize=4:indentSize=4:noTabs=false:maxLineLen=0:
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License
  9. * as published by the Free Software Foundation; either version 2
  10. * of the License, or any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  20. */
  21. package sessions;
  22. import java.util.Vector;
  23. import org.gjt.sp.jedit.EBComponent;
  24. import org.gjt.sp.jedit.EBMessage;
  25. /**
  26. * This message is sent out on EditBus before the "Session Properties"
  27. * dialog is being displayed for the current session.
  28. * It allows third parties to add custom sesion property panes
  29. * to the dialog, using <code>addPropertyPane()</code> and
  30. * <code>addPropertyGroup()</code>.
  31. */
  32. public final class SessionPropertiesShowing extends EBMessage
  33. {
  34. SessionPropertiesShowing(EBComponent source, Session session)
  35. {
  36. super(source);
  37. this.session = session;
  38. rootGroup = new SessionPropertyGroup("All Current Session Properties");
  39. }
  40. public final SessionManager getSessionManager()
  41. {
  42. return (SessionManager) getSource();
  43. }
  44. /**
  45. * Return the session bound to this message.
  46. */
  47. public final Session getSession()
  48. {
  49. return session;
  50. }
  51. /**
  52. * Add a session property pane to the Session Properties dialog
  53. * originating from this message.
  54. * Note that the same property pane instance cannot be added twice.
  55. */
  56. public final void addPropertyPane(SessionPropertyPane pane)
  57. {
  58. rootGroup.addPane(pane);
  59. }
  60. /**
  61. * Add a session property group to the Session Properties dialog
  62. * originating from this message.
  63. * Note that the same property group instance cannot be added twice.
  64. */
  65. public final void addPropertyGroup(SessionPropertyGroup group)
  66. {
  67. rootGroup.addGroup(group);
  68. }
  69. public String paramString()
  70. {
  71. return super.paramString() + ",session=" + session;
  72. }
  73. SessionPropertyGroup getRootGroup()
  74. {
  75. return rootGroup;
  76. }
  77. private Session session;
  78. private SessionPropertyGroup rootGroup;
  79. }