Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 12:12 Go to next message
Sebastian Geedot is currently offline Sebastian GeedotFriend
Messages: 7
Registered: October 2014
Junior Member
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 13:16]

Report message to a moderator

Re: Relative width of elements / page [message #1468068 is a reply to message #1467915] Mon, 10 November 2014 14:50 Go to previous messageGo to next message
Aleksander   is currently offline Aleksander Friend
Messages: 44
Registered: May 2014
Location: France
Member
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 14:52]

Report message to a moderator

Re: Relative width of elements / page [message #1468168 is a reply to message #1468068] Mon, 10 November 2014 16:35 Go to previous message
Sebastian Geedot is currently offline Sebastian GeedotFriend
Messages: 7
Registered: October 2014
Junior Member
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: Thu Apr 18 14:21:48 GMT 2024

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

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

Back to the top