Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-2791

Please add a loadFile method to groovy.ui.Console for ease of use.

    XMLWordPrintableJSON

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.6-beta-1
    • Component/s: None
    • Labels:
      None

      Description

      Currently, fileOpen handles the task of loading the file and initializing the text area.

      Please add a method

      void loadScriptFile(File scriptFile) {
      inputArea.text = scriptFile.readLines().join('\n')
      setDirty(false)
      inputArea.caretPosition = 0
      }

      and change fileOpen accordingly to

      void fileOpen(EventObject evt = null) {
      scriptFile = selectFilename()
      if (scriptFile != null)

      { loadScriptFile(scriptFile); }

      }

      The loadScriptFile method isn't strictly necessary but eases the use of Console in an embedded environment.

        Attachments

          Activity

            People

            • Assignee:
              shemnon Daniel Ferrin
              Reporter:
              huxi Joern Huxhorn
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: