Index: src/org/openide/text/EditorSupportLineSet.java =================================================================== RCS file: /cvs/openide/src/org/openide/text/EditorSupportLineSet.java,v retrieving revision 1.41 diff -u -r1.41 EditorSupportLineSet.java --- src/org/openide/text/EditorSupportLineSet.java 22 Jan 2005 15:52:18 -0000 1.41 +++ src/org/openide/text/EditorSupportLineSet.java 11 Mar 2005 13:59:35 -0000 @@ -13,12 +13,11 @@ package org.openide.text; -import org.openide.util.WeakListeners; -import java.io.*; import java.util.*; import javax.swing.event.*; import javax.swing.text.StyledDocument; import javax.swing.text.Position; +import org.openide.util.Utilities; /** Line set for an EditorSupport. * @@ -78,6 +77,9 @@ CloneableEditorSupport.Pane editor = support.openAt(pos, column); if (kind == SHOW_GOTO) { + editor.getComponent ().requestActive(); + } else if (kind == SHOW_TOFRONT ) { + Utilities.toFront( editor.getComponent() ); editor.getComponent ().requestActive(); } } Index: src/org/openide/text/Line.java =================================================================== RCS file: /cvs/openide/src/org/openide/text/Line.java,v retrieving revision 1.30 diff -u -r1.30 Line.java --- src/org/openide/text/Line.java 13 Oct 2004 13:07:16 -0000 1.30 +++ src/org/openide/text/Line.java 11 Mar 2005 09:23:53 -0000 @@ -79,6 +79,13 @@ */ public final static int SHOW_GOTO = 2; + /** 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) show + * @see java.awt.Window#toFront() + */ + public final static int SHOW_TOFRONT = 3; + /** Instance of null implementation of Line.Part */ static final private Line.Part nullPart = new Line.NullPart(); Index: src/org/openide/util/Utilities.java =================================================================== RCS file: /cvs/openide/src/org/openide/util/Utilities.java,v retrieving revision 1.148 diff -u -r1.148 Utilities.java --- src/org/openide/util/Utilities.java 3 Feb 2005 16:23:01 -0000 1.148 +++ src/org/openide/util/Utilities.java 11 Mar 2005 14:00:56 -0000 @@ -17,9 +17,6 @@ import java.awt.event.KeyEvent; import java.awt.event.ActionListener; import java.awt.event.ActionEvent; -import java.awt.event.FocusListener; -import java.beans.PropertyChangeListener; -import java.beans.VetoableChangeListener; import java.util.*; import java.util.List; import java.lang.reflect.*; @@ -35,13 +32,12 @@ import javax.swing.Action; import javax.swing.JMenuItem; import javax.swing.KeyStroke; +import javax.swing.SwingUtilities; import javax.swing.Timer; -import javax.swing.event.ChangeListener; -import javax.swing.event.DocumentListener; import org.openide.ErrorManager; -import org.openide.util.ContextAwareAction; + /** Otherwise uncategorized useful static methods. * @@ -2520,5 +2516,19 @@ // not a file: URL return null; } + } + + public static void toFront( Component component ) { + Window parentWindow = SwingUtilities.getWindowAncestor( component ); + // 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(); + } } }