Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » WindowBuilder » Check if opened in design mode
Check if opened in design mode [message #725252] Wed, 14 September 2011 07:27 Go to next message
Rayleigh Missing name is currently offline Rayleigh Missing name
Messages: 20
Registered: July 2011
Junior Member
I'd like to draw my custom swing components a little different if they're opened in window builder. Is there a way to check this?
Re: Check if opened in design mode [message #725265 is a reply to message #725252] Wed, 14 September 2011 07:41 Go to previous messageGo to next message
Christian Campo is currently offline Christian Campo
Messages: 590
Registered: July 2009
Senior Member
try

if (Beans.isDesignTime()) {
}

- christian
Re: Check if opened in design mode [message #725269 is a reply to message #725265] Wed, 14 September 2011 07:49 Go to previous messageGo to next message
Rayleigh Missing name is currently offline Rayleigh Missing name
Messages: 20
Registered: July 2011
Junior Member
works. thank you!
Re: Check if opened in design mode [message #725777 is a reply to message #725269] Thu, 15 September 2011 14:22 Go to previous message
Eric Clayberg is currently offline Eric Clayberg
Messages: 856
Registered: July 2009
Location: Boston, MA
Senior Member
In addition to allowing you to provide design-time specific rendering, Beans.isDesignTime() is also very useful for suppressing other runtime behavior that won't work at design time. From the WB FAQ...

Quote:
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 and false at runtime.
Previous Topic:ResourceManager class
Next Topic:JFace Databinding
Goto Forum:
  


Current Time: Wed Aug 20 14:41:16 EDT 2014

Powered by FUDForum. Page generated in 0.01818 seconds