pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Brown <gkbr...@mac.com>
Subject Re: extending a component
Date Thu, 04 Mar 2010 18:46:20 GMT
Bindable is probably what you are looking for. It hasn't been documented yet, but you can see
an example in the source code. See this thread for more info:

http://mail-archives.apache.org/mod_mbox/pivot-user/201003.mbox/%3c935D2D69-F9CC-43A8-BFEA-3AA0A30BE82E@mac.com%3e


On Mar 4, 2010, at 1:42 PM, Robert Piotrowski wrote:

> Where are the docs for bindable?
> 
> Without "bindable", would I normally have to "read" an object into a SplitPane object
and pass it to another object to compartmentalize the events for an accordion panel?
> 
> I have 4 panels for this accordion.  One for each type of entity (person,employee,company,assignment).
 Same basic components in the nested splitpanes/tableview/treeviews.  Same mouse/text handlers.
 Whats the best way to compartmentalize these panels so that I dont have to pass the panel
name to all the methods & handlers?
> 
> 
> I need to use Java handlers, I cant use the javascript stuff.
> 
> 
> Thanks,
> 
> Bob
> 
> 
> On Thu, Mar 4, 2010 at 10:28 AM, Greg Brown <gkbrown@mac.com> wrote:
> Heh. I was going to suggest that you take a look at the Bindable interface for this use
case as well.
> 
> I really need to get that part of the tutorial done.  :-)
> 
> 
> On Mar 4, 2010, at 11:14 AM, Robert Piotrowski wrote:
> 
>> never mind.
>> 
>> I'm a bonehead.
>> 
>> 
>> 
>> Sorry.
>> 
>> 
>> 
>> 
>> 
>> 
>> On Thu, Mar 4, 2010 at 9:14 AM, Robert Piotrowski <rpiotrowski@azonic.net>
wrote:
>> I'm trying to add independent SplitPane classes to an Accordian.  All SplitPanes
are pretty similar and I wanted them to run independently so I tried this:
>> 
>> public class EntityPane extends SplitPane{
>> 
>>     SplitPane entity_pane;
>> 
>>     public EntityPane(String URL) throws Exception{
>> 
>>         WTKXSerializer wtkxSerializer = new WTKXSerializer();
>>         System.out.println("url:"+ URL);
>>         this.entity_pane = (SplitPane) wtkxSerializer.readObject(new FileInputStream(URL));
>>         System.out.println("inner_user_data:" + entity_pane.getUserData().get("entity").toString());
 //This works.
>> 
>>     }
>> 
>> }
>> 
>> 
>> And then I tried adding them to the accordion this way, but I'm getting a null pointer
when trying to access the userdata or adding it to the accordion add setting the index to
zero:
>> 
>> public void startup(Display display, Map<String, String> properties)
>>             throws Exception {
>>         WTKXSerializer wtkxSerializer = new WTKXSerializer();
>> 
>>         window = (Window) wtkxSerializer.readObject(new FileInputStream("c:\\rpiotrowski\\solr\\topwindow_v2.xml"));
>> 
>>         accordion_entities= (Accordion) wtkxSerializer.get("accordion_entities");
>>   
>>         EntityPane person = new EntityPane("c:\\rpiotrowski\\solr\\pane_person.xml");
 //The instantiation shows the inner system.out.println above.
>>             
>>         System.out.println("outer_user_data:" + person.getUserData().get("entity").toString());
>> 
>> //fails        accordion_entities.add(new EntityPane("c:\\rpiotrowski\\solr\\pane_person.xml"));
>> //fails        accordion_entities.setSelectedIndex(0);
>> 
>> 
>> I want to encapsulate the splitpanels into their own java objects to make all the
eventhandling easier.  If I have everything in one xml_file then I have to pass the splitpanel
to every listener, etc.
>> 
>> 
>> If I do "includes" in the xml, I'll end up with a everything in one big main class
again.  Right?
>> 
>> 
>> 
>> 
>> Bob
>> 
> 
> 


Mime
View raw message