Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » WindowBuilder » WindowBuilder hangs when accessing password protected URL/image
WindowBuilder hangs when accessing password protected URL/image [message #1064214] Tue, 18 June 2013 10:03 Go to next message
Thomas Zimmer is currently offline Thomas ZimmerFriend
Messages: 2
Registered: June 2013
Junior Member
I have a small piece of code that freezes WindowBuilder and Eclipse. It happens when I try to access a password protected hardcoded URL like this
URL imgURLgarage = null;
        
        try {
           //
           // insert URL that requires password
           // I cannot post it, because the forum requires to have more than 5 messages :-)
           // 
	    imgURLgarage = new URL( <insert string to password protected URL> );
	 
	} catch (MalformedURLException e) {
	    
	    e.printStackTrace();
	}
        Icon iconGarage = new ImageIcon(imgURLgarage);
        lblGarageIMG.setIcon(iconGarage);
 


The code itself works, there is an Authenticator that delivers the password. When trying to view the design pane, WB says "Parsing..." and than hangs forever. I have to kill the entire Eclipse process. Obviously, WB tries to load the image and then something goes wrong.

Versions:

Eclipse 4.2.2
WindowBuilder 1.5.1.r42x201209161109

Re: WindowBuilder hangs when accessing password protected URL/image [message #1064297 is a reply to message #1064214] Tue, 18 June 2013 14:58 Go to previous messageGo to next message
Eric Clayberg is currently offline Eric ClaybergFriend
Messages: 979
Registered: July 2009
Location: Boston, MA
Senior Member
It sounds like that code is not appropriate for accessing at design time, so you need to wrapper it in a call to Beans.isDesignTime() as described in the WindowBuilder FAQ. From the FAQ...

Quote:
Note: A component may rely on some runtime behavior that is not possible at design time (such as accessing an application database or some other file). Runtime specific behavior should be isolated (and stubbed out as necessary) by wrappering the runtime specific code with a call to Beans.isDesignTime() which will answer true when the component is loaded within WindowBuilder Pro and false at runtime.
Re: WindowBuilder hangs when accessing password protected URL/image [message #1064436 is a reply to message #1064297] Wed, 19 June 2013 09:13 Go to previous messageGo to next message
Thomas Zimmer is currently offline Thomas ZimmerFriend
Messages: 2
Registered: June 2013
Junior Member
Thanks, I already have found a solution by bracketing with // $hide>>$ and // $hide<<$ comments.
I just thought that it is a bug that has to be adressed.
Re: WindowBuilder hangs when accessing password protected URL/image [message #1064449 is a reply to message #1064436] Wed, 19 June 2013 10:50 Go to previous message
Eric Clayberg is currently offline Eric ClaybergFriend
Messages: 979
Registered: July 2009
Location: Boston, MA
Senior Member
I would assume in this case that the Authenticator is either not running or not available at design time, so the code for retrieving the image ends up in a wait state and hangs the environment.

This is precisely the type of situation that Beans.isDesignTime() is meant to address. The hide tags also provide a more limited version of the same thing as they work during parse time for the actual class being edited. The Beans.isDesignTime() approach is a bit more general purpose as it will also work within the context of a custom component/widget that is being used in another window that is being edited.
Previous Topic:XML databinding in SWT help
Next Topic:How to customize XML generation for UI components
Goto Forum:
  


Current Time: Thu Apr 18 01:02:27 GMT 2024

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

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

Back to the top