custom TableFormat for computed display fields?

View: New views
2 Messages — Rating Filter:   Alert me  

custom TableFormat for computed display fields?

by arghman :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have an EventList<Foo> where Foo contains information that's not directly accessible as Bean-style fields, e.g. if I have a Foo foo, I have to call String.format("%0.3f", foo.getMetadata().getCapacity()) to extract a string representing capacity, I can't just call foo.getCapacity().

Is there a way to create a custom TableFormat object to do the dirty work of extracting the relevant computed fields for display purposes?

For the time being I am going to try to use a TransformedList<Foo, DisplayFoo> where DisplayFoo is a wrapper class that exposes Bean-style fields, but that just seems wrong.

re: custom TableFormat for computed display fields?

by Kevin Day-7 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
You'll want to provide your own TableFormat implementation instead of having one constructed for you from bean properties.
 
- K
 
----------------------- Original Message -----------------------
  
From: arghman jmsachs@...
Cc: 
Date: Tue, 11 Aug 2009 06:51:46 -0700 (PDT)
Subject: custom TableFormat for computed display fields?
  

I have an EventList<Foo> where Foo contains information that's not directly
accessible as Bean-style fields, e.g. if I have a Foo foo, I have to call
String.format("%0.3f", foo.getMetadata().getCapacity()) to extract a string
representing capacity, I can't just call foo.getCapacity().

Is there a way to create a custom TableFormat object to do the dirty work of
extracting the relevant computed fields for display purposes?

For the time being I am going to try to use a TransformedList<Foo,
DisplayFoo> where DisplayFoo is a wrapper class that exposes Bean-style
fields, but that just seems wrong.
--
View this message in context: http://www.nabble.com/custom-TableFormat-for-computed-display-fields--tp24918088p24918088.html
Sent from the GlazedLists - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


--------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@... For additional commands, e-mail: users-help@...