VE don't show BeanInfo characteristics. [message #23648] |
Tue, 09 March 2004 02:32  |
Eclipse User |
|
|
|
Hi!
I've write some bean classes and beanInfo classes too.
Some of the classes don't show the benInfo properties. Simply VE ignores
the BeanInfo class.
I've using static final variables in the bean class. If I change this
variables for 'static' or 'final' only, VE show the properties with the
BeanInfo correctly but when I used a 'static final' variable VE ignores
the BeanInfo information. I need 'static final' variables in my code and
can't do this change.
The variables used in the bean are:
private static final TTextField MODELO = new TTextField();
private static final int ANCHO_FUENTE_MEDIA = ((int)
(SwingUtilities.computeStringWidth(MODELO.getFontMetrics(
MODELO.getFont()), TODAS) / TODAS.length())) + 1;
Note: TTextField is a simple class that extends from JTextField. TODAS is
a String with some characters.
|
|
|
Re: VE don't show BeanInfo characteristics. [message #24116 is a reply to message #23648] |
Tue, 09 March 2004 11:56  |
Eclipse User |
|
|
|
Originally posted by: mendelgili.netscape.net
David Díaz wrote:
> Hi!
>
> I've write some bean classes and beanInfo classes too.
> Some of the classes don't show the benInfo properties. Simply VE ignores
> the BeanInfo class.
>
> I've using static final variables in the bean class. If I change this
> variables for 'static' or 'final' only, VE show the properties with the
> BeanInfo correctly but when I used a 'static final' variable VE ignores
> the BeanInfo information. I need 'static final' variables in my code and
> can't do this change.
>
> The variables used in the bean are:
>
> private static final TTextField MODELO = new TTextField();
>
> private static final int ANCHO_FUENTE_MEDIA = ((int)
> (SwingUtilities.computeStringWidth(MODELO.getFontMetrics(
> MODELO.getFont()), TODAS) / TODAS.length())) + 1;
>
>
> Note: TTextField is a simple class that extends from JTextField. TODAS is
> a String with some characters.
>
>
>
Not sure that I fully understod the context for this problem.
MODELO is a visual and should be rendered by VE if it has an
initialization method. Given that MODELO is instantiated in its
decleration, you will have to have one of the predefined (from the VE
pref. page) methods declared.
The following code will render MODELO on the FreeForm, and if selected
on the Property Sheet (I used JTextField, and a String):
import javax.swing.JTextField;
import javax.swing.SwingUtilities;
class Empty {
private static final JTextField MODELO = new JTextField();
private static final int ANCHO_FUENTE_MEDIA = ((int)
(SwingUtilities.computeStringWidth(MODELO.getFontMetrics(
MODELO.getFont()), "Gili") / "Gili".length())) + 1;
// Need to have an init method for MODELO ... see pref. page
private void jbInit() {
}
}
If this does not answer your question, it will help if you attach your
BeanInfo and Class code, and an example where BeanInfo is ignored.
|
|
|
Re: VE don't show BeanInfo characteristics. [message #583953 is a reply to message #23648] |
Tue, 09 March 2004 11:56  |
Eclipse User |
|
|
|
David Díaz wrote:
> Hi!
>
> I've write some bean classes and beanInfo classes too.
> Some of the classes don't show the benInfo properties. Simply VE ignores
> the BeanInfo class.
>
> I've using static final variables in the bean class. If I change this
> variables for 'static' or 'final' only, VE show the properties with the
> BeanInfo correctly but when I used a 'static final' variable VE ignores
> the BeanInfo information. I need 'static final' variables in my code and
> can't do this change.
>
> The variables used in the bean are:
>
> private static final TTextField MODELO = new TTextField();
>
> private static final int ANCHO_FUENTE_MEDIA = ((int)
> (SwingUtilities.computeStringWidth(MODELO.getFontMetrics(
> MODELO.getFont()), TODAS) / TODAS.length())) + 1;
>
>
> Note: TTextField is a simple class that extends from JTextField. TODAS is
> a String with some characters.
>
>
>
Not sure that I fully understod the context for this problem.
MODELO is a visual and should be rendered by VE if it has an
initialization method. Given that MODELO is instantiated in its
decleration, you will have to have one of the predefined (from the VE
pref. page) methods declared.
The following code will render MODELO on the FreeForm, and if selected
on the Property Sheet (I used JTextField, and a String):
import javax.swing.JTextField;
import javax.swing.SwingUtilities;
class Empty {
private static final JTextField MODELO = new JTextField();
private static final int ANCHO_FUENTE_MEDIA = ((int)
(SwingUtilities.computeStringWidth(MODELO.getFontMetrics(
MODELO.getFont()), "Gili") / "Gili".length())) + 1;
// Need to have an init method for MODELO ... see pref. page
private void jbInit() {
}
}
If this does not answer your question, it will help if you attach your
BeanInfo and Class code, and an example where BeanInfo is ignored.
|
|
|
Powered by
FUDForum. Page generated in 0.05361 seconds