Skip to main content



      Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Relative width of elements / page
icon9.gif  Relative width of elements / page [message #1467915] Mon, 10 November 2014 07:12 Go to next message
Eclipse UserFriend
My aim is the implementation of a kind of fileviewer and I am trying to get as much width on den screen as available.

But with Gridlayout the screen size seems to be fixed.

Experimenting with FormLayout by now..

The examples, like org.eclipse.rap.examples(.pages) seem to have a fixed size, too.

Does anyone know a possibility to spread a textarea over the whole width of den Browser window like width="100%" in html?
In html it is basically easy to achieve this, but using RAP I can't see this :-/


Thanks in advance

Geedot

[Updated on: Mon, 10 November 2014 08:16] by Moderator

Re: Relative width of elements / page [message #1468068 is a reply to message #1467915] Mon, 10 November 2014 09:50 Go to previous messageGo to next message
Eclipse UserFriend
You can use a FillLayout, or you can use GridLayout with a GridData on the browser like this: "new GridData(SWT.FILL, SWT.FILL, true, true);"
The browser will take all the available space in the parent.

Then in the browser you setText() like this :
<textarea style="width:100%;">
Your text.
</textarea>


If you want to use the whole screen you can simply open a Dialog and override this:
@Override
protected Point getInitialSize() {
	return new Point(PlatformUI.getWorkbench().getDisplay().getClientArea().width , PlatformUI.getWorkbench().getDisplay().getClientArea().height);
}
@Override
protected Point getInitialLocation(Point initialSize) {
	return new Point(0, 0);
}


Sorry if I misunderstood your problem.

[Updated on: Mon, 10 November 2014 09:52] by Moderator

Re: Relative width of elements / page [message #1468168 is a reply to message #1468068] Mon, 10 November 2014 11:35 Go to previous message
Eclipse UserFriend
Thank you so much. I used a Fill-Layout but it didn't work. The solution in this case was that I have missed to wrap the text widget into a ScrolledComposite.
That's why it didn't resized on the Page. Now it does just fine.

I am not sure what you mean by your second example but I will try that with a Dialog to see what it does.
Anyway, this is very helpful.

Regards
G.
Previous Topic:Migrating Tests from 1.5 to 2.0
Next Topic:RAP 3.0 : Workbench View Icons
Goto Forum:
  


Current Time: Sun Jul 27 13:42:54 EDT 2025

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

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

Back to the top