Skip to main content


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 11:27 Go to next message
Rayleigh Missing name is currently offline Rayleigh Missing nameFriend
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 11:41 Go to previous messageGo to next message
Christian Campo is currently offline Christian CampoFriend
Messages: 597
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 11:49 Go to previous messageGo to next message
Rayleigh Missing name is currently offline Rayleigh Missing nameFriend
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 18:22 Go to previous message
Eric Clayberg is currently offline Eric ClaybergFriend
Messages: 979
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: Fri Apr 19 20:38:01 GMT 2024

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

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

Back to the top