+ // ------------------------------------------------------------------------
+ // TWidget ----------------------------------------------------------------
+ // ------------------------------------------------------------------------
+
+ /**
+ * Draw me on screen.
+ */
+ @Override
+ public void draw() {
+ super.draw();
+ vLineXY(33, 4, getHeight() - 6, GraphicsChars.WINDOW_SIDE,
+ getBackground());
+ }
+
+ // ------------------------------------------------------------------------
+ // TFileOpenBox -----------------------------------------------------------
+ // ------------------------------------------------------------------------
+
+ /**
+ * Get the return string.
+ *
+ * @return the filename the user selected, or null if they canceled.
+ */
+ public String getFilename() {
+ return filename;
+ }
+
+ /**
+ * See if there is a valid filename to return. If the filename is a
+ * directory, then
+ *
+ * @param newFilename the filename to check and return
+ * @throws IOException of a java.io operation throws
+ */
+ private void checkFilename(final String newFilename) throws IOException {
+ File newFile = new File(newFilename);
+ if (newFile.exists()) {
+ if (newFile.isFile() || (type == Type.SELECT)) {
+ filename = newFilename;
+ getApplication().closeWindow(this);
+ return;
+ }
+ if (newFile.isDirectory()) {
+ treeViewRoot = new TDirectoryTreeItem(treeView,
+ newFilename, true);
+ treeView.setTreeRoot(treeViewRoot, true);
+ if (type == Type.OPEN) {
+ openButton.setEnabled(false);
+ }
+ directoryList.setPath(newFilename);
+ }
+ } else if (type != Type.OPEN) {
+ filename = newFilename;
+ getApplication().closeWindow(this);
+ return;
+ }
+ }
+