Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » E4 + SWT renderer in FullScreen mode?
E4 + SWT renderer in FullScreen mode? [message #695976] Wed, 13 July 2011 00:43 Go to next message
Cristiano Gavião is currently offline Cristiano GaviãoFriend
Messages: 279
Registered: July 2009
Senior Member
Hi,

I would like to know where is the best place to call the SWT shell.setFullScreen(true) method to able my E4 RCP to start in fullScreen mode ?

I have tried to use lifeCycleURI, but I've discovered that it is processed before UI is get started...

I've start to investigate a solution with addOn (using the MinMaxAddOn as example) but I couldn't find out how could I have the main shell injected...

I would appreciate any help.

cheers

Cristiano
Re: E4 + SWT renderer in FullScreen mode? [message #696096 is a reply to message #695976] Wed, 13 July 2011 09:07 Go to previous messageGo to next message
Christoph Keimel is currently offline Christoph KeimelFriend
Messages: 482
Registered: December 2010
Location: Germany
Senior Member
Hi,

I haven't tried it myself, but you could try to register a processor via the extension point org.eclipse.e4.workbench.model. Inside of the class you should be able to get the Shell by Injection:

@Inject @Named(IServiceConstants.ACTIVE_SHELL) Shell shell;

@Execute
public void execute() {
	shell.setFullScreen(true);
}


Let me know if it works ...

christoph
Re: E4 + SWT renderer in FullScreen mode? [message #696382 is a reply to message #696096] Wed, 13 July 2011 20:31 Go to previous messageGo to next message
Cristiano Gavião is currently offline Cristiano GaviãoFriend
Messages: 279
Registered: July 2009
Senior Member
Hi I could make it work using AddOns.
I've subscribed on UIEvents.UIElement.WIDGET and get the shell from it.

		ev5 = new EventHandler() {

			@Override
			public void handleEvent(Event event) {
				Object objElement = event
						.getProperty(UIEvents.EventTags.ELEMENT);
				Object objType = event.getProperty(UIEvents.EventTags.TYPE);
				Object objWidget = event.getProperty(UIEvents.EventTags.WIDGET);
				Object objNew = event.getProperty(UIEvents.EventTags.NEW_VALUE);
				Object objOld = event.getProperty(UIEvents.EventTags.OLD_VALUE);
				Object objAtt = event.getProperty(UIEvents.EventTags.ATTNAME);

				if (!(event.getProperty(UIEvents.EventTags.ELEMENT) instanceof MWindow))
					return;

				String attName = (String) event
						.getProperty(UIEvents.EventTags.ATTNAME);
				// Is this listener interested ?
				MWindow windowModel = (MWindow) objElement;
				// if (windowModel.getRenderer() != WBWRenderer.this)
				// return;

				// No widget == nothing to update
				Shell theShell = (Shell) windowModel.getWidget();
				if (theShell == null)
					return;
				
				theShell.pack(true);
				theShell.setMaximized(true);
//				theShell.setFullScreen(true);
			}
		};
		eventBroker.subscribe(UIEvents.buildTopic(UIEvents.UIElement.TOPIC,
				UIEvents.UIElement.WIDGET), ev5);
	}


It is entering on fullScreen properly, but the screen is not ok on my Mac.
The main toolbar is shorter (height) that the normal and my icons was trimmed. I think it is related to the top bar that is removed when it enter in fullscreen mode... (see attached picture)

any tip to help me to investigate this?

thanks

Cristiano
Re: E4 + SWT renderer in FullScreen mode? [message #1776530 is a reply to message #696382] Fri, 17 November 2017 10:46 Go to previous message
saravanakumar Mohanasundaram is currently offline saravanakumar MohanasundaramFriend
Messages: 19
Registered: February 2017
Junior Member
Hi, This link may help you.
https://stackoverflow.com/questions/12543858/set-the-window-of-an-eclipse-e4-application-to-have-the-whole-screen-size
Previous Topic:Pragmatically resize a view
Next Topic:Make Perspective from Model Fragment as pre-defined
Goto Forum:
  


Current Time: Thu Apr 18 19:13:06 GMT 2024

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

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

Back to the top