From 1978ad505e3e45fdff495a6a0869c1c5caddf118 Mon Sep 17 00:00:00 2001 From: Kevin Lamonte Date: Tue, 22 Aug 2017 20:15:41 -0400 Subject: [PATCH] addEditor() --- src/jexer/TApplication.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/jexer/TApplication.java b/src/jexer/TApplication.java index abd69ca7..4457197c 100644 --- a/src/jexer/TApplication.java +++ b/src/jexer/TApplication.java @@ -28,6 +28,7 @@ */ package jexer; +import java.io.File; import java.io.InputStream; import java.io.IOException; import java.io.OutputStream; @@ -2755,6 +2756,7 @@ public class TApplication implements Runnable { TWindow window = new TWindow(this, title, 0, 0, width, height); return window; } + /** * Convenience function to create a new window and make it active. * Window will be located at (0, 0). @@ -2805,4 +2807,17 @@ public class TApplication implements Runnable { return window; } + /** + * Convenience function to open a file in an editor window and make it + * active. + * + * @param file the file to open + * @throws IOException if a java.io operation throws + */ + public final TEditorWindow addEditor(final File file) throws IOException { + + TEditorWindow editor = new TEditorWindow(this, file); + return editor; + } + } -- 2.27.0