javax.swing.TextComponent getDocument to scala.swing.document.

peer.getDocument() replaced with document member function in scala.swing.TextComponent.
We are on the same page.  I have a preliminary version up and running 
with enough mistakes to make it a throw-away system.  A design based on 
the experience will go into github bug report shortly.

Allan

On 10/23/2014 01:55 PM, Andy Hicks wrote:
>
> In 
> examples/src/main/scala/scala/swing/examples/tutorials/components/ListSelectionDemo.scala:
>
> > +      val firstIndex = list.selection.leadIndex
> > +      val lastIndex = list.selection.anchorIndex // anchor = last?
> > +      val isAdjusting = list.selection.adjusting
> > +      output.append("Event for indexes " + firstIndex + " - " + lastIndex +
> > +          "; isAdjusting is " + isAdjusting + "; selected indexes:")
> > +      if (list.selection.indices.isEmpty) {
> > +        output.append(" <none>")
> > +      }
> > +      else {
> > +        // Find out which indexes are selected.
> > +        for (i <- list.selection.indices) {
> > +          output.append(" " + i)
> > +        }
> > +      }
> > +      output.append("\n")
> > +      output.caret.position = output.document.getLength()
>
> If you want to raise it in a bigger issue tracking system then there 
> you can add it to issues.scala-lang.org and assign it to me. However 
> given the code is in github I have a preference to trying to link up 
> the issues and the code.
>
> If you do have a go at this then you should remeber that you are 
> trying to make this easy for a scala dev to use it, so there may not 
> be a 1-to-1 mapping between java functions and scala-swing.
> As well as all the issues you mentioned we could add 'should 
> addDocumentListener()' be more a stream/reactive system and not just a 
> renaming wrapper to the existing code. Probably a lot of 
> experimentation with different styles may be needed to come up with a 
> good one
>
> —
> Reply to this email directly or view it on GitHub 
> <https://github.com/scala/scala-swing/pull/26/files#r19307045>.
>