From fbrunnerlist at gmx.ch Mon Mar 2 11:46:39 2009 From: fbrunnerlist at gmx.ch (Florian Brunner) Date: Mon, 02 Mar 2009 12:46:39 +0100 Subject: Swing Group Status? Message-ID: <49ABC71F.6000001@gmx.ch> Hi, I posted several e-mails the past 2 weeks but unfortunatly the only response from Sun was some shorts thoughts from Alexander Potochkin. Now, I don't want to blame anyone (I cannot always react as fast as I would like to, myself), but for the better understanding: What is the current status of the Swing group of OpenJDK inside Sun? How many developers work full-time for the Swing project inside Sun? How many developers work partial-time for the Swing project inside Sun? How is the communication to the community organized inside Sun? Do all Swing developers of Sun participate in swing-dev at openjdk.java.net or just some selected developers? Do these developers have some fixed time they can use to communicate with the community or just as needed and time allows? It would be great if we could speed up things a bit! -Florian From Alexander.Potochkin at Sun.COM Mon Mar 2 13:26:34 2009 From: Alexander.Potochkin at Sun.COM (Alexander Potochkin) Date: Mon, 02 Mar 2009 16:26:34 +0300 Subject: Swing Group Status? In-Reply-To: <49ABC71F.6000001@gmx.ch> References: <49ABC71F.6000001@gmx.ch> Message-ID: <49ABDE8A.40502@sun.com> Hello Florian > Hi, > > I posted several e-mails the past 2 weeks but unfortunatly the only > response from Sun was some shorts thoughts from Alexander Potochkin. > Now, I don't want to blame anyone (I cannot always react as fast as I > would like to, myself), but for the better understanding: > > What is the current status of the Swing group of OpenJDK inside Sun? > How many developers work full-time for the Swing project inside Sun? > How many developers work partial-time for the Swing project inside Sun? > How is the communication to the community organized inside Sun? > Do all Swing developers of Sun participate in swing-dev at openjdk.java.net > or just some selected developers? > Do these developers have some fixed time they can use to communicate > with the community or just as needed and time allows? I am really sorry for delay in our communication Let me explain the situation: Your participation is very important for us, so the dedicated engineer(Pavel) is responsible for supporting your efforts. That's why I sent only shorts thoughts about that. Unfortunately Pavel is ill now and can't answer you, but it is not serious and he is going to recover in couple of days and returning to swing-dev > > It would be great if we could speed up things a bit! Meanwhile let me know if there is anything I can help you with. Thank you very much for your support alexp > > -Florian > From fbrunnerlist at gmx.ch Mon Mar 2 18:13:58 2009 From: fbrunnerlist at gmx.ch (Florian Brunner) Date: Mon, 02 Mar 2009 19:13:58 +0100 Subject: Swing Group Status? In-Reply-To: <49ABDE8A.40502@sun.com> References: <49ABC71F.6000001@gmx.ch> <49ABDE8A.40502@sun.com> Message-ID: <49AC21E6.80103@gmx.ch> Hi Alexander, thanks for your answer. Sorry to hear that Pavel is ill and hope he is soon well again. I understand that Pavel is responsible for the swing-generics project (from Sun side), but of course all Swing developers are invited to join the discussions (inside and outside of Sun). If all agree, the chances are smaller that we missed something. If not, then this can lead to more arguments from the other developers. This should also make life easier for Pavel to form an opinion for the final decision. Since creating a polished patch always takes some (of my free-)time, it's important for me that there are already decisions for all the open questions before I start to make a patch for later review. -Florian Alexander Potochkin schrieb: > Hello Florian > >> Hi, >> >> I posted several e-mails the past 2 weeks but unfortunatly the only >> response from Sun was some shorts thoughts from Alexander Potochkin. >> Now, I don't want to blame anyone (I cannot always react as fast as I >> would like to, myself), but for the better understanding: >> >> What is the current status of the Swing group of OpenJDK inside Sun? >> How many developers work full-time for the Swing project inside Sun? >> How many developers work partial-time for the Swing project inside Sun? >> How is the communication to the community organized inside Sun? >> Do all Swing developers of Sun participate in >> swing-dev at openjdk.java.net or just some selected developers? >> Do these developers have some fixed time they can use to communicate >> with the community or just as needed and time allows? > > I am really sorry for delay in our communication > > Let me explain the situation: > > Your participation is very important for us, > so the dedicated engineer(Pavel) > is responsible for supporting your efforts. > > That's why I sent only shorts thoughts about that. > > Unfortunately Pavel is ill now and can't answer you, > but it is not serious and he is going to recover in couple of days > and returning to swing-dev >> >> It would be great if we could speed up things a bit! > > Meanwhile let me know if there is anything I can help you with. > > Thank you very much for your support > alexp > >> >> -Florian >> > From Alexander.Potochkin at Sun.COM Mon Mar 2 18:33:22 2009 From: Alexander.Potochkin at Sun.COM (Alexander Potochkin) Date: Mon, 02 Mar 2009 21:33:22 +0300 Subject: Swing Group Status? In-Reply-To: <49AC21E6.80103@gmx.ch> References: <49ABC71F.6000001@gmx.ch> <49ABDE8A.40502@sun.com> <49AC21E6.80103@gmx.ch> Message-ID: <49AC2672.4010204@sun.com> Hello Florian > Hi Alexander, > > thanks for your answer. > > Sorry to hear that Pavel is ill and hope he is soon well again. > > I understand that Pavel is responsible for the swing-generics project > (from Sun side), but of course all Swing developers are invited to join > the discussions (inside and outside of Sun). If all agree, the chances > are smaller that we missed something. If not, then this can lead to more > arguments from the other developers. This should also make life easier > for Pavel to form an opinion for the final decision. That's correct. I'll encourage people to participate. > Since creating a polished patch always takes some (of my free-)time, > it's important for me that there are already decisions for all the open > questions before I start to make a patch for later review. I understand. I am going to reread the messages with your latest proposals. Thanks for your support alexp > > -Florian > > Alexander Potochkin schrieb: >> Hello Florian >> >>> Hi, >>> >>> I posted several e-mails the past 2 weeks but unfortunatly the only >>> response from Sun was some shorts thoughts from Alexander Potochkin. >>> Now, I don't want to blame anyone (I cannot always react as fast as I >>> would like to, myself), but for the better understanding: >>> >>> What is the current status of the Swing group of OpenJDK inside Sun? >>> How many developers work full-time for the Swing project inside Sun? >>> How many developers work partial-time for the Swing project inside Sun? >>> How is the communication to the community organized inside Sun? >>> Do all Swing developers of Sun participate in >>> swing-dev at openjdk.java.net or just some selected developers? >>> Do these developers have some fixed time they can use to communicate >>> with the community or just as needed and time allows? >> >> I am really sorry for delay in our communication >> >> Let me explain the situation: >> >> Your participation is very important for us, >> so the dedicated engineer(Pavel) >> is responsible for supporting your efforts. >> >> That's why I sent only shorts thoughts about that. >> >> Unfortunately Pavel is ill now and can't answer you, >> but it is not serious and he is going to recover in couple of days >> and returning to swing-dev >>> >>> It would be great if we could speed up things a bit! >> >> Meanwhile let me know if there is anything I can help you with. >> >> Thank you very much for your support >> alexp >> >>> >>> -Florian >>> >> > From roman.kennke at aicas.com Mon Mar 2 19:37:04 2009 From: roman.kennke at aicas.com (Roman Kennke) Date: Mon, 02 Mar 2009 20:37:04 +0100 Subject: Swing Group Status? In-Reply-To: <49ABC71F.6000001@gmx.ch> References: <49ABC71F.6000001@gmx.ch> Message-ID: <1236022624.10565.2.camel@moonlight> Hi there, > I posted several e-mails the past 2 weeks but unfortunatly the only > response from Sun was some shorts thoughts from Alexander Potochkin. Btw, same for me. Generally, when I post something to swing-dev, I need a lot of patience. /Roman > Now, I don't want to blame anyone (I cannot always react as fast as I > would like to, myself), but for the better understanding: > > What is the current status of the Swing group of OpenJDK inside Sun? > How many developers work full-time for the Swing project inside Sun? > How many developers work partial-time for the Swing project inside Sun? > How is the communication to the community organized inside Sun? > Do all Swing developers of Sun participate in swing-dev at openjdk.java.net > or just some selected developers? > Do these developers have some fixed time they can use to communicate > with the community or just as needed and time allows? > > It would be great if we could speed up things a bit! > > -Florian > -- Dipl.-Inform. (FH) Roman Kennke, Software Engineer, http://kennke.org aicas Allerton Interworks Computer Automated Systems GmbH Haid-und-Neu-Stra?e 18 * D-76131 Karlsruhe * Germany http://www.aicas.com * Tel: +49-721-663 968-48 USt-Id: DE216375633, Handelsregister HRB 109481, AG Karlsruhe Gesch?ftsf?hrer: Dr. James J. Hunt From iman_shani at hotmail.com Mon Mar 2 20:00:15 2009 From: iman_shani at hotmail.com (iman_shani at hotmail.com) Date: Mon, 2 Mar 2009 12:00:15 -0800 Subject: Semestersvar In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: From Alexander.Potochkin at Sun.COM Tue Mar 3 18:27:12 2009 From: Alexander.Potochkin at Sun.COM (Alexander Potochkin) Date: Tue, 03 Mar 2009 21:27:12 +0300 Subject: 6179357: Generics: JList: ListCellRenderer & prototypeCellValue In-Reply-To: <200902262228.19105.fbrunnerlist@gmx.ch> References: <200902211930.09829.fbrunnerlist@gmx.ch> <4f59bb5d0902221336x541d8f79h62d9e32abe5d577c@mail.gmail.com> <200902262228.19105.fbrunnerlist@gmx.ch> Message-ID: <49AD7680.4000100@sun.com> Hello Florian I must confess that I don't think it is desirable to generify every class in Swing, so #1 looks good for me :-) Two generic parameters add to much of typing, in my opinion Could you please provide a complete example of a JList with a custom ListCellRenderer that proves that renderer should be generified By the way the more examples the better, another one which promotes JList generifying would also help to promote this idea for Swing team members Thanks alexp > So, 2 votes for option 3), which is a reasonable one, I think. > > Pavel? Anyone else? > > -Florian > > Am Sonntag, 22. Februar 2009 schrieb Erik Lundqvist: >> Hi, >> ListCellRenderer should absolutely be generic which rules out option 1 :) >> I cannot remember ever using the prototypeCellValue so a bit worried about >> saying too much about how people are using it, but it does not seem >> unreasonable that it should be of the same type so I would go for Option 3 >> as well which seems the simpler and most common use case. >> >> //erik >> >> 2009/2/21 Florian Brunner >> >>> Hi, >>> >>> I think adding generics to the ListCellRenderer could also be useful. The >>> problem is that in JList >>> the same cell renderer is used for the items as for the >>> prototypeCellValue - and the >>> prototypeCellValue doesn't necessarily have be of the same type as the >>> items! >>> >>> So I think we have 3 options: >>> >>> 1) Don't provide a generic cell renderer/ allow only Object as parameter >>> for the cell renderer in >>> JList. >>> >>> 2) Add a second generic parameter. Eg. something like: >>> class JList { ... } >>> >>> and use P for the prototypeCellValue property as well as for the cell >>> renderer. >>> >>> 3) Require prototypeCellValue to be of type E. In the probably rare >>> cases, where this is a problem >>> one can still specify a common base class of the items and the >>> prototypeCellValue as the generic >>> parameter or use a raw type JList. >>> >>> >>> >>> I think it would be a pity not to provide a generic cell renderer (1) and >>> think 2) is inconvenient >>> and confusing, since in my experiences prototypeCellValue is only used >>> rarely. >>> >>> So I'm voting for 3). For which option do you vote? For which reason? >>> >>> >>> >>> Note I also propose to use: >>> >>> ListCellRenderer cellRenderer >>> >>> rather than >>> >>> ListCellRenderer cellRenderer >>> >>> in JList. This would make it more flexible. Do you agree? (It's actually >>> the first time, I think, I >>> use 'super' with generics myself, but I think this is a good use case of >>> it. So any comments are >>> welcome. ;-) ) >>> >>> -Florian > > From fbrunnerlist at gmx.ch Tue Mar 3 18:51:04 2009 From: fbrunnerlist at gmx.ch (Florian Brunner) Date: Tue, 03 Mar 2009 19:51:04 +0100 Subject: 6179357: Generics: JList: ListCellRenderer & prototypeCellValue In-Reply-To: <49AD7680.4000100@sun.com> References: <200902211930.09829.fbrunnerlist@gmx.ch> <4f59bb5d0902221336x541d8f79h62d9e32abe5d577c@mail.gmail.com> <200902262228.19105.fbrunnerlist@gmx.ch> <49AD7680.4000100@sun.com> Message-ID: <49AD7C18.6000908@gmx.ch> Ok, I'll think about some examples. -Florian Alexander Potochkin schrieb: > Hello Florian > > I must confess that I don't think it is desirable > to generify every class in Swing, so #1 looks good for me > :-) > > Two generic parameters add to much of typing, in my opinion > > Could you please provide a complete example of a JList > with a custom ListCellRenderer that proves that renderer should be > generified > > By the way the more examples the better, > another one which promotes JList generifying > would also help to promote this idea for Swing team members > > Thanks > alexp > >> So, 2 votes for option 3), which is a reasonable one, I think. >> >> Pavel? Anyone else? >> >> -Florian >> >> Am Sonntag, 22. Februar 2009 schrieb Erik Lundqvist: >>> Hi, >>> ListCellRenderer should absolutely be generic which rules out option >>> 1 :) >>> I cannot remember ever using the prototypeCellValue so a bit worried >>> about >>> saying too much about how people are using it, but it does not seem >>> unreasonable that it should be of the same type so I would go for >>> Option 3 >>> as well which seems the simpler and most common use case. >>> >>> //erik >>> >>> 2009/2/21 Florian Brunner >>> >>>> Hi, >>>> >>>> I think adding generics to the ListCellRenderer could also be >>>> useful. The >>>> problem is that in JList >>>> the same cell renderer is used for the items as for the >>>> prototypeCellValue - and the >>>> prototypeCellValue doesn't necessarily have be of the same type as the >>>> items! >>>> >>>> So I think we have 3 options: >>>> >>>> 1) Don't provide a generic cell renderer/ allow only Object as >>>> parameter >>>> for the cell renderer in >>>> JList. >>>> >>>> 2) Add a second generic parameter. Eg. something like: >>>> class JList { ... } >>>> >>>> and use P for the prototypeCellValue property as well as for the cell >>>> renderer. >>>> >>>> 3) Require prototypeCellValue to be of type E. In the probably rare >>>> cases, where this is a problem >>>> one can still specify a common base class of the items and the >>>> prototypeCellValue as the generic >>>> parameter or use a raw type JList. >>>> >>>> >>>> >>>> I think it would be a pity not to provide a generic cell renderer >>>> (1) and >>>> think 2) is inconvenient >>>> and confusing, since in my experiences prototypeCellValue is only used >>>> rarely. >>>> >>>> So I'm voting for 3). For which option do you vote? For which reason? >>>> >>>> >>>> >>>> Note I also propose to use: >>>> >>>> ListCellRenderer cellRenderer >>>> >>>> rather than >>>> >>>> ListCellRenderer cellRenderer >>>> >>>> in JList. This would make it more flexible. Do you agree? (It's >>>> actually >>>> the first time, I think, I >>>> use 'super' with generics myself, but I think this is a good use >>>> case of >>>> it. So any comments are >>>> welcome. ;-) ) >>>> >>>> -Florian >> >> > From Thomas.Hawtin at Sun.COM Tue Mar 3 19:01:34 2009 From: Thomas.Hawtin at Sun.COM (Tom Hawtin) Date: Tue, 03 Mar 2009 19:01:34 +0000 Subject: 6179357: Generics: JList: ListCellRenderer & prototypeCellValue In-Reply-To: <49AD7680.4000100@sun.com> References: <200902211930.09829.fbrunnerlist@gmx.ch> <4f59bb5d0902221336x541d8f79h62d9e32abe5d577c@mail.gmail.com> <200902262228.19105.fbrunnerlist@gmx.ch> <49AD7680.4000100@sun.com> Message-ID: <49AD7E8E.7090203@sun.com> Alexander Potochkin wrote: > Could you please provide a complete example of a JList > with a custom ListCellRenderer that proves that renderer should be > generified I bet if you used NetBeans to find implementations of ListCellRenderer even within the JDK most useful implementations would cast the value argument. (I prefer option 3, btw.) Tom Hawtin From Alexander.Potochkin at Sun.COM Tue Mar 3 19:23:29 2009 From: Alexander.Potochkin at Sun.COM (Alexander Potochkin) Date: Tue, 03 Mar 2009 22:23:29 +0300 Subject: 6179357: Generics: JList: ListCellRenderer & prototypeCellValue In-Reply-To: <49AD7E8E.7090203@sun.com> References: <200902211930.09829.fbrunnerlist@gmx.ch> <4f59bb5d0902221336x541d8f79h62d9e32abe5d577c@mail.gmail.com> <200902262228.19105.fbrunnerlist@gmx.ch> <49AD7680.4000100@sun.com> <49AD7E8E.7090203@sun.com> Message-ID: <49AD83B1.3010107@sun.com> Hello Tom It's nice to see you here >> Could you please provide a complete example of a JList >> with a custom ListCellRenderer that proves that renderer should be >> generified > > I bet if you used NetBeans to find implementations of ListCellRenderer > even within the JDK most useful implementations would cast the value > argument. anyway, it is always better to have a fixed set of examples to discuss > > (I prefer option 3, btw.) Thanks alexp > > Tom Hawtin From fbrunnerlist at gmx.ch Wed Mar 4 01:04:12 2009 From: fbrunnerlist at gmx.ch (Florian Brunner) Date: Wed, 4 Mar 2009 02:04:12 +0100 Subject: =?utf-8?q?6179357=3A_Generics=3A_JList=3A_ListCellRen?= =?utf-8?q?derer=09=26_prototypeCellValue?= In-Reply-To: <49AD83B1.3010107@sun.com> References: <200902211930.09829.fbrunnerlist@gmx.ch> <49AD7E8E.7090203@sun.com> <49AD83B1.3010107@sun.com> Message-ID: <200903040204.12385.fbrunnerlist@gmx.ch> Here is a second sample. It's not really a real-world sample, but should be useful to show that also JList of other "value" types than String, such as Integer, Long and Short, can profit from generics. It also shows why JList should specify ListCellRenderer cellRenderer rather than ListCellRenderer cellRenderer (Here: a common Number-cell renderer is used.) -Florian Am Dienstag, 3. M?rz 2009 schrieb Alexander Potochkin: > Hello Tom > > It's nice to see you here > > >> Could you please provide a complete example of a JList > >> with a custom ListCellRenderer that proves that renderer should be > >> generified > > > > I bet if you used NetBeans to find implementations of ListCellRenderer > > even within the JDK most useful implementations would cast the value > > argument. > > anyway, it is always better to have a fixed set of examples to discuss > > > (I prefer option 3, btw.) > > Thanks > alexp > > > Tom Hawtin -------------- next part -------------- A non-text attachment was scrubbed... Name: ListSample2Frame.form Type: application/xml Size: 9827 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: NumberCellRenderer.java Type: text/x-java Size: 931 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ListSample2Frame.java Type: text/x-java Size: 13229 bytes Desc: not available URL: From fbrunnerlist at gmx.ch Tue Mar 3 23:08:54 2009 From: fbrunnerlist at gmx.ch (Florian Brunner) Date: Wed, 4 Mar 2009 00:08:54 +0100 Subject: =?utf-8?q?6179357=3A_Generics=3A_JList=3A_ListCellRen?= =?utf-8?q?derer=09=26_prototypeCellValue?= In-Reply-To: <49AD83B1.3010107@sun.com> References: <200902211930.09829.fbrunnerlist@gmx.ch> <49AD7E8E.7090203@sun.com> <49AD83B1.3010107@sun.com> Message-ID: <200903040008.54785.fbrunnerlist@gmx.ch> Ok, here is a first sample. It's really small, maybe not 100% real-world, but should be useful to show what can be gained from generics. -Florian Am Dienstag, 3. M?rz 2009 schrieb Alexander Potochkin: > Hello Tom > > It's nice to see you here > > >> Could you please provide a complete example of a JList > >> with a custom ListCellRenderer that proves that renderer should be > >> generified > > > > I bet if you used NetBeans to find implementations of ListCellRenderer > > even within the JDK most useful implementations would cast the value > > argument. > > anyway, it is always better to have a fixed set of examples to discuss > > > (I prefer option 3, btw.) > > Thanks > alexp > > > Tom Hawtin -------------- next part -------------- A non-text attachment was scrubbed... Name: Participant.java Type: text/x-java Size: 755 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ListSample1Frame.form Type: application/xml Size: 8077 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ListSample1Frame.java Type: text/x-java Size: 9756 bytes Desc: not available URL: From Peter.Zhelezniakov at Sun.COM Thu Mar 5 12:19:26 2009 From: Peter.Zhelezniakov at Sun.COM (Peter Zhelezniakov) Date: Thu, 05 Mar 2009 15:19:26 +0300 Subject: 6179357: Generics: JList: ListCellRenderer & prototypeCellValue In-Reply-To: <200902262228.19105.fbrunnerlist@gmx.ch> References: <200902211930.09829.fbrunnerlist@gmx.ch> <4f59bb5d0902221336x541d8f79h62d9e32abe5d577c@mail.gmail.com> <200902262228.19105.fbrunnerlist@gmx.ch> Message-ID: <49AFC34E.5040208@Sun.com> Florian Brunner wrote: > So, 2 votes for option 3), which is a reasonable one, I think. > > Pavel? Anyone else? There certainly are cases when it's tempting to use a String as a prototype value for a more complex object. However, with #3 this is still doable in a number of ways: JList, raw JList, or use setFixedCellW/H() instead. I like #3 most. 2009/2/21 Florian Brunner > So I think we have 3 options: > > 1) Don't provide a generic cell renderer/ allow only Object as parameter > for the cell renderer in > JList. > > 2) Add a second generic parameter. Eg. something like: > class JList { ... } > > and use P for the prototypeCellValue property as well as for the cell > renderer. > > 3) Require prototypeCellValue to be of type E. In the probably rare > cases, where this is a problem > one can still specify a common base class of the items and the > prototypeCellValue as the generic > parameter or use a raw type JList. > > > > I think it would be a pity not to provide a generic cell renderer (1) and > think 2) is inconvenient > and confusing, since in my experiences prototypeCellValue is only used > rarely. > > So I'm voting for 3). For which option do you vote? For which reason? -- Peter | x33066 | location: SPB04 | timezone: GMT+03 From Alexander.Potochkin at Sun.COM Thu Mar 5 17:41:13 2009 From: Alexander.Potochkin at Sun.COM (Alexander Potochkin) Date: Thu, 05 Mar 2009 20:41:13 +0300 Subject: 6179357: Generics: JList: ListCellRenderer & prototypeCellValue In-Reply-To: <200903040204.12385.fbrunnerlist@gmx.ch> References: <200902211930.09829.fbrunnerlist@gmx.ch> <49AD7E8E.7090203@sun.com> <49AD83B1.3010107@sun.com> <200903040204.12385.fbrunnerlist@gmx.ch> Message-ID: <49B00EB9.3090109@sun.com> Hello Florian Thank you for the constructive examples! I looked at the usage of prototypeCellValue property, following the JList.updateFixedCellSize() method I found this code in the DefaultListCellRenderer.getListCellRendererComponent(): if (value instanceof Icon) { setIcon((Icon)value); setText(""); } else { setIcon(null); setText((value == null) ? "" : value.toString()); } It means that value always can be an icon, so we need to do something about that I also think that shouldn't generify prototypeCellValue, since it doesn't give as any visible advantage, moreover some programmers may use an object of a special type that toString() method returns something meaningful for prototypeCellValue Thanks alexp > Here is a second sample. > > It's not really a real-world sample, but should be useful to show that also JList of other "value" > types than String, such as Integer, Long and Short, can profit from generics. > > It also shows why JList should specify > ListCellRenderer cellRenderer > > rather than > > ListCellRenderer cellRenderer > > (Here: a common Number-cell renderer is used.) > > -Florian > > Am Dienstag, 3. M?rz 2009 schrieb Alexander Potochkin: >> Hello Tom >> >> It's nice to see you here >> >>>> Could you please provide a complete example of a JList >>>> with a custom ListCellRenderer that proves that renderer should be >>>> generified >>> I bet if you used NetBeans to find implementations of ListCellRenderer >>> even within the JDK most useful implementations would cast the value >>> argument. >> anyway, it is always better to have a fixed set of examples to discuss >> >>> (I prefer option 3, btw.) >> Thanks >> alexp >> >>> Tom Hawtin > > From fbrunnerlist at gmx.ch Thu Mar 5 18:42:46 2009 From: fbrunnerlist at gmx.ch (Florian Brunner) Date: Thu, 05 Mar 2009 19:42:46 +0100 Subject: 6179357: Generics: JList: ListCellRenderer & prototypeCellValue In-Reply-To: <49B00EB9.3090109@sun.com> References: <200902211930.09829.fbrunnerlist@gmx.ch> <49AD7E8E.7090203@sun.com> <49AD83B1.3010107@sun.com> <200903040204.12385.fbrunnerlist@gmx.ch> <49B00EB9.3090109@sun.com> Message-ID: <49B01D26.4020608@gmx.ch> Hi Alexander, Alexander Potochkin schrieb: > Hello Florian > > Thank you for the constructive examples! > You're welcome! :-) > I looked at the usage of prototypeCellValue property, > following the JList.updateFixedCellSize() method > Yes, this was the reason for this whole discussion: the list entries and the prototypeCellValue use the same ListCellRenderer. If both are of type E, both can use a ListCellRenderer > I found this code in the > DefaultListCellRenderer.getListCellRendererComponent(): > > > if (value instanceof Icon) { > setIcon((Icon)value); > setText(""); > } > else { > setIcon(null); > setText((value == null) ? "" : value.toString()); > } > > It means that value always can be an icon, > so we need to do something about that I already had a short look at DefaultListCellRenderer. I think it has to be specified something like: DefaultListCellRenderer implements ListCellRenderer since it works for all Objects (toString() ) and Object is a superclass of Icon. Like this it also fits to ListCellRenderer for any given E and thus should be possible to use it as the default cellRenderer of JList (which it probably already is, though I can't check it right now. Somewhere in the UI class?) I didn't plan to include DefaultListCellRenderer in the first patch, but can do so, if you prefer. > > I also think that shouldn't generify prototypeCellValue, > since it doesn't give as any visible advantage, This would be option 1) then, because if prototypeCellValue is of type Object, the ListCellRenderer has to be as well. The value of having a generified prototypeCellValue is that we can use a generified ListCellRenderer! I think it would be a pity if we don't provide a generic ListCellRenderer. > moreover some programmers may use an object of a special type > that toString() method returns something meaningful for > prototypeCellValue > This is still possible with option 3), eg. with JList or "raw" JList. -Florian > Thanks > alexp > >> Here is a second sample. >> >> It's not really a real-world sample, but should be useful to show >> that also JList of other "value" types than String, such as Integer, >> Long and Short, can profit from generics. >> >> It also shows why JList should specify >> ListCellRenderer cellRenderer >> >> rather than >> >> ListCellRenderer cellRenderer >> >> (Here: a common Number-cell renderer is used.) >> >> -Florian >> >> Am Dienstag, 3. M?rz 2009 schrieb Alexander Potochkin: >>> Hello Tom >>> >>> It's nice to see you here >>> >>>>> Could you please provide a complete example of a JList >>>>> with a custom ListCellRenderer that proves that renderer should be >>>>> generified >>>> I bet if you used NetBeans to find implementations of ListCellRenderer >>>> even within the JDK most useful implementations would cast the value >>>> argument. >>> anyway, it is always better to have a fixed set of examples to discuss >>> >>>> (I prefer option 3, btw.) >>> Thanks >>> alexp >>> >>>> Tom Hawtin >> >> > From fbrunnerlist at gmx.ch Thu Mar 5 19:02:28 2009 From: fbrunnerlist at gmx.ch (Florian Brunner) Date: Thu, 05 Mar 2009 20:02:28 +0100 Subject: 6179357: Generics: JList: ListCellRenderer & prototypeCellValue In-Reply-To: <49B01D26.4020608@gmx.ch> References: <200902211930.09829.fbrunnerlist@gmx.ch> <49AD7E8E.7090203@sun.com> <49AD83B1.3010107@sun.com> <200903040204.12385.fbrunnerlist@gmx.ch> <49B00EB9.3090109@sun.com> <49B01D26.4020608@gmx.ch> Message-ID: <49B021C4.7000308@gmx.ch> Just to clarify: The downside of option 3) is that if you want an arbitrary Object as prototypeCellValue, then you need to specify something like JList or "raw" JList, and would in this case loose the benefit of the generified JList. (If it's another superclass of E, you can limit that loss a bit.) In contrast: with option 1) you can always benefit from a generified JList (from the entries getter point of view) but you can never really benefit from a generified ListCellRenderer, which would be a pity, I think. (Unsafe casts - see the samples) Option 2) is somewhere in between: you can always benefit from a generified JList (from the entries getter-methods point of view - the first parameter) and can sometimes also benefit from a generified ListCellRenderer (the second parameter). -Florian Florian Brunner schrieb: > Hi Alexander, > > Alexander Potochkin schrieb: >> Hello Florian >> >> Thank you for the constructive examples! >> > You're welcome! :-) >> I looked at the usage of prototypeCellValue property, >> following the JList.updateFixedCellSize() method >> > Yes, this was the reason for this whole discussion: the list entries > and the prototypeCellValue use the same ListCellRenderer. > If both are of type E, both can use a ListCellRenderer > >> I found this code in the >> DefaultListCellRenderer.getListCellRendererComponent(): >> >> >> if (value instanceof Icon) { >> setIcon((Icon)value); >> setText(""); >> } >> else { >> setIcon(null); >> setText((value == null) ? "" : value.toString()); >> } >> >> It means that value always can be an icon, >> so we need to do something about that > > I already had a short look at DefaultListCellRenderer. I think it has > to be specified something like: > > DefaultListCellRenderer implements ListCellRenderer > > since it works for all Objects (toString() ) and Object is a > superclass of Icon. Like this it also fits to ListCellRenderer E> for any given E and thus should be possible to use it as the > default cellRenderer of JList (which it probably already is, though I > can't check it right now. Somewhere in the UI class?) > > I didn't plan to include DefaultListCellRenderer in the first patch, > but can do so, if you prefer. >> >> I also think that shouldn't generify prototypeCellValue, >> since it doesn't give as any visible advantage, > This would be option 1) then, because if prototypeCellValue is of type > Object, the ListCellRenderer has to be as well. The value of having a > generified prototypeCellValue is that we can use a generified > ListCellRenderer! > > I think it would be a pity if we don't provide a generic > ListCellRenderer. >> moreover some programmers may use an object of a special type >> that toString() method returns something meaningful for >> prototypeCellValue >> > This is still possible with option 3), eg. with JList or "raw" > JList. > > -Florian > >> Thanks >> alexp >> >>> Here is a second sample. >>> >>> It's not really a real-world sample, but should be useful to show >>> that also JList of other "value" types than String, such as Integer, >>> Long and Short, can profit from generics. >>> >>> It also shows why JList should specify >>> ListCellRenderer cellRenderer >>> >>> rather than >>> >>> ListCellRenderer cellRenderer >>> >>> (Here: a common Number-cell renderer is used.) >>> >>> -Florian >>> >>> Am Dienstag, 3. M?rz 2009 schrieb Alexander Potochkin: >>>> Hello Tom >>>> >>>> It's nice to see you here >>>> >>>>>> Could you please provide a complete example of a JList >>>>>> with a custom ListCellRenderer that proves that renderer should be >>>>>> generified >>>>> I bet if you used NetBeans to find implementations of >>>>> ListCellRenderer >>>>> even within the JDK most useful implementations would cast the value >>>>> argument. >>>> anyway, it is always better to have a fixed set of examples to discuss >>>> >>>>> (I prefer option 3, btw.) >>>> Thanks >>>> alexp >>>> >>>>> Tom Hawtin >>> >>> >> > From willcodejavaforfood at googlemail.com Fri Mar 6 10:02:07 2009 From: willcodejavaforfood at googlemail.com (Erik Lundqvist) Date: Fri, 6 Mar 2009 10:02:07 +0000 Subject: 6179357: Generics: JList: ListCellRenderer & prototypeCellValue In-Reply-To: <49B021C4.7000308@gmx.ch> References: <200902211930.09829.fbrunnerlist@gmx.ch> <49AD7E8E.7090203@sun.com> <49AD83B1.3010107@sun.com> <200903040204.12385.fbrunnerlist@gmx.ch> <49B00EB9.3090109@sun.com> <49B01D26.4020608@gmx.ch> <49B021C4.7000308@gmx.ch> Message-ID: <4f59bb5d0903060202u3826ada0scf32ec28b1ceaaf2@mail.gmail.com> I still say option 3 since what we are trying to achieve here is to make the every day use of Swing easier by introducing generics. If that is the case we should try and make the more common use cases easier and it would be acceptable to have the more uncommon ones slightly more cumbersom to perform. The use of prototypeCellValue would in my opinion belong to the latter category. 2009/3/5 Florian Brunner > Just to clarify: > The downside of option 3) is that if you want an arbitrary Object as > prototypeCellValue, then you need to specify something like JList or > "raw" JList, and would in this case loose the benefit of the generified > JList. (If it's another superclass of E, you can limit that loss a bit.) > > In contrast: with option 1) you can always benefit from a generified JList > (from the entries getter point of view) but you can never really benefit > from a generified ListCellRenderer, which would be a pity, I think. (Unsafe > casts - see the samples) > > Option 2) is somewhere in between: you can always benefit from a generified > JList (from the entries getter-methods point of view - the first parameter) > and can sometimes also benefit from a generified ListCellRenderer (the > second parameter). > > -Florian > > Florian Brunner schrieb: > > Hi Alexander, >> >> Alexander Potochkin schrieb: >> >>> Hello Florian >>> >>> Thank you for the constructive examples! >>> >>> You're welcome! :-) >> >>> I looked at the usage of prototypeCellValue property, >>> following the JList.updateFixedCellSize() method >>> >>> Yes, this was the reason for this whole discussion: the list entries and >> the prototypeCellValue use the same ListCellRenderer. >> If both are of type E, both can use a ListCellRenderer >> >> I found this code in the >>> DefaultListCellRenderer.getListCellRendererComponent(): >>> >>> >>> if (value instanceof Icon) { >>> setIcon((Icon)value); >>> setText(""); >>> } >>> else { >>> setIcon(null); >>> setText((value == null) ? "" : value.toString()); >>> } >>> >>> It means that value always can be an icon, >>> so we need to do something about that >>> >> >> I already had a short look at DefaultListCellRenderer. I think it has to >> be specified something like: >> >> DefaultListCellRenderer implements ListCellRenderer >> >> since it works for all Objects (toString() ) and Object is a superclass of >> Icon. Like this it also fits to ListCellRenderer for any given E >> and thus should be possible to use it as the default cellRenderer of JList >> (which it probably already is, though I can't check it right now. Somewhere >> in the UI class?) >> >> I didn't plan to include DefaultListCellRenderer in the first patch, but >> can do so, if you prefer. >> >>> >>> I also think that shouldn't generify prototypeCellValue, >>> since it doesn't give as any visible advantage, >>> >> This would be option 1) then, because if prototypeCellValue is of type >> Object, the ListCellRenderer has to be as well. The value of having a >> generified prototypeCellValue is that we can use a generified >> ListCellRenderer! >> >> I think it would be a pity if we don't provide a generic ListCellRenderer. >> >>> moreover some programmers may use an object of a special type >>> that toString() method returns something meaningful for >>> prototypeCellValue >>> >>> This is still possible with option 3), eg. with JList or "raw" >> JList. >> >> -Florian >> >> Thanks >>> alexp >>> >>> Here is a second sample. >>>> >>>> It's not really a real-world sample, but should be useful to show that >>>> also JList of other "value" types than String, such as Integer, Long and >>>> Short, can profit from generics. >>>> >>>> It also shows why JList should specify >>>> ListCellRenderer cellRenderer >>>> >>>> rather than >>>> >>>> ListCellRenderer cellRenderer >>>> >>>> (Here: a common Number-cell renderer is used.) >>>> >>>> -Florian >>>> >>>> Am Dienstag, 3. M?rz 2009 schrieb Alexander Potochkin: >>>> >>>>> Hello Tom >>>>> >>>>> It's nice to see you here >>>>> >>>>> Could you please provide a complete example of a JList >>>>>>> with a custom ListCellRenderer that proves that renderer should be >>>>>>> generified >>>>>>> >>>>>> I bet if you used NetBeans to find implementations of ListCellRenderer >>>>>> even within the JDK most useful implementations would cast the value >>>>>> argument. >>>>>> >>>>> anyway, it is always better to have a fixed set of examples to discuss >>>>> >>>>> (I prefer option 3, btw.) >>>>>> >>>>> Thanks >>>>> alexp >>>>> >>>>> Tom Hawtin >>>>>> >>>>> >>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Alexander.Potochkin at Sun.COM Fri Mar 6 15:43:23 2009 From: Alexander.Potochkin at Sun.COM (Alexander Potochkin) Date: Fri, 06 Mar 2009 18:43:23 +0300 Subject: 6179357: Generics: JList: ListCellRenderer & prototypeCellValue In-Reply-To: <49B01D26.4020608@gmx.ch> References: <200902211930.09829.fbrunnerlist@gmx.ch> <49AD7E8E.7090203@sun.com> <49AD83B1.3010107@sun.com> <200903040204.12385.fbrunnerlist@gmx.ch> <49B00EB9.3090109@sun.com> <49B01D26.4020608@gmx.ch> Message-ID: <49B1449B.70705@sun.com> Hello Florian >> >> Thank you for the constructive examples! >> > You're welcome! :-) >> I looked at the usage of prototypeCellValue property, >> following the JList.updateFixedCellSize() method >> > Yes, this was the reason for this whole discussion: the list entries and > the prototypeCellValue use the same ListCellRenderer. > If both are of type E, both can use a ListCellRenderer > >> I found this code in the >> DefaultListCellRenderer.getListCellRendererComponent(): >> >> >> if (value instanceof Icon) { >> setIcon((Icon)value); >> setText(""); >> } >> else { >> setIcon(null); >> setText((value == null) ? "" : value.toString()); >> } >> >> It means that value always can be an icon, >> so we need to do something about that > > I already had a short look at DefaultListCellRenderer. I think it has to > be specified something like: > > DefaultListCellRenderer implements ListCellRenderer it makes sense > > since it works for all Objects (toString() ) and Object is a superclass > of Icon. Like this it also fits to ListCellRenderer for any > given E and thus should be possible to use it as the default > cellRenderer of JList (which it probably already is, though I can't > check it right now. Somewhere in the UI class?) > > I didn't plan to include DefaultListCellRenderer in the first patch, but > can do so, if you prefer. Yes please >> >> I also think that shouldn't generify prototypeCellValue, >> since it doesn't give as any visible advantage, > This would be option 1) then, because if prototypeCellValue is of type > Object, the ListCellRenderer has to be as well. The value of having a > generified prototypeCellValue is that we can use a generified > ListCellRenderer! > > I think it would be a pity if we don't provide a generic ListCellRenderer. >> moreover some programmers may use an object of a special type >> that toString() method returns something meaningful for >> prototypeCellValue >> > This is still possible with option 3), eg. with JList or "raw" > JList. Using the "raw" types is not an option for me, we should never use raw types of generified objects or encourage programmers to use them JList is fine, so I also vote for the option #3 Thank you alexp > > -Florian > >> Thanks >> alexp >> >>> Here is a second sample. >>> >>> It's not really a real-world sample, but should be useful to show >>> that also JList of other "value" types than String, such as Integer, >>> Long and Short, can profit from generics. >>> >>> It also shows why JList should specify >>> ListCellRenderer cellRenderer >>> >>> rather than >>> >>> ListCellRenderer cellRenderer >>> >>> (Here: a common Number-cell renderer is used.) >>> >>> -Florian >>> >>> Am Dienstag, 3. M?rz 2009 schrieb Alexander Potochkin: >>>> Hello Tom >>>> >>>> It's nice to see you here >>>> >>>>>> Could you please provide a complete example of a JList >>>>>> with a custom ListCellRenderer that proves that renderer should be >>>>>> generified >>>>> I bet if you used NetBeans to find implementations of ListCellRenderer >>>>> even within the JDK most useful implementations would cast the value >>>>> argument. >>>> anyway, it is always better to have a fixed set of examples to discuss >>>> >>>>> (I prefer option 3, btw.) >>>> Thanks >>>> alexp >>>> >>>>> Tom Hawtin >>> >>> >> > From Pavel.Porvatov at Sun.COM Wed Mar 11 16:35:06 2009 From: Pavel.Porvatov at Sun.COM (Pavel Porvatov) Date: Wed, 11 Mar 2009 19:35:06 +0300 Subject: 6179357: Generics: JList: ListCellRenderer & prototypeCellValue In-Reply-To: <49B021C4.7000308@gmx.ch> References: <200902211930.09829.fbrunnerlist@gmx.ch> <49AD7E8E.7090203@sun.com> <49AD83B1.3010107@sun.com> <200903040204.12385.fbrunnerlist@gmx.ch> <49B00EB9.3090109@sun.com> <49B01D26.4020608@gmx.ch> <49B021C4.7000308@gmx.ch> Message-ID: <49B7E83A.4010107@sun.com> Hi Florian, First of all sorry for delay, I was ill. > Just to clarify: > The downside of option 3) is that if you want an arbitrary Object as > prototypeCellValue, then you need to specify something like > JList or "raw" JList, and would in this case loose the benefit > of the generified JList. (If it's another superclass of E, you can limit > that loss a bit.) It's a bad idea to use prototypeCellValue with a type different from other values (IMO). Therefore I'm voting for option #3 Regards, Pavel > > In contrast: with option 1) you can always benefit from a generified > JList (from the entries getter point of view) but you can never really > benefit from a generified ListCellRenderer, which would be a pity, I > think. (Unsafe casts - see the samples) > > Option 2) is somewhere in between: you can always benefit from a > generified JList (from the entries getter-methods point of view - the > first parameter) and can sometimes also benefit from a generified > ListCellRenderer (the second parameter). > > -Florian > > Florian Brunner schrieb: >> Hi Alexander, >> >> Alexander Potochkin schrieb: >>> Hello Florian >>> >>> Thank you for the constructive examples! >>> >> You're welcome! :-) >>> I looked at the usage of prototypeCellValue property, >>> following the JList.updateFixedCellSize() method >>> >> Yes, this was the reason for this whole discussion: the list entries >> and the prototypeCellValue use the same ListCellRenderer. >> If both are of type E, both can use a ListCellRenderer >> >>> I found this code in the >>> DefaultListCellRenderer.getListCellRendererComponent(): >>> >>> >>> if (value instanceof Icon) { >>> setIcon((Icon)value); >>> setText(""); >>> } >>> else { >>> setIcon(null); >>> setText((value == null) ? "" : value.toString()); >>> } >>> >>> It means that value always can be an icon, >>> so we need to do something about that >> >> I already had a short look at DefaultListCellRenderer. I think it has >> to be specified something like: >> >> DefaultListCellRenderer implements ListCellRenderer >> >> since it works for all Objects (toString() ) and Object is a >> superclass of Icon. Like this it also fits to ListCellRenderer> E> for any given E and thus should be possible to use it as the >> default cellRenderer of JList (which it probably already is, though I >> can't check it right now. Somewhere in the UI class?) >> >> I didn't plan to include DefaultListCellRenderer in the first patch, >> but can do so, if you prefer. >>> >>> I also think that shouldn't generify prototypeCellValue, >>> since it doesn't give as any visible advantage, >> This would be option 1) then, because if prototypeCellValue is of type >> Object, the ListCellRenderer has to be as well. The value of having a >> generified prototypeCellValue is that we can use a generified >> ListCellRenderer! >> >> I think it would be a pity if we don't provide a generic >> ListCellRenderer. >>> moreover some programmers may use an object of a special type >>> that toString() method returns something meaningful for >>> prototypeCellValue >>> >> This is still possible with option 3), eg. with JList or "raw" >> JList. >> >> -Florian >> >>> Thanks >>> alexp >>> >>>> Here is a second sample. >>>> >>>> It's not really a real-world sample, but should be useful to show >>>> that also JList of other "value" types than String, such as Integer, >>>> Long and Short, can profit from generics. >>>> >>>> It also shows why JList should specify >>>> ListCellRenderer cellRenderer >>>> >>>> rather than >>>> >>>> ListCellRenderer cellRenderer >>>> >>>> (Here: a common Number-cell renderer is used.) >>>> >>>> -Florian >>>> >>>> Am Dienstag, 3. M?rz 2009 schrieb Alexander Potochkin: >>>>> Hello Tom >>>>> >>>>> It's nice to see you here >>>>> >>>>>>> Could you please provide a complete example of a JList >>>>>>> with a custom ListCellRenderer that proves that renderer should be >>>>>>> generified >>>>>> I bet if you used NetBeans to find implementations of >>>>>> ListCellRenderer >>>>>> even within the JDK most useful implementations would cast the value >>>>>> argument. >>>>> anyway, it is always better to have a fixed set of examples to discuss >>>>> >>>>>> (I prefer option 3, btw.) >>>>> Thanks >>>>> alexp >>>>> >>>>>> Tom Hawtin >>>> >>>> >>> >> > From iman_shani at hotmail.com Wed Mar 11 19:00:32 2009 From: iman_shani at hotmail.com (iman_shani at hotmail.com) Date: Wed, 11 Mar 2009 12:00:32 -0700 Subject: Semestersvar In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: From fbrunnerlist at gmx.ch Wed Mar 11 22:30:03 2009 From: fbrunnerlist at gmx.ch (Florian Brunner) Date: Wed, 11 Mar 2009 23:30:03 +0100 Subject: =?utf-8?q?6179357=3A_Generics=3A_JList=3A_ListCellRen?= =?utf-8?q?derer=09=26_prototypeCellValue?= In-Reply-To: <49B7E83A.4010107@sun.com> References: <200902211930.09829.fbrunnerlist@gmx.ch> <49B021C4.7000308@gmx.ch> <49B7E83A.4010107@sun.com> Message-ID: <200903112330.03607.fbrunnerlist@gmx.ch> Hi Pavel, great to see on the list. I hope you feel well again. I think all voted for option #3 now (correct me if I'm wrong), so let's go for option #3. -Florian Am Mittwoch, 11. M?rz 2009 schrieb Pavel Porvatov: > Hi Florian, > > First of all sorry for delay, I was ill. > > > Just to clarify: > > The downside of option 3) is that if you want an arbitrary Object as > > prototypeCellValue, then you need to specify something like > > JList or "raw" JList, and would in this case loose the benefit > > of the generified JList. (If it's another superclass of E, you can limit > > that loss a bit.) > > It's a bad idea to use prototypeCellValue with a type different from > other values (IMO). Therefore I'm voting for option #3 > > Regards, Pavel > > > In contrast: with option 1) you can always benefit from a generified > > JList (from the entries getter point of view) but you can never really > > benefit from a generified ListCellRenderer, which would be a pity, I > > think. (Unsafe casts - see the samples) > > > > Option 2) is somewhere in between: you can always benefit from a > > generified JList (from the entries getter-methods point of view - the > > first parameter) and can sometimes also benefit from a generified > > ListCellRenderer (the second parameter). > > > > -Florian > > > > Florian Brunner schrieb: > >> Hi Alexander, > >> > >> Alexander Potochkin schrieb: > >>> Hello Florian > >>> > >>> Thank you for the constructive examples! > >> > >> You're welcome! :-) > >> > >>> I looked at the usage of prototypeCellValue property, > >>> following the JList.updateFixedCellSize() method > >> > >> Yes, this was the reason for this whole discussion: the list entries > >> and the prototypeCellValue use the same ListCellRenderer. > >> If both are of type E, both can use a ListCellRenderer > >> > >>> I found this code in the > >>> DefaultListCellRenderer.getListCellRendererComponent(): > >>> > >>> > >>> if (value instanceof Icon) { > >>> setIcon((Icon)value); > >>> setText(""); > >>> } > >>> else { > >>> setIcon(null); > >>> setText((value == null) ? "" : value.toString()); > >>> } > >>> > >>> It means that value always can be an icon, > >>> so we need to do something about that > >> > >> I already had a short look at DefaultListCellRenderer. I think it has > >> to be specified something like: > >> > >> DefaultListCellRenderer implements ListCellRenderer > >> > >> since it works for all Objects (toString() ) and Object is a > >> superclass of Icon. Like this it also fits to ListCellRenderer >> E> for any given E and thus should be possible to use it as the > >> default cellRenderer of JList (which it probably already is, though I > >> can't check it right now. Somewhere in the UI class?) > >> > >> I didn't plan to include DefaultListCellRenderer in the first patch, > >> but can do so, if you prefer. > >> > >>> I also think that shouldn't generify prototypeCellValue, > >>> since it doesn't give as any visible advantage, > >> > >> This would be option 1) then, because if prototypeCellValue is of type > >> Object, the ListCellRenderer has to be as well. The value of having a > >> generified prototypeCellValue is that we can use a generified > >> ListCellRenderer! > >> > >> I think it would be a pity if we don't provide a generic > >> ListCellRenderer. > >> > >>> moreover some programmers may use an object of a special type > >>> that toString() method returns something meaningful for > >>> prototypeCellValue > >> > >> This is still possible with option 3), eg. with JList or "raw" > >> JList. > >> > >> -Florian > >> > >>> Thanks > >>> alexp > >>> > >>>> Here is a second sample. > >>>> > >>>> It's not really a real-world sample, but should be useful to show > >>>> that also JList of other "value" types than String, such as Integer, > >>>> Long and Short, can profit from generics. > >>>> > >>>> It also shows why JList should specify > >>>> ListCellRenderer cellRenderer > >>>> > >>>> rather than > >>>> > >>>> ListCellRenderer cellRenderer > >>>> > >>>> (Here: a common Number-cell renderer is used.) > >>>> > >>>> -Florian > >>>> > >>>> Am Dienstag, 3. M?rz 2009 schrieb Alexander Potochkin: > >>>>> Hello Tom > >>>>> > >>>>> It's nice to see you here > >>>>> > >>>>>>> Could you please provide a complete example of a JList > >>>>>>> with a custom ListCellRenderer that proves that renderer should be > >>>>>>> generified > >>>>>> > >>>>>> I bet if you used NetBeans to find implementations of > >>>>>> ListCellRenderer > >>>>>> even within the JDK most useful implementations would cast the value > >>>>>> argument. > >>>>> > >>>>> anyway, it is always better to have a fixed set of examples to > >>>>> discuss > >>>>> > >>>>>> (I prefer option 3, btw.) > >>>>> > >>>>> Thanks > >>>>> alexp > >>>>> > >>>>>> Tom Hawtin From fbrunnerlist at gmx.ch Wed Mar 11 22:32:27 2009 From: fbrunnerlist at gmx.ch (Florian Brunner) Date: Wed, 11 Mar 2009 23:32:27 +0100 Subject: 6179357: Generics: JList: Constructors & Model In-Reply-To: <200902262225.03571.fbrunnerlist@gmx.ch> References: <200902012328.17974.fbrunnerlist@gmx.ch> <200902211754.15890.fbrunnerlist@gmx.ch> <200902262225.03571.fbrunnerlist@gmx.ch> Message-ID: <200903112332.27730.fbrunnerlist@gmx.ch> This one is still open... Opinions? -Florian Am Donnerstag, 26. Februar 2009 schrieb Florian Brunner: > So, which approach do we take? I'm tending now more towards approach 1) but > approach 2) would be fine for me, too? > > Pavel? Anyone else? > > -Florian > > Am Samstag, 21. Februar 2009 schrieb Florian Brunner: > > In the case of JComboBox I think it's not even possible to define > > something like: > > > > class JComboBox{ > > ComboBoxModel getModel(); > > setModel(ComboBoxModel); > > } > > > > because JComboBox internally uses the ComboBoxModel.setSelectedItem > > method. > > > > So the question is what do you think is better: > > > > 1) To look at each component individually and try to make each as > > flexible as possible. So in the JList/ JComboBox case this would mean: > > > > class JList{ > > ListModel getModel(); > > setModel(ListModel); > > } > > > > but > > > > class JComboBox{ > > ComboBoxModel getModel(); > > setModel(ComboBoxModel); > > } > > > > 2) Make the interfaces as consistent as possible over all components. > > This would mean for the JList case to use somethink like: > > class JList{ > > ListModel getModel(); > > setModel(ListModel); > > } > > > > This approach is slightly less flexible than the approach 1), but cases > > where one could benefit from approach 1) are probably rare and there are > > various work-arounds (like: wrapping the model/ use a common base class > > for the generic parameter/ use raw type/... ) > > > > So what do you think? Approach 1) or 2)? > > > > -Florian > > > > Am Donnerstag, 19. Februar 2009 schrieb Florian Brunner: > > > Well, there is probably no big issue with JList, because the ListModel > > > is immutable. > > > > > > But when we add generics to JComboBox, which is similar to JList, the > > > situation is a bit more controversial, because the ComboBoxModel is > > > mutable. > > > > > > So if we have something like this: > > > class JComboBox{ > > > ComboBoxModel getModel(); > > > setModel(ComboBoxModel); > > > } > > > > > > then something like this is not possible: > > > JComboBox cb = new JComboBox(...); > > > ... > > > Foo foo; > > > ComboBoxModel model = cb.getModel(); > > > model.setSelectedItem(foo); -> compile time error > > > > > > You would need to do an unchecked (-> not type-safe) cast first: > > > ComboBoxModel model = (ComboBoxModel) cb.getModel(); > > > > > > And type-safty is what generics is all about. > > > > > > -Florian > > > > > > Am Dienstag, 3. Februar 2009 schrieb Pavel Porvatov: > > > > Hi Florian, > > > > > > > > > ---------------------------------------- > > > > > > > > > > public JList(ListModel dataModel) > > > > > > > > > > { > > > > > > > > > > if (dataModel == null) { > > > > > > > > > > throw new IllegalArgumentException("dataModel must be non null"); > > > > > > > > > > } > > > > > > > > > > // Register with the ToolTipManager so that tooltips from the > > > > > > > > > > // renderer show through. > > > > > > > > > > ToolTipManager toolTipManager = ToolTipManager.sharedInstance(); > > > > > > > > > > toolTipManager.registerComponent(this); > > > > > > > > > > layoutOrientation = VERTICAL; > > > > > > > > > > this.dataModel = dataModel; > > > > > > > > > > selectionModel = createSelectionModel(); > > > > > > > > > > setAutoscrolls(true); > > > > > > > > > > setOpaque(true); > > > > > > > > > > updateUI(); > > > > > > > > > > } > > > > > > > > > > ---> > > > > > > > > > > public JList(ListModel dataModel) > > > > > > > > > > { > > > > > > > > > > if (dataModel == null) { > > > > > > > > > > throw new IllegalArgumentException("dataModel must be non null"); > > > > > > > > > > } > > > > > > > > > > // Register with the ToolTipManager so that tooltips from the > > > > > > > > > > // renderer show through. > > > > > > > > > > ToolTipManager toolTipManager = ToolTipManager.sharedInstance(); > > > > > > > > > > toolTipManager.registerComponent(this); > > > > > > > > > > layoutOrientation = VERTICAL; > > > > > > > > > > this.dataModel = dataModel; > > > > > > > > > > selectionModel = createSelectionModel(); > > > > > > > > > > setAutoscrolls(true); > > > > > > > > > > setOpaque(true); > > > > > > > > > > updateUI(); > > > > > > > > > > } > > > > > > > > > > We could define the signature also like this: > > > > > > > > > > public JList(ListModel dataModel) > > > > > > > > > > but then we would have to define the dataModel-field also with: > > > > > > > > > > private ListModel dataModel > > > > > > > > > > as well as the model-property. I don't think this would be a good > > > > > idea and thus define the signature as: > > > > > > > > > > public JList(ListModel dataModel) > > > > > > > > > > What do you think? > > > > > > > > Why do you think that "private ListModel dataModel" is > > > > not a very good idea? > > > > > > > > Regards, Pavel From pavel.porvatov at sun.com Thu Mar 12 11:08:12 2009 From: pavel.porvatov at sun.com (pavel.porvatov at sun.com) Date: Thu, 12 Mar 2009 11:08:12 +0000 Subject: hg: jdk7/swing/jdk: 6491795: COM should be initialized for Shell API calls in ShellFolder2.cpp Message-ID: <20090312110845.93BC3ED57@hg.openjdk.java.net> Changeset: 51148b9aed43 Author: rupashka Date: 2009-03-12 14:00 +0300 URL: http://hg.openjdk.java.net/jdk7/swing/jdk/rev/51148b9aed43 6491795: COM should be initialized for Shell API calls in ShellFolder2.cpp Reviewed-by: peterz, loneid ! src/share/classes/javax/swing/plaf/basic/BasicDirectoryModel.java ! src/share/classes/sun/awt/shell/ShellFolder.java ! src/share/classes/sun/awt/shell/ShellFolderManager.java ! src/share/classes/sun/swing/FilePane.java ! src/windows/classes/sun/awt/shell/Win32ShellFolder2.java ! src/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java ! src/windows/native/sun/windows/ShellFolder2.cpp + test/javax/swing/JFileChooser/6570445/bug6570445.java From Pavel.Porvatov at Sun.COM Thu Mar 12 16:22:35 2009 From: Pavel.Porvatov at Sun.COM (Pavel Porvatov) Date: Thu, 12 Mar 2009 19:22:35 +0300 Subject: 6179357: Generics: JList: Constructors & Model In-Reply-To: <200903112332.27730.fbrunnerlist@gmx.ch> References: <200902012328.17974.fbrunnerlist@gmx.ch> <200902211754.15890.fbrunnerlist@gmx.ch> <200902262225.03571.fbrunnerlist@gmx.ch> <200903112332.27730.fbrunnerlist@gmx.ch> Message-ID: <49B936CB.7070006@sun.com> Hi Florian, I'd like more consistent variant #2 because of the javax.swing.ComboBoxModel#setSelectedItem() method prevents to use construction like "" in the JComboBox class (as you noticed before)... Regards, Pavel. > This one is still open... > Opinions? > > -Florian > > Am Donnerstag, 26. Februar 2009 schrieb Florian Brunner: >> So, which approach do we take? I'm tending now more towards approach 1) but >> approach 2) would be fine for me, too? >> >> Pavel? Anyone else? >> >> -Florian >> >> Am Samstag, 21. Februar 2009 schrieb Florian Brunner: >>> In the case of JComboBox I think it's not even possible to define >>> something like: >>> >>> class JComboBox{ >>> ComboBoxModel getModel(); >>> setModel(ComboBoxModel); >>> } >>> >>> because JComboBox internally uses the ComboBoxModel.setSelectedItem >>> method. >>> >>> So the question is what do you think is better: >>> >>> 1) To look at each component individually and try to make each as >>> flexible as possible. So in the JList/ JComboBox case this would mean: >>> >>> class JList{ >>> ListModel getModel(); >>> setModel(ListModel); >>> } >>> >>> but >>> >>> class JComboBox{ >>> ComboBoxModel getModel(); >>> setModel(ComboBoxModel); >>> } >>> >>> 2) Make the interfaces as consistent as possible over all components. >>> This would mean for the JList case to use somethink like: >>> class JList{ >>> ListModel getModel(); >>> setModel(ListModel); >>> } >>> >>> This approach is slightly less flexible than the approach 1), but cases >>> where one could benefit from approach 1) are probably rare and there are >>> various work-arounds (like: wrapping the model/ use a common base class >>> for the generic parameter/ use raw type/... ) >>> >>> So what do you think? Approach 1) or 2)? >>> >>> -Florian >>> >>> Am Donnerstag, 19. Februar 2009 schrieb Florian Brunner: >>>> Well, there is probably no big issue with JList, because the ListModel >>>> is immutable. >>>> >>>> But when we add generics to JComboBox, which is similar to JList, the >>>> situation is a bit more controversial, because the ComboBoxModel is >>>> mutable. >>>> >>>> So if we have something like this: >>>> class JComboBox{ >>>> ComboBoxModel getModel(); >>>> setModel(ComboBoxModel); >>>> } >>>> >>>> then something like this is not possible: >>>> JComboBox cb = new JComboBox(...); >>>> ... >>>> Foo foo; >>>> ComboBoxModel model = cb.getModel(); >>>> model.setSelectedItem(foo); -> compile time error >>>> >>>> You would need to do an unchecked (-> not type-safe) cast first: >>>> ComboBoxModel model = (ComboBoxModel) cb.getModel(); >>>> >>>> And type-safty is what generics is all about. >>>> >>>> -Florian >>>> >>>> Am Dienstag, 3. Februar 2009 schrieb Pavel Porvatov: >>>>> Hi Florian, >>>>> >>>>>> ---------------------------------------- >>>>>> >>>>>> public JList(ListModel dataModel) >>>>>> >>>>>> { >>>>>> >>>>>> if (dataModel == null) { >>>>>> >>>>>> throw new IllegalArgumentException("dataModel must be non null"); >>>>>> >>>>>> } >>>>>> >>>>>> // Register with the ToolTipManager so that tooltips from the >>>>>> >>>>>> // renderer show through. >>>>>> >>>>>> ToolTipManager toolTipManager = ToolTipManager.sharedInstance(); >>>>>> >>>>>> toolTipManager.registerComponent(this); >>>>>> >>>>>> layoutOrientation = VERTICAL; >>>>>> >>>>>> this.dataModel = dataModel; >>>>>> >>>>>> selectionModel = createSelectionModel(); >>>>>> >>>>>> setAutoscrolls(true); >>>>>> >>>>>> setOpaque(true); >>>>>> >>>>>> updateUI(); >>>>>> >>>>>> } >>>>>> >>>>>> ---> >>>>>> >>>>>> public JList(ListModel dataModel) >>>>>> >>>>>> { >>>>>> >>>>>> if (dataModel == null) { >>>>>> >>>>>> throw new IllegalArgumentException("dataModel must be non null"); >>>>>> >>>>>> } >>>>>> >>>>>> // Register with the ToolTipManager so that tooltips from the >>>>>> >>>>>> // renderer show through. >>>>>> >>>>>> ToolTipManager toolTipManager = ToolTipManager.sharedInstance(); >>>>>> >>>>>> toolTipManager.registerComponent(this); >>>>>> >>>>>> layoutOrientation = VERTICAL; >>>>>> >>>>>> this.dataModel = dataModel; >>>>>> >>>>>> selectionModel = createSelectionModel(); >>>>>> >>>>>> setAutoscrolls(true); >>>>>> >>>>>> setOpaque(true); >>>>>> >>>>>> updateUI(); >>>>>> >>>>>> } >>>>>> >>>>>> We could define the signature also like this: >>>>>> >>>>>> public JList(ListModel dataModel) >>>>>> >>>>>> but then we would have to define the dataModel-field also with: >>>>>> >>>>>> private ListModel dataModel >>>>>> >>>>>> as well as the model-property. I don't think this would be a good >>>>>> idea and thus define the signature as: >>>>>> >>>>>> public JList(ListModel dataModel) >>>>>> >>>>>> What do you think? >>>>> Why do you think that "private ListModel dataModel" is >>>>> not a very good idea? >>>>> >>>>> Regards, Pavel > > From Alexander.Potochkin at Sun.COM Thu Mar 12 16:32:38 2009 From: Alexander.Potochkin at Sun.COM (Alexander Potochkin) Date: Thu, 12 Mar 2009 19:32:38 +0300 Subject: 6179357: Generics: JList: Constructors & Model In-Reply-To: <49B936CB.7070006@sun.com> References: <200902012328.17974.fbrunnerlist@gmx.ch> <200902211754.15890.fbrunnerlist@gmx.ch> <200902262225.03571.fbrunnerlist@gmx.ch> <200903112332.27730.fbrunnerlist@gmx.ch> <49B936CB.7070006@sun.com> Message-ID: <49B93926.5040400@sun.com> > Hi Florian, > > I'd like more consistent variant #2 because of the > javax.swing.ComboBoxModel#setSelectedItem() method prevents to use > construction like "" in the JComboBox class (as you noticed > before)... I second Pavel, "" doesn't work well for getters/setters #2 is preferable Thanks alexp > > Regards, Pavel. > >> This one is still open... >> Opinions? >> >> -Florian >> >> Am Donnerstag, 26. Februar 2009 schrieb Florian Brunner: >>> So, which approach do we take? I'm tending now more towards approach >>> 1) but >>> approach 2) would be fine for me, too? >>> >>> Pavel? Anyone else? >>> >>> -Florian >>> >>> Am Samstag, 21. Februar 2009 schrieb Florian Brunner: >>>> In the case of JComboBox I think it's not even possible to define >>>> something like: >>>> >>>> class JComboBox{ >>>> ComboBoxModel getModel(); >>>> setModel(ComboBoxModel); >>>> } >>>> >>>> because JComboBox internally uses the ComboBoxModel.setSelectedItem >>>> method. >>>> >>>> So the question is what do you think is better: >>>> >>>> 1) To look at each component individually and try to make each as >>>> flexible as possible. So in the JList/ JComboBox case this would mean: >>>> >>>> class JList{ >>>> ListModel getModel(); >>>> setModel(ListModel); >>>> } >>>> >>>> but >>>> >>>> class JComboBox{ >>>> ComboBoxModel getModel(); >>>> setModel(ComboBoxModel); >>>> } >>>> >>>> 2) Make the interfaces as consistent as possible over all components. >>>> This would mean for the JList case to use somethink like: >>>> class JList{ >>>> ListModel getModel(); >>>> setModel(ListModel); >>>> } >>>> >>>> This approach is slightly less flexible than the approach 1), but cases >>>> where one could benefit from approach 1) are probably rare and there >>>> are >>>> various work-arounds (like: wrapping the model/ use a common base class >>>> for the generic parameter/ use raw type/... ) >>>> >>>> So what do you think? Approach 1) or 2)? >>>> >>>> -Florian >>>> >>>> Am Donnerstag, 19. Februar 2009 schrieb Florian Brunner: >>>>> Well, there is probably no big issue with JList, because the ListModel >>>>> is immutable. >>>>> >>>>> But when we add generics to JComboBox, which is similar to JList, the >>>>> situation is a bit more controversial, because the ComboBoxModel is >>>>> mutable. >>>>> >>>>> So if we have something like this: >>>>> class JComboBox{ >>>>> ComboBoxModel getModel(); >>>>> setModel(ComboBoxModel); >>>>> } >>>>> >>>>> then something like this is not possible: >>>>> JComboBox cb = new JComboBox(...); >>>>> ... >>>>> Foo foo; >>>>> ComboBoxModel model = cb.getModel(); >>>>> model.setSelectedItem(foo); -> compile time error >>>>> >>>>> You would need to do an unchecked (-> not type-safe) cast first: >>>>> ComboBoxModel model = (ComboBoxModel) cb.getModel(); >>>>> >>>>> And type-safty is what generics is all about. >>>>> >>>>> -Florian >>>>> >>>>> Am Dienstag, 3. Februar 2009 schrieb Pavel Porvatov: >>>>>> Hi Florian, >>>>>> >>>>>>> ---------------------------------------- >>>>>>> >>>>>>> public JList(ListModel dataModel) >>>>>>> >>>>>>> { >>>>>>> >>>>>>> if (dataModel == null) { >>>>>>> >>>>>>> throw new IllegalArgumentException("dataModel must be non null"); >>>>>>> >>>>>>> } >>>>>>> >>>>>>> // Register with the ToolTipManager so that tooltips from the >>>>>>> >>>>>>> // renderer show through. >>>>>>> >>>>>>> ToolTipManager toolTipManager = ToolTipManager.sharedInstance(); >>>>>>> >>>>>>> toolTipManager.registerComponent(this); >>>>>>> >>>>>>> layoutOrientation = VERTICAL; >>>>>>> >>>>>>> this.dataModel = dataModel; >>>>>>> >>>>>>> selectionModel = createSelectionModel(); >>>>>>> >>>>>>> setAutoscrolls(true); >>>>>>> >>>>>>> setOpaque(true); >>>>>>> >>>>>>> updateUI(); >>>>>>> >>>>>>> } >>>>>>> >>>>>>> ---> >>>>>>> >>>>>>> public JList(ListModel dataModel) >>>>>>> >>>>>>> { >>>>>>> >>>>>>> if (dataModel == null) { >>>>>>> >>>>>>> throw new IllegalArgumentException("dataModel must be non null"); >>>>>>> >>>>>>> } >>>>>>> >>>>>>> // Register with the ToolTipManager so that tooltips from the >>>>>>> >>>>>>> // renderer show through. >>>>>>> >>>>>>> ToolTipManager toolTipManager = ToolTipManager.sharedInstance(); >>>>>>> >>>>>>> toolTipManager.registerComponent(this); >>>>>>> >>>>>>> layoutOrientation = VERTICAL; >>>>>>> >>>>>>> this.dataModel = dataModel; >>>>>>> >>>>>>> selectionModel = createSelectionModel(); >>>>>>> >>>>>>> setAutoscrolls(true); >>>>>>> >>>>>>> setOpaque(true); >>>>>>> >>>>>>> updateUI(); >>>>>>> >>>>>>> } >>>>>>> >>>>>>> We could define the signature also like this: >>>>>>> >>>>>>> public JList(ListModel dataModel) >>>>>>> >>>>>>> but then we would have to define the dataModel-field also with: >>>>>>> >>>>>>> private ListModel dataModel >>>>>>> >>>>>>> as well as the model-property. I don't think this would be a good >>>>>>> idea and thus define the signature as: >>>>>>> >>>>>>> public JList(ListModel dataModel) >>>>>>> >>>>>>> What do you think? >>>>>> Why do you think that "private ListModel dataModel" is >>>>>> not a very good idea? >>>>>> >>>>>> Regards, Pavel >> >> > From Thomas.Hawtin at Sun.COM Thu Mar 12 16:56:49 2009 From: Thomas.Hawtin at Sun.COM (Tom Hawtin) Date: Thu, 12 Mar 2009 16:56:49 +0000 Subject: 6179357: Generics: JList: Constructors & Model In-Reply-To: <49B93926.5040400@sun.com> References: <200902012328.17974.fbrunnerlist@gmx.ch> <200902211754.15890.fbrunnerlist@gmx.ch> <200902262225.03571.fbrunnerlist@gmx.ch> <200903112332.27730.fbrunnerlist@gmx.ch> <49B936CB.7070006@sun.com> <49B93926.5040400@sun.com> Message-ID: <49B93ED1.4080807@sun.com> Alexander Potochkin wrote: > >> Hi Florian, >> >> I'd like more consistent variant #2 because of the >> javax.swing.ComboBoxModel#setSelectedItem() method prevents to use >> construction like "" in the JComboBox class (as you >> noticed before)... > > I second Pavel, "" doesn't work well for getters/setters > > #2 is preferable Thirded. Remember Josh Bloch's PECS: Producers Extends; Consumers Super. A model is both a producer and a consumer, so we want , i.e. . Tom From peter.zhelezniakov at sun.com Fri Mar 13 16:29:11 2009 From: peter.zhelezniakov at sun.com (peter.zhelezniakov at sun.com) Date: Fri, 13 Mar 2009 16:29:11 +0000 Subject: hg: jdk7/swing/jdk: 6815767: Bad parameter when calling another method in the class SynthTabbedPaneUI Message-ID: <20090313162939.51C9AEE46@hg.openjdk.java.net> Changeset: 4f7dd74de2e3 Author: peterz Date: 2009-03-13 19:25 +0300 URL: http://hg.openjdk.java.net/jdk7/swing/jdk/rev/4f7dd74de2e3 6815767: Bad parameter when calling another method in the class SynthTabbedPaneUI Reviewed-by: alexp, rupashka ! src/share/classes/javax/swing/plaf/synth/SynthTabbedPaneUI.java From fbrunnerlist at gmx.ch Fri Mar 13 23:14:30 2009 From: fbrunnerlist at gmx.ch (Florian Brunner) Date: Sat, 14 Mar 2009 00:14:30 +0100 Subject: 6179357: Generics: JList: Constructors & Model In-Reply-To: <49B93ED1.4080807@sun.com> References: <200902012328.17974.fbrunnerlist@gmx.ch> <49B93926.5040400@sun.com> <49B93ED1.4080807@sun.com> Message-ID: <200903140014.31220.fbrunnerlist@gmx.ch> Hi Tom, I just received a copy of Joshua Bloch's book "Effective Java - Second Edition" this week (of course I already own a copy of the first edition ;-) ) and could read about the PECS mnemonic. :-) I think you're right that in many cases a model is both a producer and a consumer, but I think in the case of the immutable ListModel, it's actually just a producer. As I said, I currently slightly favor variant #1 (flexibility) but I'm also fine if the decision is to follow variant #2 (consistency). -Florian Am Donnerstag, 12. M?rz 2009 schrieb Tom Hawtin: > Alexander Potochkin wrote: > >> Hi Florian, > >> > >> I'd like more consistent variant #2 because of the > >> javax.swing.ComboBoxModel#setSelectedItem() method prevents to use > >> construction like "" in the JComboBox class (as you > >> noticed before)... > > > > I second Pavel, "" doesn't work well for getters/setters > > > > #2 is preferable > > Thirded. > > Remember Josh Bloch's PECS: Producers Extends; Consumers Super. > > A model is both a producer and a consumer, so we want E>, i.e. . > > Tom From pavel.porvatov at sun.com Tue Mar 17 13:11:36 2009 From: pavel.porvatov at sun.com (pavel.porvatov at sun.com) Date: Tue, 17 Mar 2009 13:11:36 +0000 Subject: hg: jdk7/swing/jdk: 6738668: JFileChooser cannot be created under SecurityManager Message-ID: <20090317131159.93AECE0FE@hg.openjdk.java.net> Changeset: 540c7f47aadf Author: rupashka Date: 2009-03-17 16:06 +0300 URL: http://hg.openjdk.java.net/jdk7/swing/jdk/rev/540c7f47aadf 6738668: JFileChooser cannot be created under SecurityManager Reviewed-by: peterz ! src/share/classes/com/sun/java/swing/plaf/windows/WindowsFileChooserUI.java ! src/share/classes/javax/swing/plaf/metal/MetalFileChooserUI.java ! src/share/classes/sun/swing/plaf/synth/SynthFileChooserUIImpl.java + test/javax/swing/JFileChooser/6738668/bug6738668.java + test/javax/swing/JFileChooser/6738668/security.policy From fbrunnerlist at gmx.ch Sun Mar 22 19:03:04 2009 From: fbrunnerlist at gmx.ch (Florian Brunner) Date: Sun, 22 Mar 2009 20:03:04 +0100 Subject: =?utf-8?q?_=C2=A0=5BPATCH=5D_6179357=3A_Generics=3A_J?= =?utf-8?q?List?= Message-ID: <200903222003.05081.fbrunnerlist@gmx.ch> Hi, so, here I prepared a first patch to "generify" JList, along with: AbstractListModel, DefaultListCellRenderer, DefaultListModel, ListCellRenderer and ListModel. -Florian -------------- next part -------------- A non-text attachment was scrubbed... Name: swing-patch-generics-jlist-20090322.patch Type: text/x-patch Size: 27344 bytes Desc: not available URL: From peter.zhelezniakov at sun.com Mon Mar 23 11:25:39 2009 From: peter.zhelezniakov at sun.com (peter.zhelezniakov at sun.com) Date: Mon, 23 Mar 2009 11:25:39 +0000 Subject: hg: jdk7/swing/jdk: 6653395: Default LAF is set to CrossPlatformLookAndFeel not SystemLookAndFeel Message-ID: <20090323112604.A885FE6E7@hg.openjdk.java.net> Changeset: 4bf886c9df34 Author: peterz Date: 2009-03-23 14:09 +0300 URL: http://hg.openjdk.java.net/jdk7/swing/jdk/rev/4bf886c9df34 6653395: Default LAF is set to CrossPlatformLookAndFeel not SystemLookAndFeel Summary: Swing now checks AppContext properties to determine default LAF name. This is needed for plugin to be able to set default LAF w/o loading Swing classes. Reviewed-by: alexp, loneid ! src/share/classes/javax/swing/UIManager.java From iman_shani at hotmail.com Mon Mar 23 11:26:21 2009 From: iman_shani at hotmail.com (iman_shani at hotmail.com) Date: Mon, 23 Mar 2009 04:26:21 -0700 Subject: Semestersvar In-Reply-To: Message-ID: An HTML attachment was scrubbed... URL: From peter.zhelezniakov at sun.com Mon Mar 23 13:45:59 2009 From: peter.zhelezniakov at sun.com (peter.zhelezniakov at sun.com) Date: Mon, 23 Mar 2009 13:45:59 +0000 Subject: hg: jdk7/swing/jdk: 4783068: Components with HTML text should gray out the text when disabled Message-ID: <20090323134618.DBDF3E6F2@hg.openjdk.java.net> Changeset: 652e05578a7e Author: peterz Date: 2009-03-23 16:41 +0300 URL: http://hg.openjdk.java.net/jdk7/swing/jdk/rev/652e05578a7e 4783068: Components with HTML text should gray out the text when disabled Summary: Views fixed to use different colors when container is disabled Reviewed-by: gsm, rupashka ! src/share/classes/javax/swing/text/GlyphView.java ! src/share/classes/javax/swing/text/html/ImageView.java ! src/share/classes/javax/swing/text/html/StyleSheet.java + test/javax/swing/text/html/Test4783068.java From Pavel.Porvatov at Sun.COM Mon Mar 23 16:04:38 2009 From: Pavel.Porvatov at Sun.COM (Pavel Porvatov) Date: Mon, 23 Mar 2009 19:04:38 +0300 Subject: [PATCH] 6179357: Generics: JList In-Reply-To: <200903222003.05081.fbrunnerlist@gmx.ch> References: <200903222003.05081.fbrunnerlist@gmx.ch> Message-ID: <49C7B316.1010908@sun.com> Hi Florian, I will take a look at your diff briefly. Thanks, Pavel. > Hi, > > so, here I prepared a first patch to "generify" JList, along with: AbstractListModel, > DefaultListCellRenderer, DefaultListModel, ListCellRenderer and ListModel. > > -Florian > > From pavel.porvatov at sun.com Thu Mar 26 08:10:21 2009 From: pavel.porvatov at sun.com (pavel.porvatov at sun.com) Date: Thu, 26 Mar 2009 08:10:21 +0000 Subject: hg: jdk7/swing/jdk: 6798062: Memory Leak on using getFiles of FileSystemView Message-ID: <20090326081045.2DEB9EA45@hg.openjdk.java.net> Changeset: b8d8ec2dac68 Author: rupashka Date: 2009-03-26 11:04 +0300 URL: http://hg.openjdk.java.net/jdk7/swing/jdk/rev/b8d8ec2dac68 6798062: Memory Leak on using getFiles of FileSystemView Reviewed-by: peterz, malenkov ! src/windows/native/sun/windows/ShellFolder2.cpp + test/javax/swing/JFileChooser/6798062/bug6798062.html + test/javax/swing/JFileChooser/6798062/bug6798062.java From Pavel.Porvatov at Sun.COM Thu Mar 26 12:23:03 2009 From: Pavel.Porvatov at Sun.COM (Pavel Porvatov) Date: Thu, 26 Mar 2009 15:23:03 +0300 Subject: [PATCH] 6179357: Generics: JList In-Reply-To: <200903222003.05081.fbrunnerlist@gmx.ch> References: <200903222003.05081.fbrunnerlist@gmx.ch> Message-ID: <49CB73A7.8090509@sun.com> Hi Florian, Please take a look at the http://openjdk.java.net/contribute/ page, especially at *Submit a patch* section. We are trying to standardize contribution process, so you should create a new bug report in the OpenJDK Bugzilla system and add your patch there. Thanks, Pavel. P.S. I'm looking at your patch regardless of a bug report, but you should create the bug report. > Hi, > > so, here I prepared a first patch to "generify" JList, along with: AbstractListModel, > DefaultListCellRenderer, DefaultListModel, ListCellRenderer and ListModel. > > -Florian > > From fbrunnerlist at gmx.ch Thu Mar 26 12:43:47 2009 From: fbrunnerlist at gmx.ch (Florian Brunner) Date: Thu, 26 Mar 2009 13:43:47 +0100 Subject: [PATCH] 6179357: Generics: JList In-Reply-To: <49CB73A7.8090509@sun.com> References: <200903222003.05081.fbrunnerlist@gmx.ch> <49CB73A7.8090509@sun.com> Message-ID: <49CB7883.2000401@gmx.ch> Hi Pavel, OK, I'll do that as soon as I find some time (probably this week). I just had shortly scanned the "Submit a patch" section and I have some questions: - Should I add a bug report for each planed patch (Generics: JList, Generics: JComboBox,...) or is it fine to just file one report for sunbug=6179357, which will be closed when we can close the sunbug? - Should I set your username with the sponsor flag? What is your username? :-) -Florian Pavel Porvatov schrieb: > Hi Florian, > > Please take a look at the http://openjdk.java.net/contribute/ page, > especially at *Submit a patch* section. We are trying to standardize > contribution process, so you should create a new bug report in the > OpenJDK Bugzilla system and add your patch there. > > Thanks, Pavel. > > P.S. I'm looking at your patch regardless of a bug report, but you > should create the bug report. > >> Hi, >> >> so, here I prepared a first patch to "generify" JList, along with: >> AbstractListModel, DefaultListCellRenderer, DefaultListModel, >> ListCellRenderer and ListModel. >> >> -Florian >> >> > From Pavel.Porvatov at Sun.COM Thu Mar 26 13:15:12 2009 From: Pavel.Porvatov at Sun.COM (Pavel Porvatov) Date: Thu, 26 Mar 2009 16:15:12 +0300 Subject: [PATCH] 6179357: Generics: JList In-Reply-To: <49CB7883.2000401@gmx.ch> References: <200903222003.05081.fbrunnerlist@gmx.ch> <49CB73A7.8090509@sun.com> <49CB7883.2000401@gmx.ch> Message-ID: <49CB7FE0.2060805@sun.com> Hi Florian, > OK, I'll do that as soon as I find some time (probably this week). > > I just had shortly scanned the "Submit a patch" section and I have some > questions: > > - Should I add a bug report for each planed patch (Generics: JList, > Generics: JComboBox,...) Yes > or is it fine to just file one report for > sunbug=6179357, which will be closed when we can close the sunbug? Actually your patch doesn't relative to sunbug 6179357, therefore you should leave this field empty. > - Should I set your username with the sponsor flag? No > What is your > username? :-) I'll fill this field later Thanks, Pavel. > > -Florian > > Pavel Porvatov schrieb: >> Hi Florian, >> >> Please take a look at the http://openjdk.java.net/contribute/ page, >> especially at *Submit a patch* section. We are trying to standardize >> contribution process, so you should create a new bug report in the >> OpenJDK Bugzilla system and add your patch there. >> >> Thanks, Pavel. >> >> P.S. I'm looking at your patch regardless of a bug report, but you >> should create the bug report. >> >>> Hi, >>> >>> so, here I prepared a first patch to "generify" JList, along with: >>> AbstractListModel, DefaultListCellRenderer, DefaultListModel, >>> ListCellRenderer and ListModel. >>> >>> -Florian >>> >>> >> > From fbrunnerlist at gmx.ch Thu Mar 26 13:35:06 2009 From: fbrunnerlist at gmx.ch (Florian Brunner) Date: Thu, 26 Mar 2009 14:35:06 +0100 Subject: [PATCH] 6179357: Generics: JList In-Reply-To: <49CB7FE0.2060805@sun.com> References: <200903222003.05081.fbrunnerlist@gmx.ch> <49CB73A7.8090509@sun.com> <49CB7883.2000401@gmx.ch> <49CB7FE0.2060805@sun.com> Message-ID: <49CB848A.3010805@gmx.ch> Hi Pavel, > - Should I add a bug report for each planed patch (Generics: JList, Generics: JComboBox,...) >> Yes > or is it fine to just file one report for sunbug=6179357, which will be closed when we can close the sunbug? >> Actually your patch doesn't relative to sunbug 6179357, therefore you should leave this field empty. I don't understand. The whole swing-generics project started to fix: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6179357 and the related http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6303622 Why do you think the current work is not related? -Florian Pavel Porvatov schrieb: > Hi Florian, > >> OK, I'll do that as soon as I find some time (probably this week). >> >> I just had shortly scanned the "Submit a patch" section and I have >> some questions: >> >> - Should I add a bug report for each planed patch (Generics: JList, >> Generics: JComboBox,...) > Yes > >> or is it fine to just file one report for sunbug=6179357, which will >> be closed when we can close the sunbug? > Actually your patch doesn't relative to sunbug 6179357, therefore you > should leave this field empty. > >> - Should I set your username with the sponsor flag? > No > >> What is your username? :-) > I'll fill this field later > > Thanks, Pavel. > >> >> -Florian >> >> Pavel Porvatov schrieb: >>> Hi Florian, >>> >>> Please take a look at the http://openjdk.java.net/contribute/ page, >>> especially at *Submit a patch* section. We are trying to standardize >>> contribution process, so you should create a new bug report in the >>> OpenJDK Bugzilla system and add your patch there. >>> >>> Thanks, Pavel. >>> >>> P.S. I'm looking at your patch regardless of a bug report, but you >>> should create the bug report. >>> >>>> Hi, >>>> >>>> so, here I prepared a first patch to "generify" JList, along with: >>>> AbstractListModel, DefaultListCellRenderer, DefaultListModel, >>>> ListCellRenderer and ListModel. >>>> >>>> -Florian >>>> >>>> >>> >> > From Pavel.Porvatov at Sun.COM Thu Mar 26 14:01:23 2009 From: Pavel.Porvatov at Sun.COM (Pavel Porvatov) Date: Thu, 26 Mar 2009 17:01:23 +0300 Subject: [PATCH] 6179357: Generics: JList In-Reply-To: <49CB848A.3010805@gmx.ch> References: <200903222003.05081.fbrunnerlist@gmx.ch> <49CB73A7.8090509@sun.com> <49CB7883.2000401@gmx.ch> <49CB7FE0.2060805@sun.com> <49CB848A.3010805@gmx.ch> Message-ID: <49CB8AB3.3040003@sun.com> Hi Florian, > > - Should I add a bug report for each planed patch (Generics: JList, > Generics: JComboBox,...) > >> Yes > or is it fine to just file one report for sunbug=6179357, > which will be closed when we can close the sunbug? > >> Actually your patch doesn't relative to sunbug 6179357, therefore > you should leave this field empty. > > I don't understand. The whole swing-generics project started to fix: > http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6179357 TreeModel and ListModel have nothing in common. So your patch doesn't relative to sunbug 6179357. > and the related > http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6303622 I'm going to file another bug which will be more specific. Therefore I'll be able to close it after generification of JList will be completed. This way allows to track changes in the sources and releases. Regards, Pavel. > > Why do you think the current work is not related? > > -Florian > > Pavel Porvatov schrieb: >> Hi Florian, >> >>> OK, I'll do that as soon as I find some time (probably this week). >>> >>> I just had shortly scanned the "Submit a patch" section and I have >>> some questions: >>> >>> - Should I add a bug report for each planed patch (Generics: JList, >>> Generics: JComboBox,...) >> Yes >> >>> or is it fine to just file one report for sunbug=6179357, which will >>> be closed when we can close the sunbug? >> Actually your patch doesn't relative to sunbug 6179357, therefore you >> should leave this field empty. >> >>> - Should I set your username with the sponsor flag? >> No >> >>> What is your username? :-) >> I'll fill this field later >> >> Thanks, Pavel. >> >>> >>> -Florian >>> >>> Pavel Porvatov schrieb: >>>> Hi Florian, >>>> >>>> Please take a look at the http://openjdk.java.net/contribute/ page, >>>> especially at *Submit a patch* section. We are trying to standardize >>>> contribution process, so you should create a new bug report in the >>>> OpenJDK Bugzilla system and add your patch there. >>>> >>>> Thanks, Pavel. >>>> >>>> P.S. I'm looking at your patch regardless of a bug report, but you >>>> should create the bug report. >>>> >>>>> Hi, >>>>> >>>>> so, here I prepared a first patch to "generify" JList, along with: >>>>> AbstractListModel, DefaultListCellRenderer, DefaultListModel, >>>>> ListCellRenderer and ListModel. >>>>> >>>>> -Florian >>>>> >>>>> >>>> >>> >> > From fbrunnerlist at gmx.ch Sat Mar 28 10:45:32 2009 From: fbrunnerlist at gmx.ch (Florian Brunner) Date: Sat, 28 Mar 2009 11:45:32 +0100 Subject: [PATCH] 6179357: Generics: JList In-Reply-To: <49CB8AB3.3040003@sun.com> References: <200903222003.05081.fbrunnerlist@gmx.ch> <49CB848A.3010805@gmx.ch> <49CB8AB3.3040003@sun.com> Message-ID: <200903281145.32982.fbrunnerlist@gmx.ch> Hi Pavel, I created the bug report in the OpenJDK Bugzilla system: https://bugs.openjdk.java.net/show_bug.cgi?id=100029 -Florian Am Donnerstag, 26. M?rz 2009 schrieb Pavel Porvatov: > Hi Florian, > > > > - Should I add a bug report for each planed patch (Generics: JList, > > > > Generics: JComboBox,...) > > > > >> Yes > or is it fine to just file one report for sunbug=6179357, > > > > which will be closed when we can close the sunbug? > > > > >> Actually your patch doesn't relative to sunbug 6179357, therefore > > > > you should leave this field empty. > > > > I don't understand. The whole swing-generics project started to fix: > > http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6179357 > > TreeModel and ListModel have nothing in common. So your patch doesn't > relative to sunbug 6179357. > > > and the related > > http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6303622 > > I'm going to file another bug which will be more specific. Therefore > I'll be able to close it after generification of JList will be > completed. This way allows to track changes in the sources and releases. > > Regards, Pavel. > > > Why do you think the current work is not related? > > > > -Florian > > > > Pavel Porvatov schrieb: > >> Hi Florian, > >> > >>> OK, I'll do that as soon as I find some time (probably this week). > >>> > >>> I just had shortly scanned the "Submit a patch" section and I have > >>> some questions: > >>> > >>> - Should I add a bug report for each planed patch (Generics: JList, > >>> Generics: JComboBox,...) > >> > >> Yes > >> > >>> or is it fine to just file one report for sunbug=6179357, which will > >>> be closed when we can close the sunbug? > >> > >> Actually your patch doesn't relative to sunbug 6179357, therefore you > >> should leave this field empty. > >> > >>> - Should I set your username with the sponsor flag? > >> > >> No > >> > >>> What is your username? :-) > >> > >> I'll fill this field later > >> > >> Thanks, Pavel. > >> > >>> -Florian > >>> > >>> Pavel Porvatov schrieb: > >>>> Hi Florian, > >>>> > >>>> Please take a look at the http://openjdk.java.net/contribute/ page, > >>>> especially at *Submit a patch* section. We are trying to standardize > >>>> contribution process, so you should create a new bug report in the > >>>> OpenJDK Bugzilla system and add your patch there. > >>>> > >>>> Thanks, Pavel. > >>>> > >>>> P.S. I'm looking at your patch regardless of a bug report, but you > >>>> should create the bug report. > >>>> > >>>>> Hi, > >>>>> > >>>>> so, here I prepared a first patch to "generify" JList, along with: > >>>>> AbstractListModel, DefaultListCellRenderer, DefaultListModel, > >>>>> ListCellRenderer and ListModel. > >>>>> > >>>>> -Florian