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.

Bug 56277

Summary: allow editor window to be fronted when a breakpoint is hit
Product: platform Reporter: Stanislav Aubrecht <saubrecht>
Component: Window SystemAssignee: Stanislav Aubrecht <saubrecht>
Status: RESOLVED FIXED    
Severity: blocker CC: apireviews
Priority: P3 Keywords: API_REVIEW_FAST
Version: 4.x   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:
Bug Depends on:    
Bug Blocks: 47825    
Attachments: Proposed fix
Improved patch

Description Stanislav Aubrecht 2005-03-11 14:22:40 UTC
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.
Comment 1 Stanislav Aubrecht 2005-03-11 14:25:12 UTC
Created attachment 20786 [details]
Proposed fix
Comment 2 Jaroslav Tulach 2005-03-15 08:56:24 UTC
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.
Comment 3 Stanislav Aubrecht 2005-03-18 11:24:25 UTC
Created attachment 20948 [details]
Improved patch
Comment 4 Stanislav Aubrecht 2005-03-18 11:27:22 UTC
added a new patch implementing jarda's requirements.
i also moved the fronting implementation to the window system -
TopComponent/WindowManager.

i left the constant name intact to make it consistent with existing SHOW_GOTO.
Comment 5 Stanislav Aubrecht 2005-03-22 08:28:28 UTC
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
done
Checking in src/org/openide/text/EditorSupportLineSet.java;
/cvs/openide/src/org/openide/text/EditorSupportLineSet.java,v  <-- 
EditorSupportLineSet.java
new revision: 1.42; previous revision: 1.41
done
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
done
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
done
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
done
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
done