Story:
The user selects a multi-line block of text in the definitions pane.
He then pulls down a menu item labelled "Make selected text into
a String" and the highlighted text is wrapped in quotation marks.
Because Java Strings cannot occur across multiple lines, each
line is wrapped into separate quotation marks (with a "\n" added to
the end of all quoted lines but the last), and the lines are
concatenated. For example, if the user selected the text below:
(this is a (string)
representation of a
list)
It would become:
"(this is a (string)\n" +
" representation of a\n" +
" list)"
This functionality would be useful for writing tests over complex
data structures. Often we want to check that the toString()
representation of a data structure is what we expect. The
expected form is easily retrieved from working code by calling
toString() in the interactions pane, but the resultant String isn't
quoted.
-- Eric
Logged In: YES
user_id=431096
This is easy enough to implement. I will also need to check for
all instances of the quote characters and backslash-escape
them.