Your browser does not support JavaScript and this site utilizes JavaScript to build content and provide links to additional information. You should either enable JavaScript in your browser settings or use a browser that supports JavaScript in order to take full advantage of this site.

1 /*2 * The contents of this file are subject to the terms of the Common Development3 * and Distribution License (the License). You may not use this file except in4 * compliance with the License.5 *6 * You can obtain a copy of the License at http://www.netbeans.org/cddl.html7 * or http://www.netbeans.org/cddl.txt.8 *9 * When distributing Covered Code, include this CDDL Header Notice in each file10 * and include the License file at http://www.netbeans.org/cddl.txt.11 * If applicable, add the following below the CDDL Header, with the fields12 * enclosed by brackets [] replaced by your own identifying information:13 * "Portions Copyrighted [year] [name of copyright owner]"14 *15 * The Original Software is NetBeans. The Initial Developer of the Original16 * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun17 * Microsystems, Inc. All Rights Reserved.18 */19 package org.openide.windows;20 21 importjava.awt.Image;22 importjava.awt.Rectangle;23 24 importjava.beans.PropertyChangeListener;25 26 importjava.io.Serializable;27 28 29 /** Instances of this interface represent places or containers30 * which <code>TopComponent</code> has to be added to31 * in order to be managed by window system.32 *33 * <p>There is always present default document mode named "editor".34 * Modules can add their own modes by declaring them using XML.35 * <P>36 * Modules can get a set of current modes by calling37 * {@link WindowManager#getModes}.<p>38 *39 * <p>40 * Each mode must have a unique name.41 *42 * <p><p>43 * <b><font color="red"><em>Important note: Do not provide implementation of this interface unless you are window system provider!</em></font></b>44 */45 publicinterface Mode extendsSerializable {46 /** Name of property for bounds of the mode */47 publicstaticfinalString PROP_BOUNDS = "bounds"; // NOI18N48 49 /** Name of property for the unique programmatic name of this mode.50 * @deprecated Do not use. It is redundant, name can not be changed.*/51 publicstaticfinalString PROP_NAME = "name"; // NOI18N52 53 /** Name of property for the display name of this mode.54 * @deprecated Do not use. It is redundant. */55 publicstaticfinalString PROP_DISPLAY_NAME = "displayName"; // NOI18N56 57 /** @deprecated Only public by accident. */58 59 /* public static final */long serialVersionUID = -2650968323666215654L;60 61 /** Get the diplay name of the mode.62 * This name will be used by a container to create its title.63 * @return human-presentable name of the mode64 * @deprecated Do not use. It is redudant. */65 publicString getDisplayName();66 67 /** Get the programmatic name of the mode.68 * This name should be unique, as it is used to find modes etc.69 * @return programmatic name of the mode */70 publicString getName();71 72 /** Get the icon of the mode. It will be used by component container73 * implementations as the icon (e.g. for display in tabs).74 * @return the icon of the mode (or <code>null</code> if no icon was specified)75 * @deprecated Do not use. It is redundant. */76 publicImage getIcon();77 78 /** Attaches a component to a mode for this workspace.79 * If the component is in different mode on this workspace, it is80 * removed from the original and moved to this one.81 *82 * @param c component83 * @return true if top component was succesfully docked to this mode, false otherwise84 */85 publicboolean dockInto(TopComponent c);86 87 /** Allows implementor to specify some restrictive policy as to which88 * top components can be docked into this mode.89 * @return true if a given top component can be docked into this mode,90 * false otherwise91 */92 publicboolean canDock(TopComponent tc);93 94 /** Sets the bounds of the mode.95 * @param s the bounds for the mode96 */97 publicvoid setBounds(Rectangle s);98 99 /** Getter for current bounds of the mode.100 * @return the bounds of the mode101 */102 publicRectangle getBounds();103 104 /** Getter for asociated workspace.105 * @return The workspace instance to which is this mode asociated.106 * @deprecated Do not use. Worskpaces are not supporeted anymore. */107 publicWorkspace getWorkspace();108 109 /** Get all top components currently docked into this mode.110 * @return the list of components; might be empty, but not null111 */112 publicTopComponent[] getTopComponents();113 114 /** Add a property change listener.115 * @param list the listener to add116 */117 publicvoid addPropertyChangeListener(PropertyChangeListener list);118 119 /** Remove a property change listener.120 * @param list the listener to remove121 */122 publicvoid removePropertyChangeListener(PropertyChangeListener list);123 124 /** Gets selected <code>TopComponent</code> in this mode.125 * @since 4.13 */126 publicTopComponent getSelectedTopComponent();127 }128