How can I tell whether it's design time or runtime? [message #143321] |
Thu, 13 December 2007 05:58 |
Eclipse User |
|
|
|
Originally posted by: eli_lato.hotmail.com
If the designer left out a required property of my component, I want to
throw an IllegalStateException at runtime, but of course not at design
time.
My ugly solution was to add a component listener, look at my component's
parents, and see whether any of them is a ve class. If none of my parents
is a VE class, it's runtime, and I check for missing required properties.
This works fine, but it's obviously a hack. Is there a better way?
Thanks,
Eli
|
|
|
Re: How can I tell whether it's design time or runtime? [message #143330 is a reply to message #143321] |
Thu, 13 December 2007 13:51 |
Eclipse User |
|
|
|
Originally posted by: no.ddress.now
In article <320d30be9625ef3e95fd7251f4a62b05$1@www.eclipse.org>,
eli_lato@hotmail.com says...
> If the designer left out a required property of my component, I want to
> throw an IllegalStateException at runtime, but of course not at design
> time.
>
> My ugly solution was to add a component listener, look at my component's
> parents, and see whether any of them is a ve class. If none of my parents
> is a VE class, it's runtime, and I check for missing required properties.
>
> This works fine, but it's obviously a hack. Is there a better way?
>
> Thanks,
> Eli
>
>
java.beans.Beans.isDesignTime()
--
Gerald Rosenberg
Certiv
|
|
|
|
Re: How can I tell whether it's design time or runtime? [message #616907 is a reply to message #143321] |
Thu, 13 December 2007 13:51 |
Eclipse User |
|
|
|
Originally posted by: no.ddress.now
In article <320d30be9625ef3e95fd7251f4a62b05$1@www.eclipse.org>,
eli_lato@hotmail.com says...
> If the designer left out a required property of my component, I want to
> throw an IllegalStateException at runtime, but of course not at design
> time.
>
> My ugly solution was to add a component listener, look at my component's
> parents, and see whether any of them is a ve class. If none of my parents
> is a VE class, it's runtime, and I check for missing required properties.
>
> This works fine, but it's obviously a hack. Is there a better way?
>
> Thanks,
> Eli
>
>
java.beans.Beans.isDesignTime()
--
Gerald Rosenberg
Certiv
|
|
|
|
Powered by
FUDForum. Page generated in 0.03390 seconds