This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
<change>
<api name="editor"/>
<summary>Added a new SHOW_TOFRONT constant to the <code>org.openide.text.Line</code> class.</summary>
<version major="5" minor="8"/>
<date day="21" month="3" year="2005"/>
<compatibility addition="yes"/>
<description>
The new constant is used in the <code>EditorSupportLineSet</code> and brings
editor's parent <code>Window</code> to be fronted above all other top-level windows.
</description>
<class package="org.openide.text" name="Line"/>
<class package="org.openide.text" name="EditorSupportLineSet"/>
<issue number="47825"/>
</change>
<api name="winsys"/>
<summary>Added the <code>TopComponent</code> ability to bring their parent
<code>Window</code> to front of other windows.</summary>
The <code>TopComponent</code> class has a new method <code>toFront()</code>
that attempts to bring the parent <code>Window</code> of the TopComponent to
front of other top-level windows.
The method is implemented in the <code>WindowManager</code> class
using AWT's <code>java.awt.Window#toFront()</code>.
<class package="org.openide.windows" name="TopComponent"/>
<class package="org.openide.windows" name="WindowManager"/>
<issue number="56277"/>
--
editor.getComponent ().requestActive();
editor.getComponent().requestActive();
} else if (kind == SHOW_TOFRONT) {
editor.getComponent().toFront();
/** Same as SHOW_GOTO except that the Window Manager attempts to front the
* editor window (i.e. make it the top most window).
* @see #show(int) <code>show</code>
* @see org.openide.windows.TopComponent#toFront()
* @since 5.8
*/
public final static int SHOW_TOFRONT = 3;
/**
* Attempts to bring the parent <code>Window</code> or <code>Frame</code>
* of this <code>TopComponent<code> to front of other windows.
public void toFront() {
WindowManager.getDefault().topComponentToFront(this);
}
import java.awt.Frame;
import java.awt.Window;
import javax.swing.SwingUtilities;
* Attempts to bring the parent <code>Window</code> of the given <code>TopComponent</code>
* to front of other windows.
* @see java.awt.Window#toFront()
protected void topComponentToFront(TopComponent tc) {
Window parentWindow = SwingUtilities.getWindowAncestor( tc );
// be defensive, although w probably will always be non-null here
if( null != parentWindow ) {
if( parentWindow instanceof Frame ) {
Frame parentFrame = (Frame)parentWindow;
int state = parentFrame.getExtendedState();
if( (state & Frame.ICONIFIED) > 0 )
parentFrame.setExtendedState( state & ~Frame.ICONIFIED );
parentWindow.toFront();