Is it possible to delete a blog from the "I read these blogs" list?
Re: [nbusers] Does NetBeans support Beans.isDesignTime()  calls ?
Hello Guest
  
  • Login
• Register…
• Start blog
  • Who, Where, When
• What can I do?
• What to Read?
  • Polls
• Avatars
• Interests
  • Cities and Countries
• Random blog
• Users search
  • Search
• Games
• Tests
• QAIX
  • Сообщества
• Talxy Chat
• Horoscope
• Online
 
Зарегистрируйся!

QAIX > Java Programming > Re: [nbusers] Does NetBeans support Beans.isDesignTime(­) calls ? 28 November 2000 19:59:10

  Recent blog posts: 
  They have birthday today: 
  Forums:   
  Discuss: 
  Recent forum topics: 
  Recent forum comments:
  Moderators:

Re: [nbusers] Does NetBeans support Beans.isDesignTime(­) calls ?

Trung Duc Tran 28 November 2000 19:59:10
 On Tue, 21 Nov 2000 14:10:40 +0100 "Patrick Ruzand" <pruzand@ilog.fr>
wrote:
Hello all,>
[NB 3.1 beta bld.7]>
I'm currently working on a Bean class. This class> is a graphical representation of a set of data contained in> a data model. Typically (aka by code), the data model would be > first populated then attached to the graphics representation (the bean).> To avoid to have an empty Bean when using it inside an ide,> I populate it with a default datamodel, but only at design time.> It gives something like :>
public Foobar() {> ...> if (Beans.isDesignTime­()) {> setModel(new DefaultModel());> }> }>
This works well under most of the ide, except under our> favorite one : NetBeans, where I don't have the expected result> (nothing happens).>
So, does NetBeans support the Beans.isDesignTime(­) API ?

not now. This is actually very interesting issue. I'm glad you brought
it up. You're probably one of very rare developers who take advantage
of Beans.isDesignTime(­).

To make Beans.isDesignTime(­) to return true for your beans inside the
IDE is simple and tricky at the same time. The IDE can just add a
single call Beans.setDesignTime­(true) somewhere during startup. The
tricky part is that your bean's code lives in the same JVM as the IDE.
By settings designTime to true for your beans we set it true for the
whole IDE. As of now no beans which I know, or at least not those
standard ones used by the IDE differentiate their behavior based on
Beans.isDesignTime(­). So I could do it safely. But things will stop
working if someone starts using your beans in some IDE modules.

I cc nbdev mailing lists. If someone has some bright ideas, please,
let me and the list know

-- Trung


Add comment
Patrick Ruzand 22 November 2000 10:42:41 permanent link ]
 Hi Trung,
So, does NetBeans support the Beans.isDesignTime(­) API ?>
not now. This is actually very interesting issue. I'm glad you brought> it up. You're probably one of very rare developers who take advantage> of Beans.isDesignTime(­).

According to the huge number of reactions ;-)­, it seems so...
To make Beans.isDesignTime(­) to return true for your beans inside the> IDE is simple and tricky at the same time. The IDE can just add a> single call Beans.setDesignTime­(true) somewhere during startup. The> tricky part is that your bean's code lives in the same JVM as the IDE.> By settings designTime to true for your beans we set it true for the> whole IDE. As of now no beans which I know, or at least not those> standard ones used by the IDE differentiate their behavior based on> Beans.isDesignTime(­). So I could do it safely. But things will stop> working if someone starts using your beans in some IDE modules.

I understand your point.
But maybe it could be the default behavior. I'm really convinced
that NB should be able to return whether we are in design time :
adapting the behavior of a bean depending on when it is used is a
possibility offers by the Bean specs and should be supported by
Bean boxes.
Furthermore, setting Beans.designTime to true when the ide starts
should have less side effects than the contrary. The
advantage is that all the beans will work as expected, the only
drawback is that only modules that use a bean that uses itself the
isDesignTime() feature will not work. I don't know NB enough but
are there a lot of such modules out there ?

Finally, but it may be a stupid idea (since as I told you my
knowledge of the way NB works internally is near zero) don't
you think it could be set only at GUI Design time ? For example,
when the GUI Editing workspace is activated (provided of course
it is the only way to use the form editor) ?

Just my 2 cts on this subject. (Of course, my opinion is perhaps a
little subjective... ;-)­.

Anyway, for the time being, your workaround will do the trick.
I will do that.

Thanks a lot, and congratulation for this great tool that NB is.

Patrick.



Add comment
Trung Duc Tran 22 November 2000 19:46:39 permanent link ]
 On Wed, 22 Nov 2000 08:42:41 +0100 "Patrick Ruzand" <pruzand@ilog.fr>
wrote:
Hi Trung,>
So, does NetBeans support the Beans.isDesignTime(­) API ?> >
not now. This is actually very interesting issue. I'm glad you brought> > it up. You're probably one of very rare developers who take advantage> > of Beans.isDesignTime(­).>
According to the huge number of reactions ;-)­, it seems so...>
To make Beans.isDesignTime(­) to return true for your beans inside the> > IDE is simple and tricky at the same time. The IDE can just add a> > single call Beans.setDesignTime­(true) somewhere during startup. The> > tricky part is that your bean's code lives in the same JVM as the IDE.> > By settings designTime to true for your beans we set it true for the> > whole IDE. As of now no beans which I know, or at least not those> > standard ones used by the IDE differentiate their behavior based on> > Beans.isDesignTime(­). So I could do it safely. But things will stop> > working if someone starts using your beans in some IDE modules.>
I understand your point. > But maybe it could be the default behavior. I'm really convinced> that NB should be able to return whether we are in design time :> adapting the behavior of a bean depending on when it is used is a> possibility offers by the Bean specs and should be supported by> Bean boxes.> Furthermore, setting Beans.designTime to true when the ide starts> should have less side effects than the contrary. The> advantage is that all the beans will work as expected, the only> drawback is that only modules that use a bean that uses itself the> isDesignTime() feature will not work. I don't know NB enough but> are there a lot of such modules out there ?

Beans.isDesignTime(­) returns 'true' now, this will appear in the next NB
3.1beta build. Please have a look and tell us if this change satisfies
your needs.

-- Trung

Add comment
Bill Shannon 23 November 2000 03:36:35 permanent link ]
 Shouldn't you also add support for java.beans.DesignMo­de so that beans
that might actually be used in the IDE itself can be told that it's
*not* design time, while simple beans being designed in the IDE can
use the global Beans.isDesignTime?­


Add comment
Patrick Ruzand 28 November 2000 12:18:39 permanent link ]
 Hello Trung,

----- Original Message -----
From: "Trung Duc Tran" <trung.duc.tran@net­beans.com>
To: <nbusers@netbeans.o­rg>
Cc: <nbdev@netbeans.org­>
Beans.isDesignTime(­) returns 'true' now, this will appear in the next NB> 3.1beta build. Please have a look and tell us if this change satisfies> your needs.

At first, I'm sorry to get back to you so late.
The patch does the trick. It's perfect.

Thanks a lot,

Patrick.


Add comment
Trung Duc Tran 28 November 2000 19:59:10 permanent link ]
 On Wed, 22 Nov 2000 16:36:35 -0800 (PST) Bill Shannon
<Bill.Shannon@Eng.S­un.COM> wrote:
Shouldn't you also add support for java.beans.DesignMo­de so that beans> that might actually be used in the IDE itself can be told that it's> *not* design time, while simple beans being designed in the IDE can> use the global Beans.isDesignTime?­

good idea. I'll add support for java.beans.DesignMo­de in the list of
features planed for the next release (3.2)

-- Trung

Add comment
 

Add new comment

As:
Login:  Password:  
 
 
  
 
Пожалуйста, относитесь к собеседникам уважительно, не используйте нецензурные слова, не злоупотребляйте заглавными буквами, не публикуйте рекламу и объявления о купле/продаже, а также материалы нарушающие сетевой этикет или УК РФ.


QAIX > Java Programming > Re: [nbusers] Does NetBeans support Beans.isDesignTime(­) calls ? 28 November 2000 19:59:10

see also:
Upgrading to Quickbooks 2006
import Expense data from Quicken 2004…
How to refund and upfront deposit
пройди тесты:
Do you know women?
see also:
And it again I! I spoke, that I shall…
i'm a new user!!!
hello

  Copyright © 2001—2008 QAIX
Idea: Miсhael Monashev
Помощь и задать вопросы можно в сообществе support.qaix.com.
Сообщения об ошибках оставляем в сообществе bugs.qaix.com.
Предложения и комментарии пишем в сообществе suggest.qaix.com.
Информация для родителей.
Write us at:
If you would like to report an abuse of our service, such as a spam message, please .