From: Kevin Lamonte Date: Wed, 23 Aug 2017 00:15:41 +0000 (-0400) Subject: addEditor() X-Git-Url: https://git.nikiroo.be/?a=commitdiff_plain;h=1978ad505e3e45fdff495a6a0869c1c5caddf118;p=fanfix-jexer.git addEditor() --- diff --git a/src/jexer/TApplication.java b/src/jexer/TApplication.java index abd69ca..4457197 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; + } + }