SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Studio
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV Studio Discussion related to the SageTV Studio application produced by SageTV. Questions, issues, problems, suggestions, etc. relating to the Studio software application should be posted here.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 05-16-2009, 11:01 PM
tpboyce tpboyce is offline
Sage User
 
Join Date: Dec 2007
Posts: 58
Populating Tables from Java Functions

I am working on a plugin that will ultimately have two tables. The data will be drawn from a custom Java class, so I can structure the returns however it works best. The table on the left will drive the data in the table on the right. There are a couple of things that I am running into that I am not readily finding answers to:

1) What is the expected return from my Java Application? Is it an array of strings? An array of objects? If it is an array of objects, what determines the text that is displayed in the table?

2) For my second table, depending upon the answer to 1, it would be possible to populate the table with all of the data and filter based upon the first table.

3) I am hoping that it is an array of objects becaust there could be multiple items in the list with the same text value. This will be rare, but is possible.

4) In the background, I may receive updates that might affect the data in the second table (which will likely be two dimensional).
Reply With Quote
  #2  
Old 05-16-2009, 11:38 PM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
A Table widget takes as input an array, List, Vector, or Map. In the first three cases the element type can be whatever you need it to be; in the Map case the Map's key set is used, and the element type is the key type.

The Table and TableComponent widgets just define the structure and layout of the table. The actual content displayed in each cell is determined by whatever chain of UI widgets you create below the TableComponent. It's up to you to interpret the element data (whatever it may be) and generate the appropriate text and/or graphics to display in the cell.

Filtering is not something the table does. It's something you do to your data before passing it in to the Table widget. Your job is to construct the array, List, or whatever to contain exactly the data you want display, in the order you want it. So any sorting or filtering happens first, before the table comes into play.

If your data changes, it's up to you to notice the change a trigger a display refresh. During the refresh, Sage will re-execute the code leading into the Table widget, thereby recalculating the array or List that feeds it.

The basic mechanics of tables are covered in the tutorial #12 in chapter 8 of the Studio manual. It's a good idea to work through those tutorials if you haven't already.
__________________
-- Greg
Reply With Quote
  #3  
Old 05-17-2009, 03:50 PM
tpboyce tpboyce is offline
Sage User
 
Join Date: Dec 2007
Posts: 58
I have looked over the samples, and they still leave a gap. I am going to try some of my own code. The big question that I have is if I have an array of objects, how do I specify the name, and do I have easy access to other parameters?
Reply With Quote
  #4  
Old 05-17-2009, 05:11 PM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
The name of what? What other parameters?

Again, any text that appears on screen is the result of some chain of UI widgets you create. If your object has a field called Name, create an Action widget to call that field accessor, and pass the result to a Text widget. If your objects have other fields or methods whose values you want to display, write the appropriate code to call those methods and format the result as text.

If your question is about how to call arbitrary Java methods from widget code at all (never mind tables), see p. 151 of the Studio manual.
__________________
-- Greg
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Tables, Java - Java Not being Called for each TableComponent Cell stuckless SageTV Studio 3 04-02-2008 03:03 PM
Resizing Tables bialio SageTV Studio 5 01-22-2008 01:17 PM
Upgrade to Java 1.6.01 breaks PageUp and PageDown functions jhkoenig SageTV Software 3 05-01-2007 10:42 PM
Troubling Tables kuch68 SageTV Studio 5 09-13-2006 01:06 PM


All times are GMT -6. The time now is 03:56 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.