Skip to main content



      Home
Home » Eclipse Projects » GEF » Implement IPropertySource with array property
Implement IPropertySource with array property [message #155726] Tue, 26 October 2004 11:16 Go to next message
Eclipse UserFriend
Originally posted by: bandrews.nospam_bphnx.com

Hi,
I understand how to implement an IPropertySource for a complex type such
as Point or Dim, but I am stuck on how to do this for an array. Actually a
Hashtable<String,String>. If someone could give me a hint to help my
simple mind grasp this concept, I would greatly appreciate it.


thanks,

B
Re: Implement IPropertySource with array property [message #155735 is a reply to message #155726] Tue, 26 October 2004 11:27 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

Wrap the table in another propertysource object. So, create a descriptor
for the hashtable, but that descriptor doesn't need to allow editing or
provide a cell editor. The user will expand the source in the
propertysheet.

Then, in your propertysource implementation, implement getDescriptors() to
just return objects wrapping all of the keys in the table. getValue will
lookup the values in the table.

The propertysheet will call setPropertyValue() bottom-up. You can safely
ignore the setting of the hashtable back into the original source of the
table, but you do need to make sure you fire notification.

Finally, you probably could use a celleditor on the table itself to popup a
dialog which allows the creation of a new key+value pair.

"bandrews" <bandrews@nospam_bphnx.com> wrote in message
news:cllpo1$g37$1@eclipse.org...
> Hi,
> I understand how to implement an IPropertySource for a complex type such
> as Point or Dim, but I am stuck on how to do this for an array. Actually a
> Hashtable<String,String>. If someone could give me a hint to help my
> simple mind grasp this concept, I would greatly appreciate it.
>
>
> thanks,
>
> B
>
Re: Implement IPropertySource with array property [message #155741 is a reply to message #155735] Tue, 26 October 2004 11:37 Go to previous message
Eclipse UserFriend
Originally posted by: bandrews.nospam_bphnx.com

Very clear! Thanks a lot!!




Randy Hudson wrote:

> Wrap the table in another propertysource object. So, create a descriptor
> for the hashtable, but that descriptor doesn't need to allow editing or
> provide a cell editor. The user will expand the source in the
> propertysheet.

> Then, in your propertysource implementation, implement getDescriptors() to
> just return objects wrapping all of the keys in the table. getValue will
> lookup the values in the table.

> The propertysheet will call setPropertyValue() bottom-up. You can safely
> ignore the setting of the hashtable back into the original source of the
> table, but you do need to make sure you fire notification.

> Finally, you probably could use a celleditor on the table itself to popup a
> dialog which allows the creation of a new key+value pair.

> "bandrews" <bandrews@nospam_bphnx.com> wrote in message
> news:cllpo1$g37$1@eclipse.org...
> > Hi,
> > I understand how to implement an IPropertySource for a complex type such
> > as Point or Dim, but I am stuck on how to do this for an array. Actually a
> > Hashtable<String,String>. If someone could give me a hint to help my
> > simple mind grasp this concept, I would greatly appreciate it.
> >
> >
> > thanks,
> >
> > B
> >
Previous Topic:insert more than one element with the palette at once
Next Topic:how to create a subsubmenu
Goto Forum:
  


Current Time: Mon Jul 07 23:17:40 EDT 2025

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

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

Back to the top