PageRenderTime 19ms CodeModel.GetById 14ms app.highlight 2ms RepoModel.GetById 2ms 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
  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
 22
 23package sessions;
 24
 25
 26import java.util.Vector;
 27import org.gjt.sp.jedit.EBComponent;
 28import org.gjt.sp.jedit.EBMessage;
 29
 30
 31/**
 32 * This message is sent out on EditBus before the "Session Properties"
 33 * dialog is being displayed for the current session.
 34 * It allows third parties to add custom sesion property panes
 35 * to the dialog, using <code>addPropertyPane()</code> and
 36 * <code>addPropertyGroup()</code>.
 37 */
 38public final class SessionPropertiesShowing extends EBMessage
 39{
 40
 41	SessionPropertiesShowing(EBComponent source, Session session)
 42	{
 43		super(source);
 44		this.session = session;
 45		rootGroup = new SessionPropertyGroup("All Current Session Properties");
 46	}
 47
 48
 49	public final SessionManager getSessionManager()
 50	{
 51		return (SessionManager) getSource();
 52	}
 53
 54
 55	/**
 56	 * Return the session bound to this message.
 57	 */
 58	public final Session getSession()
 59	{
 60		return session;
 61	}
 62
 63
 64	/**
 65	 * Add a session property pane to the Session Properties dialog
 66	 * originating from this message.
 67	 * Note that the same property pane instance cannot be added twice.
 68	 */
 69	public final void addPropertyPane(SessionPropertyPane pane)
 70	{
 71		rootGroup.addPane(pane);
 72	}
 73
 74
 75
 76	/**
 77	 * Add a session property group to the Session Properties dialog
 78	 * originating from this message.
 79	 * Note that the same property group instance cannot be added twice.
 80	 */
 81	public final void addPropertyGroup(SessionPropertyGroup group)
 82	{
 83		rootGroup.addGroup(group);
 84	}
 85
 86
 87	public String paramString()
 88	{
 89		return super.paramString() + ",session=" + session;
 90	}
 91
 92
 93	SessionPropertyGroup getRootGroup()
 94	{
 95		return rootGroup;
 96	}
 97
 98
 99	private Session session;
100	private SessionPropertyGroup rootGroup;
101
102}
103