Package jexer
Class TFileOpenBox
- java.lang.Object
-
- jexer.TWidget
-
- jexer.TWindow
-
- jexer.TFileOpenBox
-
- All Implemented Interfaces:
java.lang.Comparable<TWidget>
public class TFileOpenBox extends TWindow
TFileOpenBox is a system-modal dialog for selecting a file to open. Call it like:filename = fileOpenBox("/path/to/file.ext", TFileOpenBox.Type.OPEN); if (filename != null) { ... the user selected a file, go open it ... }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTFileOpenBox.TypeTFileOpenBox can be called for either Open or Save actions.
-
Field Summary
-
Fields inherited from class jexer.TWindow
ABSOLUTEXY, borderStyleActive, borderStyleActiveModal, borderStyleInactive, borderStyleMoving, CENTERED, helpTopic, HIDEONCLOSE, inKeyboardResize, inWindowMove, inWindowResize, MODAL, mouse, NOCLOSEBOX, NOZOOMBOX, overlay, OVERRIDEMENU, RESIZABLE, statusBar, underlay
-
-
Constructor Summary
Constructors Constructor Description TFileOpenBox(TApplication application, java.lang.String path, TFileOpenBox.Type type)Public constructor.TFileOpenBox(TApplication application, java.lang.String path, TFileOpenBox.Type type, java.util.List<java.lang.String> filters)Public constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddraw()Draw me on screen.java.lang.StringgetFilename()Get the return string.voidonKeypress(TKeypressEvent keypress)Handle keystrokes.-
Methods inherited from class jexer.TWindow
activate, addOverlay, addShortcutKeypress, addUnderlay, center, clearShortcutKeypresses, close, disableCloseEffect, disableOpenEffect, ensureOnScreen, getAlpha, getApplication, getBackground, getBorder, getBorderControls, getBorderStyle, getBorderStyleForeground, getBorderStyleInactive, getBorderStyleModal, getBorderStyleMoving, getHelpTopic, getMaximumWindowHeight, getMaximumWindowWidth, getMinimumWindowHeight, getMinimumWindowWidth, getMouseStyle, getScreen, getStatusBar, getTitle, getWindowTheme, getZ, hasCloseBox, hasHiddenMouse, hasOverriddenMenu, hasZoomBox, hide, inMovements, isHidden, isModal, isResizable, isShortcutKeypress, isShown, maximize, mouseOnClose, mouseOnMaximize, mouseOnResize, newStatusBar, onClose, onCommand, onFocus, onHide, onMenu, onMouseDown, onMouseMotion, onMouseUp, onPostDraw, onPreClose, onResize, onShow, onUnfocus, removeShortcutKeypress, restore, setAlpha, setBorderStyleForeground, setBorderStyleInactive, setBorderStyleModal, setBorderStyleMoving, setCloseBox, setHiddenMouse, setMaximumWindowHeight, setMaximumWindowWidth, setMinimumWindowHeight, setMinimumWindowWidth, setResizable, setTackboardsDirty, setTitle, setWindowTheme, setZ, setZoomBox, show, stopMovements, toString
-
Methods inherited from class jexer.TWidget
activate, activate, activateAll, addButton, addCalendar, addCheckBox, addCheckBox, addComboBox, addDirectoryList, addDirectoryList, addDirectoryList, addDirectoryList, addEditor, addField, addField, addField, addField, addImage, addImage, addImage, addImage, addLabel, addLabel, addLabel, addLabel, addLabel, addLabel, addList, addList, addList, addList, addPanel, addPasswordField, addPasswordField, addPasswordField, addProgressBar, addRadioGroup, addRadioGroup, addSpinner, addSplitPane, addTable, addTable, addText, addText, addTreeViewWidget, addTreeViewWidget, compareTo, doRepaint, drawBox, drawBox, drawBoxShadow, drawChildren, fileOpenBox, fileOpenBox, fileOpenBox, fileOpenBox, fileSaveBox, getAbsoluteX, getAbsoluteY, getActiveChild, getAttrXY, getChildren, getClipboard, getCursorAbsoluteX, getCursorAbsoluteY, getCursorX, getCursorY, getCustomMousePointer, getHeight, getLayoutManager, getLocale, getParent, getTheme, getWidgetUnderMouse, getWidth, getWindow, getX, getY, handleEvent, hasChild, hLineXY, hLineXY, inputBox, inputBox, inputBox, isAbsoluteActive, isActive, isCursorVisible, isDrawable, isEchoKeystrokes, isEnabled, isPixelMouse, isVisible, messageBox, messageBox, mouseWouldHit, onIdle, onMouseDoubleClick, putAll, putAttrXY, putAttrXY, putCharXY, putCharXY, putCharXY, putStringXY, putStringXY, remove, remove, remove, remove, removeAll, resetTabOrder, setActive, setCursorVisible, setCursorX, setCursorY, setCustomMousePointer, setDimensions, setEchoKeystrokes, setEchoKeystrokes, setEnabled, setHeight, setLayoutManager, setLocale, setMouseStyle, setParent, setupForTWindow, setVisible, setWidth, setWindow, setX, setY, splitHorizontal, splitVertical, switchWidget, toPrettyString, toPrettyString, vLineXY, vLineXY
-
-
-
-
Constructor Detail
-
TFileOpenBox
public TFileOpenBox(TApplication application, java.lang.String path, TFileOpenBox.Type type) throws java.io.IOException
Public constructor. The file open box will be centered on screen.- Parameters:
application- the TApplication that manages this windowpath- path of selected filetype- one of the Type constants- Throws:
java.io.IOException- of a java.io operation throws
-
TFileOpenBox
public TFileOpenBox(TApplication application, java.lang.String path, TFileOpenBox.Type type, java.util.List<java.lang.String> filters) throws java.io.IOException
Public constructor. The file open box will be centered on screen.- Parameters:
application- the TApplication that manages this windowpath- path of selected filetype- one of the Type constantsfilters- a list of strings that files must match to be displayed- Throws:
java.io.IOException- of a java.io operation throws
-
-
Method Detail
-
onKeypress
public void onKeypress(TKeypressEvent keypress)
Handle keystrokes.- Overrides:
onKeypressin classTWindow- Parameters:
keypress- keystroke event
-
getFilename
public java.lang.String getFilename()
Get the return string.- Returns:
- the filename the user selected, or null if they canceled.
-
-