This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: silly newbie question about inner classes
- From: John Whittaker <john dot whittaker at sbcglobal dot net>
- To: kawa at sourceware dot org, Per Bothner <per at bothner dot com>
- Date: Fri, 2 Nov 2007 10:15:08 -0700 (PDT)
- Subject: Re: silly newbie question about inner classes
Per,
Thank you so much for the quick response. If I might
amplify a bit, I have another question.
How would I create a subclass of
javax.swing.text.html.HTMLEditorKit.$ParserCallback?
Doing something like this (below) doesn't work:
(define-simple-class my-parser-callback (
<javax.swing.text.html.HTMLEditorKit.$ParserCallback>
)
((handleText (data :: <char[]>) (pos :: <int>))
::<void> access: 'public
(write data) (newline))
Thanks,
John Whittaker
--- Per Bothner <per@bothner.com> wrote:
> john whittaker wrote:
> > I apologize if this is a really silly question.
> I'm new to both Kawa and
> > Java, so I may not even be asking the question
> correctly.
>
> It's a perfectly fine question. Wkecine to Kawa and
> to Java!
>
> > Suppose I want to create an instance of an inner
> class such as
> >
> javax.swing.text.html.HTMLEditorKit.ParserCallback.
> I cannot seem to do this
> > in Kawa. Here is an example of the simple-minded
> thing I tried:
> >
> > #|kawa:16|#
>
(javax.swing.text.html.HTMLEditorKit.ParserCallback:new)
>
> Since Kawa uses colon as a "get-named-component"
> operator,
> I think this *should* work, but it doesn't:
>
(javax.swing.text.html.HTMLEditorKit.ParserCallback:new)
>
> However, this works:
>
(javax.swing.text.html.HTMLEditorKit$ParserCallback:new)
>
> It works because that is the actual "internal name".
>
> You can also leave out the ":new", since "applying"
> a class
> creates an instance:
>
> (javax.swing.text.html.HTMLEditorKit$ParserCallback)
> --
> --Per Bothner
> per@bothner.com http://per.bothner.com/
>