Path: csiph.com!x330-a1.tempe.blueboxinc.net!feeder1.hal-mli.net!news.glorb.com!news-out.readnews.com!news-xxxfer.readnews.com!news-out.news.tds.net!newsreading01.news.tds.net!86597e80!not-for-mail From: "Eric Sosman" Subject: Re: One missing link in j Message-ID: X-Comment-To: comp.lang.java.gui,comp.l Newsgroups: comp.lang.java.gui In-Reply-To: References: Content-Type: text/plain; charset=IBM437 Content-Transfer-Encoding: 8bit X-Gateway: time.synchro.net [Synchronet 3.15a-Win32 NewsLink 1.92] Lines: 54 Date: Wed, 27 Apr 2011 15:36:17 GMT NNTP-Posting-Host: 96.60.20.240 X-Complaints-To: news@tds.net X-Trace: newsreading01.news.tds.net 1303918577 96.60.20.240 (Wed, 27 Apr 2011 10:36:17 CDT) NNTP-Posting-Date: Wed, 27 Apr 2011 10:36:17 CDT Organization: TDS.net Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.gui:1948 To: comp.lang.java.gui,comp.l Bjorn Abelli wrote: > "Oliver Wong" wrote... >> "Eric Sosman" wrote ... >>> Oliver Wong wrote: > >>>> "RC" wrote in message >>>> news:f5ua7t$2ci$1@news.nems.noaa.gov... >>>>> Where is that missing link between DefaultTableColumnModel and >>>>> DefaultTableModel? >>>>> or between TableColumnModel and TableModel? >>>>> >>>>> Thank Q very much in advance! >>>> TableModel is an object that can be queried to provide information >>>> about tabular data. This object contains no information about how this >>>> data should be displayed, or what business rules might apply to the >>>> interaction between the user and this data (e.g. this user cannot edit >>>> certain parts of the data, etc.) >>> You were doing fine, and I was applauding, right up until >>> the parenthetical remark. How do you reconcile that remark with >>> the isCellEditable() method? >> Bad design on Sun's part? Surely, the error cannot be mine. ;) > > I'm not sure I get the objections of either part here... > > I agree with Oliver that the TableModel should be a "backing unit", separate > from the user interface, but now I'm not quite sure what you mean with > "interaction between the user and this [displayed] data". > > As far as I'm concerned there is still a difference between the possibility > to edit displayed data (in the interface) and the isCellEditable() in the > TableModel; the possibility to affect the "backing data". If you could change the displayed data without changing the model's data, in what sense would the model be "backing" the display? If you edit the content of a displayed cell (and the edit passes whatever validity checks are in force), the table eventually calls the model's setValueAt() method with the newly-entered data. It is conceivable that setValueAt() might be a no-op and leave the model unchanged, but that's a pretty strange thing to do -- if the table subsequently called getValueAt() on the cell, perhaps during a repaint while scrolling or something, the edit would "softly and silently vanish away!" -- Eric Sosman esosman@ieee-dot-org.invalid --- * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet! --- Synchronet 3.15a-Win32 NewsLink 1.92 Time Warp of the Future BBS - telnet://time.synchro.net:24