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 26321 - Single keystroke making Source Editor going fullscreen
Summary: Single keystroke making Source Editor going fullscreen
Status: RESOLVED FIXED
Alias: None
Product: ide
Classification: Unclassified
Component: UI (show other bugs)
Version: 3.x
Hardware: All All
: P3 blocker with 5 votes (vote)
Assignee: issues@www
URL:
Keywords:
Depends on: 29379
Blocks:
  Show dependency tree
 
Reported: 2002-08-06 16:49 UTC by peterp
Modified: 2005-03-09 04:28 UTC (History)
6 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
Revised FullScreenAction.java (6.95 KB, text/plain)
2002-12-10 21:16 UTC, Jesse Glick
Details

Note You need to log in before you can comment on or make changes to this bug.
Description peterp 2002-08-06 16:49:23 UTC
After pressing certain key(s), Source Editor should go 
full-screen in MDI (in SDI it's obvious). See i.e. 
Internet Explorer's >4.0 F11 key functionality.
Comment 1 Jesse Glick 2002-12-04 22:49:57 UTC
Try fullscreeneditor.jar at

http://contrib.netbeans.org/servlets/ProjectDownloadList

Crude and not tested except on Linux. Uses JDK 1.4's "full screen"
mode. Maybe it will be impressive on Windows, or maybe it will just
cause some heinous error. Try it. Includes sources.
Comment 2 kosherjava 2002-12-05 18:00:07 UTC
I just tried the fullscreen jar
In windows (jdk 1.4.1 on win2k) it pops up a iconized - 
fully minimized window in the upper left corner of the 
screen and after a few seconds delay (slow machine and I 
never got around to optimizing the jvm params)it pops to 
full screen mode. Works great. One glitch I noticed is 
that if I manually close the new fullscreen editor (window 
decorations do show up)without using CTRL-SHIFT-F11 the 
next time I hit CTRL-SHIFT-F11 it will not open. the close
() method of the window does not properly notify that it 
was closed so the second CTRL-SHIFT-F11 seems to try to 
close it again and takes an other time to open (just a 
guess). 

running System.out.println
(java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment
().getDefaultScreenDevice().isFullScreenSupported()); from 
the scripting console outputs true Jesse indicated that it 
returns false on Linux


One other thing is that this shortcut does not show up in 
the list of all shortcuts and unless I modify the 
layer.xml there seems to be no way to change the keys to 
toggle it.
Last but not least a minor look and feel issue is that the 
frame has the default sun coffee cup logo and not the 
netbeans one.

Thanks for the module. On my 17 inch monitor the module is 
just what I needed.

Comment 3 Jesse Glick 2002-12-05 18:55:08 UTC
So:

- need to listen for window closed events and handle them sanely

- register Actions/Window/fullscreeneditor-FullScreenAction.instance
for customizability

- TopComponent.getIcon does not appear to be working, though it
(apparently) does in the regular window system, since tabs get
appropriate icons. Needs investigation. Maybe an issue with accessing
components outside the AWT thread; try SwingUtilities.invokeLater.
Comment 4 kosherjava 2002-12-06 17:29:24 UTC
It seems that window decorations are showing up because 
the following line is commented out:
//f.setUndecorated(true);

Comment 5 Jesse Glick 2002-12-06 17:41:50 UTC
Well uncommenting it didn't work for me, I tried. Someone running on a
different platform should feel free to try uncommenting it. Of course
if full-screen mode is actually supported by the JRE (for which
platforms is this true??) it should be irrelevant.
Comment 6 kosherjava 2002-12-06 17:54:36 UTC
from the javadocs for java.awt.Frame: 

isUndecorated
public boolean isUndecorated()
Indicates whether this frame is undecorated. By default, 
all frames are initially decorated. 

so it seems that it is relevant
Comment 7 Jesse Glick 2002-12-06 18:42:46 UTC
Indeed, now that I try it again (JDK 1.4.1 Linux)
setUndecorated(false) does indeed work as expected. I am not sure what
did not work before.
Comment 8 kosherjava 2002-12-08 02:02:43 UTC
just a note that even if its undecorated there are ways to 
close the window, so the window close listener still needs 
to be in place.
Will this always be a module or is it likely to be 
integrated into the core?
Thanks

PS the src code included in the jar did not compile on my 
machine using the openide.jar (3.4)in the lib dir. Was I 
doing something wrong?
Comment 9 Jesse Glick 2002-12-09 17:28:07 UTC
"Will this always be a module or is it likely to be integrated into
the core?" - depends on how stable and useful the code seems. Should
have some people use it for a while. I think a UI review
(nbui@netbeans.org) is needed first, since there are potentially a lot
of UI issues surrounding this. For example, what happens if you
Alt-Sh-O to open a new file? Should it then replace the current file
in full-screen mode? Is there any way to switch files while in this
mode? Etc. I think the current state could be described as
"exploratory", i.e. these are prototypes.

"the src code included in the jar did not compile on my machine using
the openide.jar (3.4) in the lib dir" - specifically what was the
problem? (I use a 4.0 dev build BTW, did not test on 3.4.)
Comment 10 Jesse Glick 2002-12-09 17:28:46 UTC
If you add comments to an issue, please remember to add yourself to
the CC list too, so people can respond to you.
Comment 11 kosherjava 2002-12-09 17:40:36 UTC
fullscreeneditor/FullScreenAction.java [35:1] 
fullscreeneditor.FullScreenAction.FakeWM should be 
declared abstract; it does not define componentRegistry() 
in org.openide.windows.WindowManager
    private static final class FakeWM extends 
WindowManager {
                         ^
1 error
Errors compiling FullScreenAction.java.
Comment 12 Jesse Glick 2002-12-09 18:15:12 UTC
"fullscreeneditor.FullScreenAction.FakeWM should be declared abstract;
it does not define componentRegistry() in
org.openide.windows.WindowManager" - ah, well just implement that
method to return null, it doesn't matter.
Comment 13 Jesse Glick 2002-12-09 18:15:41 UTC
I mean to throw IllegalStateException.
Comment 14 kosherjava 2002-12-10 20:31:29 UTC
In fullscreen mode try CTRL-F to initiate a find. The 
dialog opens under the fullscreen making it unusable.
Comment 15 Jesse Glick 2002-12-10 21:00:18 UTC
I don't get that problem on Linux. Instead, the dialog opens and gets
focus and all, but the fullscreen window gets hidden behind the NB MDI
window!
Comment 16 Jesse Glick 2002-12-10 21:16:11 UTC
Created attachment 8256 [details]
Revised FullScreenAction.java
Comment 17 Jesse Glick 2002-12-10 21:18:01 UTC
The revised class I just attached should:

- prevent the full-screen window from going behind the MDI window

- handle explicit closing of the full-screen window properly

On Linux with Sawfish + sloppy focus, I still have problems opening
e.g. the Find dialog; it is opened but does not get KB focus. I have
to Alt-TAB to focus it.
Comment 18 kosherjava 2002-12-11 15:12:49 UTC
Using the updated version on windows has the following 
issues:
ctrl - f is still modal to the MDI (main) frame and does 
not show in the fullscreen frame (focus is lost from the 
full screen window and any typing will be to the hidden 
find dialog)
On alt- tab or window key where focus is changed to a 
different window, the fullscreen is minimized and is 
visible modal to the main NB Frame. Clicking in NB frame 
will leave the full screen unfocused and visible in its 
minimized state. Is there any way to force focus and 
maximization back to the full screen window as soon as NB 
is back in focus?

Thanks
Comment 19 Jesse Glick 2002-12-11 16:57:05 UTC
Re. all of the last questions from kosherjava - I have no idea, maybe
someone else does... (I do not have a Win machine to test on anyway)
Comment 20 kosherjava 2002-12-12 20:29:59 UTC
To better describe my problem.
When an other app/window gets focus (alt-tab, window key 
etc) the fullscreen window gets iconified and does not 
always maximize when NB gets focus again.
The code below disposes of the full screen on 
iconification. It isn't optimal in the sense that I 
shouldn't have to dispose of it and recreate it later.
Ideally on refocus of NB the "hidden" fullscreen window 
should pop back up.

public void windowIconified(WindowEvent e) {
    disposeIt();
}
Comment 21 kosherjava 2002-12-19 14:32:22 UTC
Just a note that windowIconified causes unwanted behavior. 
This is because a dialog poping up from an other program 
(a new email from outlook) will cause iconification in 
fulllscreen mode. The issue seems to be more of an issue 
with the way Swing works
Comment 22 kosherjava 2002-12-23 21:35:32 UTC
Just a suggestion. Can the feature be implemented slightly 
differently? instead of an actual full screen how about 
just toggeling on and off the explorer  (or whatever else 
you have open on the left) as well as the document tabs 
(on bottom). This way while it would not actually be a 
full screen version it would cearly give a lot of more 
space than in a regular nb editor window.
Comment 23 _ jrichard 2002-12-27 17:59:22 UTC
I like the idea kosherjava (aka None) had, but I think there is a
problem where the state of TopComponents which are removed will be
lost.  So when you toggle back to normal mode, you'll have to reexpand
opened tree branches.  The same problem occurs in the output window,
which I reported a while ago (see issue 17504).
Comment 24 Jesse Glick 2003-01-09 05:44:47 UTC
Cf. issue #13717.
Comment 25 kosherjava 2003-02-11 21:12:23 UTC
Just some additional comments.
Despite the bugs I find this usefull.
Here are some other small problems.
1)Am at line 1000 of my code and hit CTRL-SHFT-F11 and end 
up at line 1 in the new window.
2) the dropdown widget(don't know the correct name) that 
lists all the methods does not properly repaint when 
scrolling through the list in full screen made making it 
almost useless (would not be such an issue if I could get 
there by using CTRL F that is broken)

Comment 26 kosherjava 2003-03-10 16:42:20 UTC
Just noticed in the netBeans weekly news that a new module 
editorBonuses was posted by carcassi that does almost what 
this does.
http://contrib.netbeans.org/servlets/ProjectDownloadList?
action=download&dlID=302
Having them both running (thank goodness for the different 
shortcut keys) I have to say that the new one while not 
really FullScreen like this one seems to work better.
I don't know if this is the place to post prolems with the 
new module but i guess its as good a place as any.
a) crtl-f works but with a look and feel bug. when in full 
screen if you hit ctrl-f the full screen is minimized and 
an empty regular netbean window pops up (same as if you 
alt tabbed over to it). enter the search and you are back 
to the full scfeer mode.
b) when in full screen mode bring up an other app (say 
Outlook). go back to the fulll screen and hit ctrl -alt 
f11 to get back to non full screen editor mode. what is 
now in focus is the app you used (Outlook in this case). 
What I would have expected is a non full screen NB.
c) the dropdown widget(don't know the correct name) that 
lists all the methods allowing easy navigation of a large 
file is shorter in the new module than in the main window. 
I set it to display all params so I can easily tell one 
overloaded method from an other. Since the size of this 
dropdown seems to be fixed in size in the editorBonuses 
window, its hard to tell one method from an other.
d) Is there a reason that it requires its own task bar 
icon? If it were "THE" netbeans window the ctrl-F and 
other app focus problems above might not be an issue.
e) The fact that the full screen has a close (X) will lead 
to people closing it expecting to get back to regular mode 
that way. That will totally close the editor window 
loosing all your open tabs (painful if you have many open 
windows) What the close (X) should do is the equiv of 
hitting CTRL-ALT F11 and return to regular not full screen 
mode.

Thanks for the module
Comment 27 carcassi 2003-03-11 14:44:49 UTC
In my module I basically get the current frame, make it a 
separate window and maximize. a, b, d and e are 
consequence of this. As you say, if instead of creating a 
new window, I would use the NetBeans one, those problems 
would disappear. Unfortunately, I have no idea how to do 
that and (worst) I don't even know if it is possible or 
not with the current API (I am but a small NB hacker :-) ).

As for c, the dropdown widget works exactly the same for 
me.
Comment 28 _ jrichard 2003-07-29 01:39:08 UTC
Just an update that the eclipse editor implements a full screen editor
this way:  when the user double clicks on the 
editor tab, the editor takes up the full IDE window temporarily hiding
the output, outline, and explorer panes.
Double clicking on the tab again brings back the hidden panes and
restores the editor window to normal size.
Comment 29 Jesse Glick 2003-08-05 18:35:08 UTC
I believe the new window system already has something like this
implemented. See:

http://ui.netbeans.org/docs/ui/ws/ws_spec.html#3.10
Comment 30 Peter Zavadsky 2003-08-07 09:09:54 UTC
Well, there is something like that... in fact there is an action which
maximizes/unmaximizes the active window (it means, the others are not
visible - inside the MDI frame, but not full screen).

Adding Jano (responsible for UI) to get this request.
Comment 31 Jesse Glick 2003-11-12 09:22:44 UTC
I guess this is now fixed with the new window system. Shift-Escape, I
think.

It does not remove window decorations, remove the menu bar, remove
toolbars, or hide other document tabs, so it is not total full-screen
mode. But it does hide other windows, which frees up most of the
screen for the editor.