when debugging an application it is desired to bring the editor window to
foreground when a breakpoint is hit. the current interface for this feature
(org.openide.text.Line.show(int kind)) offers only to request focus to the
editor window (Line.SHOW_GOTO). this is not enough if the editor window is
obscured by other windows on the desktop or if it is minimized to task bar. the
user does not have any visual feedback that the application hangs on a breakpoint.
i suggest to add another constant to the org.netbeans.openide.text.Line class -
SHOW_TOFRONT. using this constant in the Line.show(int kind) method would mean
the editor window is first restored from iconized state (if necessary), brought
to foreground (java.awt.Window.toFront()) and then focused.
module developers (especially debugger) then can use this parameter to implement
the desired behavior.
Created attachment 20786 [details]
req: @since is missing in SHOW_TOFRONT
req: Utilities.toFront does not have any documentation
req: please do not forget about apichanges, increment of module version, etc.
adv: should not the contant be SHOW_TO_FRONT as "to front" are two words?
adv: Should not the toFront method be somewhere in window system api? Might be
useful for giving the window system impl control over what the method does and
text package depends on windows package anyway.
Created attachment 20948 [details]
added a new patch implementing jarda's requirements.
i also moved the fronting implementation to the window system -
i left the constant name intact to make it consistent with existing SHOW_GOTO.
fixed - the patch is integrated into the trunk code
Checking in api/doc/changes/apichanges.xml;
/cvs/openide/api/doc/changes/apichanges.xml,v <-- apichanges.xml
new revision: 1.237; previous revision: 1.236
Checking in src/org/openide/text/EditorSupportLineSet.java;
new revision: 1.42; previous revision: 1.41
Checking in src/org/openide/text/Line.java;
/cvs/openide/src/org/openide/text/Line.java,v <-- Line.java
new revision: 1.31; previous revision: 1.30
Checking in src/org/openide/windows/TopComponent.java;
/cvs/openide/src/org/openide/windows/TopComponent.java,v <-- TopComponent.java
new revision: 1.139; previous revision: 1.138
Checking in src/org/openide/windows/WindowManager.java;
/cvs/openide/src/org/openide/windows/WindowManager.java,v <-- WindowManager.java
new revision: 1.49; previous revision: 1.48
Checking in openide-spec-vers.properties;
/cvs/openide/openide-spec-vers.properties,v <-- openide-spec-vers.properties
new revision: 1.169; previous revision: 1.168