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.

View | Details | Raw Unified | Return to bug 56277
Collapse All | Expand All

(-)api/doc/changes/apichanges.xml (-2 / +36 lines)
Line 117 Link Here
117
118
    <change>
119
        <api name="editor"/>
120
        <summary>Added a new SHOW_TOFRONT constant to the <code>org.openide.text.Line</code> class.</summary>
121
        <version major="5" minor="8"/>
122
        <date day="21" month="3" year="2005"/>
123
        <compatibility addition="yes"/>
124
        <description>
125
            The new constant is used in the <code>EditorSupportLineSet</code> and brings 
126
            editor's parent <code>Window</code> to be fronted above all other top-level windows.
127
        </description>
128
        <class package="org.openide.text" name="Line"/>
129
        <class package="org.openide.text" name="EditorSupportLineSet"/>
130
        <issue number="47825"/>
131
    </change>
132
    
133
    <change>
134
        <api name="winsys"/>
135
        <summary>Added the <code>TopComponent</code> ability to bring their parent 
136
        <code>Window</code> to front of other windows.</summary>
137
        <version major="5" minor="8"/>
138
        <date day="21" month="3" year="2005"/>
139
        <compatibility addition="yes"/>
140
        <description>
141
            The <code>TopComponent</code> class has a new method <code>toFront()</code>
142
            that attempts to bring the parent <code>Window</code> of the TopComponent to
143
            front of other top-level windows.
144
            The method is implemented in the <code>WindowManager</code> class
145
            using AWT's <code>java.awt.Window#toFront()</code>.
146
        </description>
147
        <class package="org.openide.windows" name="TopComponent"/>
148
        <class package="org.openide.windows" name="WindowManager"/>
149
        <issue number="56277"/>
150
    </change>
151
    
Line 6490 Link Here
6490
6525
    
6491
--
(-)src/org/openide/text/EditorSupportLineSet.java (-2 / +5 lines)
Line 81 Link Here
81
                editor.getComponent ().requestActive();
81
                editor.getComponent().requestActive();
82
--
82
            } else if (kind == SHOW_TOFRONT) {
83
                editor.getComponent().toFront();
84
                editor.getComponent().requestActive();
Line 83 Link Here
86
(-)src/org/openide/text/Line.java (+9 lines)
Line 81 Link Here
81
    
82
    /** Same as SHOW_GOTO except that the Window Manager attempts to front the 
83
     * editor window (i.e. make it the top most window).
84
     * @see #show(int) <code>show</code>
85
     * @see org.openide.windows.TopComponent#toFront()
86
     * @since 5.8
87
     */
88
    public final static int SHOW_TOFRONT     = 3;
89
(-)src/org/openide/windows/TopComponent.java (+9 lines)
Line 556 Link Here
556
    /**
557
     * Attempts to bring the parent <code>Window</code> or <code>Frame</code> 
558
     * of this <code>TopComponent<code> to front of other windows.
559
     * @since 5.8
560
     */
561
    public void toFront() {
562
        WindowManager.getDefault().topComponentToFront(this);
563
    }
564
    
(-)src/org/openide/windows/WindowManager.java (+23 lines)
Line 18 Link Here
18
import java.awt.Frame;
Line 19 Link Here
20
import java.awt.Window;
Line 22 Link Here
24
import javax.swing.SwingUtilities;
Line 380 Link Here
383
    }
384
    
385
    /**
386
     * Attempts to bring the parent <code>Window</code> of the given <code>TopComponent</code>
387
     * to front of other windows.
388
     * @see java.awt.Window#toFront()
389
     * @since 5.8
390
     */
391
    protected void topComponentToFront(TopComponent tc) {
392
        Window parentWindow = SwingUtilities.getWindowAncestor( tc );
393
         // be defensive, although w probably will always be non-null here
394
         if( null != parentWindow ) {
395
            if( parentWindow instanceof Frame ) {
396
                Frame parentFrame = (Frame)parentWindow;
397
                int state = parentFrame.getExtendedState();
398
                if( (state & Frame.ICONIFIED) > 0 )
399
                    parentFrame.setExtendedState( state & ~Frame.ICONIFIED );
400
            }
401
            parentWindow.toFront();
402
        }                

Return to bug 56277