Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » How to redirect key presses to another shell?
How to redirect key presses to another shell? [message #673993] Wed, 25 May 2011 09:20 Go to next message
Eclipse UserFriend
I'm working on a way to maximise an EditorPart to be absolutely full-screen, no trim, no menu, and so on. Actually, it's a GEF Editor. It's a bit of a hack, but it kind of works:

        GraphicalViewer viewer = (GraphicalViewer)getWorkbenchPart().getAdapter(GraphicalViewer.class);
        Control control = viewer.getControl();
        Composite oldParent = control.getParent();
                
        Shell shell = new Shell(SWT.APPLICATION_MODAL);
        shell.setFullScreen(true);
        shell.setMaximized(true);
        
        // Some code here to listen to Esc key to dispose Shell and return...
        
        shell.setLayout(new FillLayout());
        control.setParent(shell);
        shell.open();


Basically it sets the parent of the GraphicalViewer control to the newly created, maximised Shell. Pressing escape will return the control to it's original parent (code not shown for brevity).

The only thing that doesn't work is receiving global key presses (Del, Ctrl-Z, Ctrl-A) the ones that are declared for the Workbench and forwarded to the EditorPart. Is there any way I can hook into these or redirect them from the EditorPart to forward them on to the GraphicalViewer?

Thanks in advance,

Phil
Re: How to redirect key presses to another shell? [message #674307 is a reply to message #673993] Thu, 26 May 2011 09:21 Go to previous message
Eclipse UserFriend
The short answer is that you can't. See my response in http://stackoverflow.com/questions/6125164/how-to-redirect-key-presses-to-another-shell-in-an-eclipse-based-app/6138297#6138297

"The only supported way would be to open a new Workbench window with a perspective that only contained the editor area, and extending your org.eclipse.ui.application.WorkbenchWindowAdvisor.createWindowContents(Shell) method for that window+perspective combination to hide all of the trim you don't want, using org.eclipse.ui.application.IWorkbenchWindowConfigurer."

PW
Previous Topic:How to make sure that all workspace projects are loaded by workspacejob asynchronously
Next Topic:EFS Vs ResourceMapping
Goto Forum:
  


Current Time: Sun Jul 13 01:11:35 EDT 2025

Powered by FUDForum. Page generated in 0.07421 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top