PageRenderTime 37ms CodeModel.GetById 31ms app.highlight 4ms RepoModel.GetById 1ms 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
  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
 20package org.gjt.sp.jedit.msg;
 21
 22import org.gjt.sp.jedit.gui.DockableWindow;
 23import org.gjt.sp.jedit.*;
 24
 25/**
 26 * @deprecated Use the new dockable window API (with the <code>dockables.xml</code>
 27 * file) instead of listening for this message.
 28 */
 29public class CreateDockableWindow extends EBMessage
 30{
 31	/**
 32	 * Creates a dockable window request message.
 33	 * @param view The view
 34	 * @param name The dockable window name
 35	 * @param position The dockable window position
 36	 */
 37	public CreateDockableWindow(View view, String name, String position)
 38	{
 39		super(view);
 40
 41		if(name == null)
 42			throw new NullPointerException("Name must be non-null");
 43
 44		this.name = name;
 45		this.position = position;
 46	}
 47
 48	/**
 49	 * Returns the view involved.
 50	 */
 51	public View getView()
 52	{
 53		return (View)getSource();
 54	}
 55
 56	/**
 57	 * Returns the name of the dockable window to create.
 58	 */
 59	public String getDockableWindowName()
 60	{
 61		return name;
 62	}
 63
 64	/**
 65	 * Sets the dockable window name.
 66	 */
 67	public void setDockableWindow(DockableWindow win)
 68	{
 69		this.win = win;
 70		veto();
 71	}
 72
 73	/**
 74	 * Returns the dockable window, or null if nobody responded to the
 75	 * message.
 76	 */
 77	public DockableWindow getDockableWindow()
 78	{
 79		return win;
 80	}
 81
 82	/**
 83	 * Returns the dockable window position.
 84	 */
 85	public String getPosition()
 86	{
 87		return position;
 88	}
 89
 90	public String paramString()
 91	{
 92		return super.paramString() + ",name=" + name + ",position="
 93			+ position;
 94	}
 95
 96	// private members
 97	private String name;
 98	private String position;
 99	private DockableWindow win;
100}