Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Dialog.open() method packs all my Views
Dialog.open() method packs all my Views [message #1424681] Tue, 16 September 2014 09:20 Go to next message
UmaShankar Subramani is currently offline UmaShankar SubramaniFriend
Messages: 194
Registered: December 2011
Location: SWEDEN
Senior Member
My RAP application has 3 views. When a view is displayed, the others are minimized.

Whenever I try to open a dialog from any view, it packs(same action as I have called pack() method) all the views.

When this unwanted pack happens, my some UI controls scales and grap more space than intended.

How can I solve this problem.



MessageBox dialog = new MessageBox(shell, SWT.OK);

dialog.open();

[Updated on: Tue, 16 September 2014 09:34]

Report message to a moderator

Re: Dialog.open() method packs all my Views [message #1424696 is a reply to message #1424681] Tue, 16 September 2014 09:42 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2334
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi,
probably this side effect is related to text-size-determination
mechanism in RAP. Do you pack your views in the code?
Best,
Ivan

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Dialog.open() method packs all my Views [message #1424721 is a reply to message #1424696] Tue, 16 September 2014 10:15 Go to previous messageGo to next message
UmaShankar Subramani is currently offline UmaShankar SubramaniFriend
Messages: 194
Registered: December 2011
Location: SWEDEN
Senior Member
Hi Ivan,

Thanks for your reply.

I found that pack spoils my layout. So I do not have any pack statement in my views at all.

There is no pack statement in my application at all.

Is there any workaround?
Re: Dialog.open() method packs all my Views [message #1424746 is a reply to message #1424721] Tue, 16 September 2014 10:54 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2334
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi,
could you provide a simple test project to demonstrate the issue?
Best,
Ivan

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Dialog.open() method packs all my Views [message #1424834 is a reply to message #1424746] Tue, 16 September 2014 13:32 Go to previous messageGo to next message
UmaShankar Subramani is currently offline UmaShankar SubramaniFriend
Messages: 194
Registered: December 2011
Location: SWEDEN
Senior Member
Hi Ivan,

Thanks for you help.

I have attached a Sample View(called TextView).

Step 1: The view is loaded with a textBox(SWT.Wrap) with a simple text.

Step 2: Click "Modify Text" . Then a Long text is set to the textBox. Since the text is too long, it wraps.

Step 3: Click "Open Dialog". When the dialog is opened, the text box expands and becomes greedy. It occupies as much space as needed. This is the problem.



When I debug the code, the change in the UI(pack) happend just after the lock.wait() call in the switchThread() method of UIThread class (During dialog.open() method call). Is that a good clue?

public void switchThread() {
Object lock = getLock();
synchronized( lock ) {
checkAndReportTerminatedUIThread();
lock.notifyAll();
boolean done = false;
while( !done ) {
try {
lock.wait();
done = true;
} catch( InterruptedException e ) {
handleInterruptInSwitchThread( e );
}
}
}
}


  • Attachment: TestView.java
    (Size: 2.91KB, Downloaded 252 times)
  • Attachment: Step1.png
    (Size: 27.42KB, Downloaded 107 times)
  • Attachment: Step2.png
    (Size: 30.21KB, Downloaded 104 times)
  • Attachment: Step3.png
    (Size: 32.27KB, Downloaded 97 times)

[Updated on: Tue, 16 September 2014 14:03]

Report message to a moderator

Re: Dialog.open() method packs all my Views [message #1426141 is a reply to message #1424834] Thu, 18 September 2014 09:52 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2334
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi,
I can reproduce it with your test view. As I assumed, it is related to
RAP text-size-determination mechanism and happens only in the first
session after server is restarted. If you want to keep the Text height
fixed, just specify its heightHint (similar to widthHint in your example).
HTH,
Ivan

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Dialog.open() method packs all my Views [message #1432025 is a reply to message #1426141] Fri, 26 September 2014 13:51 Go to previous message
UmaShankar Subramani is currently offline UmaShankar SubramaniFriend
Messages: 194
Registered: December 2011
Location: SWEDEN
Senior Member
Hi Ivan,

Thanks. After the heightHint, it works better now. Thanks.

-Uma
Previous Topic:Enable text selection in a custom widget
Next Topic:Custom widget for fusioncharts
Goto Forum:
  


Current Time: Thu Feb 20 16:41:52 GMT 2020

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

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

Back to the top