<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Setting line position in an edit-box uicontrol</title>
	<atom:link href="http://undocumentedmatlab.com/blog/setting-line-position-in-edit-box-uicontrol/feed/" rel="self" type="application/rss+xml" />
	<link>http://undocumentedmatlab.com/blog/setting-line-position-in-edit-box-uicontrol/</link>
	<description>Charting Matlab's unsupported hidden underbelly</description>
	<lastBuildDate>Tue, 07 Sep 2010 22:25:59 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Yair Altman</title>
		<link>http://undocumentedmatlab.com/blog/setting-line-position-in-edit-box-uicontrol/comment-page-1/#comment-1122</link>
		<dc:creator>Yair Altman</dc:creator>
		<pubDate>Mon, 01 Jun 2009 17:38:24 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=81#comment-1122</guid>
		<description>@Bindermann - I can think of two reasons for this problem:

1. the figure or one of its components is hidden, thereby causing a problem in retrieving the RootPane and/or TopLevelAncestor (=Frame peer) references.

2. are you using the latest version of FindJObj? - one of the latest versions increased the size/position tolerance used when trying to locate a handle onscreen and this may solve the problem of FindJObj not finding this handle.

If none of these appear to be the cause, then please email me a reproducible code snippet and I&#039;ll try to fix the problem.</description>
		<content:encoded><![CDATA[<p>@Bindermann &#8211; I can think of two reasons for this problem:</p>
<p>1. the figure or one of its components is hidden, thereby causing a problem in retrieving the RootPane and/or TopLevelAncestor (=Frame peer) references.</p>
<p>2. are you using the latest version of FindJObj? &#8211; one of the latest versions increased the size/position tolerance used when trying to locate a handle onscreen and this may solve the problem of FindJObj not finding this handle.</p>
<p>If none of these appear to be the cause, then please email me a reproducible code snippet and I&#8217;ll try to fix the problem.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: A. Bindemann</title>
		<link>http://undocumentedmatlab.com/blog/setting-line-position-in-edit-box-uicontrol/comment-page-1/#comment-1118</link>
		<dc:creator>A. Bindemann</dc:creator>
		<pubDate>Mon, 01 Jun 2009 12:25:14 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=81#comment-1118</guid>
		<description>Yair,

I&#039;m having a problem with findjobj.  It returns an empty result when I pass it the MATLAB handle of an edit box.    The problem appears to begin in the call to getRootPanel on line 319 (jRootPane = jFigPanel.getRootPane).

The function falls through to line 346 (jRootPane = jRootPane.getTopLevelAncestor;) which also returns an empty result.

I&#039;m trying to use a MATLAB GUI to display a message log, and would like to position the cursor at the end of the edit box.  Interestingly, the edit box behavior under R14SP3 always placed the cursor at the end of the edit box.  The behavior changed somewhere between that version and R2007b.

Any ideas you might have would be appreciated.

Thanks,
A. Bindemann</description>
		<content:encoded><![CDATA[<p>Yair,</p>
<p>I&#8217;m having a problem with findjobj.  It returns an empty result when I pass it the MATLAB handle of an edit box.    The problem appears to begin in the call to getRootPanel on line 319 (jRootPane = jFigPanel.getRootPane).</p>
<p>The function falls through to line 346 (jRootPane = jRootPane.getTopLevelAncestor;) which also returns an empty result.</p>
<p>I&#8217;m trying to use a MATLAB GUI to display a message log, and would like to position the cursor at the end of the edit box.  Interestingly, the edit box behavior under R14SP3 always placed the cursor at the end of the edit box.  The behavior changed somewhere between that version and R2007b.</p>
<p>Any ideas you might have would be appreciated.</p>
<p>Thanks,<br />
A. Bindemann</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Heiko</title>
		<link>http://undocumentedmatlab.com/blog/setting-line-position-in-edit-box-uicontrol/comment-page-1/#comment-196</link>
		<dc:creator>Heiko</dc:creator>
		<pubDate>Mon, 20 Apr 2009 06:29:14 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=81#comment-196</guid>
		<description>Thank you for the answer. 

Unfortunately, both of your options don&#039;t work. But while trying I found that fiddling with the java settings alters the uitable properties in an unpredictable way. For instance, the ColumnEditable property is reset to default (1), which caused the described behavior. 

Another problem is, that there seems to be a loop through many different callbacks that call my CellSelectionCallback. Especially from the second selection it takes seconds for the tables to react, and the result is wrong. 

I stop working on this for now. Thank you again! Bye</description>
		<content:encoded><![CDATA[<p>Thank you for the answer. </p>
<p>Unfortunately, both of your options don&#8217;t work. But while trying I found that fiddling with the java settings alters the uitable properties in an unpredictable way. For instance, the ColumnEditable property is reset to default (1), which caused the described behavior. </p>
<p>Another problem is, that there seems to be a loop through many different callbacks that call my CellSelectionCallback. Especially from the second selection it takes seconds for the tables to react, and the result is wrong. </p>
<p>I stop working on this for now. Thank you again! Bye</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yair Altman</title>
		<link>http://undocumentedmatlab.com/blog/setting-line-position-in-edit-box-uicontrol/comment-page-1/#comment-161</link>
		<dc:creator>Yair Altman</dc:creator>
		<pubDate>Fri, 17 Apr 2009 13:38:04 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=81#comment-161</guid>
		<description>You can do 2 things with a standard JTable and the old uitable, but I&#039;m not sure they work with the new uitable (no harm trying):

1. Set all the table columns as non-editable using somthing like the following:

      for colIdx = 0 : numCols
          tablePeer.setEditable(colIdx,0);  % 1:end doesn&#039;t work...
      end

2. Set all the table column CellEditors to have infinite ClickCountToStart, like this:

      for colIdx = 0 : numCols
          try
             editor=tablePeer.getColumnModel.getColumn(colIdx).getCellEditor;
             editor.setClickCountToStart(intmax);  % i.e, never enter edit mode...
          catch
             % never mind...
          end
      end

One or both of these may work for you.</description>
		<content:encoded><![CDATA[<p>You can do 2 things with a standard JTable and the old uitable, but I&#8217;m not sure they work with the new uitable (no harm trying):</p>
<p>1. Set all the table columns as non-editable using somthing like the following:</p>
<p>      for colIdx = 0 : numCols<br />
          tablePeer.setEditable(colIdx,0);  % 1:end doesn&#8217;t work&#8230;<br />
      end</p>
<p>2. Set all the table column CellEditors to have infinite ClickCountToStart, like this:</p>
<p>      for colIdx = 0 : numCols<br />
          try<br />
             editor=tablePeer.getColumnModel.getColumn(colIdx).getCellEditor;<br />
             editor.setClickCountToStart(intmax);  % i.e, never enter edit mode&#8230;<br />
          catch<br />
             % never mind&#8230;<br />
          end<br />
      end</p>
<p>One or both of these may work for you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Heiko</title>
		<link>http://undocumentedmatlab.com/blog/setting-line-position-in-edit-box-uicontrol/comment-page-1/#comment-159</link>
		<dc:creator>Heiko</dc:creator>
		<pubDate>Fri, 17 Apr 2009 12:59:50 +0000</pubDate>
		<guid isPermaLink="false">http://undocumentedmatlab.com/?p=81#comment-159</guid>
		<description>Hi. Yesterday I stepped over the findjobj function (actually a very fine piece of work, thank you very much!) while looking for a way to link the selected cells of multiple uitable objects (R2009a). I have four uitables showing related data at different processing stages. What I wanted was to click on one table and select the same cell in all four tables, which is not a native uitable property to set (or even get! The selected cell is given only in the CellSelectionEvent). With findjobj I found several promising methods. The methods &quot;setRowSelectionInterval&quot; and &quot;setColumnSelectionInterval&quot; seemed to link to the method &quot;setSelectionInterval&quot; of the javax.swing.DefaultListSelectionModel but it didn&#039;t work at all. The method &quot;changeSelection&quot; (seems to be a wrapper from the MathWorks) finally did almost what I wanted. It selected the correct cells when I first clicked on a table, but after that, clicking on the tables directly entered the cell editing mode, even if this was disabled for the uitable object, and so the cellSelectionEvent was not fired anymore. I also couldn&#039;t find out what the parameters of the method are. It takes four of them, the first is the row, the second is the column. The other two do change the behavior in an undescribable way. Do you have any hints where I can find out about the parameters of &quot;changeSelection&quot;, and if there is something else I could do to get the behavior I like to have? Maybe I misunderstood the SelectionInterval-functionality, but it didn&#039;t change anything on the java objects. Thank you for reading!</description>
		<content:encoded><![CDATA[<p>Hi. Yesterday I stepped over the findjobj function (actually a very fine piece of work, thank you very much!) while looking for a way to link the selected cells of multiple uitable objects (R2009a). I have four uitables showing related data at different processing stages. What I wanted was to click on one table and select the same cell in all four tables, which is not a native uitable property to set (or even get! The selected cell is given only in the CellSelectionEvent). With findjobj I found several promising methods. The methods &#8220;setRowSelectionInterval&#8221; and &#8220;setColumnSelectionInterval&#8221; seemed to link to the method &#8220;setSelectionInterval&#8221; of the javax.swing.DefaultListSelectionModel but it didn&#8217;t work at all. The method &#8220;changeSelection&#8221; (seems to be a wrapper from the MathWorks) finally did almost what I wanted. It selected the correct cells when I first clicked on a table, but after that, clicking on the tables directly entered the cell editing mode, even if this was disabled for the uitable object, and so the cellSelectionEvent was not fired anymore. I also couldn&#8217;t find out what the parameters of the method are. It takes four of them, the first is the row, the second is the column. The other two do change the behavior in an undescribable way. Do you have any hints where I can find out about the parameters of &#8220;changeSelection&#8221;, and if there is something else I could do to get the behavior I like to have? Maybe I misunderstood the SelectionInterval-functionality, but it didn&#8217;t change anything on the java objects. Thank you for reading!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
