Properties sheet [message #98842] |
Wed, 20 July 2005 17:01  |
Eclipse User |
|
|
|
Originally posted by: lgodl.2die4.com
Hi, I have two questions concerning the addition of a component to VE.
First, I would like to know if there is a way to group properties of an
Object in a category other than creating a class containing those
properties. Lets say I have a class that extends JButton to which I added
two properties, I would like to have those properties grouped (showing
under a category with the + sign in the properties view).
Also, if I throw an illegal argument exception in a setter of a component,
there is an exclamation mark showing over the component in the graphical
editor. Is there a way to do the same thing with setters for a class
which is used for a property? Let me explain what I mean. If I extends a
JButton with two properties, foo which is an int and bar which is a point
(a class I created with 2 variables, x and y). If a throw an illegal
argument exception in setFoo(int aFoo) when the argument equals 2, I will
have a exclamation mark showing in the graphical editor when I set that
property to 2. If I throw an illegal argument exception in setX from the
bar class, nothing is showed when I set x to 2 in the property editor. Is
there a way to have the same comportment in the second case?
Thanks
Daniel
|
|
|
Re: Properties sheet [message #98872 is a reply to message #98842] |
Wed, 20 July 2005 18:08  |
Eclipse User |
|
|
|
Originally posted by: richkulp.us.NO_SPAM.ibm.com
Daniel Godbout wrote:
> Hi, I have two questions concerning the addition of a component to VE.
> First, I would like to know if there is a way to group properties of an
> Object in a category other than creating a class containing those
> properties. Let�s say I have a class that extends JButton to which I
> added two properties, I would like to have those properties grouped
> (showing under a category with the �+� sign in the properties view).
You use beaninfo to mark a property into a category:
PropertyDescriptor.setValue("category", "(category-name)");
And then you have to hit the Show categories button on the property
sheet (if not already depressed).
> Also, if I throw an illegal argument exception in a setter of a
> component, there is an exclamation mark showing over the component in
> the graphical editor. Is there a way to do the same thing with setters
> for a class which is used for a property? Let me explain what I mean.
> If I extends a JButton with two properties, foo which is an int and bar
> which is a point (a class I created with 2 variables, x and y). If a
> throw an illegal argument exception in setFoo(int aFoo) when the
> argument equals 2, I will have a exclamation mark showing in the
> graphical editor when I set that property to 2. If I throw an illegal
> argument exception in setX from the bar class, nothing is showed when I
> set x to 2 in the property editor. Is there a way to have the same
> comportment in the second case?
The problem is that it is a property of a property. We don't roll up the
error indicators. We only show errors of properties that are directly
set on a main component (i.e. a property of something in the BeansList).
So since setFoo is on the object in the BeansList, we can show the error
indicator. But since setX is on the property bar of setBar, we don't see
it because it more than one level down.
This would be a good enhancement. Please open a VE bugzilla on it
against component Java Core. We will then be able to prioritize it with
other enhancements.
>
> Thanks
>
> Daniel
>
>
--
Thanks,
Rich Kulp
|
|
|
Re: Properties sheet [message #609145 is a reply to message #98842] |
Wed, 20 July 2005 18:08  |
Eclipse User |
|
|
|
Originally posted by: richkulp.us.NO_SPAM.ibm.com
Daniel Godbout wrote:
> Hi, I have two questions concerning the addition of a component to VE.
> First, I would like to know if there is a way to group properties of an
> Object in a category other than creating a class containing those
> properties. Let�s say I have a class that extends JButton to which I
> added two properties, I would like to have those properties grouped
> (showing under a category with the �+� sign in the properties view).
You use beaninfo to mark a property into a category:
PropertyDescriptor.setValue("category", "(category-name)");
And then you have to hit the Show categories button on the property
sheet (if not already depressed).
> Also, if I throw an illegal argument exception in a setter of a
> component, there is an exclamation mark showing over the component in
> the graphical editor. Is there a way to do the same thing with setters
> for a class which is used for a property? Let me explain what I mean.
> If I extends a JButton with two properties, foo which is an int and bar
> which is a point (a class I created with 2 variables, x and y). If a
> throw an illegal argument exception in setFoo(int aFoo) when the
> argument equals 2, I will have a exclamation mark showing in the
> graphical editor when I set that property to 2. If I throw an illegal
> argument exception in setX from the bar class, nothing is showed when I
> set x to 2 in the property editor. Is there a way to have the same
> comportment in the second case?
The problem is that it is a property of a property. We don't roll up the
error indicators. We only show errors of properties that are directly
set on a main component (i.e. a property of something in the BeansList).
So since setFoo is on the object in the BeansList, we can show the error
indicator. But since setX is on the property bar of setBar, we don't see
it because it more than one level down.
This would be a good enhancement. Please open a VE bugzilla on it
against component Java Core. We will then be able to prioritize it with
other enhancements.
>
> Thanks
>
> Daniel
>
>
--
Thanks,
Rich Kulp
|
|
|
Powered by
FUDForum. Page generated in 0.07200 seconds