--- a/openide.windows/apichanges.xml +++ a/openide.windows/apichanges.xml @@ -50,6 +50,20 @@ Window System API + + + Added method TopComponent.getSubComponents. + + + + + +

The new method can be used to access for example inner tabs in a + multiview window.

+
+ + +
Added method TopComponent.makeBusy(boolean). --- a/openide.windows/manifest.mf +++ a/openide.windows/manifest.mf @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module: org.openide.windows -OpenIDE-Module-Specification-Version: 6.51 +OpenIDE-Module-Specification-Version: 6.52 OpenIDE-Module-Localizing-Bundle: org/openide/windows/Bundle.properties AutoUpdate-Essential-Module: true --- a/openide.windows/src/org/openide/windows/TopComponent.java +++ a/openide.windows/src/org/openide/windows/TopComponent.java @@ -80,13 +80,7 @@ import javax.accessibility.Accessible; import javax.accessibility.AccessibleContext; import javax.accessibility.AccessibleRole; -import javax.swing.AbstractAction; -import javax.swing.Action; -import javax.swing.ActionMap; -import javax.swing.JComponent; -import javax.swing.KeyStroke; -import javax.swing.SwingUtilities; -import javax.swing.Timer; +import javax.swing.*; import javax.swing.plaf.basic.BasicHTML; import javax.swing.text.Keymap; import org.openide.awt.ActionID; @@ -1033,7 +1027,7 @@ public String getHtmlDisplayName() { return htmlDisplayName; } - + /** Sets toolTip for this TopComponent, adds notification * about the change to its WindowManager.TopComponentManager. */ @@ -1394,6 +1388,17 @@ this.nodeName = nodeName; } + /** + * Retrieves sub-components this TopComponent contains. + * + * @return Array of internal sub-components. The default implementation + * returns null. + * @since 6.52 + */ + public SubComponent[] getSubComponents() { + return null; + } + /** Each top component that wishes to be cloned should implement * this interface, so CloneAction can check it and call the cloneComponent * method. @@ -1539,6 +1544,62 @@ public void removePropertyChangeListener(PropertyChangeListener l); } + /** + * Representation of a visual sub-component displayed in a TopComponent, + * for example sub-tabs in a multiview window. + * + * @see #getSubComponents() + * @since 6.52 + */ + public static abstract class SubComponent { + private final String displayName; + private final String description; + private boolean active; + + /** + * C'tor + * @param displayName Subcomponent's display name. + * @param active True if the given sub-component is currently active, + * e.g. multiview sub-tab is selected. + */ + public SubComponent( String displayName, boolean active ) { + this( displayName, null, active ); + } + + /** + * C'tor + * @param displayName Subcomponent's display name. + * @param description Short description to show in a tooltip. + * @param active True if the given sub-component is currently active, + * e.g. multiview sub-tab is selected. + */ + public SubComponent( String displayName, String description, boolean active ) { + this.displayName = displayName; + this.description = description; + this.active = active; + } + + /** + * @return True if this sub-component is the active/selected one. + */ + public final boolean isActive() { + return active; + } + + public final String getDescription() { + return description; + } + + public final String getDisplayName() { + return displayName; + } + + /** + * Make this sub-component the active/selected one. + */ + public abstract void activate(); + } + private class AttentionGetter implements ActionListener { Timer timer = null;