X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Fjvcard%2Ftui%2FTuiLauncher.java;h=066ba315c4be651db64e51a181850ec3d36d98b8;hb=30a4aa17f2141ad80a23447ee2e6303f6c9ef995;hp=2cfcc3eb9dfc03a8e2b1c32341101b7a6d5f51d6;hpb=668268fc236425a7be575417cd0d3810c29127a1;p=jvcard.git diff --git a/src/be/nikiroo/jvcard/tui/TuiLauncher.java b/src/be/nikiroo/jvcard/tui/TuiLauncher.java index 2cfcc3e..066ba31 100644 --- a/src/be/nikiroo/jvcard/tui/TuiLauncher.java +++ b/src/be/nikiroo/jvcard/tui/TuiLauncher.java @@ -1,6 +1,9 @@ package be.nikiroo.jvcard.tui; import java.io.IOException; +import java.util.List; + +import be.nikiroo.jvcard.tui.panes.FileList; import com.googlecode.lanterna.TerminalSize; import com.googlecode.lanterna.TextColor; @@ -21,7 +24,36 @@ import com.googlecode.lanterna.terminal.Terminal; * */ public class TuiLauncher { + /** + * Start the TUI program. + * + * @param textMode + * TRUE to force text mode, FALSE to force the Swing terminal + * emulator, null to automatically determine the best choice + * @param files + * the files to show at startup + * + * @throws IOException + * in case of IO error + */ + static public void start(Boolean textMode, List files) + throws IOException { + Window win = new MainWindow(new FileList(files)); + TuiLauncher.start(textMode, win); + } + /** + * Start the TUI program. + * + * @param textMode + * TRUE to force text mode, FALSE to force the Swing terminal + * emulator, null to automatically determine the best choice + * @param win + * the window to show at start + * + * @throws IOException + * in case of IO error + */ static public void start(Boolean textMode, Window win) throws IOException { Terminal terminal = null; @@ -36,7 +68,7 @@ public class TuiLauncher { } if (win instanceof MainWindow) { - MainWindow mwin = (MainWindow) win; + final MainWindow mwin = (MainWindow) win; mwin.refresh(terminal.getTerminalSize()); terminal.addResizeListener(new ResizeListener() { @Override