<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.de/matlabcentral/newsreader/view_thread/174063</link>
    <title>MATLAB Central Newsreader - Java handle to R2008a uitable</title>
    <description>Feed for thread: Java handle to R2008a uitable</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2013 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.de/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Sat, 09 Aug 2008 12:51:02 +0000</pubDate>
      <title>Java handle to R2008a uitable</title>
      <link>http://www.mathworks.de/matlabcentral/newsreader/view_thread/174063#448303</link>
      <author>Jesse Lai</author>
      <description>Does anyone know how to get the java handle to the new&lt;br&gt;
R2008a uitable?  There are several properties that I need to&lt;br&gt;
access that can only be done with setting the Java properties.</description>
    </item>
    <item>
      <pubDate>Sat, 09 Aug 2008 16:34:02 +0000</pubDate>
      <title>Re: Java handle to R2008a uitable</title>
      <link>http://www.mathworks.de/matlabcentral/newsreader/view_thread/174063#448316</link>
      <author>Donn Shull</author>
      <description>"Jesse Lai" &amp;lt;jlai.DELETETHISmatlab@gmailNOSPAM.moc&amp;gt; wrote &lt;br&gt;
in message &amp;lt;g7k3rm$b1n$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Does anyone know how to get the java handle to the new&lt;br&gt;
&amp;gt; R2008a uitable?  There are several properties that I need &lt;br&gt;
to&lt;br&gt;
&amp;gt; access that can only be done with setting the Java &lt;br&gt;
properties.&lt;br&gt;
&lt;br&gt;
If your tables handle graphics handle is t, then:&lt;br&gt;
&lt;br&gt;
jt = java(handle(t));&lt;br&gt;
&lt;br&gt;
will return an object of class uitableBeanAdapter0 which &lt;br&gt;
may allow you access to the things you want.&lt;br&gt;
&lt;br&gt;
Donn</description>
    </item>
    <item>
      <pubDate>Sat, 09 Aug 2008 20:16:44 +0000</pubDate>
      <title>Re: Java handle to R2008a uitable</title>
      <link>http://www.mathworks.de/matlabcentral/newsreader/view_thread/174063#448327</link>
      <author>Jesse Lai</author>
      <description>Donn Shull wrote:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; If your tables handle graphics handle is t, then:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; jt = java(handle(t));&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; will return an object of class uitableBeanAdapter0 which &lt;br&gt;
&amp;gt; may allow you access to the things you want.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Donn&lt;br&gt;
&amp;gt; &lt;br&gt;
&lt;br&gt;
Donn,&lt;br&gt;
&lt;br&gt;
I did try that, but it doesn't give the handle to the actual java table. &lt;br&gt;
&amp;nbsp;&amp;nbsp;It gives a java handle to the MATLAB wrapper or something.  I want to &lt;br&gt;
be able to access the methods of the java table directly, such as &lt;br&gt;
getSelectedRows/getSelectedColumns and also be able to set them since &lt;br&gt;
the MATLAB uitable doesn't have any capability to set the active cell. &lt;br&gt;
A major oversight IMHO.&lt;br&gt;
&lt;br&gt;
I'm able to do it using Yair Altman's findjobj for uitables that are &lt;br&gt;
made with the uitable command, such as:&lt;br&gt;
&lt;br&gt;
hFig = figure;&lt;br&gt;
h = uitable('Parent', hFig, 'Position', [0 0 100 100]);&lt;br&gt;
t = findjobj(h);&lt;br&gt;
t1 = get(t,'ViewPort');&lt;br&gt;
jt = get(t1, 'View');&lt;br&gt;
&lt;br&gt;
They have the table buried inside of Java scroll frames, etc.&lt;br&gt;
&lt;br&gt;
But when I try the same code on the GUIDE uitable, it doesn't work.  The &lt;br&gt;
findjobj function returns a null handle.&lt;br&gt;
&lt;br&gt;
I'll keep playing, please keep suggestions coming.&lt;br&gt;
&lt;br&gt;
Thanks,&lt;br&gt;
&lt;br&gt;
Jesse</description>
    </item>
    <item>
      <pubDate>Sun, 10 Aug 2008 07:19:06 +0000</pubDate>
      <title>Re: Java handle to R2008a uitable</title>
      <link>http://www.mathworks.de/matlabcentral/newsreader/view_thread/174063#448355</link>
      <author>Yair Altman</author>
      <description>Jesse Lai &amp;lt;"jlai.[DELETETHIS]matlab"@gmail[NOSPAM].moc&amp;gt;&lt;br&gt;
wrote in message &lt;br&gt;
&amp;gt; hFig = figure;&lt;br&gt;
&amp;gt; h = uitable('Parent', hFig, 'Position', [0 0 100 100]);&lt;br&gt;
&amp;gt; t = findjobj(h);&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; But when I try the same code on the GUIDE uitable, it&lt;br&gt;
&amp;gt; doesn't work.  The findjobj function returns a null handle.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Try running findjobj on hFig (not h), without any output:&lt;br&gt;
findjobj(hFig,'-nomenu');&lt;br&gt;
&lt;br&gt;
- this will display a GUI window with ALL the object in your&lt;br&gt;
figure, and I bet you can find the JTable buried somewhere&lt;br&gt;
in there. Once you find it, you can use its classname or&lt;br&gt;
other property to provide as extra params to findjobj, in&lt;br&gt;
order to get the relevant handle programmatically.&lt;br&gt;
&lt;br&gt;
Let us know what you find.&lt;br&gt;
&lt;br&gt;
Yair Altman</description>
    </item>
    <item>
      <pubDate>Sun, 10 Aug 2008 14:50:04 +0000</pubDate>
      <title>Re: Java handle to R2008a uitable</title>
      <link>http://www.mathworks.de/matlabcentral/newsreader/view_thread/174063#448383</link>
      <author>Jesse Lai</author>
      <description>Yair Altman wrote:&lt;br&gt;
&amp;gt; Try running findjobj on hFig (not h), without any output:&lt;br&gt;
&amp;gt; findjobj(hFig,'-nomenu');&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; - this will display a GUI window with ALL the object in your&lt;br&gt;
&amp;gt; figure, and I bet you can find the JTable buried somewhere&lt;br&gt;
&amp;gt; in there. Once you find it, you can use its classname or&lt;br&gt;
&amp;gt; other property to provide as extra params to findjobj, in&lt;br&gt;
&amp;gt; order to get the relevant handle programmatically.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Let us know what you find.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Yair Altman&lt;br&gt;
&lt;br&gt;
Yair,&lt;br&gt;
&lt;br&gt;
I think I've found the difference, although I haven't looked deeply in &lt;br&gt;
your code to see the difference.  First, I did try your suggestion of &lt;br&gt;
searching the handle of the GUI.  In case someone's interested, this &lt;br&gt;
seemed to work AFTER the GUI was made visible:&lt;br&gt;
&lt;br&gt;
jt = findjobj(hFig, '-nomenu', 'class', 'uitablepeer');&lt;br&gt;
&lt;br&gt;
where hFig is the handle the GUI figure.  But you can also use the more &lt;br&gt;
direct approach of just passing in the handle to the uitable at that &lt;br&gt;
point and using the code I posted previously to get the viewport.&lt;br&gt;
&lt;br&gt;
The problem I'm running into is that I am putting that line in the &lt;br&gt;
opening function of the GUIDE gui.  At the end of the OpeningFcn, the &lt;br&gt;
GUI visibility is set to off.  Well, findjobj doesn't return any results &lt;br&gt;
if the figure visibility is off.  As soon as I turn it on, it works as &lt;br&gt;
expected.&lt;br&gt;
&lt;br&gt;
I'm not sure that I'm going to be able to use the uitable anyway because &lt;br&gt;
of its many limitations.  I'm going to keep playing with it though.  Not &lt;br&gt;
sure where to put this function though if it doesn't work in OpeningFcn.&lt;br&gt;
&lt;br&gt;
On a side note, your findjobj function gives lots of warnings in R2008a &lt;br&gt;
about the javaframe property.  There's not much you can do about it I &lt;br&gt;
suppose unless the user suppress these warnings, which is what I do for &lt;br&gt;
my code.  But in R2008b, it gets lots more warnings and exceptions, &lt;br&gt;
although it does make it through eventually.  The uitreenode is being &lt;br&gt;
added to a future release, so they've added a '-v0' switch in R2008b &lt;br&gt;
like they did for the uitable.  Also, your jidesoft table causes some &lt;br&gt;
java exceptions with the built-in uitable because they're using it too &lt;br&gt;
for the column headers or something.&lt;br&gt;
&lt;br&gt;
Jesse</description>
    </item>
  </channel>
</rss>
