-
Notifications
You must be signed in to change notification settings - Fork 47
javax.swing.TextComponent getDocument to scala.swing.document. #26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Document should be wrapped so that this reads output.document.length
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a lot of wrapper work to be done. Table has at least one model
that needs this treatment and probably more. How does the work get
allocated among the contributors?
On 10/20/2014 06:16 AM, Andy Hicks wrote:
In
examples/src/main/scala/scala/swing/examples/tutorials/components/ListSelectionDemo.scala:
val firstIndex = list.selection.leadIndexval lastIndex = list.selection.anchorIndex // anchor = last?val isAdjusting = list.selection.adjustingoutput.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()Document should be wrapped so that this reads |output.document.length|
—
Reply to this email directly or view it on GitHub
https://github.com/scala/scala-swing/pull/26/files#r19083174.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, its a lots of work, I guess thats why nobody has done it. :-), and a lot of other wrappers.
As for allocation, its whats you're interested in or probably more traditionally somebody has found has a scala-swing project and found something missing. (so far we haven't had 2 different people working on the same part, but an email to the google group could be a good idea).
It may be that this gets put on hold and 'attached' to an issue saying text.Document needs implementing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I started on Document and the classes it uses.
The Document has a forest (multiple trees) of Elements attached (the
tree is for HTML). The peer relationships among Element nodes will need
to be kept up to date with events and listeners. I have not started
that part yet.
A Bugzilla issue sounds like a good idea.
Allan
On 10/23/2014 06:38 AM, Andy Hicks wrote:
In
examples/src/main/scala/scala/swing/examples/tutorials/components/ListSelectionDemo.scala:
val firstIndex = list.selection.leadIndexval lastIndex = list.selection.anchorIndex // anchor = last?val isAdjusting = list.selection.adjustingoutput.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()Yep, its a lots of work, I guess thats why nobody has done it. :-),
and a lot of other wrappers.As for allocation, its whats you're interested in or probably more
traditionally somebody has found has a scala-swing project and found
something missing. (so far we haven't had 2 different people working
on the same part, but an email to the google group could be a good idea).
It may be that this gets put on hold and 'attached' to an issue saying
text.Document needs implementing.—
Reply to this email directly or view it on GitHub
https://github.com/scala/scala-swing/pull/26/files#r19277162.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.leadIndexval lastIndex = list.selection.anchorIndex // anchor = last?val isAdjusting = list.selection.adjustingoutput.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.
|
I'm currently having a little problem making a clean merge with @jacobsallan fork/branch. here is what I was thinking for TableDemo.scala until I can fix the pull request. |
|
You got rid of the MouseEvent and managed to clean The code you fixed is in three more table demos: TableFTFEditDemo, On 10/23/2014 06:51 AM, Andy Hicks wrote:
|
peer.getDocument() replaced with document member function in scala.swing.TextComponent.