Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 13:20 Go to next message
h1055071 is currently offline h1055071Friend
Messages: 335
Registered: July 2009
Senior Member
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);
        // Some code here to listen to Esc key to dispose Shell and return...
        shell.setLayout(new FillLayout());

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,

Re: How to redirect key presses to another shell? [message #674307 is a reply to message #673993] Thu, 26 May 2011 13:21 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

The short answer is that you can't. See my response in

"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."


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

Current Time: Fri Sep 21 18:09:40 GMT 2018

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

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

Back to the top