1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143
|
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.openide.windows;
import java.awt.Image;
import java.awt.Rectangle;
import java.beans.PropertyChangeListener;
import java.io.Serializable;
/** Instances of this interface represent places or containers
* which <code>TopComponent</code> has to be added to
* in order to be managed by window system.
*
* <p>There is always present default document mode named "editor".
* Modules can add their own modes by declaring them using XML.
* <P>
* Modules can get a set of current modes by calling
* {@link WindowManager#getModes}.<p>
*
* <p>
* Each mode must have a unique name.
*
* <p><p>
* <b><font color="red"><em>Important note: Do not provide implementation of this interface unless you are window system provider!</em></font></b>
*/
public interface Mode extends Serializable {
/** Name of property for bounds of the mode */
public static final String PROP_BOUNDS = "bounds"; // NOI18N
/** Name of property for the unique programmatic name of this mode.
* @deprecated Do not use. It is redundant, name can not be changed.*/
public static final String PROP_NAME = "name"; // NOI18N
/** Name of property for the display name of this mode.
* @deprecated Do not use. It is redundant. */
public static final String PROP_DISPLAY_NAME = "displayName"; // NOI18N
/** @deprecated Only public by accident. */
/* public static final */ long serialVersionUID = -2650968323666215654L;
/** Get the diplay name of the mode.
* This name will be used by a container to create its title.
* @return human-presentable name of the mode
* @deprecated Do not use. It is redudant. */
public String getDisplayName();
/** Get the programmatic name of the mode.
* This name should be unique, as it is used to find modes etc.
* @return programmatic name of the mode */
public String getName();
/** Get the icon of the mode. It will be used by component container
* implementations as the icon (e.g. for display in tabs).
* @return the icon of the mode (or <code>null</code> if no icon was specified)
* @deprecated Do not use. It is redundant. */
public Image getIcon();
/** Attaches a component to a mode for this workspace.
* If the component is in different mode on this workspace, it is
* removed from the original and moved to this one.
*
* @param c component
* @return true if top component was succesfully docked to this mode, false otherwise
*/
public boolean dockInto(TopComponent c);
/** Allows implementor to specify some restrictive policy as to which
* top components can be docked into this mode.
* @return true if a given top component can be docked into this mode,
* false otherwise
*/
public boolean canDock(TopComponent tc);
/** Sets the bounds of the mode.
* @param s the bounds for the mode
*/
public void setBounds(Rectangle s);
/** Getter for current bounds of the mode.
* @return the bounds of the mode
*/
public Rectangle getBounds();
/** Getter for asociated workspace.
* @return The workspace instance to which is this mode asociated.
* @deprecated Do not use. Worskpaces are not supporeted anymore. */
public Workspace getWorkspace();
/** Get all top components currently docked into this mode.
* @return the list of components; might be empty, but not null
*/
public TopComponent[] getTopComponents();
/** Add a property change listener.
* @param list the listener to add
*/
public void addPropertyChangeListener(PropertyChangeListener list);
/** Remove a property change listener.
* @param list the listener to remove
*/
public void removePropertyChangeListener(PropertyChangeListener list);
/** Gets selected <code>TopComponent</code> in this mode.
* @since 4.13 */
public TopComponent getSelectedTopComponent();
/**
* Extension to provide exposure of XML configuration.
*
* @see http://wiki.apidesign.org/wiki/ExtendingInterfaces
* @since 6.82
*/
public interface Xml extends Mode {
/**
* Generates the Mode configuration as XML.
* @return an XML representation of the Mode's configuration.
* @since 6.82
*/
public String toXml();
}
}
|